Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test('failed linking should not create empty folder', async (t: tape.Test) => {
prepare(t)
const globalPrefix = path.resolve('..', 'global')
try {
await linkFromGlobal(['does-not-exist'], process.cwd(), await testDefaults({globalPrefix}))
t.fail('should have failed')
} catch (err) {
t.notOk(await exists(path.join(globalPrefix, 'node_modules', 'does-not-exist')))
}
})