mirror of
https://github.com/vercel/workflow.git
synced 2026-09-14 19:59:43 +08:00
00a011dee4
* Add stable Next.js eager and lazy test coverage * Address PR review feedback * Fix eager Next step route builds * Fix eager Next manifest refreshes * Fix eager Next e2e stack assertions * Externalize native step bundle bindings * Lazy load Vercel world runtime * Fix Next dev step sourcemap assertions * Consolidate eager build changesets * Fix Vercel world tracing in Next deployments * Externalize Vercel world in Next builds * Fix webpack tracing for Vercel world deps * Fix eager workflow route bundling * Rely on Next server externals
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
// ============================================================
|
|
// HELPER FUNCTIONS FOR ERROR TESTING
|
|
// ============================================================
|
|
// These helpers are imported by 99_e2e.ts to test cross-file error propagation.
|
|
// They verify that stack traces correctly reference this file (helpers.ts).
|
|
|
|
// --- Workflow Error Helpers (called directly in workflow code) ---
|
|
|
|
function throwError() {
|
|
throw new Error('Error from imported helper module');
|
|
}
|
|
|
|
/** Called by errorWorkflowCrossFile - creates a call chain across files */
|
|
export function callThrower() {
|
|
throwError();
|
|
}
|
|
|
|
// --- Step Error Helpers (step function that throws from this file) ---
|
|
|
|
export const stepErrorHelpers = {
|
|
throwErrorFromStep() {
|
|
throw new Error('Step error from imported helper module');
|
|
},
|
|
};
|
|
|
|
/** Step that throws an error - tests cross-file step error stack traces */
|
|
export async function stepThatThrowsFromHelper() {
|
|
'use step';
|
|
stepErrorHelpers.throwErrorFromStep();
|
|
return 'never reached';
|
|
}
|
|
stepThatThrowsFromHelper.maxRetries = 0;
|