1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

fix(test): Don't error on missing op details (#14184)

This commit is contained in:
AEtheve 2022-04-13 14:18:12 +02:00 committed by GitHub
parent 47e8deeaf7
commit c03fbb3c1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -198,7 +198,7 @@
} }
ArrayPrototypePush(details, message); ArrayPrototypePush(details, message);
} else if (dispatchedDiff < completedDiff) { } else if (dispatchedDiff < completedDiff) {
const [name] = OP_DETAILS[key]; const [name, hint] = OP_DETAILS[key] || [key, null];
const count = completedDiff - dispatchedDiff; const count = completedDiff - dispatchedDiff;
ArrayPrototypePush( ArrayPrototypePush(
details, details,
@ -206,7 +206,8 @@
count === 1 ? "was" : "were" count === 1 ? "was" : "were"
} started before this test, but ${ } started before this test, but ${
count === 1 ? "was" : "were" count === 1 ? "was" : "were"
} completed during the test. Async operations should not complete in a test if they were not started in that test.`, } completed during the test. Async operations should not complete in a test if they were not started in that test.
${hint ? `This is often caused by not ${hint}.` : ""}`,
); );
} }
} }