mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
tests: add 'await' to all invocations of 'assertRejects' (#12893)
This commit is contained in:
parent
e68a241946
commit
1193d46485
3 changed files with 8 additions and 8 deletions
|
@ -301,7 +301,7 @@ Deno.test(async function bufferReadFrom() {
|
||||||
const fub = new Uint8Array(testString.length);
|
const fub = new Uint8Array(testString.length);
|
||||||
await empty(b, s, fub);
|
await empty(b, s, fub);
|
||||||
}
|
}
|
||||||
assertRejects(async function () {
|
await assertRejects(async function () {
|
||||||
await new Deno.Buffer().readFrom(null!);
|
await new Deno.Buffer().readFrom(null!);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -80,8 +80,8 @@ Deno.test(function nameOfTestCaseCantBeEmpty() {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
Deno.test(function invalidStepArguments(t) {
|
Deno.test(async function invalidStepArguments(t) {
|
||||||
assertRejects(
|
await assertRejects(
|
||||||
async () => {
|
async () => {
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
await (t as any).step("test");
|
await (t as any).step("test");
|
||||||
|
@ -90,7 +90,7 @@ Deno.test(function invalidStepArguments(t) {
|
||||||
"Expected function for second argument.",
|
"Expected function for second argument.",
|
||||||
);
|
);
|
||||||
|
|
||||||
assertRejects(
|
await assertRejects(
|
||||||
async () => {
|
async () => {
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
await (t as any).step("test", "not a function");
|
await (t as any).step("test", "not a function");
|
||||||
|
@ -99,7 +99,7 @@ Deno.test(function invalidStepArguments(t) {
|
||||||
"Expected function for second argument.",
|
"Expected function for second argument.",
|
||||||
);
|
);
|
||||||
|
|
||||||
assertRejects(
|
await assertRejects(
|
||||||
async () => {
|
async () => {
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
await (t as any).step();
|
await (t as any).step();
|
||||||
|
@ -108,7 +108,7 @@ Deno.test(function invalidStepArguments(t) {
|
||||||
"Expected a test definition or name and function.",
|
"Expected a test definition or name and function.",
|
||||||
);
|
);
|
||||||
|
|
||||||
assertRejects(
|
await assertRejects(
|
||||||
async () => {
|
async () => {
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
await (t as any).step(() => {});
|
await (t as any).step(() => {});
|
||||||
|
|
|
@ -521,7 +521,7 @@ Deno.test(async function testHkdfDeriveBitsWithLargeKeySize() {
|
||||||
false,
|
false,
|
||||||
["deriveBits"],
|
["deriveBits"],
|
||||||
);
|
);
|
||||||
assertRejects(
|
await assertRejects(
|
||||||
() =>
|
() =>
|
||||||
crypto.subtle.deriveBits(
|
crypto.subtle.deriveBits(
|
||||||
{
|
{
|
||||||
|
@ -705,7 +705,7 @@ Deno.test(async function testDecryptWithInvalidIntializationVector() {
|
||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
const initVector2 = crypto.getRandomValues(new Uint8Array(16));
|
const initVector2 = crypto.getRandomValues(new Uint8Array(16));
|
||||||
assertRejects(async () => {
|
await assertRejects(async () => {
|
||||||
await crypto.subtle.decrypt(
|
await crypto.subtle.decrypt(
|
||||||
{ name: "AES-CBC", iv: initVector2 },
|
{ name: "AES-CBC", iv: initVector2 },
|
||||||
key,
|
key,
|
||||||
|
|
Loading…
Reference in a new issue