diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-07-25 15:30:28 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-25 15:30:28 +1000 |
commit | 5f44148e83bb0056b7a361dd6a1bf28d11f3116d (patch) | |
tree | e73ff318a69cabedf33a962be6fa6c73e6775f3e /tests | |
parent | 84b7504d0fdccc07b9f7412408c954ae07765ccb (diff) |
chore: update to `std@2024.07.19` (#24715)
Diffstat (limited to 'tests')
133 files changed, 276 insertions, 307 deletions
diff --git a/tests/ffi/tests/test.js b/tests/ffi/tests/test.js index 16dba6832..074db8188 100644 --- a/tests/ffi/tests/test.js +++ b/tests/ffi/tests/test.js @@ -10,7 +10,7 @@ import { assertInstanceOf, assertEquals, assertFalse, -} from "@std/assert/mod.ts"; +} from "@std/assert"; const targetDir = Deno.execPath().replace(/[^\/\\]+$/, ""); const [libPrefix, libSuffix] = { diff --git a/tests/napi/common.js b/tests/napi/common.js index 3a4f253ef..6dfdc873a 100644 --- a/tests/napi/common.js +++ b/tests/napi/common.js @@ -1,12 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -export { - assert, - assertEquals, - assertRejects, - assertThrows, -} from "@std/assert/mod.ts"; -export { fromFileUrl } from "@std/path/mod.ts"; +export { assert, assertEquals, assertRejects, assertThrows } from "@std/assert"; +export { fromFileUrl } from "@std/path"; import process from "node:process"; const targetDir = Deno.execPath().replace(/[^\/\\]+$/, ""); diff --git a/tests/node_compat/common.ts b/tests/node_compat/common.ts index c20047237..9f56744fa 100644 --- a/tests/node_compat/common.ts +++ b/tests/node_compat/common.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { partition } from "@std/collections/partition.ts"; -import { join } from "@std/path/mod.ts"; -import * as JSONC from "@std/jsonc/mod.ts"; +import { partition } from "@std/collections/partition"; +import { join } from "@std/path"; +import * as JSONC from "@std/jsonc"; /** * The test suite matches the folders inside the `test` folder inside the * node repo diff --git a/tests/node_compat/deno.json b/tests/node_compat/deno.json index 8f629a65c..315d5acda 100644 --- a/tests/node_compat/deno.json +++ b/tests/node_compat/deno.json @@ -1,6 +1,3 @@ { - "imports": { - "@test_util/": "../../test_util/", - "@std/": "../util/std/" - } + "importMap": "../../import_map.json" } diff --git a/tests/node_compat/runner.ts b/tests/node_compat/runner.ts index e923cde11..56803fad4 100644 --- a/tests/node_compat/runner.ts +++ b/tests/node_compat/runner.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import "./polyfill_globals.js"; import { createRequire } from "node:module"; -import { toFileUrl } from "@std/path/mod.ts"; +import { toFileUrl } from "@std/path/to-file-url"; const file = Deno.args[0]; if (!file) { throw new Error("No file provided"); diff --git a/tests/node_compat/runner/deno.json b/tests/node_compat/runner/deno.json index e29d224c9..972e817e0 100644 --- a/tests/node_compat/runner/deno.json +++ b/tests/node_compat/runner/deno.json @@ -1,8 +1,5 @@ { - "imports": { - "@test_util/": "../../test_util/", - "@std/": "../../util/std/" - }, + "importMap": "../../../import_map.json", "tasks": { "setup": "deno run --allow-read --allow-write ./setup.ts", "test": "deno test -A ../test.ts --" diff --git a/tests/node_compat/runner/setup.ts b/tests/node_compat/runner/setup.ts index 5ef0bc3db..95fee6a20 100755 --- a/tests/node_compat/runner/setup.ts +++ b/tests/node_compat/runner/setup.ts @@ -3,12 +3,12 @@ /** This copies the test files according to the config file `tests/node_compat/config.jsonc` */ -import { walk } from "@std/fs/walk.ts"; -import { SEPARATOR } from "@std/path/constants.ts"; -import { ensureFile } from "@std/fs/ensure_file.ts"; -import { writeAll } from "@std/io/write_all.ts"; -import { withoutAll } from "@std/collections/without_all.ts"; -import { relative } from "@std/path/posix/relative.ts"; +import { walk } from "@std/fs/walk"; +import { SEPARATOR } from "@std/path/constants"; +import { ensureFile } from "@std/fs/ensure-file"; +import { writeAll } from "@std/io/write-all"; +import { withoutAll } from "@std/collections/without-all"; +import { relative } from "@std/path/posix/relative"; import { config, ignoreList } from "../common.ts"; diff --git a/tests/node_compat/test.ts b/tests/node_compat/test.ts index 3f8655169..c9ec1544d 100644 --- a/tests/node_compat/test.ts +++ b/tests/node_compat/test.ts @@ -13,10 +13,10 @@ * all share the same working directory. */ -import { magenta } from "@std/fmt/colors.ts"; -import { pooledMap } from "@std/async/pool.ts"; -import { dirname, fromFileUrl, join } from "@std/path/mod.ts"; -import { assertEquals, fail } from "@std/assert/mod.ts"; +import { magenta } from "@std/fmt/colors"; +import { pooledMap } from "@std/async/pool"; +import { dirname, fromFileUrl, join } from "@std/path"; +import { assertEquals, fail } from "@std/assert"; import { config, getPathsFromTestSuites, diff --git a/tests/specs/future/runtime_api/worker.js b/tests/specs/future/runtime_api/worker.js index 36d35b7b2..eac42fe56 100644 --- a/tests/specs/future/runtime_api/worker.js +++ b/tests/specs/future/runtime_api/worker.js @@ -1,4 +1,4 @@ -import { delay } from "@std/async/delay.ts"; +import { delay } from "@std/async/delay"; const worker = new Worker(import.meta.resolve("./main.js"), { type: "module" }); await delay(1_000); diff --git a/tests/specs/future/unstable_flags/worker.js b/tests/specs/future/unstable_flags/worker.js index 36d35b7b2..eac42fe56 100644 --- a/tests/specs/future/unstable_flags/worker.js +++ b/tests/specs/future/unstable_flags/worker.js @@ -1,4 +1,4 @@ -import { delay } from "@std/async/delay.ts"; +import { delay } from "@std/async/delay"; const worker = new Worker(import.meta.resolve("./main.js"), { type: "module" }); await delay(1_000); diff --git a/tests/specs/run/045_proxy/proxy_test.ts b/tests/specs/run/045_proxy/proxy_test.ts index d04356930..70781f97d 100644 --- a/tests/specs/run/045_proxy/proxy_test.ts +++ b/tests/specs/run/045_proxy/proxy_test.ts @@ -1,14 +1,10 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { Server } from "@std/http/server.ts"; - const addr = Deno.args[1] || "localhost:4555"; -async function proxyServer() { +function proxyServer() { const [hostname, p] = addr.split(":"); const port = parseInt(p ?? 4555); - const server = new Server({ hostname, port, handler }); - console.log(`Proxy server listening on http://${addr}/`); - await server.listenAndServe(); + Deno.serve({ hostname, port }, handler); } async function handler(req: Request): Promise<Response> { diff --git a/tests/specs/run/045_proxy/proxy_test.ts.out b/tests/specs/run/045_proxy/proxy_test.ts.out index a1e567a14..39cb8779a 100644 --- a/tests/specs/run/045_proxy/proxy_test.ts.out +++ b/tests/specs/run/045_proxy/proxy_test.ts.out @@ -1,4 +1,4 @@ -Proxy server listening on [WILDCARD] +Listening on [WILDCARD] Proxy request to: http://localhost:4545/run/045_mod.ts Proxy request to: http://localhost:4545/run/045_mod.ts Proxy request to: http://localhost:4545/run/045_output.ts diff --git a/tests/specs/test/clean_flag/main.js b/tests/specs/test/clean_flag/main.js index 9ccdea1ce..d00e56958 100644 --- a/tests/specs/test/clean_flag/main.js +++ b/tests/specs/test/clean_flag/main.js @@ -1,4 +1,4 @@ -import { emptyDir } from "@std/fs/empty_dir.ts"; +import { emptyDir } from "@std/fs/empty-dir"; const DIR = "./coverage"; const COMMAND = new Deno.Command(Deno.execPath(), { diff --git a/tests/specs/test/clean_flag/sum_test.js b/tests/specs/test/clean_flag/sum_test.js index eab3c53ad..e49b60d45 100644 --- a/tests/specs/test/clean_flag/sum_test.js +++ b/tests/specs/test/clean_flag/sum_test.js @@ -1,5 +1,5 @@ import { sum } from "./sum.js"; -import { assertEquals } from "@std/assert/assert_equals.ts"; +import { assertEquals } from "@std/assert/equals"; Deno.test("sum()", () => { assertEquals(sum(1, 2), 3); diff --git a/tests/testdata/cert/listen_tls_alpn_fail.ts b/tests/testdata/cert/listen_tls_alpn_fail.ts index 484c28212..9a96c04dd 100644 --- a/tests/testdata/cert/listen_tls_alpn_fail.ts +++ b/tests/testdata/cert/listen_tls_alpn_fail.ts @@ -1,4 +1,4 @@ -import { assertRejects } from "@std/assert/mod.ts"; +import { assertRejects } from "@std/assert"; const listener = Deno.listenTls({ port: Number(Deno.args[0]), diff --git a/tests/testdata/compile/standalone_follow_redirects_2.js b/tests/testdata/compile/standalone_follow_redirects_2.js index a7639c82c..b5fcb9e8a 100644 --- a/tests/testdata/compile/standalone_follow_redirects_2.js +++ b/tests/testdata/compile/standalone_follow_redirects_2.js @@ -1,5 +1,2 @@ // unversioned import redirects with dependencies. -import { - assertNotEquals as _a, - assertStrictEquals as _b, -} from "@std/assert/mod.ts"; +import { assertNotEquals as _a, assertStrictEquals as _b } from "@std/assert"; diff --git a/tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts b/tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts index 5ec2117f0..b55091a3d 100644 --- a/tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts +++ b/tests/testdata/coverage/no_snaps_included/no_snaps_included_test.ts @@ -1,4 +1,4 @@ -import { assertSnapshot } from "@std/testing/snapshot.ts"; +import { assertSnapshot } from "@std/testing/snapshot"; import { truth } from "./no_snaps_included.ts"; Deno.test("the truth", () => { diff --git a/tests/testdata/coverage/no_tests_included/foo.test.js b/tests/testdata/coverage/no_tests_included/foo.test.js index e838badea..276375311 100644 --- a/tests/testdata/coverage/no_tests_included/foo.test.js +++ b/tests/testdata/coverage/no_tests_included/foo.test.js @@ -1,5 +1,5 @@ import { addNumbers } from "./foo.ts"; -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; Deno.test("addNumbers works", () => { assertEquals(addNumbers(1, 2), 3); diff --git a/tests/testdata/coverage/no_tests_included/foo.test.mts b/tests/testdata/coverage/no_tests_included/foo.test.mts index e838badea..276375311 100644 --- a/tests/testdata/coverage/no_tests_included/foo.test.mts +++ b/tests/testdata/coverage/no_tests_included/foo.test.mts @@ -1,5 +1,5 @@ import { addNumbers } from "./foo.ts"; -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; Deno.test("addNumbers works", () => { assertEquals(addNumbers(1, 2), 3); diff --git a/tests/testdata/coverage/no_tests_included/foo.test.ts b/tests/testdata/coverage/no_tests_included/foo.test.ts index e838badea..276375311 100644 --- a/tests/testdata/coverage/no_tests_included/foo.test.ts +++ b/tests/testdata/coverage/no_tests_included/foo.test.ts @@ -1,5 +1,5 @@ import { addNumbers } from "./foo.ts"; -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; Deno.test("addNumbers works", () => { assertEquals(addNumbers(1, 2), 3); diff --git a/tests/testdata/coverage/no_transpiled_lines/index.ts b/tests/testdata/coverage/no_transpiled_lines/index.ts index 5cda523fb..75788fc2b 100644 --- a/tests/testdata/coverage/no_transpiled_lines/index.ts +++ b/tests/testdata/coverage/no_transpiled_lines/index.ts @@ -1,3 +1,3 @@ -export { assertStrictEquals } from "@std/assert/mod.ts"; +export { assertStrictEquals } from "@std/assert"; export * from "./interface.ts"; diff --git a/tests/testdata/echo_server.ts b/tests/testdata/echo_server.ts index b75805dbc..ee159f8be 100644 --- a/tests/testdata/echo_server.ts +++ b/tests/testdata/echo_server.ts @@ -1,4 +1,4 @@ -import { copy } from "@std/io/copy.ts"; +import { copy } from "@std/io/copy"; const addr = Deno.args[0] || "0.0.0.0:4544"; const [hostname, port] = addr.split(":"); const listener = Deno.listen({ hostname, port: Number(port) }); diff --git a/tests/testdata/run/import_meta/importmap.json b/tests/testdata/run/import_meta/importmap.json index 7d583dd81..834bf5e46 100644 --- a/tests/testdata/run/import_meta/importmap.json +++ b/tests/testdata/run/import_meta/importmap.json @@ -1,6 +1,7 @@ { "imports": { - "@std/": "../../../util/std/", + "@std/assert/throws": "../../../util/std/assert/throws.ts", + "@std/internal/styles": "../../../util/std/internal/styles.ts", "bare": "https://example.com/", "https://example.com/rewrite": "https://example.com/rewritten", diff --git a/tests/testdata/run/import_meta/main.ts b/tests/testdata/run/import_meta/main.ts index 6e4d5be98..d0425826e 100644 --- a/tests/testdata/run/import_meta/main.ts +++ b/tests/testdata/run/import_meta/main.ts @@ -1,4 +1,4 @@ -import { assertThrows } from "@std/assert/mod.ts"; +import { assertThrows } from "@std/assert/throws"; import "http://localhost:4545/run/import_meta/other.ts"; import "./other.ts"; diff --git a/tests/testdata/run/onload/imported.ts b/tests/testdata/run/onload/imported.ts index 38649b9b3..77d3da998 100644 --- a/tests/testdata/run/onload/imported.ts +++ b/tests/testdata/run/onload/imported.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-window-prefix -import { assert } from "@std/assert/mod.ts"; +import { assert } from "@std/assert"; import "./nest_imported.ts"; const handler = (e: Event) => { diff --git a/tests/testdata/run/onload/main.ts b/tests/testdata/run/onload/main.ts index c0e120d96..69bd174fa 100644 --- a/tests/testdata/run/onload/main.ts +++ b/tests/testdata/run/onload/main.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-window-prefix no-prototype-builtins -import { assert } from "@std/assert/mod.ts"; +import { assert } from "@std/assert"; import "./imported.ts"; assert(window.hasOwnProperty("onload")); diff --git a/tests/testdata/run/onload/nest_imported.ts b/tests/testdata/run/onload/nest_imported.ts index 98775d943..dbe313b9c 100644 --- a/tests/testdata/run/onload/nest_imported.ts +++ b/tests/testdata/run/onload/nest_imported.ts @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-window-prefix -import { assert } from "@std/assert/mod.ts"; +import { assert } from "@std/assert"; const handler = (e: Event) => { assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable); diff --git a/tests/testdata/run/textproto.ts b/tests/testdata/run/textproto.ts index d1b667c15..9e0f5f5f0 100644 --- a/tests/testdata/run/textproto.ts +++ b/tests/testdata/run/textproto.ts @@ -14,8 +14,8 @@ * @module */ -import type { BufReader, ReadLineResult } from "@std/io/buf_reader.ts"; -import { concat } from "@std/bytes/concat.ts"; +import type { BufReader, ReadLineResult } from "@std/io/buf-reader"; +import { concat } from "@std/bytes/concat"; // Constants created for DRY const CHAR_SPACE: number = " ".charCodeAt(0); diff --git a/tests/testdata/run/tls_connecttls.js b/tests/testdata/run/tls_connecttls.js index 540dd5721..b44b950fd 100644 --- a/tests/testdata/run/tls_connecttls.js +++ b/tests/testdata/run/tls_connecttls.js @@ -1,5 +1,5 @@ -import { assert, assertEquals } from "@std/assert/mod.ts"; -import { BufReader, BufWriter } from "@std/io/mod.ts"; +import { assert, assertEquals } from "@std/assert"; +import { BufReader, BufWriter } from "@std/io"; import { TextProtoReader } from "./textproto.ts"; const encoder = new TextEncoder(); diff --git a/tests/testdata/run/tls_starttls.js b/tests/testdata/run/tls_starttls.js index eb550d9be..3d9439811 100644 --- a/tests/testdata/run/tls_starttls.js +++ b/tests/testdata/run/tls_starttls.js @@ -1,6 +1,6 @@ -import { assert, assertEquals } from "@std/assert/mod.ts"; -import { BufReader } from "@std/io/buf_reader.ts"; -import { BufWriter } from "@std/io/buf_writer.ts"; +import { assert, assertEquals } from "@std/assert"; +import { BufReader } from "@std/io/buf-reader"; +import { BufWriter } from "@std/io/buf-writer"; import { TextProtoReader } from "./textproto.ts"; const encoder = new TextEncoder(); diff --git a/tests/testdata/run/websocket_server_idletimeout.ts b/tests/testdata/run/websocket_server_idletimeout.ts index aa1da5ccd..c33fd9efb 100644 --- a/tests/testdata/run/websocket_server_idletimeout.ts +++ b/tests/testdata/run/websocket_server_idletimeout.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; const errorDeferred = Promise.withResolvers<void>(); const closeDeferred = Promise.withResolvers<void>(); diff --git a/tests/testdata/test/allow_all.ts b/tests/testdata/test/allow_all.ts index 589f200df..01341d9e5 100644 --- a/tests/testdata/test/allow_all.ts +++ b/tests/testdata/test/allow_all.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; const permissions: Deno.PermissionName[] = [ "read", diff --git a/tests/testdata/test/allow_none.ts b/tests/testdata/test/allow_none.ts index 903a926ba..17a6f4014 100644 --- a/tests/testdata/test/allow_none.ts +++ b/tests/testdata/test/allow_none.ts @@ -1,4 +1,4 @@ -import { unreachable } from "@std/assert/mod.ts"; +import { unreachable } from "@std/assert"; const permissions: Deno.PermissionName[] = [ "read", diff --git a/tests/testdata/workers/deno_worker.ts b/tests/testdata/workers/deno_worker.ts index ca16d4fa4..5f78af6e2 100644 --- a/tests/testdata/workers/deno_worker.ts +++ b/tests/testdata/workers/deno_worker.ts @@ -1,4 +1,4 @@ -import { assert } from "@std/assert/mod.ts"; +import { assert } from "@std/assert"; onmessage = function (e) { if (typeof self.Deno === "undefined") { diff --git a/tests/unit/blob_test.ts b/tests/unit/blob_test.ts index b05b5fb7c..b57825314 100644 --- a/tests/unit/blob_test.ts +++ b/tests/unit/blob_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { assert, assertEquals, assertStringIncludes } from "./test_util.ts"; -import { concat } from "@std/bytes/concat.ts"; +import { concat } from "@std/bytes/concat"; Deno.test(function blobString() { const b1 = new Blob(["Hello World"]); diff --git a/tests/unit/broadcast_channel_test.ts b/tests/unit/broadcast_channel_test.ts index 7e4d55848..dce5f1086 100644 --- a/tests/unit/broadcast_channel_test.ts +++ b/tests/unit/broadcast_channel_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; Deno.test("BroadcastChannel worker", async () => { const intercom = new BroadcastChannel("intercom"); diff --git a/tests/unit/buffer_test.ts b/tests/unit/buffer_test.ts index 6d2123622..221574882 100644 --- a/tests/unit/buffer_test.ts +++ b/tests/unit/buffer_test.ts @@ -11,7 +11,7 @@ import { assertRejects, assertThrows, } from "./test_util.ts"; -import { writeAllSync } from "@std/io/write_all.ts"; +import { writeAllSync } from "@std/io/write-all"; const MAX_SIZE = 2 ** 32 - 2; // N controls how many iterations of certain checks are performed. diff --git a/tests/unit/console_test.ts b/tests/unit/console_test.ts index 4c9378bd4..957ad3ef9 100644 --- a/tests/unit/console_test.ts +++ b/tests/unit/console_test.ts @@ -14,7 +14,7 @@ import { assertStringIncludes, assertThrows, } from "./test_util.ts"; -import { stripColor } from "@std/fmt/colors.ts"; +import { stripAnsiCode } from "@std/fmt/colors"; const customInspect = Symbol.for("Deno.customInspect"); const { @@ -27,7 +27,7 @@ const { } = Deno[Deno.internal]; function stringify(...args: unknown[]): string { - return stripColor(inspectArgs(args).replace(/\n$/, "")); + return stripAnsiCode(inspectArgs(args).replace(/\n$/, "")); } interface Css { @@ -372,7 +372,7 @@ Deno.test(function consoleTestStringifyCircular() { }`, ); // test inspect is working the same - assertEquals(stripColor(Deno.inspect(nestedObj)), nestedObjExpected); + assertEquals(stripAnsiCode(Deno.inspect(nestedObj)), nestedObjExpected); }); Deno.test(function consoleTestStringifyMultipleCircular() { @@ -451,7 +451,7 @@ Deno.test(function consoleTestStringifyFunctionWithProperties() { ); assertEquals( - stripColor(Deno.inspect(Array, { showHidden: true })), + stripAnsiCode(Deno.inspect(Array, { showHidden: true })), `<ref *1> [Function: Array] { [length]: 1, [name]: "Array", @@ -529,24 +529,24 @@ Deno.test(function consoleTestStringifyWithDepth() { // deno-lint-ignore no-explicit-any const nestedObj: any = { a: { b: { c: { d: { e: { f: 42 } } } } } }; assertEquals( - stripColor(inspectArgs([nestedObj], { depth: 3 })), + stripAnsiCode(inspectArgs([nestedObj], { depth: 3 })), "{\n a: { b: { c: { d: [Object] } } }\n}", ); assertEquals( - stripColor(inspectArgs([nestedObj], { depth: 4 })), + stripAnsiCode(inspectArgs([nestedObj], { depth: 4 })), "{\n a: {\n b: { c: { d: { e: [Object] } } }\n }\n}", ); assertEquals( - stripColor(inspectArgs([nestedObj], { depth: 0 })), + stripAnsiCode(inspectArgs([nestedObj], { depth: 0 })), "{ a: [Object] }", ); assertEquals( - stripColor(inspectArgs([nestedObj])), + stripAnsiCode(inspectArgs([nestedObj])), "{\n a: {\n b: { c: { d: { e: [Object] } } }\n }\n}", ); // test inspect is working the same way assertEquals( - stripColor(Deno.inspect(nestedObj, { depth: 4 })), + stripAnsiCode(Deno.inspect(nestedObj, { depth: 4 })), "{\n a: {\n b: { c: { d: { e: [Object] } } }\n }\n}", ); }); @@ -1032,11 +1032,13 @@ Deno.test(function consoleTestIteratorValueAreNotConsumed() { Deno.test(function consoleTestWeakSetAndWeakMapWithShowHidden() { assertEquals( - stripColor(Deno.inspect(new WeakSet([{}]), { showHidden: true })), + stripAnsiCode(Deno.inspect(new WeakSet([{}]), { showHidden: true })), "WeakSet { {} }", ); assertEquals( - stripColor(Deno.inspect(new WeakMap([[{}, "foo"]]), { showHidden: true })), + stripAnsiCode( + Deno.inspect(new WeakMap([[{}, "foo"]]), { showHidden: true }), + ), 'WeakMap { {} => "foo" }', ); }); @@ -1195,7 +1197,10 @@ Deno.test(function consoleTestWithObjectFormatSpecifier() { Deno.test(function consoleTestWithStyleSpecifier() { assertEquals(stringify("%cfoo%cbar"), "%cfoo%cbar"); assertEquals(stringify("%cfoo%cbar", ""), "foo%cbar"); - assertEquals(stripColor(stringify("%cfoo%cbar", "", "color: red")), "foobar"); + assertEquals( + stripAnsiCode(stringify("%cfoo%cbar", "", "color: red")), + "foobar", + ); }); Deno.test(function consoleParseCssColor() { @@ -1532,7 +1537,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table({ a: "test", b: 1 }); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ¬βββββββββ β (idx) β Values β @@ -1546,7 +1551,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table({ a: { b: 10 }, b: { b: 20, c: 30 } }, ["c"]); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ¬βββββ β (idx) β c β @@ -1560,7 +1565,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table([[1, 1], [234, 2.34], [56789, 56.789]]); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ¬ββββββββ¬βββββββββ β (idx) β 0 β 1 β @@ -1575,7 +1580,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table([1, 2, [3, [4]], [5, 6], [[7], [8]]]); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ¬ββββββββ¬ββββββββ¬βββββββββ β (idx) β 0 β 1 β Values β @@ -1592,7 +1597,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table(new Set([1, 2, 3, "test"])); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ ββββββββββββββ¬βββββββββ β (iter idx) β Values β @@ -1613,7 +1618,7 @@ Deno.test(function consoleTable() { ]), ); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ ββββββββββββββ¬ββββββ¬βββββββββ β (iter idx) β Key β Values β @@ -1633,7 +1638,7 @@ Deno.test(function consoleTable() { h: new Map([[1, "one"]]), }); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ¬ββββββββββββ¬βββββββββββββββββββββ¬βββββββββ β (idx) β c β e β Values β @@ -1656,7 +1661,7 @@ Deno.test(function consoleTable() { ["test", { b: 20, c: "test" }], ]); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ¬βββββββββ¬βββββββββββββββββββββββ¬βββββ¬βββββββββ β (idx) β 0 β 1 β a β Values β @@ -1673,7 +1678,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table([]); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ β (idx) β @@ -1685,7 +1690,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table({}); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ β (idx) β @@ -1697,7 +1702,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table(new Set()); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ ββββββββββββββ β (iter idx) β @@ -1709,7 +1714,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table(new Map()); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ ββββββββββββββ β (iter idx) β @@ -1725,7 +1730,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table(["Hello", "δ½ ε₯½", "AmapΓ‘"]); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ¬ββββββββββ β (idx) β Values β @@ -1743,7 +1748,7 @@ Deno.test(function consoleTable() { [3, 4], ]); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ¬ββββ¬ββββ β (idx) β 0 β 1 β @@ -1757,7 +1762,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table({ 1: { a: 4, b: 5 }, 2: null, 3: { b: 6, c: 7 } }, ["b"]); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ¬ββββ β (idx) β b β @@ -1772,7 +1777,7 @@ Deno.test(function consoleTable() { mockConsole((console, out) => { console.table([{ a: 0 }, { a: 1, b: 1 }, { a: 2 }, { a: 3, b: 3 }]); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ¬ββββ¬ββββ β (idx) β a β b β @@ -1791,7 +1796,7 @@ Deno.test(function consoleTable() { ["a", "b", "c"], ); assertEquals( - stripColor(out.toString()), + stripAnsiCode(out.toString()), `\ βββββββββ¬ββββ¬ββββ¬ββββ β (idx) β a β b β c β @@ -1829,7 +1834,7 @@ Deno.test(function consoleLogShouldNotThrowError() { Deno.test(function consoleLogShouldNotThrowErrorWhenInvalidCssColorsAreGiven() { mockConsole((console, out) => { console.log("%cfoo", "color: foo; background-color: bar;"); - assertEquals(stripColor(out.toString()), "foo\n"); + assertEquals(stripAnsiCode(out.toString()), "foo\n"); }); }); @@ -1838,7 +1843,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInvalidDateIsPassed() { mockConsole((console, out) => { const invalidDate = new Date("test"); console.log(invalidDate); - assertEquals(stripColor(out.toString()), "Invalid Date\n"); + assertEquals(stripAnsiCode(out.toString()), "Invalid Date\n"); }); }); @@ -1847,7 +1852,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedSet() { mockConsole((console, out) => { const proxiedSet = new Proxy(new Set([1, 2]), {}); console.log(proxiedSet); - assertEquals(stripColor(out.toString()), "Set(2) { 1, 2 }\n"); + assertEquals(stripAnsiCode(out.toString()), "Set(2) { 1, 2 }\n"); }); }); @@ -1856,7 +1861,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedMap() { mockConsole((console, out) => { const proxiedMap = new Proxy(new Map([[1, 1], [2, 2]]), {}); console.log(proxiedMap); - assertEquals(stripColor(out.toString()), "Map(2) { 1 => 1, 2 => 2 }\n"); + assertEquals(stripAnsiCode(out.toString()), "Map(2) { 1 => 1, 2 => 2 }\n"); }); }); @@ -1865,7 +1870,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedTypedArray() { mockConsole((console, out) => { const proxiedUint8Array = new Proxy(new Uint8Array([1, 2]), {}); console.log(proxiedUint8Array); - assertEquals(stripColor(out.toString()), "Uint8Array(2) [ 1, 2 ]\n"); + assertEquals(stripAnsiCode(out.toString()), "Uint8Array(2) [ 1, 2 ]\n"); }); }); @@ -1874,7 +1879,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedRegExp() { mockConsole((console, out) => { const proxiedRegExp = new Proxy(/aaaa/, {}); console.log(proxiedRegExp); - assertEquals(stripColor(out.toString()), "/aaaa/\n"); + assertEquals(stripAnsiCode(out.toString()), "/aaaa/\n"); }); }); @@ -1883,7 +1888,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedDate() { mockConsole((console, out) => { const proxiedDate = new Proxy(new Date("2022-09-24T15:59:39.529Z"), {}); console.log(proxiedDate); - assertEquals(stripColor(out.toString()), "2022-09-24T15:59:39.529Z\n"); + assertEquals(stripAnsiCode(out.toString()), "2022-09-24T15:59:39.529Z\n"); }); }); @@ -1892,7 +1897,7 @@ Deno.test(function consoleLogShouldNotThrowErrorWhenInputIsProxiedError() { mockConsole((console, out) => { const proxiedError = new Proxy(new Error("message"), {}); console.log(proxiedError); - assertStringIncludes(stripColor(out.toString()), "Error: message\n"); + assertStringIncludes(stripAnsiCode(out.toString()), "Error: message\n"); }); }); @@ -1931,18 +1936,18 @@ Deno.test(function consoleTrace() { Deno.test(function inspectString() { assertEquals( - stripColor(Deno.inspect("\0")), + stripAnsiCode(Deno.inspect("\0")), `"\\x00"`, ); assertEquals( - stripColor(Deno.inspect("\x1b[2J")), + stripAnsiCode(Deno.inspect("\x1b[2J")), `"\\x1b[2J"`, ); }); Deno.test(function inspectGetters() { assertEquals( - stripColor(Deno.inspect({ + stripAnsiCode(Deno.inspect({ get foo() { return 0; }, @@ -1951,7 +1956,7 @@ Deno.test(function inspectGetters() { ); assertEquals( - stripColor(Deno.inspect({ + stripAnsiCode(Deno.inspect({ get foo() { return 0; }, @@ -1976,15 +1981,15 @@ Deno.test(function inspectPrototype() { Deno.test(function inspectSorted() { assertEquals( - stripColor(Deno.inspect({ b: 2, a: 1 }, { sorted: true })), + stripAnsiCode(Deno.inspect({ b: 2, a: 1 }, { sorted: true })), "{ a: 1, b: 2 }", ); assertEquals( - stripColor(Deno.inspect(new Set(["b", "a"]), { sorted: true })), + stripAnsiCode(Deno.inspect(new Set(["b", "a"]), { sorted: true })), `Set(2) { "a", "b" }`, ); assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( new Map([ ["b", 2], ["a", 1], @@ -1997,7 +2002,7 @@ Deno.test(function inspectSorted() { Deno.test(function inspectTrailingComma() { assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( [ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", @@ -2010,7 +2015,7 @@ Deno.test(function inspectTrailingComma() { ]`, ); assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( { aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: 1, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb: 2, @@ -2023,7 +2028,7 @@ Deno.test(function inspectTrailingComma() { }`, ); assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( new Set([ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", @@ -2036,7 +2041,7 @@ Deno.test(function inspectTrailingComma() { }`, ); assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( new Map([ ["aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 1], ["bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", 2], @@ -2052,7 +2057,7 @@ Deno.test(function inspectTrailingComma() { Deno.test(function inspectCompact() { assertEquals( - stripColor(Deno.inspect({ a: 1, b: 2 }, { compact: false })), + stripAnsiCode(Deno.inspect({ a: 1, b: 2 }, { compact: false })), `{ a: 1, b: 2 @@ -2062,15 +2067,15 @@ Deno.test(function inspectCompact() { Deno.test(function inspectIterableLimit() { assertEquals( - stripColor(Deno.inspect(["a", "b", "c"], { iterableLimit: 2 })), + stripAnsiCode(Deno.inspect(["a", "b", "c"], { iterableLimit: 2 })), `[ "a", "b", ... 1 more item ]`, ); assertEquals( - stripColor(Deno.inspect(new Set(["a", "b", "c"]), { iterableLimit: 2 })), + stripAnsiCode(Deno.inspect(new Set(["a", "b", "c"]), { iterableLimit: 2 })), `Set(3) { "a", "b", ... 1 more item }`, ); assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( new Map([ ["a", 1], ["b", 2], @@ -2084,19 +2089,19 @@ Deno.test(function inspectIterableLimit() { Deno.test(function inspectProxy() { assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( new Proxy([1, 2, 3], {}), )), "[ 1, 2, 3 ]", ); assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( new Proxy({ key: "value" }, {}), )), `{ key: "value" }`, ); assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( new Proxy({}, { get(_target, key) { if (key === Symbol.toStringTag) { @@ -2120,14 +2125,14 @@ Deno.test(function inspectProxy() { `Object [MyProxy] { prop1: 5, prop2: 5 }`, ); assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( new Proxy([1, 2, 3], { get() {} }), { showProxy: true }, )), "Proxy [ [ 1, 2, 3 ], { get: [Function: get] } ]", ); assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( new Proxy({ a: 1 }, { set(): boolean { return false; @@ -2138,7 +2143,7 @@ Deno.test(function inspectProxy() { "Proxy [ { a: 1 }, { set: [Function: set] } ]", ); assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( new Proxy([1, 2, 3, 4, 5, 6, 7], { get() {} }), { showProxy: true }, )), @@ -2151,7 +2156,7 @@ Deno.test(function inspectProxy() { ]`, ); assertEquals( - stripColor(Deno.inspect( + stripAnsiCode(Deno.inspect( new Proxy(function fn() {}, { get() {} }), { showProxy: true }, )), @@ -2166,15 +2171,15 @@ Deno.test(function inspectError() { }); assertStringIncludes( - stripColor(Deno.inspect(error1)), + stripAnsiCode(Deno.inspect(error1)), "Error: This is an error", ); assertStringIncludes( - stripColor(Deno.inspect(error2)), + stripAnsiCode(Deno.inspect(error2)), "Error: This is an error", ); assertStringIncludes( - stripColor(Deno.inspect(error2)), + stripAnsiCode(Deno.inspect(error2)), "Caused by Error: This is a cause error", ); }); @@ -2189,19 +2194,19 @@ Deno.test(function inspectErrorCircular() { error2.cause.cause = error2; assertStringIncludes( - stripColor(Deno.inspect(error1)), + stripAnsiCode(Deno.inspect(error1)), "Error: This is an error", ); assertStringIncludes( - stripColor(Deno.inspect(error2)), + stripAnsiCode(Deno.inspect(error2)), "<ref *1> Error: This is an error", ); assertStringIncludes( - stripColor(Deno.inspect(error2)), + stripAnsiCode(Deno.inspect(error2)), "Caused by Error: This is a cause error", ); assertStringIncludes( - stripColor(Deno.inspect(error2)), + stripAnsiCode(Deno.inspect(error2)), "Caused by [Circular *1]", ); }); @@ -2213,11 +2218,11 @@ Deno.test(function inspectErrorWithCauseFormat() { }, }); assertStringIncludes( - stripColor(Deno.inspect(error)), + stripAnsiCode(Deno.inspect(error)), "Error: This is an error", ); assertStringIncludes( - stripColor(Deno.inspect(error)), + stripAnsiCode(Deno.inspect(error)), "Caused by { code: 100500 }", ); }); diff --git a/tests/unit/fetch_test.ts b/tests/unit/fetch_test.ts index 39cadcb44..09cbb5cd2 100644 --- a/tests/unit/fetch_test.ts +++ b/tests/unit/fetch_test.ts @@ -8,7 +8,7 @@ import { fail, unimplemented, } from "./test_util.ts"; -import { Buffer } from "@std/io/buffer.ts"; +import { Buffer } from "@std/io/buffer"; const listenPort = 4506; diff --git a/tests/unit/files_test.ts b/tests/unit/files_test.ts index b25b2fd5d..754c6fb15 100644 --- a/tests/unit/files_test.ts +++ b/tests/unit/files_test.ts @@ -8,7 +8,7 @@ import { assertRejects, assertThrows, } from "./test_util.ts"; -import { copy } from "@std/io/copy.ts"; +import { copy } from "@std/io/copy"; // Note tests for Deno.FsFile.setRaw is in integration tests. diff --git a/tests/unit/http_test.ts b/tests/unit/http_test.ts index 03c30965f..6d3543e44 100644 --- a/tests/unit/http_test.ts +++ b/tests/unit/http_test.ts @@ -2,7 +2,7 @@ // deno-lint-ignore-file no-deprecated-deno-api -import { Buffer, BufReader, BufWriter } from "@std/io/mod.ts"; +import { Buffer, BufReader, BufWriter } from "@std/io"; import { TextProtoReader } from "../testdata/run/textproto.ts"; import { assert, @@ -13,7 +13,7 @@ import { delay, fail, } from "./test_util.ts"; -import { join } from "@std/path/mod.ts"; +import { join } from "@std/path"; const listenPort = 4507; const listenPort2 = 4508; diff --git a/tests/unit/io_test.ts b/tests/unit/io_test.ts index aadb82297..5b55729dd 100644 --- a/tests/unit/io_test.ts +++ b/tests/unit/io_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { assertEquals } from "./test_util.ts"; -import { Buffer } from "@std/io/buffer.ts"; +import { Buffer } from "@std/io/buffer"; const DEFAULT_BUF_SIZE = 32 * 1024; diff --git a/tests/unit/kv_test.ts b/tests/unit/kv_test.ts index c39e0d0fc..28d79d1f9 100644 --- a/tests/unit/kv_test.ts +++ b/tests/unit/kv_test.ts @@ -7,7 +7,7 @@ import { assertRejects, assertThrows, } from "./test_util.ts"; -import { assertType, IsExact } from "@std/testing/types.ts"; +import { assertType, IsExact } from "@std/testing/types"; const sleep = (time: number) => new Promise((r) => setTimeout(r, time)); diff --git a/tests/unit/message_channel_test.ts b/tests/unit/message_channel_test.ts index 87023bb1f..0fcbc5e95 100644 --- a/tests/unit/message_channel_test.ts +++ b/tests/unit/message_channel_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // NOTE: these are just sometests to test the TypeScript types. Real coverage is // provided by WPT. -import { assert, assertEquals } from "@std/assert/mod.ts"; +import { assert, assertEquals } from "@std/assert"; Deno.test("messagechannel", async () => { const mc = new MessageChannel(); diff --git a/tests/unit/serve_test.ts b/tests/unit/serve_test.ts index ee87d8189..4a7d53e1b 100644 --- a/tests/unit/serve_test.ts +++ b/tests/unit/serve_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertMatch, assertRejects } from "@std/assert/mod.ts"; -import { Buffer, BufReader, BufWriter } from "@std/io/mod.ts"; +import { assertMatch, assertRejects } from "@std/assert"; +import { Buffer, BufReader, BufWriter } from "@std/io"; import { TextProtoReader } from "../testdata/run/textproto.ts"; import { assert, diff --git a/tests/unit/test_util.ts b/tests/unit/test_util.ts index db2585ebd..e45a963e9 100644 --- a/tests/unit/test_util.ts +++ b/tests/unit/test_util.ts @@ -1,9 +1,9 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import * as colors from "@std/fmt/colors.ts"; -import { assert } from "@std/assert/mod.ts"; +import * as colors from "@std/fmt/colors"; +import { assert } from "@std/assert"; export { colors }; -import { join, resolve } from "@std/path/mod.ts"; +import { join, resolve } from "@std/path"; export { assert, assertEquals, @@ -20,10 +20,10 @@ export { fail, unimplemented, unreachable, -} from "@std/assert/mod.ts"; -export { delay } from "@std/async/delay.ts"; -export { readLines } from "@std/io/read_lines.ts"; -export { parse as parseArgs } from "@std/flags/mod.ts"; +} from "@std/assert"; +export { delay } from "@std/async/delay"; +export { readLines } from "@std/io/read-lines"; +export { parseArgs } from "@std/cli/parse-args"; export function pathToAbsoluteFileUrl(path: string): URL { path = resolve(path); diff --git a/tests/unit/tls_test.ts b/tests/unit/tls_test.ts index 5be05b73e..34061bb21 100644 --- a/tests/unit/tls_test.ts +++ b/tests/unit/tls_test.ts @@ -7,9 +7,9 @@ import { assertStrictEquals, assertThrows, } from "./test_util.ts"; -import { BufReader, BufWriter } from "@std/io/mod.ts"; -import { readAll } from "@std/io/read_all.ts"; -import { writeAll } from "@std/io/write_all.ts"; +import { BufReader, BufWriter } from "@std/io"; +import { readAll } from "@std/io/read-all"; +import { writeAll } from "@std/io/write-all"; import { TextProtoReader } from "../testdata/run/textproto.ts"; const encoder = new TextEncoder(); diff --git a/tests/unit/urlpattern_test.ts b/tests/unit/urlpattern_test.ts index 2b635a513..3c1fb0cf1 100644 --- a/tests/unit/urlpattern_test.ts +++ b/tests/unit/urlpattern_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { assert, assertEquals } from "./test_util.ts"; -import { assertType, IsExact } from "@std/testing/types.ts"; +import { assertType, IsExact } from "@std/testing/types"; Deno.test(function urlPatternFromString() { const pattern = new URLPattern("https://deno.land/foo/:bar"); diff --git a/tests/unit/websocketstream_test.ts.disabled b/tests/unit/websocketstream_test.ts.disabled index 19941e08e..4f8c321c9 100644 --- a/tests/unit/websocketstream_test.ts.disabled +++ b/tests/unit/websocketstream_test.ts.disabled @@ -6,7 +6,7 @@ import { assertRejects, assertThrows, unreachable, -} from "@std/assert/mod.ts"; +} from "@std/assert"; Deno.test("fragment", () => { assertThrows(() => new WebSocketStream("ws://localhost:4242/#")); diff --git a/tests/unit/worker_test.ts b/tests/unit/worker_test.ts index a66eb69a9..526618d54 100644 --- a/tests/unit/worker_test.ts +++ b/tests/unit/worker_test.ts @@ -2,12 +2,7 @@ // Requires to be run with `--allow-net` flag -import { - assert, - assertEquals, - assertMatch, - assertThrows, -} from "@std/assert/mod.ts"; +import { assert, assertEquals, assertMatch, assertThrows } from "@std/assert"; function resolveWorker(worker: string): string { return import.meta.resolve(`../testdata/workers/${worker}`); diff --git a/tests/unit_node/_fs/_fs_access_test.ts b/tests/unit_node/_fs/_fs_access_test.ts index 713a8d9a7..f8010b0b8 100644 --- a/tests/unit_node/_fs/_fs_access_test.ts +++ b/tests/unit_node/_fs/_fs_access_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import * as fs from "node:fs"; -import { assertRejects, assertThrows } from "@std/assert/mod.ts"; +import { assertRejects, assertThrows } from "@std/assert"; Deno.test( "[node/fs.access] Uses the owner permission when the user is the owner", diff --git a/tests/unit_node/_fs/_fs_appendFile_test.ts b/tests/unit_node/_fs/_fs_appendFile_test.ts index edc4dfb94..f50eba856 100644 --- a/tests/unit_node/_fs/_fs_appendFile_test.ts +++ b/tests/unit_node/_fs/_fs_appendFile_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; +import { assertEquals, assertThrows, fail } from "@std/assert"; import { appendFile, appendFileSync } from "node:fs"; -import { fromFileUrl } from "@std/path/mod.ts"; +import { fromFileUrl } from "@std/path"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; const decoder = new TextDecoder("utf-8"); diff --git a/tests/unit_node/_fs/_fs_chmod_test.ts b/tests/unit_node/_fs/_fs_chmod_test.ts index 90ab6761b..97dc9ecdd 100644 --- a/tests/unit_node/_fs/_fs_chmod_test.ts +++ b/tests/unit_node/_fs/_fs_chmod_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertRejects, assertThrows, fail } from "@std/assert/mod.ts"; +import { assert, assertRejects, assertThrows, fail } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { chmod, chmodSync } from "node:fs"; diff --git a/tests/unit_node/_fs/_fs_chown_test.ts b/tests/unit_node/_fs/_fs_chown_test.ts index 6059e882d..6cb2f576a 100644 --- a/tests/unit_node/_fs/_fs_chown_test.ts +++ b/tests/unit_node/_fs/_fs_chown_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, fail } from "@std/assert/mod.ts"; +import { assertEquals, fail } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { chown, chownSync } from "node:fs"; diff --git a/tests/unit_node/_fs/_fs_close_test.ts b/tests/unit_node/_fs/_fs_close_test.ts index 085f387c6..e41711126 100644 --- a/tests/unit_node/_fs/_fs_close_test.ts +++ b/tests/unit_node/_fs/_fs_close_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertThrows, fail } from "@std/assert/mod.ts"; +import { assert, assertThrows, fail } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { close, closeSync } from "node:fs"; diff --git a/tests/unit_node/_fs/_fs_copy_test.ts b/tests/unit_node/_fs/_fs_copy_test.ts index adc002187..22f30ea37 100644 --- a/tests/unit_node/_fs/_fs_copy_test.ts +++ b/tests/unit_node/_fs/_fs_copy_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import * as path from "@std/path/mod.ts"; -import { assert } from "@std/assert/mod.ts"; +import * as path from "@std/path"; +import { assert } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { copyFile, copyFileSync, cpSync, existsSync } from "node:fs"; diff --git a/tests/unit_node/_fs/_fs_dir_test.ts b/tests/unit_node/_fs/_fs_dir_test.ts index e108960fa..0f41543e9 100644 --- a/tests/unit_node/_fs/_fs_dir_test.ts +++ b/tests/unit_node/_fs/_fs_dir_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertEquals, fail } from "@std/assert/mod.ts"; +import { assert, assertEquals, fail } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { Dir as DirOrig, type Dirent } from "node:fs"; diff --git a/tests/unit_node/_fs/_fs_dirent_test.ts b/tests/unit_node/_fs/_fs_dirent_test.ts index 853888925..093617faf 100644 --- a/tests/unit_node/_fs/_fs_dirent_test.ts +++ b/tests/unit_node/_fs/_fs_dirent_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertEquals, assertThrows } from "@std/assert/mod.ts"; +import { assert, assertEquals, assertThrows } from "@std/assert"; import { Dirent as Dirent_ } from "node:fs"; // deno-lint-ignore no-explicit-any diff --git a/tests/unit_node/_fs/_fs_exists_test.ts b/tests/unit_node/_fs/_fs_exists_test.ts index 04411e61b..7ed7584ae 100644 --- a/tests/unit_node/_fs/_fs_exists_test.ts +++ b/tests/unit_node/_fs/_fs_exists_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertEquals, assertStringIncludes } from "@std/assert/mod.ts"; +import { assert, assertEquals, assertStringIncludes } from "@std/assert"; import { exists, existsSync } from "node:fs"; import { promisify } from "node:util"; diff --git a/tests/unit_node/_fs/_fs_fdatasync_test.ts b/tests/unit_node/_fs/_fs_fdatasync_test.ts index 2c054cac3..6e0143d64 100644 --- a/tests/unit_node/_fs/_fs_fdatasync_test.ts +++ b/tests/unit_node/_fs/_fs_fdatasync_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, fail } from "@std/assert/mod.ts"; +import { assertEquals, fail } from "@std/assert"; import { fdatasync, fdatasyncSync } from "node:fs"; Deno.test({ diff --git a/tests/unit_node/_fs/_fs_fstat_test.ts b/tests/unit_node/_fs/_fs_fstat_test.ts index b0c767bcf..46ab508cf 100644 --- a/tests/unit_node/_fs/_fs_fstat_test.ts +++ b/tests/unit_node/_fs/_fs_fstat_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { fstat, fstatSync } from "node:fs"; -import { fail } from "@std/assert/mod.ts"; +import { fail } from "@std/assert"; import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts"; import type { BigIntStats, Stats } from "node:fs"; diff --git a/tests/unit_node/_fs/_fs_fsync_test.ts b/tests/unit_node/_fs/_fs_fsync_test.ts index 855abcd16..3a162f97c 100644 --- a/tests/unit_node/_fs/_fs_fsync_test.ts +++ b/tests/unit_node/_fs/_fs_fsync_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, fail } from "@std/assert/mod.ts"; +import { assertEquals, fail } from "@std/assert"; import { fsync, fsyncSync } from "node:fs"; Deno.test({ diff --git a/tests/unit_node/_fs/_fs_ftruncate_test.ts b/tests/unit_node/_fs/_fs_ftruncate_test.ts index 238f51c0c..78cbe630a 100644 --- a/tests/unit_node/_fs/_fs_ftruncate_test.ts +++ b/tests/unit_node/_fs/_fs_ftruncate_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; +import { assertEquals, assertThrows, fail } from "@std/assert"; import { ftruncate, ftruncateSync } from "node:fs"; Deno.test({ diff --git a/tests/unit_node/_fs/_fs_futimes_test.ts b/tests/unit_node/_fs/_fs_futimes_test.ts index 2f9bd516f..48f949b1a 100644 --- a/tests/unit_node/_fs/_fs_futimes_test.ts +++ b/tests/unit_node/_fs/_fs_futimes_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; +import { assertEquals, assertThrows, fail } from "@std/assert"; import { futimes, futimesSync } from "node:fs"; const randomDate = new Date(Date.now() + 1000); diff --git a/tests/unit_node/_fs/_fs_handle_test.ts b/tests/unit_node/_fs/_fs_handle_test.ts index 91dabbece..ea6af9c29 100644 --- a/tests/unit_node/_fs/_fs_handle_test.ts +++ b/tests/unit_node/_fs/_fs_handle_test.ts @@ -1,8 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import * as path from "@std/path/mod.ts"; +import * as path from "@std/path"; import { Buffer } from "node:buffer"; import * as fs from "node:fs/promises"; -import { assert, assertEquals } from "@std/assert/mod.ts"; +import { assert, assertEquals } from "@std/assert"; const moduleDir = path.dirname(path.fromFileUrl(import.meta.url)); const testData = path.resolve(moduleDir, "testdata", "hello.txt"); diff --git a/tests/unit_node/_fs/_fs_link_test.ts b/tests/unit_node/_fs/_fs_link_test.ts index aad025413..3062db7a6 100644 --- a/tests/unit_node/_fs/_fs_link_test.ts +++ b/tests/unit_node/_fs/_fs_link_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import * as path from "@std/path/mod.ts"; -import { assert, assertEquals, fail } from "@std/assert/mod.ts"; +import * as path from "@std/path"; +import { assert, assertEquals, fail } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { link, linkSync } from "node:fs"; diff --git a/tests/unit_node/_fs/_fs_lstat_test.ts b/tests/unit_node/_fs/_fs_lstat_test.ts index 2887cf23b..6a4244345 100644 --- a/tests/unit_node/_fs/_fs_lstat_test.ts +++ b/tests/unit_node/_fs/_fs_lstat_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { lstat, lstatSync } from "node:fs"; -import { fail } from "@std/assert/mod.ts"; +import { fail } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts"; import type { BigIntStats, Stats } from "node:fs"; diff --git a/tests/unit_node/_fs/_fs_mkdir_test.ts b/tests/unit_node/_fs/_fs_mkdir_test.ts index 874e9f856..b9f6adf44 100644 --- a/tests/unit_node/_fs/_fs_mkdir_test.ts +++ b/tests/unit_node/_fs/_fs_mkdir_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import * as path from "@std/path/mod.ts"; -import { assert } from "@std/assert/mod.ts"; +import * as path from "@std/path"; +import { assert } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { existsSync, mkdir, mkdirSync } from "node:fs"; diff --git a/tests/unit_node/_fs/_fs_mkdtemp_test.ts b/tests/unit_node/_fs/_fs_mkdtemp_test.ts index 3021a52af..47530b495 100644 --- a/tests/unit_node/_fs/_fs_mkdtemp_test.ts +++ b/tests/unit_node/_fs/_fs_mkdtemp_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertRejects, assertThrows } from "@std/assert/mod.ts"; +import { assert, assertRejects, assertThrows } from "@std/assert"; import { EncodingOption, existsSync, mkdtemp, mkdtempSync } from "node:fs"; import { env } from "node:process"; import { promisify } from "node:util"; diff --git a/tests/unit_node/_fs/_fs_open_test.ts b/tests/unit_node/_fs/_fs_open_test.ts index 3f0750382..b4679cbab 100644 --- a/tests/unit_node/_fs/_fs_open_test.ts +++ b/tests/unit_node/_fs/_fs_open_test.ts @@ -9,7 +9,7 @@ import { O_TRUNC, O_WRONLY, } from "node:constants"; -import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; +import { assertEquals, assertThrows, fail } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { open, openSync } from "node:fs"; import { join, parse } from "node:path"; diff --git a/tests/unit_node/_fs/_fs_opendir_test.ts b/tests/unit_node/_fs/_fs_opendir_test.ts index 74a5438b4..e22a47a70 100644 --- a/tests/unit_node/_fs/_fs_opendir_test.ts +++ b/tests/unit_node/_fs/_fs_opendir_test.ts @@ -6,7 +6,7 @@ import { assertFalse, assertInstanceOf, assertThrows, -} from "@std/assert/mod.ts"; +} from "@std/assert"; import { opendir, opendirSync } from "node:fs"; import { Buffer } from "node:buffer"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; diff --git a/tests/unit_node/_fs/_fs_readFile_test.ts b/tests/unit_node/_fs/_fs_readFile_test.ts index 9f07690bc..ea36b9d86 100644 --- a/tests/unit_node/_fs/_fs_readFile_test.ts +++ b/tests/unit_node/_fs/_fs_readFile_test.ts @@ -1,8 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { promises, readFile, readFileSync } from "node:fs"; -import * as path from "@std/path/mod.ts"; -import { assert, assertEquals } from "@std/assert/mod.ts"; +import * as path from "@std/path"; +import { assert, assertEquals } from "@std/assert"; const moduleDir = path.dirname(path.fromFileUrl(import.meta.url)); const testData = path.resolve(moduleDir, "testdata", "hello.txt"); diff --git a/tests/unit_node/_fs/_fs_read_test.ts b/tests/unit_node/_fs/_fs_read_test.ts index 77311f7f3..42e8fed73 100644 --- a/tests/unit_node/_fs/_fs_read_test.ts +++ b/tests/unit_node/_fs/_fs_read_test.ts @@ -4,11 +4,11 @@ import { assertFalse, assertMatch, assertStrictEquals, -} from "@std/assert/mod.ts"; +} from "@std/assert"; import { read, readSync } from "node:fs"; import { open, openSync } from "node:fs"; import { Buffer } from "node:buffer"; -import * as path from "@std/path/mod.ts"; +import * as path from "@std/path"; import { closeSync } from "node:fs"; async function readTest( diff --git a/tests/unit_node/_fs/_fs_readdir_test.ts b/tests/unit_node/_fs/_fs_readdir_test.ts index b54e15816..8e5b46fc8 100644 --- a/tests/unit_node/_fs/_fs_readdir_test.ts +++ b/tests/unit_node/_fs/_fs_readdir_test.ts @@ -1,8 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, assertNotEquals, fail } from "@std/assert/mod.ts"; +import { assertEquals, assertNotEquals, fail } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { readdir, readdirSync } from "node:fs"; -import { join } from "@std/path/mod.ts"; +import { join } from "@std/path"; Deno.test({ name: "ASYNC: reading empty directory", diff --git a/tests/unit_node/_fs/_fs_readlink_test.ts b/tests/unit_node/_fs/_fs_readlink_test.ts index f955d09a1..23c5e3896 100644 --- a/tests/unit_node/_fs/_fs_readlink_test.ts +++ b/tests/unit_node/_fs/_fs_readlink_test.ts @@ -1,8 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { readlink, readlinkSync } from "node:fs"; -import { assert, assertEquals } from "@std/assert/mod.ts"; -import * as path from "@std/path/mod.ts"; +import { assert, assertEquals } from "@std/assert"; +import * as path from "@std/path"; const testDir = Deno.makeTempDirSync(); const oldname = path.join(testDir, "oldname"); diff --git a/tests/unit_node/_fs/_fs_realpath_test.ts b/tests/unit_node/_fs/_fs_realpath_test.ts index 1fabfe779..b0285cf54 100644 --- a/tests/unit_node/_fs/_fs_realpath_test.ts +++ b/tests/unit_node/_fs/_fs_realpath_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import * as path from "@std/path/mod.ts"; -import { assertEquals } from "@std/assert/mod.ts"; +import * as path from "@std/path"; +import { assertEquals } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { realpath, realpathSync } from "node:fs"; diff --git a/tests/unit_node/_fs/_fs_rename_test.ts b/tests/unit_node/_fs/_fs_rename_test.ts index d8392b9e7..76d2e1314 100644 --- a/tests/unit_node/_fs/_fs_rename_test.ts +++ b/tests/unit_node/_fs/_fs_rename_test.ts @@ -1,9 +1,9 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, fail } from "@std/assert/mod.ts"; +import { assertEquals, fail } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { rename, renameSync } from "node:fs"; import { existsSync } from "node:fs"; -import { join, parse } from "@std/path/mod.ts"; +import { join, parse } from "@std/path"; Deno.test({ name: "ASYNC: renaming a file", diff --git a/tests/unit_node/_fs/_fs_rm_test.ts b/tests/unit_node/_fs/_fs_rm_test.ts index 64aa378b6..6ded2e564 100644 --- a/tests/unit_node/_fs/_fs_rm_test.ts +++ b/tests/unit_node/_fs/_fs_rm_test.ts @@ -1,13 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { - assertEquals, - assertRejects, - assertThrows, - fail, -} from "@std/assert/mod.ts"; +import { assertEquals, assertRejects, assertThrows, fail } from "@std/assert"; import { rm, rmSync } from "node:fs"; import { existsSync } from "node:fs"; -import { join } from "@std/path/mod.ts"; +import { join } from "@std/path"; Deno.test({ name: "ASYNC: removing empty folder", diff --git a/tests/unit_node/_fs/_fs_rmdir_test.ts b/tests/unit_node/_fs/_fs_rmdir_test.ts index 1045882c7..db0c692a4 100644 --- a/tests/unit_node/_fs/_fs_rmdir_test.ts +++ b/tests/unit_node/_fs/_fs_rmdir_test.ts @@ -1,8 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, fail } from "@std/assert/mod.ts"; +import { assertEquals, fail } from "@std/assert"; import { rmdir, rmdirSync } from "node:fs"; import { existsSync } from "node:fs"; -import { join } from "@std/path/mod.ts"; +import { join } from "@std/path"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; Deno.test({ diff --git a/tests/unit_node/_fs/_fs_stat_test.ts b/tests/unit_node/_fs/_fs_stat_test.ts index 2f9ab5214..09d78f9db 100644 --- a/tests/unit_node/_fs/_fs_stat_test.ts +++ b/tests/unit_node/_fs/_fs_stat_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { BigIntStats, stat, Stats, statSync } from "node:fs"; -import { assertEquals, fail } from "@std/assert/mod.ts"; +import { assertEquals, fail } from "@std/assert"; export function assertStats(actual: Stats, expected: Deno.FileInfo) { assertEquals(actual.dev, expected.dev); diff --git a/tests/unit_node/_fs/_fs_statfs_test.ts b/tests/unit_node/_fs/_fs_statfs_test.ts index fde1c8fed..fc85bcf17 100644 --- a/tests/unit_node/_fs/_fs_statfs_test.ts +++ b/tests/unit_node/_fs/_fs_statfs_test.ts @@ -1,8 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import * as fs from "node:fs"; -import { assertEquals, assertRejects } from "@std/assert/mod.ts"; -import * as path from "@std/path/mod.ts"; +import { assertEquals, assertRejects } from "@std/assert"; +import * as path from "@std/path"; function assertStatFs( statFs: fs.StatsFsBase<unknown>, diff --git a/tests/unit_node/_fs/_fs_symlink_test.ts b/tests/unit_node/_fs/_fs_symlink_test.ts index 98cf51460..dfd6adb51 100644 --- a/tests/unit_node/_fs/_fs_symlink_test.ts +++ b/tests/unit_node/_fs/_fs_symlink_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertThrows, fail } from "@std/assert/mod.ts"; +import { assert, assertThrows, fail } from "@std/assert"; import { symlink, symlinkSync } from "node:fs"; Deno.test({ diff --git a/tests/unit_node/_fs/_fs_truncate_test.ts b/tests/unit_node/_fs/_fs_truncate_test.ts index 9fb8a8bf2..67bd021e4 100644 --- a/tests/unit_node/_fs/_fs_truncate_test.ts +++ b/tests/unit_node/_fs/_fs_truncate_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; +import { assertEquals, assertThrows, fail } from "@std/assert"; import { truncate, truncateSync } from "node:fs"; Deno.test({ diff --git a/tests/unit_node/_fs/_fs_unlink_test.ts b/tests/unit_node/_fs/_fs_unlink_test.ts index 7377f5c87..f96217f8e 100644 --- a/tests/unit_node/_fs/_fs_unlink_test.ts +++ b/tests/unit_node/_fs/_fs_unlink_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, fail } from "@std/assert/mod.ts"; +import { assertEquals, fail } from "@std/assert"; import { existsSync } from "node:fs"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { unlink, unlinkSync } from "node:fs"; diff --git a/tests/unit_node/_fs/_fs_utimes_test.ts b/tests/unit_node/_fs/_fs_utimes_test.ts index 4b805c923..717d511c0 100644 --- a/tests/unit_node/_fs/_fs_utimes_test.ts +++ b/tests/unit_node/_fs/_fs_utimes_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, assertThrows, fail } from "@std/assert/mod.ts"; +import { assertEquals, assertThrows, fail } from "@std/assert"; import { utimes, utimesSync } from "node:fs"; const randomDate = new Date(Date.now() + 1000); diff --git a/tests/unit_node/_fs/_fs_watch_test.ts b/tests/unit_node/_fs/_fs_watch_test.ts index 8e2fb619c..c6082d77f 100644 --- a/tests/unit_node/_fs/_fs_watch_test.ts +++ b/tests/unit_node/_fs/_fs_watch_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { unwatchFile, watch, watchFile } from "node:fs"; -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; function wait(time: number) { return new Promise((resolve) => { diff --git a/tests/unit_node/_fs/_fs_writeFile_test.ts b/tests/unit_node/_fs/_fs_writeFile_test.ts index 2310dac68..53af660cf 100644 --- a/tests/unit_node/_fs/_fs_writeFile_test.ts +++ b/tests/unit_node/_fs/_fs_writeFile_test.ts @@ -5,9 +5,9 @@ import { assertNotEquals, assertRejects, assertThrows, -} from "@std/assert/mod.ts"; +} from "@std/assert"; import { writeFile, writeFileSync } from "node:fs"; -import * as path from "@std/path/mod.ts"; +import * as path from "@std/path"; type TextEncodings = | "ascii" diff --git a/tests/unit_node/_fs/_fs_write_test.ts b/tests/unit_node/_fs/_fs_write_test.ts index 148bc40e7..ab82d4f5b 100644 --- a/tests/unit_node/_fs/_fs_write_test.ts +++ b/tests/unit_node/_fs/_fs_write_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { write, writeSync } from "node:fs"; -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; import { Buffer } from "node:buffer"; const decoder = new TextDecoder("utf-8"); diff --git a/tests/unit_node/_test_utils.ts b/tests/unit_node/_test_utils.ts index 0aa2c8521..d9dd4e5d5 100644 --- a/tests/unit_node/_test_utils.ts +++ b/tests/unit_node/_test_utils.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertStringIncludes } from "@std/assert/mod.ts"; +import { assert, assertStringIncludes } from "@std/assert"; /** Asserts that an error thrown in a callback will not be wrongly caught. */ export async function assertCallbackErrorUncaught( diff --git a/tests/unit_node/assertion_error_test.ts b/tests/unit_node/assertion_error_test.ts index 6cce7a4ac..4f8fe70ba 100644 --- a/tests/unit_node/assertion_error_test.ts +++ b/tests/unit_node/assertion_error_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { stripColor } from "@std/fmt/colors.ts"; -import { assert, assertStrictEquals } from "@std/assert/mod.ts"; +import { stripAnsiCode } from "@std/fmt/colors"; +import { assert, assertStrictEquals } from "@std/assert"; import { AssertionError } from "node:assert"; Deno.test({ @@ -31,7 +31,7 @@ Deno.test({ { actual: 1, expected: 2, operator: "equal" }, ); assertStrictEquals(err.name, "AssertionError"); - assertStrictEquals(stripColor(err.message), "1 equal 2"); + assertStrictEquals(stripAnsiCode(err.message), "1 equal 2"); assertStrictEquals(err.generatedMessage, true); assertStrictEquals(err.code, "ERR_ASSERTION"); assertStrictEquals(err.actual, 1); @@ -51,7 +51,7 @@ Deno.test({ stackStartFn, }); assertStrictEquals(err.name, "AssertionError"); - assertStrictEquals(stripColor(err.message), `'deno' match /node/`); + assertStrictEquals(stripAnsiCode(err.message), `'deno' match /node/`); assertStrictEquals(err.generatedMessage, true); assertStrictEquals(err.code, "ERR_ASSERTION"); assertStrictEquals(err.actual, "deno"); diff --git a/tests/unit_node/async_hooks_test.ts b/tests/unit_node/async_hooks_test.ts index 46d7dd785..f153f6753 100644 --- a/tests/unit_node/async_hooks_test.ts +++ b/tests/unit_node/async_hooks_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { AsyncLocalStorage, AsyncResource } from "node:async_hooks"; -import { assert, assertEquals } from "@std/assert/mod.ts"; +import { assert, assertEquals } from "@std/assert"; Deno.test(async function foo() { const asyncLocalStorage = new AsyncLocalStorage(); diff --git a/tests/unit_node/buffer_test.ts b/tests/unit_node/buffer_test.ts index 07f5dd2c1..bd7f6edb1 100644 --- a/tests/unit_node/buffer_test.ts +++ b/tests/unit_node/buffer_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { Buffer } from "node:buffer"; -import { assertEquals, assertThrows } from "@std/assert/mod.ts"; +import { assertEquals, assertThrows } from "@std/assert"; Deno.test({ name: "[node/buffer] alloc fails if size is not a number", diff --git a/tests/unit_node/child_process_test.ts b/tests/unit_node/child_process_test.ts index 23de928db..cfac0b5a9 100644 --- a/tests/unit_node/child_process_test.ts +++ b/tests/unit_node/child_process_test.ts @@ -9,8 +9,8 @@ import { assertNotStrictEquals, assertStrictEquals, assertStringIncludes, -} from "@std/assert/mod.ts"; -import * as path from "@std/path/mod.ts"; +} from "@std/assert"; +import * as path from "@std/path"; const { spawn, spawnSync, execFile, execFileSync, ChildProcess } = CP; diff --git a/tests/unit_node/console_test.ts b/tests/unit_node/console_test.ts index f79dcc436..25d4a78e5 100644 --- a/tests/unit_node/console_test.ts +++ b/tests/unit_node/console_test.ts @@ -1,18 +1,18 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import vm from "node:vm"; -import { stripColor } from "@std/fmt/colors.ts"; -import { assertStringIncludes } from "@std/assert/mod.ts"; +import { stripAnsiCode } from "@std/fmt/colors"; +import { assertStringIncludes } from "@std/assert"; Deno.test(function inspectCrossRealmObjects() { assertStringIncludes( - stripColor( + stripAnsiCode( Deno.inspect(vm.runInNewContext(`new Error("This is an error")`)), ), "Error: This is an error", ); assertStringIncludes( - stripColor( + stripAnsiCode( Deno.inspect( vm.runInNewContext(`new AggregateError([], "This is an error")`), ), @@ -20,7 +20,7 @@ Deno.test(function inspectCrossRealmObjects() { "AggregateError: This is an error", ); assertStringIncludes( - stripColor( + stripAnsiCode( Deno.inspect(vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`)), ), "2018-12-10T02:26:59.002Z", diff --git a/tests/unit_node/crypto/crypto_cipher_gcm_test.ts b/tests/unit_node/crypto/crypto_cipher_gcm_test.ts index f25c81036..e87ae23f0 100644 --- a/tests/unit_node/crypto/crypto_cipher_gcm_test.ts +++ b/tests/unit_node/crypto/crypto_cipher_gcm_test.ts @@ -4,7 +4,7 @@ import crypto from "node:crypto"; import { Buffer } from "node:buffer"; import testVectors128 from "./gcmEncryptExtIV128.json" with { type: "json" }; import testVectors256 from "./gcmEncryptExtIV256.json" with { type: "json" }; -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; const aesGcm = (bits: string, key: Uint8Array) => { const ALGO = bits == "128" ? `aes-128-gcm` : `aes-256-gcm`; diff --git a/tests/unit_node/crypto/crypto_cipher_test.ts b/tests/unit_node/crypto/crypto_cipher_test.ts index ab8bb4d37..91227cf00 100644 --- a/tests/unit_node/crypto/crypto_cipher_test.ts +++ b/tests/unit_node/crypto/crypto_cipher_test.ts @@ -3,7 +3,7 @@ import crypto from "node:crypto"; import { Buffer } from "node:buffer"; import { Readable } from "node:stream"; import { buffer, text } from "node:stream/consumers"; -import { assertEquals, assertThrows } from "@std/assert/mod.ts"; +import { assertEquals, assertThrows } from "@std/assert"; const rsaPrivateKey = Deno.readTextFileSync( new URL("../testdata/rsa_private.pem", import.meta.url), diff --git a/tests/unit_node/crypto/crypto_hash_test.ts b/tests/unit_node/crypto/crypto_hash_test.ts index 96bc1d51b..0d4e30709 100644 --- a/tests/unit_node/crypto/crypto_hash_test.ts +++ b/tests/unit_node/crypto/crypto_hash_test.ts @@ -2,7 +2,7 @@ import { createHash, createHmac, getHashes } from "node:crypto"; import { Buffer } from "node:buffer"; import { Readable } from "node:stream"; -import { assert, assertEquals } from "@std/assert/mod.ts"; +import { assert, assertEquals } from "@std/assert"; // https://github.com/denoland/deno/issues/18140 Deno.test({ diff --git a/tests/unit_node/crypto/crypto_hkdf_test.ts b/tests/unit_node/crypto/crypto_hkdf_test.ts index be5d99086..34102fd03 100644 --- a/tests/unit_node/crypto/crypto_hkdf_test.ts +++ b/tests/unit_node/crypto/crypto_hkdf_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { hkdfSync } from "node:crypto"; -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; import { Buffer } from "node:buffer"; import nodeFixtures from "../testdata/crypto_digest_fixtures.json" with { type: "json", diff --git a/tests/unit_node/crypto/crypto_key_test.ts b/tests/unit_node/crypto/crypto_key_test.ts index d3a43b3b8..6365119e2 100644 --- a/tests/unit_node/crypto/crypto_key_test.ts +++ b/tests/unit_node/crypto/crypto_key_test.ts @@ -15,7 +15,7 @@ import { } from "node:crypto"; import { promisify } from "node:util"; import { Buffer } from "node:buffer"; -import { assert, assertEquals, assertThrows } from "@std/assert/mod.ts"; +import { assert, assertEquals, assertThrows } from "@std/assert"; const RUN_SLOW_TESTS = Deno.env.get("SLOW_TESTS") === "1"; diff --git a/tests/unit_node/crypto/crypto_pbkdf2_test.ts b/tests/unit_node/crypto/crypto_pbkdf2_test.ts index 8ace870cb..c937eb0c4 100644 --- a/tests/unit_node/crypto/crypto_pbkdf2_test.ts +++ b/tests/unit_node/crypto/crypto_pbkdf2_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { pbkdf2, pbkdf2Sync } from "node:crypto"; -import { assert, assertEquals } from "@std/assert/mod.ts"; +import { assert, assertEquals } from "@std/assert"; import nodeFixtures from "../testdata/crypto_digest_fixtures.json" with { type: "json", }; diff --git a/tests/unit_node/crypto/crypto_scrypt_test.ts b/tests/unit_node/crypto/crypto_scrypt_test.ts index c128abb92..03c08909e 100644 --- a/tests/unit_node/crypto/crypto_scrypt_test.ts +++ b/tests/unit_node/crypto/crypto_scrypt_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { scrypt, scryptSync } from "node:crypto"; import { Buffer } from "node:buffer"; -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; Deno.test("scrypt works correctly", async () => { const { promise, resolve } = Promise.withResolvers<boolean>(); diff --git a/tests/unit_node/crypto/crypto_sign_test.ts b/tests/unit_node/crypto/crypto_sign_test.ts index 77c5caf75..557eea08e 100644 --- a/tests/unit_node/crypto/crypto_sign_test.ts +++ b/tests/unit_node/crypto/crypto_sign_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertEquals } from "@std/testing/asserts.ts"; +import { assert, assertEquals } from "@std/assert"; import { createSign, createVerify, sign, verify } from "node:crypto"; import { Buffer } from "node:buffer"; import fixtures from "../testdata/crypto_digest_fixtures.json" with { diff --git a/tests/unit_node/dgram_test.ts b/tests/unit_node/dgram_test.ts index 10c8e5253..2ccdfbfb7 100644 --- a/tests/unit_node/dgram_test.ts +++ b/tests/unit_node/dgram_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; import { execCode } from "../unit/test_util.ts"; import { createSocket } from "node:dgram"; diff --git a/tests/unit_node/domain_test.ts b/tests/unit_node/domain_test.ts index 88c2b4b47..ddc56efae 100644 --- a/tests/unit_node/domain_test.ts +++ b/tests/unit_node/domain_test.ts @@ -4,7 +4,7 @@ import domain from "node:domain"; import { EventEmitter } from "node:events"; -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; Deno.test("should work on throws", async function () { const deferred = Promise.withResolvers<void>(); diff --git a/tests/unit_node/fs_test.ts b/tests/unit_node/fs_test.ts index 1b121c71f..c94a2447e 100644 --- a/tests/unit_node/fs_test.ts +++ b/tests/unit_node/fs_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertEquals, assertThrows } from "@std/assert/mod.ts"; +import { assert, assertEquals, assertThrows } from "@std/assert"; import { join } from "node:path"; import { tmpdir } from "node:os"; import { diff --git a/tests/unit_node/http2_test.ts b/tests/unit_node/http2_test.ts index 968ef15a0..67c2497d5 100644 --- a/tests/unit_node/http2_test.ts +++ b/tests/unit_node/http2_test.ts @@ -5,7 +5,7 @@ import { Buffer } from "node:buffer"; import { readFile } from "node:fs/promises"; import { join } from "node:path"; import * as net from "node:net"; -import { assert, assertEquals } from "@std/assert/mod.ts"; +import { assert, assertEquals } from "@std/assert"; import { curlRequest } from "../unit/test_util.ts"; for (const url of ["http://127.0.0.1:4246", "https://127.0.0.1:4247"]) { diff --git a/tests/unit_node/http_test.ts b/tests/unit_node/http_test.ts index 3831cac06..c9a1ec3ea 100644 --- a/tests/unit_node/http_test.ts +++ b/tests/unit_node/http_test.ts @@ -7,9 +7,9 @@ import https from "node:https"; import net from "node:net"; import fs from "node:fs"; -import { assert, assertEquals, fail } from "@std/assert/mod.ts"; -import { assertSpyCalls, spy } from "@std/testing/mock.ts"; -import { fromFileUrl, relative } from "@std/path/mod.ts"; +import { assert, assertEquals, fail } from "@std/assert"; +import { assertSpyCalls, spy } from "@std/testing/mock"; +import { fromFileUrl, relative } from "@std/path"; import { gzip } from "node:zlib"; import { Buffer } from "node:buffer"; diff --git a/tests/unit_node/internal/_randomBytes_test.ts b/tests/unit_node/internal/_randomBytes_test.ts index 4d6f5c39a..ff3acf5e3 100644 --- a/tests/unit_node/internal/_randomBytes_test.ts +++ b/tests/unit_node/internal/_randomBytes_test.ts @@ -1,10 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { - assert, - assertEquals, - assertRejects, - assertThrows, -} from "@std/assert/mod.ts"; +import { assert, assertEquals, assertRejects, assertThrows } from "@std/assert"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { pseudoRandomBytes, randomBytes } from "node:crypto"; diff --git a/tests/unit_node/internal/_randomFill_test.ts b/tests/unit_node/internal/_randomFill_test.ts index 438e6e42d..7b590666c 100644 --- a/tests/unit_node/internal/_randomFill_test.ts +++ b/tests/unit_node/internal/_randomFill_test.ts @@ -1,11 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { Buffer } from "node:buffer"; import { randomFill, randomFillSync } from "node:crypto"; -import { - assertEquals, - assertNotEquals, - assertThrows, -} from "@std/assert/mod.ts"; +import { assertEquals, assertNotEquals, assertThrows } from "@std/assert"; const validateNonZero = (buf: Buffer) => { if (!buf.some((ch) => ch > 0)) throw new Error("Error"); diff --git a/tests/unit_node/internal/_randomInt_test.ts b/tests/unit_node/internal/_randomInt_test.ts index 1d2610268..b0d9d771e 100644 --- a/tests/unit_node/internal/_randomInt_test.ts +++ b/tests/unit_node/internal/_randomInt_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { randomInt } from "node:crypto"; -import { assert, assertThrows } from "@std/assert/mod.ts"; +import { assert, assertThrows } from "@std/assert"; const between = (x: number, min: number, max: number) => x >= min && x < max; diff --git a/tests/unit_node/module_test.ts b/tests/unit_node/module_test.ts index c17aabc72..25249101a 100644 --- a/tests/unit_node/module_test.ts +++ b/tests/unit_node/module_test.ts @@ -7,7 +7,7 @@ import { isBuiltin, Module, } from "node:module"; -import { assert, assertEquals } from "@std/assert/mod.ts"; +import { assert, assertEquals } from "@std/assert"; import process from "node:process"; import * as path from "node:path"; diff --git a/tests/unit_node/net_test.ts b/tests/unit_node/net_test.ts index ebbc749b5..521de1e73 100644 --- a/tests/unit_node/net_test.ts +++ b/tests/unit_node/net_test.ts @@ -1,8 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import * as net from "node:net"; -import { assert, assertEquals } from "@std/assert/mod.ts"; -import * as path from "@std/path/mod.ts"; +import { assert, assertEquals } from "@std/assert"; +import * as path from "@std/path"; import * as http from "node:http"; Deno.test("[node/net] close event emits after error event - when host is not found", async () => { diff --git a/tests/unit_node/os_test.ts b/tests/unit_node/os_test.ts index 810c22518..a75b66807 100644 --- a/tests/unit_node/os_test.ts +++ b/tests/unit_node/os_test.ts @@ -7,7 +7,7 @@ import { assertEquals, assertNotEquals, assertThrows, -} from "@std/assert/mod.ts"; +} from "@std/assert"; Deno.test({ name: "build architecture is a string", diff --git a/tests/unit_node/path_test.ts b/tests/unit_node/path_test.ts index 0313c60ed..bd0711334 100644 --- a/tests/unit_node/path_test.ts +++ b/tests/unit_node/path_test.ts @@ -4,7 +4,7 @@ import path from "node:path"; import posix from "node:path/posix"; import win32 from "node:path/win32"; -import { assertStrictEquals } from "@std/assert/mod.ts"; +import { assertStrictEquals } from "@std/assert"; Deno.test("[node/path] posix and win32 objects", () => { assertStrictEquals(path.posix, posix); diff --git a/tests/unit_node/perf_hooks_test.ts b/tests/unit_node/perf_hooks_test.ts index 1b066a42b..d5b900041 100644 --- a/tests/unit_node/perf_hooks_test.ts +++ b/tests/unit_node/perf_hooks_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import * as perfHooks from "node:perf_hooks"; import { performance, PerformanceObserver } from "node:perf_hooks"; -import { assertEquals, assertThrows } from "@std/assert/mod.ts"; +import { assertEquals, assertThrows } from "@std/assert"; Deno.test({ name: "[perf_hooks] performance", diff --git a/tests/unit_node/process_test.ts b/tests/unit_node/process_test.ts index e15d37744..cc9e4dbd4 100644 --- a/tests/unit_node/process_test.ts +++ b/tests/unit_node/process_test.ts @@ -21,10 +21,10 @@ import { assertStrictEquals, assertThrows, fail, -} from "@std/assert/mod.ts"; -import { stripColor } from "@std/fmt/colors.ts"; -import * as path from "@std/path/mod.ts"; -import { delay } from "@std/async/delay.ts"; +} from "@std/assert"; +import { stripAnsiCode } from "@std/fmt/colors"; +import * as path from "@std/path"; +import { delay } from "@std/async/delay"; const testDir = new URL(".", import.meta.url); @@ -178,7 +178,7 @@ Deno.test({ const { stdout } = await command.output(); const decoder = new TextDecoder(); - assertEquals(stripColor(decoder.decode(stdout).trim()), "1\n2"); + assertEquals(stripAnsiCode(decoder.decode(stdout).trim()), "1\n2"); }, }); @@ -897,7 +897,7 @@ Deno.test({ const { stdout } = await command.output(); const decoder = new TextDecoder(); - assertEquals(stripColor(decoder.decode(stdout).trim()), "exit"); + assertEquals(stripAnsiCode(decoder.decode(stdout).trim()), "exit"); }, }); @@ -916,7 +916,7 @@ Deno.test({ const { stdout } = await command.output(); const decoder = new TextDecoder(); - assertEquals(stripColor(decoder.decode(stdout).trim()), "really exited"); + assertEquals(stripAnsiCode(decoder.decode(stdout).trim()), "really exited"); }, }); diff --git a/tests/unit_node/punycode_test.ts b/tests/unit_node/punycode_test.ts index baf1b57f6..fffa26164 100644 --- a/tests/unit_node/punycode_test.ts +++ b/tests/unit_node/punycode_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import * as punycode from "node:punycode"; -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; Deno.test("regression #19214", () => { const input = "δΈͺ\uFFFD\uFFFD.hk"; diff --git a/tests/unit_node/querystring_test.ts b/tests/unit_node/querystring_test.ts index 7a97b3b9a..09672df37 100644 --- a/tests/unit_node/querystring_test.ts +++ b/tests/unit_node/querystring_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; import { parse, stringify } from "node:querystring"; Deno.test({ diff --git a/tests/unit_node/readline_test.ts b/tests/unit_node/readline_test.ts index b9a732548..68f0cd7c9 100644 --- a/tests/unit_node/readline_test.ts +++ b/tests/unit_node/readline_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import { createInterface, Interface } from "node:readline"; -import { assertInstanceOf } from "@std/assert/mod.ts"; +import { assertInstanceOf } from "@std/assert"; import { Readable, Writable } from "node:stream"; Deno.test("[node/readline] createInstance", () => { diff --git a/tests/unit_node/repl_test.ts b/tests/unit_node/repl_test.ts index 16c9c23f2..693fdcc9e 100644 --- a/tests/unit_node/repl_test.ts +++ b/tests/unit_node/repl_test.ts @@ -2,7 +2,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. import repl from "node:repl"; -import { assert } from "@std/assert/mod.ts"; +import { assert } from "@std/assert"; Deno.test({ name: "repl module exports", diff --git a/tests/unit_node/stream_test.ts b/tests/unit_node/stream_test.ts index 08f3831e5..a54f8b421 100644 --- a/tests/unit_node/stream_test.ts +++ b/tests/unit_node/stream_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert } from "@std/assert/mod.ts"; -import { fromFileUrl, relative } from "@std/path/mod.ts"; +import { assert } from "@std/assert"; +import { fromFileUrl, relative } from "@std/path"; import { pipeline } from "node:stream/promises"; import { createReadStream, createWriteStream } from "node:fs"; diff --git a/tests/unit_node/string_decoder_test.ts b/tests/unit_node/string_decoder_test.ts index 479ee01c0..34fbdd881 100644 --- a/tests/unit_node/string_decoder_test.ts +++ b/tests/unit_node/string_decoder_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; import { Buffer } from "node:buffer"; import { StringDecoder } from "node:string_decoder"; diff --git a/tests/unit_node/timers_test.ts b/tests/unit_node/timers_test.ts index 5a7668be7..90c6fb150 100644 --- a/tests/unit_node/timers_test.ts +++ b/tests/unit_node/timers_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, fail } from "@std/assert/mod.ts"; +import { assert, fail } from "@std/assert"; import * as timers from "node:timers"; import * as timersPromises from "node:timers/promises"; diff --git a/tests/unit_node/tls_test.ts b/tests/unit_node/tls_test.ts index a9dc10c20..6033efa31 100644 --- a/tests/unit_node/tls_test.ts +++ b/tests/unit_node/tls_test.ts @@ -1,8 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, assertInstanceOf } from "@std/assert/mod.ts"; -import { delay } from "@std/async/delay.ts"; -import { fromFileUrl, join } from "@std/path/mod.ts"; +import { assertEquals, assertInstanceOf } from "@std/assert"; +import { delay } from "@std/async/delay"; +import { fromFileUrl, join } from "@std/path"; import * as tls from "node:tls"; import * as net from "node:net"; import * as stream from "node:stream"; diff --git a/tests/unit_node/tty_test.ts b/tests/unit_node/tty_test.ts index cde05b9ff..ab3193f4a 100644 --- a/tests/unit_node/tty_test.ts +++ b/tests/unit_node/tty_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. // deno-lint-ignore-file no-explicit-any -import { assert } from "@std/assert/mod.ts"; +import { assert } from "@std/assert"; import { isatty } from "node:tty"; import tty from "node:tty"; import process from "node:process"; diff --git a/tests/unit_node/util_test.ts b/tests/unit_node/util_test.ts index 85fa72741..f245a647a 100644 --- a/tests/unit_node/util_test.ts +++ b/tests/unit_node/util_test.ts @@ -5,8 +5,8 @@ import { assertEquals, assertStrictEquals, assertThrows, -} from "@std/assert/mod.ts"; -import { stripColor } from "@std/fmt/colors.ts"; +} from "@std/assert"; +import { stripAnsiCode } from "@std/fmt/colors"; import * as util from "node:util"; import { Buffer } from "node:buffer"; @@ -27,14 +27,14 @@ Deno.test({ Deno.test({ name: "[util] inspect", fn() { - assertEquals(stripColor(util.inspect({ foo: 123 })), "{ foo: 123 }"); - assertEquals(stripColor(util.inspect("foo")), "'foo'"); + assertEquals(stripAnsiCode(util.inspect({ foo: 123 })), "{ foo: 123 }"); + assertEquals(stripAnsiCode(util.inspect("foo")), "'foo'"); assertEquals( - stripColor(util.inspect("Deno's logo is so cute.")), + stripAnsiCode(util.inspect("Deno's logo is so cute.")), `"Deno's logo is so cute."`, ); assertEquals( - stripColor(util.inspect([1, 2, 3, 4, 5, 6, 7])), + stripAnsiCode(util.inspect([1, 2, 3, 4, 5, 6, 7])), `[ 1, 2, 3, 4, 5, 6, 7 diff --git a/tests/unit_node/v8_test.ts b/tests/unit_node/v8_test.ts index b91d595db..f7208fb0e 100644 --- a/tests/unit_node/v8_test.ts +++ b/tests/unit_node/v8_test.ts @@ -6,7 +6,7 @@ import { serialize, setFlagsFromString, } from "node:v8"; -import { assertEquals } from "@std/assert/mod.ts"; +import { assertEquals } from "@std/assert"; // https://github.com/nodejs/node/blob/a2bbe5ff216bc28f8dac1c36a8750025a93c3827/test/parallel/test-v8-version-tag.js#L6 Deno.test({ diff --git a/tests/unit_node/vm_test.ts b/tests/unit_node/vm_test.ts index 46e231c6c..4c370931d 100644 --- a/tests/unit_node/vm_test.ts +++ b/tests/unit_node/vm_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assertEquals, assertThrows } from "@std/assert/mod.ts"; +import { assertEquals, assertThrows } from "@std/assert"; import { createContext, isContext, diff --git a/tests/unit_node/worker_threads_test.ts b/tests/unit_node/worker_threads_test.ts index 9991e5787..d9fe9f77d 100644 --- a/tests/unit_node/worker_threads_test.ts +++ b/tests/unit_node/worker_threads_test.ts @@ -6,8 +6,8 @@ import { assertObjectMatch, assertThrows, fail, -} from "@std/assert/mod.ts"; -import { fromFileUrl, relative, SEPARATOR } from "@std/path/mod.ts"; +} from "@std/assert"; +import { fromFileUrl, relative, SEPARATOR } from "@std/path"; import * as workerThreads from "node:worker_threads"; import { EventEmitter, once } from "node:events"; import process from "node:process"; diff --git a/tests/unit_node/zlib_test.ts b/tests/unit_node/zlib_test.ts index c7e9bbca9..215717dde 100644 --- a/tests/unit_node/zlib_test.ts +++ b/tests/unit_node/zlib_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. -import { assert, assertEquals } from "@std/assert/mod.ts"; -import { fromFileUrl, relative } from "@std/path/mod.ts"; +import { assert, assertEquals } from "@std/assert"; +import { fromFileUrl, relative } from "@std/path"; import { brotliCompress, brotliCompressSync, diff --git a/tests/util/std b/tests/util/std -Subproject 7d419485c74bcdc4a03857dd4d427d4442b058f +Subproject 3ee4c4dd43ad3a38d1b09aa981332fae1e593ab diff --git a/tests/wpt/runner/utils.ts b/tests/wpt/runner/utils.ts index 988e06c09..1674419cd 100644 --- a/tests/wpt/runner/utils.ts +++ b/tests/wpt/runner/utils.ts @@ -1,7 +1,7 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. /// FLAGS -import { parse } from "@std/flags/mod.ts"; +import { parseArgs } from "@std/cli/parse-args"; import { join, resolve, ROOT_PATH } from "../../../tools/util.js"; export const { @@ -15,7 +15,7 @@ export const { ["inspect-brk"]: inspectBrk, ["no-ignore"]: noIgnore, binary, -} = parse(Deno.args, { +} = parseArgs(Deno.args, { "--": true, boolean: ["quiet", "release", "no-interactive", "inspect-brk", "no-ignore"], string: ["json", "wptreport", "binary"], diff --git a/tests/wpt/wpt.ts b/tests/wpt/wpt.ts index fe226d5bc..8879de133 100755 --- a/tests/wpt/wpt.ts +++ b/tests/wpt/wpt.ts @@ -32,9 +32,9 @@ import { updateManifest, wptreport, } from "./runner/utils.ts"; -import { pooledMap } from "@std/async/pool.ts"; -import { blue, bold, green, red, yellow } from "@std/fmt/colors.ts"; -import { writeAll, writeAllSync } from "@std/io/write_all.ts"; +import { pooledMap } from "@std/async/pool"; +import { blue, bold, green, red, yellow } from "@std/fmt/colors"; +import { writeAll, writeAllSync } from "@std/io/write-all"; import { saveExpectation } from "./runner/utils.ts"; class TestFilter { |