2
2
3
3
const { run } = require ( "../../utils/test-utils" ) ;
4
4
5
- describe ( "--define-process-env -node-env flag" , ( ) => {
5
+ describe ( "--config -node-env flag" , ( ) => {
6
6
it ( 'should set "process.env.NODE_ENV" to "development"' , async ( ) => {
7
- const { exitCode, stderr, stdout } = await run ( __dirname , [
8
- "--define-process-env-node-env" ,
9
- "development" ,
10
- ] ) ;
7
+ const { exitCode, stderr, stdout } = await run ( __dirname , [ "--config-node-env" , "development" ] ) ;
11
8
12
9
expect ( exitCode ) . toBe ( 0 ) ;
13
10
expect ( stderr ) . toBeFalsy ( ) ;
14
11
expect ( stdout ) . toContain ( "mode: 'development'" ) ;
15
12
} ) ;
16
13
17
14
it ( 'should set "process.env.NODE_ENV" to "production"' , async ( ) => {
18
- const { exitCode, stderr, stdout } = await run ( __dirname , [
19
- "--define-process-env-node-env" ,
20
- "production" ,
21
- ] ) ;
15
+ const { exitCode, stderr, stdout } = await run ( __dirname , [ "--config-node-env" , "production" ] ) ;
22
16
23
17
expect ( exitCode ) . toBe ( 0 ) ;
24
18
expect ( stderr ) . toBeFalsy ( ) ;
25
19
expect ( stdout ) . toContain ( "mode: 'production'" ) ;
26
20
} ) ;
27
21
28
22
it ( 'should set "process.env.NODE_ENV" to "none"' , async ( ) => {
29
- const { exitCode, stderr, stdout } = await run ( __dirname , [
30
- "--define-process-env-node-env" ,
31
- "none" ,
32
- ] ) ;
23
+ const { exitCode, stderr, stdout } = await run ( __dirname , [ "--config-node-env" , "none" ] ) ;
33
24
34
25
expect ( exitCode ) . toBe ( 0 ) ;
35
26
expect ( stderr ) . toBeFalsy ( ) ;
@@ -38,7 +29,7 @@ describe("--define-process-env-node-env flag", () => {
38
29
39
30
it ( 'should set "process.env.NODE_ENV" and the "mode" option to "development"' , async ( ) => {
40
31
const { exitCode, stderr, stdout } = await run ( __dirname , [
41
- "--define-process-env -node-env" ,
32
+ "--config -node-env" ,
42
33
"development" ,
43
34
"--config" ,
44
35
"./auto-mode.config.js" ,
@@ -51,7 +42,7 @@ describe("--define-process-env-node-env flag", () => {
51
42
52
43
it ( 'should set "process.env.NODE_ENV" and the "mode" option to "production"' , async ( ) => {
53
44
const { exitCode, stderr, stdout } = await run ( __dirname , [
54
- "--define-process-env -node-env" ,
45
+ "--config -node-env" ,
55
46
"production" ,
56
47
"--config" ,
57
48
"./auto-mode.config.js" ,
@@ -64,7 +55,7 @@ describe("--define-process-env-node-env flag", () => {
64
55
65
56
it ( 'should set "process.env.NODE_ENV" and the "mode" option to "none"' , async ( ) => {
66
57
const { exitCode, stderr, stdout } = await run ( __dirname , [
67
- "--define-process-env -node-env" ,
58
+ "--config -node-env" ,
68
59
"none" ,
69
60
"--config" ,
70
61
"./auto-mode.config.js" ,
0 commit comments