-
Notifications
You must be signed in to change notification settings - Fork 9.6k
tests(snyk): assert upper bounds #9308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
eafb5f9
a24a38e
a006050
ba9bc7c
e01212b
6ec1ae1
441d4f8
55bf357
4653ba1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,3 +99,20 @@ describe('Avoids front-end JavaScript libraries with known vulnerabilities', () | |
| assert.equal(auditResult.score, 1); | ||
| }); | ||
| }); | ||
|
|
||
| describe('Every snyk vulnerability has an upperbound', () => { | ||
| for (const vulns of Object.values(NoVulnerableLibrariesAudit.snykDB.npm)) { | ||
| for (const vuln of vulns) { | ||
| for (const semver of vuln.semver.vulnerable) { | ||
| assert.notEqual(semver, '*', 'invalid semver: * is not allowed'); | ||
|
|
||
| const clauses = semver.split('||'); | ||
| for (const clause of clauses) { | ||
| if (!clause.trim().startsWith('=') && !clause.includes('<')) { | ||
|
||
| assert.fail(`invalid semver: ${semver}. Must contain an upper bound`); | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }); | ||
Uh oh!
There was an error while loading. Please reload this page.