diff --git a/scripts/test.js b/scripts/test.js index 72556313a9b2..534fedbdc8f7 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -29,6 +29,8 @@ const EXAMPLES_DIR = path.resolve(__dirname, '../examples'); const INTEGRATION_TESTS_DIR = path.resolve(__dirname, '../integration_tests'); const JEST_CLI_PATH = path.resolve(__dirname, '../packages/jest-cli'); const LINKED_MODULES = ['jest-react-native']; +const NODE_VERSION = Number(process.version.match(/^v(\d+\.\d+)/)[1]); +const SKIP_ON_OLD_NODE = ['react-native']; const VERSION = require('../lerna').version; const packages = getPackages(); @@ -45,6 +47,12 @@ function runPackageTests(packageDirectory) { function runExampleTests(exampleDirectory) { console.log(chalk.bold(chalk.cyan('Testing example: ') + exampleDirectory)); + const exampleName = path.basename(exampleDirectory); + if (NODE_VERSION < 6 && SKIP_ON_OLD_NODE.indexOf(exampleName) !== -1) { + console.log(`Skipping ${exampleName} on node ${process.version}.`); + return; + } + runCommands('npm update', exampleDirectory); packages.forEach(pkg => { const name = path.basename(pkg);