Skip to content

Commit ccd8420

Browse files
committed
chore: fix cli tests for audit fallback removal
1 parent 080a0f2 commit ccd8420

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

test/lib/commands/audit.js

-48
Original file line numberDiff line numberDiff line change
@@ -90,54 +90,6 @@ t.test('normal audit', async t => {
9090
t.matchSnapshot(joinedOutput())
9191
})
9292

93-
t.test('fallback audit ', async t => {
94-
const { npm, joinedOutput } = await loadMockNpm(t, {
95-
prefixDir: tree,
96-
})
97-
const registry = new MockRegistry({
98-
tap: t,
99-
registry: npm.config.get('registry'),
100-
})
101-
const manifest = registry.manifest({
102-
name: 'test-dep-a',
103-
packuments: [{ version: '1.0.0' }, { version: '1.0.1' }],
104-
})
105-
await registry.package({ manifest })
106-
const advisory = registry.advisory({
107-
id: 100,
108-
module_name: 'test-dep-a',
109-
vulnerable_versions: '<1.0.1',
110-
findings: [{ version: '1.0.0', paths: ['test-dep-a'] }],
111-
})
112-
registry.nock
113-
.post('/-/npm/v1/security/advisories/bulk').reply(404)
114-
.post('/-/npm/v1/security/audits/quick', body => {
115-
const unzipped = JSON.parse(gunzip(Buffer.from(body, 'hex')))
116-
return t.match(unzipped, {
117-
name: 'test-dep',
118-
version: '1.0.0',
119-
requires: { 'test-dep-a': '*' },
120-
dependencies: { 'test-dep-a': { version: '1.0.0' } },
121-
})
122-
}).reply(200, {
123-
actions: [],
124-
muted: [],
125-
advisories: {
126-
100: advisory,
127-
},
128-
metadata: {
129-
vulnerabilities: { info: 0, low: 0, moderate: 0, high: 1, critical: 0 },
130-
dependencies: 1,
131-
devDependencies: 0,
132-
optionalDependencies: 0,
133-
totalDependencies: 1,
134-
},
135-
})
136-
await npm.exec('audit', [])
137-
t.ok(process.exitCode, 'would have exited uncleanly')
138-
t.matchSnapshot(joinedOutput())
139-
})
140-
14193
t.test('json audit', async t => {
14294
const { npm, joinedOutput } = await loadMockNpm(t, {
14395
prefixDir: tree,

0 commit comments

Comments
 (0)