Skip to content

Commit

Permalink
fix(jest-config): move json behind ts (#10572)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackneer committed Dec 22, 2020
1 parent 33b8df1 commit ec820c3
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -24,6 +24,7 @@
- `[expect]` [**BREAKING**] Make `toContain` more strict with the received type ([#10119](https://github.com/facebook/jest/pull/10119) & [#10929](https://github.com/facebook/jest/pull/10929))
- `[jest-circus]` Fixed the issue of beforeAll & afterAll hooks getting executed even if it is inside a skipped `describe` block [#10451](https://github.com/facebook/jest/issues/10451)
- `[jest-circus]` Fix `testLocation` on Windows when using `test.each` ([#10871](https://github.com/facebook/jest/pull/10871))
- `[jest-config]` [**BREAKING**] Change default file extension order by moving json behind ts and tsx ([10572](https://github.com/facebook/jest/pull/10572))
- `[jest-console]` `console.dir` now respects the second argument correctly ([#10638](https://github.com/facebook/jest/pull/10638))
- `[jest-each]` [**BREAKING**] Ignore excess words in headings ([#8766](https://github.com/facebook/jest/pull/8766))
- `[jest-environment-jsdom]` Use inner realm’s `ArrayBuffer` constructor ([#10885](https://github.com/facebook/jest/pull/10885))
Expand Down
2 changes: 1 addition & 1 deletion docs/Configuration.md
Expand Up @@ -534,7 +534,7 @@ An array of directory names to be searched recursively up from the requiring mod

### `moduleFileExtensions` [array\<string>]

Default: `["js", "json", "jsx", "ts", "tsx", "node"]`
Default: `["js", "jsx", "ts", "tsx", "json", "node"]`

An array of file extensions your modules use. If you require modules without specifying a file extension, these are the extensions Jest will look for, in left-to-right order.

Expand Down
2 changes: 1 addition & 1 deletion e2e/__tests__/__snapshots__/showConfig.test.ts.snap
Expand Up @@ -29,10 +29,10 @@ exports[`--showConfig outputs config info and exits 1`] = `
],
"moduleFileExtensions": [
"js",
"json",
"jsx",
"ts",
"tsx",
"json",
"node"
],
"moduleNameMapper": [],
Expand Down
Expand Up @@ -191,10 +191,10 @@ module.exports = {
// An array of file extensions your modules use
// moduleFileExtensions: [
// \\"js\\",
// \\"json\\",
// \\"jsx\\",
// \\"ts\\",
// \\"tsx\\",
// \\"json\\",
// \\"node\\"
// ],
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-config/src/Defaults.ts
Expand Up @@ -37,7 +37,7 @@ const defaultOptions: Config.DefaultOptions = {
maxConcurrency: 5,
maxWorkers: '50%',
moduleDirectories: ['node_modules'],
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node'],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'node'],
moduleNameMapper: {},
modulePathIgnorePatterns: [],
noStackTrace: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-config/src/__tests__/normalize.test.js
Expand Up @@ -1605,10 +1605,10 @@ describe('moduleFileExtensions', () => {

expect(options.moduleFileExtensions).toEqual([
'js',
'json',
'jsx',
'ts',
'tsx',
'json',
'node',
]);
});
Expand Down

0 comments on commit ec820c3

Please sign in to comment.