1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -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 GitHub
parent e68a241946
commit 1193d46485
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View file

@ -301,7 +301,7 @@ Deno.test(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

@ -80,8 +80,8 @@ Deno.test(function nameOfTestCaseCantBeEmpty() {
);
});
Deno.test(function invalidStepArguments(t) {
assertRejects(
Deno.test(async function invalidStepArguments(t) {
await assertRejects(
async () => {
// deno-lint-ignore no-explicit-any
await (t as any).step("test");
@ -90,7 +90,7 @@ Deno.test(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");
@ -99,7 +99,7 @@ Deno.test(function invalidStepArguments(t) {
"Expected function for second argument.",
);
assertRejects(
await assertRejects(
async () => {
// deno-lint-ignore no-explicit-any
await (t as any).step();
@ -108,7 +108,7 @@ Deno.test(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 @@ Deno.test(async function testHkdfDeriveBitsWithLargeKeySize() {
false,
["deriveBits"],
);
assertRejects(
await assertRejects(
() =>
crypto.subtle.deriveBits(
{
@ -705,7 +705,7 @@ Deno.test(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,