mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-05-07 23:37:29 +08:00
Update Jest (#530)
* Update Jest * Remove default snapshot test * Fix a few things * Add a simple default test * App.spec.js -> App.test.js * Fix e2e test * Bump Jest
This commit is contained in:
@@ -9,25 +9,14 @@
|
||||
|
||||
module.exports = (resolve, rootDir) => {
|
||||
const config = {
|
||||
automock: false,
|
||||
moduleNameMapper: {
|
||||
'^[./a-zA-Z0-9$_-]+\\.(jpg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm)$': resolve('config/jest/FileStub.js'),
|
||||
'^[./a-zA-Z0-9$_-]+\\.css$': resolve('config/jest/CSSStub.js')
|
||||
},
|
||||
persistModuleRegistryBetweenSpecs: true,
|
||||
scriptPreprocessor: resolve('config/jest/transform.js'),
|
||||
setupFiles: [
|
||||
resolve('config/polyfills.js')
|
||||
],
|
||||
setupTestFrameworkScriptFile: resolve('config/jest/environment.js'),
|
||||
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/build/'],
|
||||
// Allow three popular conventions:
|
||||
// **/__tests__/*.js
|
||||
// **/*.test.js
|
||||
// **/*.spec.js
|
||||
testRegex: '(__tests__/.*|\\.(test|spec))\\.js$',
|
||||
testEnvironment: 'node',
|
||||
verbose: true
|
||||
setupFiles: [resolve('config/polyfills.js')],
|
||||
testPathIgnorePatterns: ['<rootDir>/(build|docs|node_modules)/'],
|
||||
testEnvironment: 'node'
|
||||
};
|
||||
if (rootDir) {
|
||||
config.rootDir = rootDir;
|
||||
|
||||
Reference in New Issue
Block a user