@@ -35,21 +35,6 @@ jest.mock('child_process', () => {
35
35
)
36
36
) . toBeTruthy ( ) ;
37
37
break ;
38
- case 'if-check-cwd' :
39
- expect ( param ) . toEqual (
40
- "npm run if-env -- -m ./src/__mocks__/mock-manifest.yaml -c && npm run if-run -- -m ./src/__mocks__/mock-manifest.yaml -o src/__mocks__/re-mock-manifest && node -p 'Boolean(process.stdout.isTTY)' | npm run if-diff -- -s src/__mocks__/re-mock-manifest.yaml -t ./src/__mocks__/mock-manifest.yaml"
41
- ) ;
42
- break ;
43
- case 'if-check-global' :
44
- expect ( param ) . toEqual (
45
- "if-env -m ./src/__mocks__/mock-manifest.yaml && if-run -m ./src/__mocks__/mock-manifest.yaml -o src/__mocks__/re-mock-manifest && node -p 'Boolean(process.stdout.isTTY)' | if-diff -s src/__mocks__/re-mock-manifest.yaml -t ./src/__mocks__/mock-manifest.yaml"
46
- ) ;
47
- break ;
48
- case 'if-check-prefix' :
49
- expect ( param ) . toEqual (
50
- "if-env --prefix=.. -m ./src/__mocks__/mock-manifest.yaml && if-run --prefix=.. -m ./src/__mocks__/mock-manifest.yaml -o src/__mocks__/re-mock-manifest && node -p 'Boolean(process.stdout.isTTY)' | if-diff --prefix=.. -s src/__mocks__/re-mock-manifest.yaml -t ./src/__mocks__/mock-manifest.yaml"
51
- ) ;
52
- break ;
53
38
}
54
39
return ;
55
40
} ,
@@ -72,47 +57,5 @@ describe('if-check/util/npm: ', () => {
72
57
'✔ if-check successfully verified mock-manifest.yaml\n'
73
58
) ;
74
59
} ) ;
75
-
76
- it ( 'successfully executes with cwd command.' , async ( ) => {
77
- process . env . NPM_INSTALL = 'if-check-cwd' ;
78
- const manifest = './src/__mocks__/mock-manifest.yaml' ;
79
- const logSpy = jest . spyOn ( global . console , 'log' ) ;
80
-
81
- await executeCommands ( manifest , true ) ;
82
-
83
- expect . assertions ( 2 ) ;
84
- expect ( logSpy ) . toHaveBeenCalledWith (
85
- '✔ if-check successfully verified mock-manifest.yaml\n'
86
- ) ;
87
- } ) ;
88
-
89
- it ( 'successfully executes with correct commands when is running from global.' , async ( ) => {
90
- process . env . npm_config_global = 'true' ;
91
- process . env . NPM_INSTALL = 'if-check-global' ;
92
- const manifest = './src/__mocks__/mock-manifest.yaml' ;
93
- const logSpy = jest . spyOn ( global . console , 'log' ) ;
94
-
95
- await executeCommands ( manifest , false ) ;
96
-
97
- expect . assertions ( 2 ) ;
98
- expect ( logSpy ) . toHaveBeenCalledWith (
99
- '✔ if-check successfully verified mock-manifest.yaml\n'
100
- ) ;
101
- } ) ;
102
-
103
- it ( 'successfully executes with correct commands when CURRENT_DIR is provided.' , async ( ) => {
104
- process . env . CURRENT_DIR = './mock-path' ;
105
- process . env . npm_config_global = 'true' ;
106
- process . env . NPM_INSTALL = 'if-check-prefix' ;
107
- const manifest = './src/__mocks__/mock-manifest.yaml' ;
108
- const logSpy = jest . spyOn ( global . console , 'log' ) ;
109
-
110
- await executeCommands ( manifest , false ) ;
111
-
112
- expect . assertions ( 2 ) ;
113
- expect ( logSpy ) . toHaveBeenCalledWith (
114
- '✔ if-check successfully verified mock-manifest.yaml\n'
115
- ) ;
116
- } ) ;
117
60
} ) ;
118
61
} ) ;
0 commit comments