Skip to content

Commit

Permalink
Run tests for Fire feature flags
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Sep 12, 2018
1 parent d3bbfe0 commit 8d5b9d8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@
"postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && node ./scripts/flow/createFlowConfigs.js",
"debug-test": "cross-env NODE_ENV=development node --inspect-brk node_modules/.bin/jest --config ./scripts/jest/config.source.js --runInBand",
"test": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source.js",
"test-fire": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-fire.js",
"test-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source.js",
"test-fire-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source-fire.js",
"test-prod-build": "yarn test-build-prod",
"test-build": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.build.js",
"test-build-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.build.js",
Expand Down
3 changes: 3 additions & 0 deletions scripts/circleci/test_entry_point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ fi

if [ $((1 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
COMMANDS_TO_RUN+=('yarn test-prod --maxWorkers=2')
# React Fire:
COMMANDS_TO_RUN+=('yarn test-fire --maxWorkers=2')
COMMANDS_TO_RUN+=('yarn test-fire-prod --maxWorkers=2')
fi

if [ $((2 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then
Expand Down
11 changes: 11 additions & 0 deletions scripts/jest/config.source-fire.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use strict';

const baseConfig = require('./config.base');

module.exports = Object.assign({}, baseConfig, {
setupFiles: [
...baseConfig.setupFiles,
require.resolve('./setupFire.js'),
require.resolve('./setupHostConfigs.js'),
],
});
7 changes: 7 additions & 0 deletions scripts/jest/setupFire.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

jest.mock('shared/ReactFeatureFlags', () => {
const ReactFeatureFlags = require.requireActual('shared/ReactFeatureFlags');
// TODO: Set feature flags for Fire
return ReactFeatureFlags;
});

0 comments on commit 8d5b9d8

Please sign in to comment.