summaryrefslogtreecommitdiff
path: root/cli/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests')
-rw-r--r--cli/tests/integration/node_unit_tests.rs1
-rw-r--r--cli/tests/node_compat/config.jsonc1
-rw-r--r--cli/tests/node_compat/test/parallel/test-path.js14
-rw-r--r--cli/tests/unit_node/path_test.ts16
4 files changed, 19 insertions, 13 deletions
diff --git a/cli/tests/integration/node_unit_tests.rs b/cli/tests/integration/node_unit_tests.rs
index 58183e971..ddfeb3d50 100644
--- a/cli/tests/integration/node_unit_tests.rs
+++ b/cli/tests/integration/node_unit_tests.rs
@@ -68,6 +68,7 @@ util::unit_test_factory!(
module_test,
net_test,
os_test,
+ path_test,
perf_hooks_test,
process_test,
querystring_test,
diff --git a/cli/tests/node_compat/config.jsonc b/cli/tests/node_compat/config.jsonc
index 823bb9704..576ff7305 100644
--- a/cli/tests/node_compat/config.jsonc
+++ b/cli/tests/node_compat/config.jsonc
@@ -84,7 +84,6 @@
"test-net-write-arguments.js",
"test-os.js",
"test-path-resolve.js",
- "test-path.js",
"test-querystring.js",
"test-readline-interface.js",
"test-stdin-from-file-spawn.js",
diff --git a/cli/tests/node_compat/test/parallel/test-path.js b/cli/tests/node_compat/test/parallel/test-path.js
index 657fdc951..b68f0c2d4 100644
--- a/cli/tests/node_compat/test/parallel/test-path.js
+++ b/cli/tests/node_compat/test/parallel/test-path.js
@@ -2,8 +2,8 @@
// deno-lint-ignore-file
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
-// Taken from Node 16.13.0
-// This file is automatically generated by "node/_tools/setup.ts". Do not modify this file manually
+// Taken from Node 18.12.1
+// This file is automatically generated by `tools/node_compat/setup.ts`. Do not modify this file manually.
// Copyright Joyent, Inc. and other Node contributors.
//
@@ -30,8 +30,6 @@
const common = require('../common');
const assert = require('assert');
const path = require('path');
-const posix = require('path/posix');
-const win32 = require('path/win32');
// Test thrown TypeErrors
const typeErrorTests = [true, false, 7, null, {}, undefined, [], NaN];
@@ -80,11 +78,3 @@ if (common.isWindows)
assert.strictEqual(path, path.win32);
else
assert.strictEqual(path, path.posix);
-
-// referential invariants
-assert.strictEqual(path.posix, posix);
-assert.strictEqual(path.win32, win32);
-assert.strictEqual(path.posix, path.posix.posix);
-assert.strictEqual(path.win32, path.posix.win32);
-assert.strictEqual(path.posix, path.win32.posix);
-assert.strictEqual(path.win32, path.win32.win32);
diff --git a/cli/tests/unit_node/path_test.ts b/cli/tests/unit_node/path_test.ts
new file mode 100644
index 000000000..48298afec
--- /dev/null
+++ b/cli/tests/unit_node/path_test.ts
@@ -0,0 +1,16 @@
+// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
+
+import path from "node:path";
+import posix from "node:path/posix";
+import win32 from "node:path/win32";
+
+import { assertStrictEquals } from "../../../test_util/std/testing/asserts.ts";
+
+Deno.test("[node/path] posix and win32 objects", () => {
+ assertStrictEquals(path.posix, posix);
+ assertStrictEquals(path.win32, win32);
+ assertStrictEquals(path.posix, path.posix.posix);
+ assertStrictEquals(path.win32, path.posix.win32);
+ assertStrictEquals(path.posix, path.win32.posix);
+ assertStrictEquals(path.win32, path.win32.win32);
+});