File tree Expand file tree Collapse file tree 2 files changed +15
-15
lines changed
e2e/__tests__/__snapshots__ Expand file tree Collapse file tree 2 files changed +15
-15
lines changed Original file line number Diff line number Diff line change 1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
1
+ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2
+
3
+ exports [` falls back to a loader if we encounter a ESM TS config file in a CommonJs project 1` ] = `
4
+ "PASS __tests__/a-giraffe.js
5
+ ✓ giraffe"
6
+ ` ;
7
+
8
+ exports [` falls back to a loader if we encounter a ESM TS config file in a CommonJs project 2` ] = `
9
+ "Test Suites: 1 passed, 1 total
10
+ Tests: 1 passed, 1 total
11
+ Snapshots: 0 total
12
+ Time: <<REPLACED >>
13
+ Ran all test suites."
14
+ `;
2
15
3
16
exports[`on node >=24 invalid JS in jest.config.ts (node with native TS support) 1`] = `
4
17
"Error: Jest: Failed to parse the TypeScript config file <<REPLACED >>
@@ -54,19 +67,6 @@ Time: <<REPLACED>>
54
67
Ran all test suites."
55
68
`;
56
69
57
- exports[`works with jest.config.ts with cjs contents 1`] = `
58
- "PASS __tests__/a-giraffe.js
59
- ✓ giraffe"
60
- `;
61
-
62
- exports[`works with jest.config.ts with cjs contents 2`] = `
63
- "Test Suites: 1 passed, 1 total
64
- Tests: 1 passed, 1 total
65
- Snapshots: 0 total
66
- Time: <<REPLACED >>
67
- Ran all test suites."
68
- `;
69
-
70
70
exports[`works with tsconfig.json 1`] = `
71
71
"PASS __tests__/a-giraffe.js
72
72
✓ giraffe"
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export default async function readConfigFileAndSetRootDir(
51
51
error instanceof SyntaxError &&
52
52
// Likely ESM in a file interpreted as CJS, which means it needs to be
53
53
// compiled. We ignore the error and try to load it with a loader.
54
- error . message . match ( / U n e x p e c t e d t o k e n ' ( e x p o r t | i m p o r t ) ' / )
54
+ / U n e x p e c t e d t o k e n ' ( e x p o r t | i m p o r t ) ' / . test ( error . message )
55
55
)
56
56
) {
57
57
throw error ;
You can’t perform that action at this time.
0 commit comments