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:
Dan Abramov
2016-09-01 02:08:27 +01:00
committed by GitHub
parent 497371b619
commit 67fe75926a
9 changed files with 52 additions and 65 deletions

View File

@@ -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;