1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-10 16:11:13 -05:00

tests: add 'await' to all invocations of 'assertRejects' (#12893)

This commit is contained in:
Bartek Iwańczuk 2021-11-25 02:23:03 +01:00 committed by Luca Casonato
parent b31209aea3
commit 5731583853
3 changed files with 8 additions and 8 deletions

View file

@ -302,7 +302,7 @@ unitTest(async function bufferReadFrom() {
const fub = new Uint8Array(testString.length);
await empty(b, s, fub);
}
assertRejects(async function () {
await assertRejects(async function () {
await new Deno.Buffer().readFrom(null!);
});
});

View file

@ -26,8 +26,8 @@ unitTest(function nameOfTestCaseCantBeEmpty() {
);
});
unitTest(function invalidStepArguments(t) {
assertRejects(
unitTest(async function invalidStepArguments(t) {
await assertRejects(
async () => {
// deno-lint-ignore no-explicit-any
await (t as any).step("test");
@ -36,7 +36,7 @@ unitTest(function invalidStepArguments(t) {
"Expected function for second argument.",
);
assertRejects(
await assertRejects(
async () => {
// deno-lint-ignore no-explicit-any
await (t as any).step("test", "not a function");
@ -45,7 +45,7 @@ unitTest(function invalidStepArguments(t) {
"Expected function for second argument.",
);
assertRejects(
await assertRejects(
async () => {
// deno-lint-ignore no-explicit-any
await (t as any).step();
@ -54,7 +54,7 @@ unitTest(function invalidStepArguments(t) {
"Expected a test definition or name and function.",
);
assertRejects(
await assertRejects(
async () => {
// deno-lint-ignore no-explicit-any
await (t as any).step(() => {});

View file

@ -521,7 +521,7 @@ unitTest(async function testHkdfDeriveBitsWithLargeKeySize() {
false,
["deriveBits"],
);
assertRejects(
await assertRejects(
() =>
crypto.subtle.deriveBits(
{
@ -705,7 +705,7 @@ unitTest(async function testDecryptWithInvalidIntializationVector() {
data,
);
const initVector2 = crypto.getRandomValues(new Uint8Array(16));
assertRejects(async () => {
await assertRejects(async () => {
await crypto.subtle.decrypt(
{ name: "AES-CBC", iv: initVector2 },
key,