@samitouri / QOS-React-2 / commits / 41cba2e77b

Enforce NODE_ENV=test

You could make the argument that this should be optional, but it doesn't work without it so we might as well just enforce it. Makes `jest` work by default.

Sebastian Markbage committed Sep 30, 2015 at 17:43 UTC 41cba2e77be27d1f7aaf3941e92b1a8cf317e6b8
2 files changed +5 -1
package.json
+1 -1
@@ -51,7 +51,7 @@
51 "linc": "git diff --name-only --diff-filter=ACMRTUB `git merge-base HEAD master` | grep '\\.js$' | xargs eslint --",
52 "lint": "grunt lint",
53 "postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json",
54 - "test": "NODE_ENV=test jest"
54 + "test": "jest"
55 },
56 "jest": {
57 "modulePathIgnorePatterns": [
scripts/jest/preprocessor.js
+4
@@ -1,5 +1,9 @@
1 'use strict';
2
3 +// React's test can only work in NODE_ENV=test because of how things
4 +// are set up. So we might as well enforce it.
5 +process.env.NODE_ENV = 'test';
6 +
7 var path = require('path');
8
9 var assign = require('object-assign');