Skip to content

Commit

Permalink
Only run tests in <rootDir>/src (#544) (#1808)
Browse files Browse the repository at this point in the history
* Only run tests in <rootDir>/src (#544)

* updates Jest to 19.0.2

* removes testPathIgnorePatterns from jest config

* adds testMatch to jest config to only match files in src

* Bump babel-jest to 19.0.0 to match jest 19.0.2
  • Loading branch information
kindrowboat authored and Timer committed May 16, 2017
1 parent 9f8a001 commit c5e5eb5
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions packages/react-scripts/scripts/utils/createJestConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,8 @@ module.exports = (resolve, rootDir, isEjecting) => {
setupFiles: [resolve('config/polyfills.js')],
setupTestFrameworkScriptFile: setupTestsFile,
testMatch: [
// Ignore the following directories:
// build
// - the build output directory
// .cache
// - the yarn module cache on Ubuntu if $HOME === rootDir
// docs
// - often used to publish to Github Pages
// node_modules
// - ignore tests in dependencies
// scripts
// - directory generated upon eject
'<rootDir>/!(build|docs|node_modules|scripts)/**/__tests__/**/*.js?(x)',
'<rootDir>/!(build|docs|node_modules|scripts)/**/?(*.)(spec|test).js?(x)',
'<rootDir>/src/**/__tests__/**/*.js?(x)',
'<rootDir>/src/**/?(*.)(spec|test).js?(x)'
],
testEnvironment: 'node',
testURL: 'http://localhost',
Expand Down

1 comment on commit c5e5eb5

@ThomasR
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we have <rootDir>/test too?

Please sign in to comment.