diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-04-28 12:33:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-28 12:33:09 +0200 |
commit | 8feb30e3258ed9690eb850e3ca22842b260a0403 (patch) | |
tree | 6805bfe3df675c2c7f6a379093061c6b73d8365a /std/node | |
parent | b508e845671de9351c3f51755647371d76128d29 (diff) |
BREAKING: remove overload of Deno.test() (#4951)
This commit removes overload of Deno.test() that accepted named
function.
Diffstat (limited to 'std/node')
-rw-r--r-- | std/node/_fs/_fs_exists_test.ts | 4 | ||||
-rw-r--r-- | std/node/_fs/_fs_readFile_test.ts | 8 | ||||
-rw-r--r-- | std/node/module_test.ts | 12 |
3 files changed, 12 insertions, 12 deletions
diff --git a/std/node/_fs/_fs_exists_test.ts b/std/node/_fs/_fs_exists_test.ts index fde68e717..b4885c87f 100644 --- a/std/node/_fs/_fs_exists_test.ts +++ b/std/node/_fs/_fs_exists_test.ts @@ -5,7 +5,7 @@ import { exists, existsSync } from "./_fs_exists.ts"; const { test } = Deno; -test(async function existsFile() { +test("existsFile", async function () { const availableFile = await new Promise((resolve) => { const tmpFilePath = Deno.makeTempFileSync(); exists(tmpFilePath, (exists: boolean) => { @@ -20,7 +20,7 @@ test(async function existsFile() { assertEquals(notAvailableFile, false); }); -test(function existsSyncFile() { +test("existsSyncFile", function () { const tmpFilePath = Deno.makeTempFileSync(); assertEquals(existsSync(tmpFilePath), true); Deno.removeSync(tmpFilePath); diff --git a/std/node/_fs/_fs_readFile_test.ts b/std/node/_fs/_fs_readFile_test.ts index b03d53563..429ceb3f5 100644 --- a/std/node/_fs/_fs_readFile_test.ts +++ b/std/node/_fs/_fs_readFile_test.ts @@ -7,7 +7,7 @@ const testData = path.resolve( path.join("node", "_fs", "testdata", "hello.txt") ); -test(async function readFileSuccess() { +test("readFileSuccess", async function () { const data = await new Promise((res, rej) => { readFile(testData, (err, data) => { if (err) { @@ -21,7 +21,7 @@ test(async function readFileSuccess() { assertEquals(new TextDecoder().decode(data as Uint8Array), "hello world"); }); -test(async function readFileEncodeUtf8Success() { +test("readFileEncodeUtf8Success", async function () { const data = await new Promise((res, rej) => { readFile(testData, { encoding: "utf8" }, (err, data) => { if (err) { @@ -35,13 +35,13 @@ test(async function readFileEncodeUtf8Success() { assertEquals(data as string, "hello world"); }); -test(function readFileSyncSuccess() { +test("readFileSyncSuccess", function () { const data = readFileSync(testData); assert(data instanceof Uint8Array); assertEquals(new TextDecoder().decode(data as Uint8Array), "hello world"); }); -test(function readFileEncodeUtf8Success() { +test("readFileEncodeUtf8Success", function () { const data = readFileSync(testData, { encoding: "utf8" }); assertEquals(typeof data, "string"); assertEquals(data as string, "hello world"); diff --git a/std/node/module_test.ts b/std/node/module_test.ts index 590172a7a..234e9f0f4 100644 --- a/std/node/module_test.ts +++ b/std/node/module_test.ts @@ -6,7 +6,7 @@ import { createRequire } from "./module.ts"; const require = createRequire(import.meta.url); -test(function requireSuccess() { +test("requireSuccess", function () { // Relative to import.meta.url const result = require("./tests/cjs/cjs_a.js"); assert("helloA" in result); @@ -19,14 +19,14 @@ test(function requireSuccess() { assertEquals(result.leftPad("pad", 4), " pad"); }); -test(function requireCycle() { +test("requireCycle", function () { const resultA = require("./tests/cjs/cjs_cycle_a"); const resultB = require("./tests/cjs/cjs_cycle_b"); assert(resultA); assert(resultB); }); -test(function requireBuiltin() { +test("requireBuiltin", function () { const fs = require("fs"); assert("readFileSync" in fs); const { readFileSync, isNull, extname } = require("./tests/cjs/cjs_builtin"); @@ -38,18 +38,18 @@ test(function requireBuiltin() { assertEquals(extname("index.html"), ".html"); }); -test(function requireIndexJS() { +test("requireIndexJS", function () { const { isIndex } = require("./tests/cjs"); assert(isIndex); }); -test(function requireNodeOs() { +test("requireNodeOs", function () { const os = require("os"); assert(os.arch); assert(typeof os.arch() == "string"); }); -test(function requireStack() { +test("requireStack", function () { const { hello } = require("./tests/cjs/cjs_throw"); try { hello(); |