Skip to content

Commit b91c6a0

Browse files
authored
fix: node condition should be included in cjsConditions (#15647)
1 parent 941b7c4 commit b91c6a0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/jest-resolve-dependencies/src/__tests__/dependency_resolver.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ beforeEach(async () => {
3232
moduleDirectories: ['node_modules'],
3333
moduleNameMapper: [['^\\$asdf/(.*)$', '<rootDir>/$1']],
3434
/**
35-
* `filter` must be an absolute path
35+
* `rootDir` must be an absolute path
3636
* @See https://github.com/jestjs/jest/blob/76632c6ec3f56708ec5781158972a295d0cc9332/packages/jest-haste-map/src/lib/fast_path.ts#L19-L25
3737
*/
3838
rootDir: process.cwd(),

packages/jest-runtime/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ export default class Runtime {
285285
...new Set(['import', 'default', ...envExportConditions]),
286286
];
287287
this.cjsConditions = [
288-
...new Set(['require', 'default', ...envExportConditions]),
288+
...new Set(['require', 'node', 'default', ...envExportConditions]),
289289
];
290290

291291
if (config.automock) {

0 commit comments

Comments
 (0)