Skip to content

Commit

Permalink
move jest config to a js file from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
vzaidman committed Oct 14, 2024
1 parent a36e992 commit c0192a5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
35 changes: 35 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* 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.
*
* @format
* @oncall react_native
*/

module.exports = function jestConfig() {
/** @type {import('jest').Config} **/
const config = {
modulePathIgnorePatterns: ['/node_modules/', 'packages/[^/]+/build/'],
snapshotFormat: {
escapeString: true,
printBasicPrototype: true,
},
testEnvironment: 'node',
testRegex: '/__tests__/.*-test\\.js$',
fakeTimers: {
enableGlobally: true,
legacyFakeTimers: false,
},
transform: {
'\\.js$': '<rootDir>/scripts/babelJestTransformer.js',
},
setupFiles: ['<rootDir>/scripts/setupJest.js'],
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname',
],
};
return config;
};
26 changes: 0 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,6 @@
"workspaces": [
"packages/*"
],
"jest": {
"modulePathIgnorePatterns": [
"/node_modules/",
"packages/[^/]+/build/"
],
"snapshotFormat": {
"escapeString": true,
"printBasicPrototype": true
},
"testEnvironment": "node",
"testRegex": "/__tests__/.*-test\\.js$",
"fakeTimers": {
"enableGlobally": true,
"legacyFakeTimers": false
},
"transform": {
"\\.js$": "<rootDir>/scripts/babelJestTransformer.js"
},
"setupFiles": [
"<rootDir>/scripts/setupJest.js"
],
"watchPlugins": [
"jest-watch-typeahead/filename",
"jest-watch-typeahead/testname"
]
},
"license": "MIT",
"dependencies": {},
"engines": {
Expand Down

0 comments on commit c0192a5

Please sign in to comment.