BREAKING: remove overload of Deno.test() (#4951)

This commit removes overload of Deno.test() that accepted named
function.
This commit is contained in:
Bartek Iwańczuk 2020-04-28 12:33:09 +02:00 committed by GitHub
parent b508e84567
commit 8feb30e325
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 446 additions and 471 deletions

View file

@ -3,7 +3,7 @@ const { test } = Deno;
import { assert, assertEquals, assertStrictEq } from "../testing/asserts.ts";
import { collectUint8Arrays, deferred, MuxAsyncIterator } from "./async.ts";
test(function asyncDeferred(): Promise<void> {
test("asyncDeferred", function (): Promise<void> {
const d = deferred<number>();
d.resolve(12);
return Promise.resolve();
@ -23,7 +23,7 @@ async function* gen456(): AsyncIterableIterator<number> {
yield 6;
}
test(async function asyncMuxAsyncIterator(): Promise<void> {
test("asyncMuxAsyncIterator", async function (): Promise<void> {
const mux = new MuxAsyncIterator<number>();
mux.add(gen123());
mux.add(gen456());
@ -34,21 +34,21 @@ test(async function asyncMuxAsyncIterator(): Promise<void> {
assertEquals(results.size, 6);
});
test(async function collectUint8Arrays0(): Promise<void> {
test("collectUint8Arrays0", async function (): Promise<void> {
async function* gen(): AsyncIterableIterator<Uint8Array> {}
const result = await collectUint8Arrays(gen());
assert(result instanceof Uint8Array);
assertEquals(result.length, 0);
});
test(async function collectUint8Arrays0(): Promise<void> {
test("collectUint8Arrays0", async function (): Promise<void> {
async function* gen(): AsyncIterableIterator<Uint8Array> {}
const result = await collectUint8Arrays(gen());
assert(result instanceof Uint8Array);
assertStrictEq(result.length, 0);
});
test(async function collectUint8Arrays1(): Promise<void> {
test("collectUint8Arrays1", async function (): Promise<void> {
const buf = new Uint8Array([1, 2, 3]);
// eslint-disable-next-line require-await
async function* gen(): AsyncIterableIterator<Uint8Array> {
@ -59,7 +59,7 @@ test(async function collectUint8Arrays1(): Promise<void> {
assertStrictEq(result.length, 3);
});
test(async function collectUint8Arrays4(): Promise<void> {
test("collectUint8Arrays4", async function (): Promise<void> {
// eslint-disable-next-line require-await
async function* gen(): AsyncIterableIterator<Uint8Array> {
yield new Uint8Array([1, 2, 3]);