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+ `;
215
316exports[`on node >=24 invalid JS in jest.config.ts (node with native TS support) 1`] = `
417"Error: Jest: Failed to parse the TypeScript config file <<REPLACED >>
@@ -54,19 +67,6 @@ Time: <<REPLACED>>
5467Ran all test suites."
5568`;
5669
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-
7070exports[`works with tsconfig.json 1`] = `
7171"PASS __tests__/a-giraffe.js
7272 ✓ giraffe"
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ export default async function readConfigFileAndSetRootDir(
5151 error instanceof SyntaxError &&
5252 // Likely ESM in a file interpreted as CJS, which means it needs to be
5353 // 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 )
5555 )
5656 ) {
5757 throw error ;
You can’t perform that action at this time.
0 commit comments