From a889046b39b9e440337b96e25fe920ace17ba623 Mon Sep 17 00:00:00 2001 From: Yusuke Iinuma Date: Mon, 2 Oct 2023 18:11:09 +0900 Subject: [PATCH] Add mts and cts to test match and test regex (#14584) --- .eslintrc.cjs | 1 + CHANGELOG.md | 1 + docs/Configuration.md | 4 ++-- .../__snapshots__/showConfig.test.ts.snap | 4 ++-- .../testMatchDefault.test.ts.snap | 9 +++++++ e2e/__tests__/testMatchDefault.test.ts | 16 +++++++++++++ e2e/test-match-default/__tests__/test.cjs | 10 ++++++++ e2e/test-match-default/__tests__/test.cts | 10 ++++++++ e2e/test-match-default/__tests__/test.js | 10 ++++++++ e2e/test-match-default/__tests__/test.jsx | 10 ++++++++ e2e/test-match-default/__tests__/test.mjs | 10 ++++++++ e2e/test-match-default/__tests__/test.mts | 10 ++++++++ e2e/test-match-default/__tests__/test.ts | 10 ++++++++ e2e/test-match-default/__tests__/test.tsx | 10 ++++++++ .../dot-spec-tests/test.spec.cjs | 10 ++++++++ .../dot-spec-tests/test.spec.cts | 10 ++++++++ .../dot-spec-tests/test.spec.js | 10 ++++++++ .../dot-spec-tests/test.spec.jsx | 10 ++++++++ .../dot-spec-tests/test.spec.mjs | 10 ++++++++ .../dot-spec-tests/test.spec.mts | 10 ++++++++ .../dot-spec-tests/test.spec.ts | 10 ++++++++ .../dot-spec-tests/test.spec.tsx | 10 ++++++++ e2e/test-match-default/package.json | 3 +++ e2e/test-match-default/tsconfig.json | 4 ++++ .../__tests__/__snapshots__/init.test.ts.snap | 12 +++++----- packages/jest-config/src/Defaults.ts | 5 +++- packages/jest-config/src/ValidConfig.ts | 24 ++++++++++++++----- .../src/__tests__/__fixtures__/jestConfig.ts | 4 ++-- 28 files changed, 228 insertions(+), 19 deletions(-) create mode 100644 e2e/__tests__/__snapshots__/testMatchDefault.test.ts.snap create mode 100644 e2e/__tests__/testMatchDefault.test.ts create mode 100644 e2e/test-match-default/__tests__/test.cjs create mode 100644 e2e/test-match-default/__tests__/test.cts create mode 100644 e2e/test-match-default/__tests__/test.js create mode 100644 e2e/test-match-default/__tests__/test.jsx create mode 100644 e2e/test-match-default/__tests__/test.mjs create mode 100644 e2e/test-match-default/__tests__/test.mts create mode 100644 e2e/test-match-default/__tests__/test.ts create mode 100644 e2e/test-match-default/__tests__/test.tsx create mode 100644 e2e/test-match-default/dot-spec-tests/test.spec.cjs create mode 100644 e2e/test-match-default/dot-spec-tests/test.spec.cts create mode 100644 e2e/test-match-default/dot-spec-tests/test.spec.js create mode 100644 e2e/test-match-default/dot-spec-tests/test.spec.jsx create mode 100644 e2e/test-match-default/dot-spec-tests/test.spec.mjs create mode 100644 e2e/test-match-default/dot-spec-tests/test.spec.mts create mode 100644 e2e/test-match-default/dot-spec-tests/test.spec.ts create mode 100644 e2e/test-match-default/dot-spec-tests/test.spec.tsx create mode 100644 e2e/test-match-default/package.json create mode 100644 e2e/test-match-default/tsconfig.json diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 6709399043c7..7b03c686ff68 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -160,6 +160,7 @@ module.exports = { 'e2e/failures/macros.js', 'e2e/test-in-root/*.js', 'e2e/test-match/test-suites/*', + 'e2e/test-match-default/dot-spec-tests/*', 'packages/test-utils/src/ConditionalTest.ts', ], env: {'jest/globals': true}, diff --git a/CHANGELOG.md b/CHANGELOG.md index b5618701be14..d09af0a60349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Features - `[jest-config]` [**BREAKING**] Add `mts` and `cts` to default `moduleFileExtensions` config ([#14369](https://github.com/facebook/jest/pull/14369)) +- `[jest-config]` [**BREAKING**] Update `testMatch` and `testRegex` default option for supporting `mjs`, `cjs`, `mts`, and `cts` ([#14584](https://github.com/jestjs/jest/pull/14584)) - `[@jest/core]` [**BREAKING**] Group together open handles with the same stack trace ([#13417](https://github.com/jestjs/jest/pull/13417), & [#14543](https://github.com/jestjs/jest/pull/14543)) - `[@jest/core, @jest/test-sequencer]` [**BREAKING**] Exposes `globalConfig` & `contexts` to `TestSequencer` ([#14535](https://github.com/jestjs/jest/pull/14535), & [#14543](https://github.com/jestjs/jest/pull/14543)) - `[jest-environment-jsdom]` [**BREAKING**] Upgrade JSDOM to v22 ([#13825](https://github.com/jestjs/jest/pull/13825)) diff --git a/docs/Configuration.md b/docs/Configuration.md index 8dc961201f12..54c38107fe3a 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -2000,7 +2000,7 @@ This does not change the exit code in the case of Jest errors (e.g. invalid conf ### `testMatch` \[array<string>] -(default: `[ "**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)" ]`) +(default: `[ "**/__tests__/**/*.?([mc])[jt]s?(x)", "**/?(*.)+(spec|test).?([mc])[jt]s?(x)" ]`) The glob patterns Jest uses to detect test files. By default it looks for `.js`, `.jsx`, `.ts` and `.tsx` files inside of `__tests__` folders, as well as any files with a suffix of `.test` or `.spec` (e.g. `Component.test.js` or `Component.spec.js`). It will also find files called `test.js` or `spec.js`. @@ -2024,7 +2024,7 @@ These pattern strings match against the full path. Use the `` string to ### `testRegex` \[string | array<string>] -Default: `(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$` +Default: `(/__tests__/.*|(\\.|/)(test|spec))\\.[mc]?[jt]sx?$` The pattern or patterns Jest uses to detect test files. By default it looks for `.js`, `.jsx`, `.ts` and `.tsx` files inside of `__tests__` folders, as well as any files with a suffix of `.test` or `.spec` (e.g. `Component.test.js` or `Component.spec.js`). It will also find files called `test.js` or `spec.js`. See also [`testMatch` [array<string>]](#testmatch-arraystring), but note that you cannot specify both options. diff --git a/e2e/__tests__/__snapshots__/showConfig.test.ts.snap b/e2e/__tests__/__snapshots__/showConfig.test.ts.snap index ff4075946605..b3a4eb2b913c 100644 --- a/e2e/__tests__/__snapshots__/showConfig.test.ts.snap +++ b/e2e/__tests__/__snapshots__/showConfig.test.ts.snap @@ -72,8 +72,8 @@ exports[`--showConfig outputs config info and exits 1`] = ` "testEnvironmentOptions": {}, "testLocationInResults": false, "testMatch": [ - "**/__tests__/**/*.[jt]s?(x)", - "**/?(*.)+(spec|test).[tj]s?(x)" + "**/__tests__/**/*.?([mc])[jt]s?(x)", + "**/?(*.)+(spec|test).?([mc])[jt]s?(x)" ], "testPathIgnorePatterns": [ "/node_modules/" diff --git a/e2e/__tests__/__snapshots__/testMatchDefault.test.ts.snap b/e2e/__tests__/__snapshots__/testMatchDefault.test.ts.snap new file mode 100644 index 000000000000..85aafe3318c3 --- /dev/null +++ b/e2e/__tests__/__snapshots__/testMatchDefault.test.ts.snap @@ -0,0 +1,9 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`testMatch should able to match file with \`?([mc])[jt]s?(x)\` by default 1`] = ` +"Test Suites: 16 passed, 16 total +Tests: 16 passed, 16 total +Snapshots: 0 total +Time: <> +Ran all test suites." +`; diff --git a/e2e/__tests__/testMatchDefault.test.ts b/e2e/__tests__/testMatchDefault.test.ts new file mode 100644 index 000000000000..8aa10942b7fa --- /dev/null +++ b/e2e/__tests__/testMatchDefault.test.ts @@ -0,0 +1,16 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import {extractSummary} from '../Utils'; +import runJest from '../runJest'; + +it('testMatch should able to match file with `?([mc])[jt]s?(x)` by default', () => { + const result = runJest('test-match-default'); + expect(result.exitCode).toBe(0); + const {summary} = extractSummary(result.stderr); + expect(summary).toMatchSnapshot(); +}); diff --git a/e2e/test-match-default/__tests__/test.cjs b/e2e/test-match-default/__tests__/test.cjs new file mode 100644 index 000000000000..d3a4648b1723 --- /dev/null +++ b/e2e/test-match-default/__tests__/test.cjs @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('cjs extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/__tests__/test.cts b/e2e/test-match-default/__tests__/test.cts new file mode 100644 index 000000000000..5a27bdb1cc01 --- /dev/null +++ b/e2e/test-match-default/__tests__/test.cts @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('cts extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/__tests__/test.js b/e2e/test-match-default/__tests__/test.js new file mode 100644 index 000000000000..b09fb94e9628 --- /dev/null +++ b/e2e/test-match-default/__tests__/test.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('js extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/__tests__/test.jsx b/e2e/test-match-default/__tests__/test.jsx new file mode 100644 index 000000000000..92bda9982cf2 --- /dev/null +++ b/e2e/test-match-default/__tests__/test.jsx @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('jsx extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/__tests__/test.mjs b/e2e/test-match-default/__tests__/test.mjs new file mode 100644 index 000000000000..50a1e74312a0 --- /dev/null +++ b/e2e/test-match-default/__tests__/test.mjs @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('mjs extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/__tests__/test.mts b/e2e/test-match-default/__tests__/test.mts new file mode 100644 index 000000000000..9c58cacc90ec --- /dev/null +++ b/e2e/test-match-default/__tests__/test.mts @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('mts extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/__tests__/test.ts b/e2e/test-match-default/__tests__/test.ts new file mode 100644 index 000000000000..d6041c9425a0 --- /dev/null +++ b/e2e/test-match-default/__tests__/test.ts @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('ts extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/__tests__/test.tsx b/e2e/test-match-default/__tests__/test.tsx new file mode 100644 index 000000000000..94ab24617b48 --- /dev/null +++ b/e2e/test-match-default/__tests__/test.tsx @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('tsx extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/dot-spec-tests/test.spec.cjs b/e2e/test-match-default/dot-spec-tests/test.spec.cjs new file mode 100644 index 000000000000..d3a4648b1723 --- /dev/null +++ b/e2e/test-match-default/dot-spec-tests/test.spec.cjs @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('cjs extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/dot-spec-tests/test.spec.cts b/e2e/test-match-default/dot-spec-tests/test.spec.cts new file mode 100644 index 000000000000..5a27bdb1cc01 --- /dev/null +++ b/e2e/test-match-default/dot-spec-tests/test.spec.cts @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('cts extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/dot-spec-tests/test.spec.js b/e2e/test-match-default/dot-spec-tests/test.spec.js new file mode 100644 index 000000000000..b09fb94e9628 --- /dev/null +++ b/e2e/test-match-default/dot-spec-tests/test.spec.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('js extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/dot-spec-tests/test.spec.jsx b/e2e/test-match-default/dot-spec-tests/test.spec.jsx new file mode 100644 index 000000000000..92bda9982cf2 --- /dev/null +++ b/e2e/test-match-default/dot-spec-tests/test.spec.jsx @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('jsx extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/dot-spec-tests/test.spec.mjs b/e2e/test-match-default/dot-spec-tests/test.spec.mjs new file mode 100644 index 000000000000..50a1e74312a0 --- /dev/null +++ b/e2e/test-match-default/dot-spec-tests/test.spec.mjs @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('mjs extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/dot-spec-tests/test.spec.mts b/e2e/test-match-default/dot-spec-tests/test.spec.mts new file mode 100644 index 000000000000..9c58cacc90ec --- /dev/null +++ b/e2e/test-match-default/dot-spec-tests/test.spec.mts @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('mts extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/dot-spec-tests/test.spec.ts b/e2e/test-match-default/dot-spec-tests/test.spec.ts new file mode 100644 index 000000000000..d6041c9425a0 --- /dev/null +++ b/e2e/test-match-default/dot-spec-tests/test.spec.ts @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('ts extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/dot-spec-tests/test.spec.tsx b/e2e/test-match-default/dot-spec-tests/test.spec.tsx new file mode 100644 index 000000000000..94ab24617b48 --- /dev/null +++ b/e2e/test-match-default/dot-spec-tests/test.spec.tsx @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +test('tsx extension', () => { + expect(1).toBe(1); +}); diff --git a/e2e/test-match-default/package.json b/e2e/test-match-default/package.json new file mode 100644 index 000000000000..586d4ca6b75c --- /dev/null +++ b/e2e/test-match-default/package.json @@ -0,0 +1,3 @@ +{ + "jest": {} +} diff --git a/e2e/test-match-default/tsconfig.json b/e2e/test-match-default/tsconfig.json new file mode 100644 index 000000000000..8afdfb3df9f5 --- /dev/null +++ b/e2e/test-match-default/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../tsconfig.json", + "include": ["./**/*.tsx"] +} diff --git a/packages/create-jest/src/__tests__/__snapshots__/init.test.ts.snap b/packages/create-jest/src/__tests__/__snapshots__/init.test.ts.snap index 18117e951fd4..f209d032b847 100644 --- a/packages/create-jest/src/__tests__/__snapshots__/init.test.ts.snap +++ b/packages/create-jest/src/__tests__/__snapshots__/init.test.ts.snap @@ -276,8 +276,8 @@ const config: Config = { // The glob patterns Jest uses to detect test files // testMatch: [ - // "**/__tests__/**/*.[jt]s?(x)", - // "**/?(*.)+(spec|test).[tj]s?(x)" + // "**/__tests__/**/*.?([mc])[jt]s?(x)", + // "**/?(*.)+(spec|test).?([mc])[jt]s?(x)" // ], // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped @@ -480,8 +480,8 @@ const config = { // The glob patterns Jest uses to detect test files // testMatch: [ - // "**/__tests__/**/*.[jt]s?(x)", - // "**/?(*.)+(spec|test).[tj]s?(x)" + // "**/__tests__/**/*.?([mc])[jt]s?(x)", + // "**/?(*.)+(spec|test).?([mc])[jt]s?(x)" // ], // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped @@ -684,8 +684,8 @@ const config = { // The glob patterns Jest uses to detect test files // testMatch: [ - // "**/__tests__/**/*.[jt]s?(x)", - // "**/?(*.)+(spec|test).[tj]s?(x)" + // "**/__tests__/**/*.?([mc])[jt]s?(x)", + // "**/?(*.)+(spec|test).?([mc])[jt]s?(x)" // ], // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped diff --git a/packages/jest-config/src/Defaults.ts b/packages/jest-config/src/Defaults.ts index 270c08fd5920..1684a51dbb5f 100644 --- a/packages/jest-config/src/Defaults.ts +++ b/packages/jest-config/src/Defaults.ts @@ -81,7 +81,10 @@ const defaultOptions: Config.DefaultOptions = { testEnvironmentOptions: {}, testFailureExitCode: 1, testLocationInResults: false, - testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)'], + testMatch: [ + '**/__tests__/**/*.?([mc])[jt]s?(x)', + '**/?(*.)+(spec|test).?([mc])[jt]s?(x)', + ], testPathIgnorePatterns: [NODE_MODULES_REGEXP], testRegex: [], testRunner: 'jest-circus/runner', diff --git a/packages/jest-config/src/ValidConfig.ts b/packages/jest-config/src/ValidConfig.ts index faf159ca68dd..aac2cab36ee9 100644 --- a/packages/jest-config/src/ValidConfig.ts +++ b/packages/jest-config/src/ValidConfig.ts @@ -156,12 +156,18 @@ export const initialOptions: Config.InitialOptions = { }, testFailureExitCode: 1, testLocationInResults: false, - testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], + testMatch: [ + '**/__tests__/**/*.?([mc])[jt]s?(x)', + '**/?(*.)+(spec|test).?([mc])[jt]s?(x)', + ], testNamePattern: 'test signature', testPathIgnorePatterns: [NODE_MODULES_REGEXP], testRegex: multipleValidOptions( - '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$', - ['/__tests__/\\.test\\.[jt]sx?$', '/__tests__/\\.spec\\.[jt]sx?$'], + '(/__tests__/.*|(\\.|/)(test|spec))\\.[mc]?[jt]sx?$', + [ + '/__tests__/\\.test\\.[mc]?[jt]sx?$', + '/__tests__/\\.spec\\.[mc]?[jt]sx?$', + ], ), testResultsProcessor: 'processor-node-module', testRunner: 'circus', @@ -296,11 +302,17 @@ export const initialProjectOptions: Config.InitialProjectOptions = { userAgent: 'Agent/007', }, testLocationInResults: false, - testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], + testMatch: [ + '**/__tests__/**/*.?([mc])[jt]s?(x)', + '**/?(*.)+(spec|test).?([mc])[jt]s?(x)', + ], testPathIgnorePatterns: [NODE_MODULES_REGEXP], testRegex: multipleValidOptions( - '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$', - ['/__tests__/\\.test\\.[jt]sx?$', '/__tests__/\\.spec\\.[jt]sx?$'], + '(/__tests__/.*|(\\.|/)(test|spec))\\.[mc]?[jt]sx?$', + [ + '/__tests__/\\.test\\.[mc]?[jt]sx?$', + '/__tests__/\\.spec\\.[mc]?[jt]sx?$', + ], ), testRunner: 'circus', transform: { diff --git a/packages/jest-validate/src/__tests__/__fixtures__/jestConfig.ts b/packages/jest-validate/src/__tests__/__fixtures__/jestConfig.ts index fd5bdb0045bd..8fd81bd7af35 100644 --- a/packages/jest-validate/src/__tests__/__fixtures__/jestConfig.ts +++ b/packages/jest-validate/src/__tests__/__fixtures__/jestConfig.ts @@ -46,7 +46,7 @@ export const defaultConfig = { snapshotSerializers: [], testEnvironment: 'jest-environment-node', testPathIgnorePatterns: [NODE_MODULES_REGEXP], - testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$', + testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.[mc]?[jt]sx?$', testResultsProcessor: null, transformIgnorePatterns: [NODE_MODULES_REGEXP], useStderr: false, @@ -104,7 +104,7 @@ export const validConfig = { testEnvironment: 'jest-environment-node', testNamePattern: 'test signature', testPathIgnorePatterns: [NODE_MODULES_REGEXP], - testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$', + testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.[mc]?[jt]sx?$', testResultsProcessor: 'processor-node-module', testRunner: 'circus', transform: {