Skip to content

Commit 9e8f869

Browse files
committed
exec
1 parent 106668d commit 9e8f869

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

test/lib/commands/exec.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ t.test('--prefix', async t => {
8080

8181
await registry.package({
8282
manifest,
83+
times: 2,
8384
tarballs: {
8485
'1.0.0': path.join(npm.prefix, 'npm-exec-test'),
85-
} })
86+
},
87+
})
8688

8789
await npm.exec('exec', ['@npmcli/npx-test'])
8890
const exists = await fs.stat(path.join(npm.prefix, 'npm-exec-test-success'))
@@ -123,6 +125,7 @@ t.test('runs in workspace path', async t => {
123125
})
124126

125127
await registry.package({ manifest,
128+
times: 2,
126129
tarballs: {
127130
'1.0.0': path.join(npm.prefix, 'npm-exec-test'),
128131
},
@@ -243,16 +246,9 @@ t.test('npx --no-install @npmcli/npx-test', async t => {
243246
},
244247
})
245248

246-
try {
249+
await t.rejects(async () => {
247250
await npm.exec('exec', ['@npmcli/npx-test'])
248-
t.fail('Expected error was not thrown')
249-
} catch (error) {
250-
t.match(
251-
error.message,
252-
'npx canceled due to missing packages and no YES option: ',
253-
'Expected error message thrown'
254-
)
255-
}
251+
}, 'npx canceled due to missing packages and no YES option: ')
256252
})
257253

258254
t.test('packs from git spec', async t => {

0 commit comments

Comments
 (0)