Skip to content

Commit

Permalink
Update jest config for GUTENBERG_PHASE
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Feb 15, 2019
1 parent 106d82d commit f52a902
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process.env = {
global.process.env = {
...global.process.env,
// Inject the `GUTENBERG_PHASE` global, used for feature flagging.
// eslint-disable-next-line @wordpress/gutenberg-phase
GUTENBERG_PHASE: parseInt( process.env.npm_package_config_GUTENBERG_PHASE, 10 ),
...process.env,
};
3 changes: 3 additions & 0 deletions packages/e2e-tests/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
...require( '@wordpress/scripts/config/jest-e2e.config' ),
setupTestFrameworkScriptFile: '<rootDir>/config/setup-test-framework.js',
setupFiles: [
'<rootDir>/config/gutenberg-phase.js',
],
};
6 changes: 6 additions & 0 deletions test/unit/config/gutenberg-phase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
global.process.env = {
...global.process.env,
// Inject the `GUTENBERG_PHASE` global, used for feature flagging.
// eslint-disable-next-line @wordpress/gutenberg-phase
GUTENBERG_PHASE: parseInt( process.env.npm_package_config_GUTENBERG_PHASE, 10 ),
};
2 changes: 1 addition & 1 deletion test/unit/jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"preset": "@wordpress/jest-preset-default",
"setupFiles": [
"core-js/fn/symbol/async-iterator",
"<rootDir>/test/unit/setup/gutenberg-phase.js"
"<rootDir>/test/unit/config/gutenberg-phase.js"
],
"testURL": "http://localhost",
"testPathIgnorePatterns": [
Expand Down

0 comments on commit f52a902

Please sign in to comment.