Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(testing): force compatible module resolution when running the jest executor #29189

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/jest/src/executors/jest/jest.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export async function jestExecutor(
options: JestExecutorOptions,
context: ExecutorContext
): Promise<{ success: boolean }> {
// Jest registers ts-node with module CJS https://github.com/SimenB/jest/blob/v29.6.4/packages/jest-config/src/readConfigFileAndSetRootDir.ts#L117-L119
// We want to support of ESM via 'module':'nodenext', we need to override the resolution until Jest supports it.
process.env.TS_NODE_COMPILER_OPTIONS ??= '{"moduleResolution":"node10"}';

const config = await jestConfigParser(options, context);

const { results } = await runCLI(config, [options.jestConfig]);
Expand Down
Loading