Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2097 from snyk/protect/update-fix-pr-test
test(protect): update to match fix pr setup
- Loading branch information
Showing
8 changed files
with
60 additions
and
53 deletions.
There are no files selected for viewing
27 changes: 0 additions & 27 deletions
27
packages/snyk-protect/test/acceptance/fix-pr-prepublish-hook.smoke.spec.ts
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
packages/snyk-protect/test/acceptance/fix-pr.smoke.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { createProject } from '../util/createProject'; | ||
import { getPatchedLodash } from '../util/getPatchedLodash'; | ||
import { RunCLIResult, runCommand } from '../util/runCommand'; | ||
|
||
jest.setTimeout(1000 * 60); | ||
|
||
describe('Fix PR', () => { | ||
test('patches vulnerable dependencies on install', async () => { | ||
const project = await createProject('fix-pr'); | ||
const patchedLodash = await getPatchedLodash(); | ||
|
||
expect( | ||
await runCommand('npm', ['install'], { | ||
cwd: project.path(), | ||
}), | ||
).toEqual( | ||
expect.objectContaining<RunCLIResult>({ | ||
code: 0, | ||
stdout: expect.stringContaining('Successfully applied Snyk patches'), | ||
stderr: expect.any(String), | ||
}), | ||
); | ||
|
||
await expect( | ||
project.read('node_modules/lodash/lodash.js'), | ||
).resolves.toEqual(patchedLodash); | ||
}); | ||
}); |
12 changes: 0 additions & 12 deletions
12
packages/snyk-protect/test/fixtures/fix-pr-prepublish-hook/package.json
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "fix-pr", | ||
"version": "1.0.0", | ||
"description": "Fixture with a setup similar to a Fix PR.", | ||
"private": true, | ||
"scripts": { | ||
"prepare": "npm run snyk-protect", | ||
"snyk-protect": "snyk-protect" | ||
}, | ||
"dependencies": { | ||
"@snyk/protect": "latest", | ||
"lodash": "4.17.15" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters