Skip to content

Commit 8d5b9d8

Browse files
committed
Run tests for Fire feature flags
1 parent d3bbfe0 commit 8d5b9d8

4 files changed

Lines changed: 23 additions & 0 deletions

File tree

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@
9999
"postinstall": "node node_modules/fbjs-scripts/node/check-dev-engines.js package.json && node ./scripts/flow/createFlowConfigs.js",
100100
"debug-test": "cross-env NODE_ENV=development node --inspect-brk node_modules/.bin/jest --config ./scripts/jest/config.source.js --runInBand",
101101
"test": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source.js",
102+
"test-fire": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.source-fire.js",
102103
"test-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source.js",
104+
"test-fire-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.source-fire.js",
103105
"test-prod-build": "yarn test-build-prod",
104106
"test-build": "cross-env NODE_ENV=development jest --config ./scripts/jest/config.build.js",
105107
"test-build-prod": "cross-env NODE_ENV=production jest --config ./scripts/jest/config.build.js",

scripts/circleci/test_entry_point.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ fi
1919

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

2427
if [ $((2 % CIRCLE_NODE_TOTAL)) -eq "$CIRCLE_NODE_INDEX" ]; then

scripts/jest/config.source-fire.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
const baseConfig = require('./config.base');
4+
5+
module.exports = Object.assign({}, baseConfig, {
6+
setupFiles: [
7+
...baseConfig.setupFiles,
8+
require.resolve('./setupFire.js'),
9+
require.resolve('./setupHostConfigs.js'),
10+
],
11+
});

scripts/jest/setupFire.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
jest.mock('shared/ReactFeatureFlags', () => {
4+
const ReactFeatureFlags = require.requireActual('shared/ReactFeatureFlags');
5+
// TODO: Set feature flags for Fire
6+
return ReactFeatureFlags;
7+
});

0 commit comments

Comments
 (0)