mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 21:50:00 -05:00
test(ext/node): clean up node:path test cases (#19610)
This commit is contained in:
parent
1ac5fddf54
commit
cd2525d4cf
4 changed files with 19 additions and 13 deletions
|
@ -68,6 +68,7 @@ util::unit_test_factory!(
|
|||
module_test,
|
||||
net_test,
|
||||
os_test,
|
||||
path_test,
|
||||
perf_hooks_test,
|
||||
process_test,
|
||||
querystring_test,
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
|
|
16
cli/tests/unit_node/path_test.ts
Normal file
16
cli/tests/unit_node/path_test.ts
Normal file
|
@ -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);
|
||||
});
|
Loading…
Add table
Reference in a new issue