Skip to content
This repository was archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
cover isDirect
Browse files Browse the repository at this point in the history
  • Loading branch information
naugtur committed Sep 19, 2021
1 parent f11d4f9 commit a6c0410
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tap-snapshots/test/vuln.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ exports[`test/vuln.js TAP basic vulnerability object tests > json formatted afte
{
"name": "name",
"severity": "critical",
"isDirect": false,
"isDirect": true,
"via": [
{
"type": "advisory",
Expand All @@ -71,7 +71,7 @@ exports[`test/vuln.js TAP basic vulnerability object tests > json formatted afte
],
"range": "1.0.0 - 3.0.0",
"nodes": [
""
"node_modules/thing"
],
"fixAvailable": false
}
Expand Down
6 changes: 6 additions & 0 deletions test/vuln.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,19 @@ t.test('basic vulnerability object tests', async t => {
t.equal(v2.simpleRange, '1.0.0 - 2.0.1')
t.equal(v2.range, v2.simpleRange)

const root = new Node({
path: '/path/to',
pkg: { dependencies: { thing: '1.2.1' } },
})

const node = new Node({
path: '/path/to/node_modules/thing',
name: 'thing',
pkg: {
name: 'name',
version: '1.2.1',
},
parent: root,
})

// check twice to hit memoizing code path
Expand Down

0 comments on commit a6c0410

Please sign in to comment.