Skip to content

Commit 7e3859f

Browse files
Merge pull request #1092 from Green-Software-Foundation/fix-npm-test
Fix if-check npm tests after merge
2 parents 52bcb53 + 63a6ee8 commit 7e3859f

File tree

1 file changed

+0
-57
lines changed

1 file changed

+0
-57
lines changed

src/__tests__/if-check/util/npm.test.ts

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,6 @@ jest.mock('child_process', () => {
3535
)
3636
).toBeTruthy();
3737
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;
5338
}
5439
return;
5540
},
@@ -72,47 +57,5 @@ describe('if-check/util/npm: ', () => {
7257
'✔ if-check successfully verified mock-manifest.yaml\n'
7358
);
7459
});
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-
});
11760
});
11861
});

0 commit comments

Comments
 (0)