Skip to content

Commit 280e76a

Browse files
committed
prevent timeouts when we can see npm simply ran to completion incorrectly
1 parent f992ba4 commit 280e76a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/socket-npm.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,17 @@ for (const npmDir of versions) {
4646
)
4747
spawnPromise.process.stdout.on('data', (buffer: Buffer) => {
4848
console.log(buffer.toString('utf8'))
49-
});
49+
// changed 13 packages, and audited 176 packages in 3s
50+
if (
51+
/changed .* packages, and audited .* packages in/.test(
52+
buffer.toString('utf8')
53+
)
54+
) {
55+
reject(
56+
'It seems npm ran anyways so the test failed to invoke socket'
57+
)
58+
}
59+
})
5060

5161
spawnPromise.process.stderr.on('data', (buffer: Buffer) => {
5262
console.error(buffer.toString('utf8'))

0 commit comments

Comments
 (0)