Skip to content

Commit 55e4933

Browse files
committed
use staging in cypress
1 parent f9a72f6 commit 55e4933

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

common/config/environment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* This file should only contain environment variables that are non-secret.
33
*/
4-
const isProduction = process.env.NODE_ENV === 'production';
4+
const isProduction = process.env.PRODUCTION_DEPLOYMENT === 'true';
55

66
// These are all exposed by the client, so there's no way to protect them anyways.
77
export const clientTokens = isProduction

cypress/plugins/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// ***********************************************************
1010
const { addMatchImageSnapshotPlugin } = require('cypress-image-snapshot/plugin');
1111
const webpack = require('@cypress/webpack-preprocessor');
12+
const { DefinePlugin } = require('webpack');
1213
// This function is called when a project is opened or re-opened (e.g. due to
1314
// the project's config changing)
1415
// eslint-disable-next-line no-unused-vars
@@ -33,6 +34,14 @@ module.exports = (on, config) => {
3334
alias: require('../../pathAliases'),
3435
extensions: ['.js', '.ts', '.tsx'],
3536
},
37+
plugins: [
38+
new DefinePlugin({
39+
'process.env': {
40+
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
41+
PRODUCTION_DEPLOYMENT: JSON.stringify(false),
42+
},
43+
}),
44+
],
3645
module: {
3746
rules: [
3847
{
@@ -53,5 +62,8 @@ module.exports = (on, config) => {
5362
watchOptions: {},
5463
}),
5564
);
65+
66+
console.log(process.env);
67+
5668
return config;
5769
};

0 commit comments

Comments
 (0)