refactor: Don't destructure the Deno namespace (#6268)

This commit is contained in:
Nayeem Rahman 2020-06-12 20:23:38 +01:00 committed by GitHub
parent 26bf56afda
commit 1fff6f55c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 1632 additions and 1695 deletions

View file

@ -1,12 +1,10 @@
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// TODO(kt3k): fix any types in this file
const { test } = Deno;
import { assertEquals } from "../testing/asserts.ts";
import * as path from "./mod.ts";
// TODO(kt3k): fix any types in this file
const winPaths = [
// [path, root]
["C:\\path\\dir\\index.html", "C:\\"],
@ -116,20 +114,20 @@ function checkFormat(path: any, testCases: unknown[][]): void {
});
}
test("parseWin32", function () {
Deno.test("parseWin32", function () {
checkParseFormat(path.win32, winPaths);
checkSpecialCaseParseFormat(path.win32, winSpecialCaseParseTests);
});
test("parse", function () {
Deno.test("parse", function () {
checkParseFormat(path.posix, unixPaths);
});
test("formatWin32", function () {
Deno.test("formatWin32", function () {
checkFormat(path.win32, winSpecialCaseFormatTests);
});
test("format", function () {
Deno.test("format", function () {
checkFormat(path.posix, unixSpecialCaseFormatTests);
});
@ -165,7 +163,7 @@ const posixTrailingTests = [
],
];
test("parseTrailingWin32", function () {
Deno.test("parseTrailingWin32", function () {
windowsTrailingTests.forEach(function (p) {
const actual = path.win32.parse(p[0] as string);
const expected = p[1];
@ -173,7 +171,7 @@ test("parseTrailingWin32", function () {
});
});
test("parseTrailing", function () {
Deno.test("parseTrailing", function () {
posixTrailingTests.forEach(function (p) {
const actual = path.posix.parse(p[0] as string);
const expected = p[1];