Skip to content

Commit

Permalink
test(util): tune command assertions in npm
Browse files Browse the repository at this point in the history
  • Loading branch information
narekhovhannisyan committed Dec 5, 2024
1 parent ad3cde2 commit 1aadc4e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/__tests__/if-check/util/npm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ jest.mock('../../../common/util/helpers', () => {
expect(param).toEqual('npm init -y');
break;
case 'if-check':
expect(param).toEqual(
"npm run if-env -- -m ./src/__mocks__/mock-manifest.yaml && 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"
);
expect(
[
'npm run if-env -- -m ./src/__mocks__/mock-manifest.yaml',
'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',
].includes(param)
).toBeTruthy();
break;
}
return;
Expand All @@ -45,7 +50,7 @@ describe('if-check/util/npm: ', () => {

await executeCommands(manifest, false);

expect.assertions(2);
expect.assertions(5);
expect(logSpy).toHaveBeenCalledWith(
'✔ if-check successfully verified mock-manifest.yaml\n'
);
Expand Down

0 comments on commit 1aadc4e

Please sign in to comment.