From 4254b9d47c15c9d6582de77785d3aa35dc38fc05 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Mon, 8 Aug 2016 14:15:26 +0100 Subject: [PATCH] Allow popular test path conventions --- scripts/utils/createJestConfig.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/utils/createJestConfig.js b/scripts/utils/createJestConfig.js index d4ee867f473..3072074807e 100644 --- a/scripts/utils/createJestConfig.js +++ b/scripts/utils/createJestConfig.js @@ -20,6 +20,12 @@ module.exports = (resolve, rootDir) => { resolve('config/polyfills.js') ], setupTestFrameworkScriptFile: resolve('config/jest/environment.js'), + testPathIgnorePatterns: ['/node_modules/', '/build/'], + // Allow three popular conventions: + // **/__tests__/*.js + // **/*.test.js + // **/*.spec.js + testRegex: '(__tests__/.*|\\.(test|spec))\\.js$', testEnvironment: 'node', verbose: true };