mirror of https://github.com/facebook/jest.git
Respect unicorn/prefer-regexp-test (#15701)
This commit is contained in:
parent
77cc947dfc
commit
74b51b9589
|
@ -1,4 +1,17 @@
|
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`falls back to a loader if we encounter a ESM TS config file in a CommonJs project 1`] = `
|
||||
"PASS __tests__/a-giraffe.js
|
||||
✓ giraffe"
|
||||
`;
|
||||
|
||||
exports[`falls back to a loader if we encounter a ESM TS config file in a CommonJs project 2`] = `
|
||||
"Test Suites: 1 passed, 1 total
|
||||
Tests: 1 passed, 1 total
|
||||
Snapshots: 0 total
|
||||
Time: <<REPLACED>>
|
||||
Ran all test suites."
|
||||
`;
|
||||
|
||||
exports[`on node >=24 invalid JS in jest.config.ts (node with native TS support) 1`] = `
|
||||
"Error: Jest: Failed to parse the TypeScript config file <<REPLACED>>
|
||||
|
@ -54,19 +67,6 @@ Time: <<REPLACED>>
|
|||
Ran all test suites."
|
||||
`;
|
||||
|
||||
exports[`works with jest.config.ts with cjs contents 1`] = `
|
||||
"PASS __tests__/a-giraffe.js
|
||||
✓ giraffe"
|
||||
`;
|
||||
|
||||
exports[`works with jest.config.ts with cjs contents 2`] = `
|
||||
"Test Suites: 1 passed, 1 total
|
||||
Tests: 1 passed, 1 total
|
||||
Snapshots: 0 total
|
||||
Time: <<REPLACED>>
|
||||
Ran all test suites."
|
||||
`;
|
||||
|
||||
exports[`works with tsconfig.json 1`] = `
|
||||
"PASS __tests__/a-giraffe.js
|
||||
✓ giraffe"
|
||||
|
|
|
@ -51,7 +51,7 @@ export default async function readConfigFileAndSetRootDir(
|
|||
error instanceof SyntaxError &&
|
||||
// Likely ESM in a file interpreted as CJS, which means it needs to be
|
||||
// compiled. We ignore the error and try to load it with a loader.
|
||||
error.message.match(/Unexpected token '(export|import)'/)
|
||||
/Unexpected token '(export|import)'/.test(error.message)
|
||||
)
|
||||
) {
|
||||
throw error;
|
||||
|
|
Loading…
Reference in New Issue