Skip to content

Commit b11bda6

Browse files
thymikeethomasjinlo
authored andcommitted
Use valid glob pattern instead of micromatch-specific (jestjs#5744)
* Use idiomatic glob pattern instead of micromatch-specific * Use prettierignore
1 parent 9991284 commit b11bda6

File tree

10 files changed

+10
-9
lines changed

10 files changed

+10
-9
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package.json

docs/Configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ given to [jsdom](https://github.com/tmpvar/jsdom) such as
893893

894894
##### available in Jest **19.0.0+**
895895

896-
(default: `[ '**/__tests__/**/*.js?(x)', '**/?(*.)(spec|test).js?(x)' ]`)
896+
(default: `[ '**/__tests__/**/*.js?(x)', '**/?(*.)+(spec|test).js?(x)' ]`)
897897

898898
The glob patterns Jest uses to detect test files. By default it looks for `.js`
899899
and `.jsx` files inside of `__tests__` folders, as well as any files with a

examples/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
"transform": {
1818
"^.+\\.(ts|tsx)$": "<rootDir>/preprocessor.js"
1919
},
20-
"testMatch": ["**/__tests__/*.(ts|tsx|js)"]
20+
"testMatch": ["**/__tests__/*.+(ts|tsx|js)"]
2121
}
2222
}

integration-tests/__tests__/__snapshots__/show_config.test.js.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ exports[`--showConfig outputs config info and exits 1`] = `
4545
\\"testLocationInResults\\": false,
4646
\\"testMatch\\": [
4747
\\"**/__tests__/**/*.js?(x)\\",
48-
\\"**/?(*.)(spec|test).js?(x)\\"
48+
\\"**/?(*.)+(spec|test).js?(x)\\"
4949
],
5050
\\"testPathIgnorePatterns\\": [
5151
\\"/node_modules/\\"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2004-present Facebook. All Rights Reserved.
22

3-
it('adds 1 + 2 to equal 3 in TScript', ()=> {
3+
it('adds 1 + 2 to equal 3 in TScript', () => {
44
const sum = require('../covered.ts');
55
expect(sum(1, 2)).toBe(3);
66
});

integration-tests/typescript-coverage/covered.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
export = function sum(a: number, b: number): number {
44
return a + b;
5-
}
5+
};

integration-tests/typescript-coverage/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"transform": {
55
"^.+\\.(ts|js)$": "<rootDir>/TypescriptPreprocessor.js"
66
},
7-
"testMatch": ["**/__tests__/*.(ts|tsx|js)"],
7+
"testMatch": ["**/__tests__/*.+(ts|tsx|js)"],
88
"testEnvironment": "node",
99
"moduleFileExtensions": [
1010
"ts",

packages/jest-config/src/defaults.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default ({
6464
testEnvironmentOptions: {},
6565
testFailureExitCode: 1,
6666
testLocationInResults: false,
67-
testMatch: ['**/__tests__/**/*.js?(x)', '**/?(*.)(spec|test).js?(x)'],
67+
testMatch: ['**/__tests__/**/*.js?(x)', '**/?(*.)+(spec|test).js?(x)'],
6868
testPathIgnorePatterns: [NODE_MODULES_REGEXP],
6969
testRegex: '',
7070
testResultsProcessor: null,

packages/jest-config/src/valid_config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export default ({
8686
testEnvironmentOptions: {},
8787
testFailureExitCode: 1,
8888
testLocationInResults: false,
89-
testMatch: ['**/__tests__/**/*.js?(x)', '**/?(*.)(spec|test).js?(x)'],
89+
testMatch: ['**/__tests__/**/*.js?(x)', '**/?(*.)+(spec|test).js?(x)'],
9090
testNamePattern: 'test signature',
9191
testPathIgnorePatterns: [NODE_MODULES_REGEXP],
9292
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.jsx?$',

packages/jest-editor-support/src/Settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default class Settings extends EventEmitter {
5555

5656
// Defaults for a Jest project
5757
this.settings = {
58-
testMatch: ['**/__tests__/**/*.js?(x)', '**/?(*.)(spec|test).js?(x)'],
58+
testMatch: ['**/__tests__/**/*.js?(x)', '**/?(*.)+(spec|test).js?(x)'],
5959
testRegex: '(/__tests__/.*|\\.(test|spec))\\.jsx?$',
6060
};
6161

0 commit comments

Comments
 (0)