-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6983 from marmelab/fix-cherry-pick-jest-config
Backport jest config from next
- Loading branch information
Showing
2 changed files
with
38 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
const packages = fs.readdirSync(path.resolve(__dirname, './packages')); | ||
const moduleNameMapper = packages.reduce((mapper, dirName) => { | ||
const package = require(path.resolve( | ||
__dirname, | ||
'./packages', | ||
dirName, | ||
'package.json' | ||
)); | ||
mapper[`^${package.name}(.*)$`] = path.join( | ||
__dirname, | ||
`./packages/${dirName}/src$1` | ||
); | ||
return mapper; | ||
}, {}); | ||
|
||
module.exports = { | ||
globalSetup: './test-global-setup.js', | ||
setupFilesAfterEnv: ['./test-setup.js'], | ||
preset: 'ts-jest/presets/js-with-ts', | ||
testPathIgnorePatterns: [ | ||
'/node_modules/', | ||
'/lib/', | ||
'/esm/', | ||
'/examples/simple/', | ||
], | ||
transformIgnorePatterns: [ | ||
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|ts|tsx)$', | ||
], | ||
globals: { | ||
'ts-jest': { | ||
isolatedModules: true, | ||
}, | ||
}, | ||
moduleNameMapper, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters