For consistency we are trying to use jest as our testing framework instead of tap. These tests should still test the same cases as before with tap. New tests will be added in further PRs.
Deleted functions from stubPlatform() and stubSubProcessExec() from individual test files and moved stubPlatform to common.ts. Using a spy instead of stubSubProcessExec()
In Tap assertions an extra argument was passed with arbitrary data about the test like a description of expected outcomes for the assert. Jest doesn't offer this on default, we would need to use a library. So currently we lose some of the metadata (some I left in comments) but some of it seems like noise.
How should this be manually tested?
Run npm run test-system with Gradle version < 7 and Node version >= 12
These system tests take a while to run - hence added --testTimeout=15000 in package.json
Additional questions
Tests in test/system/failure-states.test.ts are testing for Gradle errors, i.e. we are checking what error message Gradle is returning - what does it tell us? Shouldn't we be rather checking how Snyk handles the Gradle error? They fail with Gradle 7.
Should all the commits be squashed into one?
Possible future improvements
We could get rid of sinon and use jest for mocking the OS in windows.test.ts and darwin.test.ts
What this does
For consistency we are trying to use jest as our testing framework instead of tap. These tests should still test the same cases as before with tap. New tests will be added in further PRs.
Deleted functions from stubPlatform() and stubSubProcessExec() from individual test files and moved stubPlatform to common.ts. Using a spy instead of stubSubProcessExec()
In Tap assertions an
extra
argument was passed with arbitrary data about the test like a description of expected outcomes for the assert. Jest doesn't offer this on default, we would need to use a library. So currently we lose some of the metadata (some I left in comments) but some of it seems like noise.How should this be manually tested?
Run
npm run test-system
with Gradle version < 7 and Node version >= 12More information
Screenshots
These system tests take a while to run - hence added --testTimeout=15000 in package.json
Additional questions
Tests in test/system/failure-states.test.ts are testing for Gradle errors, i.e. we are checking what error message Gradle is returning - what does it tell us? Shouldn't we be rather checking how Snyk handles the Gradle error? They fail with Gradle 7.
Should all the commits be squashed into one?
Possible future improvements