diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-06-12 20:23:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-12 15:23:38 -0400 |
commit | 1fff6f55c3ba98a10018c6d374795e612061e9b6 (patch) | |
tree | 12074b6d44736b11513d857e437f9e30a6bf65a4 /std/path/glob_test.ts | |
parent | 26bf56afdaf16634ffbaa23684faf3a44cc10f62 (diff) |
refactor: Don't destructure the Deno namespace (#6268)
Diffstat (limited to 'std/path/glob_test.ts')
-rw-r--r-- | std/path/glob_test.ts | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/std/path/glob_test.ts b/std/path/glob_test.ts index 1ab3d9240..1c90e765a 100644 --- a/std/path/glob_test.ts +++ b/std/path/glob_test.ts @@ -1,10 +1,9 @@ -const { mkdir, test } = Deno; import { assert, assertEquals } from "../testing/asserts.ts"; import { testWalk, touch, walkArray } from "../fs/walk_test.ts"; import { globToRegExp, isGlob, joinGlobs, normalizeGlob } from "./glob.ts"; import { SEP, join } from "./mod.ts"; -test({ +Deno.test({ name: "glob: glob to regex", fn(): void { assertEquals(globToRegExp("unicorn.*") instanceof RegExp, true); @@ -47,8 +46,8 @@ test({ testWalk( async (d: string): Promise<void> => { - await mkdir(d + "/a"); - await mkdir(d + "/b"); + await Deno.mkdir(d + "/a"); + await Deno.mkdir(d + "/b"); await touch(d + "/a/x.ts"); await touch(d + "/b/z.ts"); await touch(d + "/b/z.js"); @@ -65,8 +64,8 @@ testWalk( testWalk( async (d: string): Promise<void> => { - await mkdir(d + "/a"); - await mkdir(d + "/a/yo"); + await Deno.mkdir(d + "/a"); + await Deno.mkdir(d + "/a/yo"); await touch(d + "/a/yo/x.ts"); }, async function globInWalkFolderWildcard(): Promise<void> { @@ -85,10 +84,10 @@ testWalk( testWalk( async (d: string): Promise<void> => { - await mkdir(d + "/a"); - await mkdir(d + "/a/unicorn"); - await mkdir(d + "/a/deno"); - await mkdir(d + "/a/raptor"); + await Deno.mkdir(d + "/a"); + await Deno.mkdir(d + "/a/unicorn"); + await Deno.mkdir(d + "/a/deno"); + await Deno.mkdir(d + "/a/raptor"); await touch(d + "/a/raptor/x.ts"); await touch(d + "/a/deno/x.ts"); await touch(d + "/a/unicorn/x.ts"); @@ -124,7 +123,7 @@ testWalk( } ); -test({ +Deno.test({ name: "isGlob: pattern to test", fn(): void { // should be true if valid glob pattern @@ -239,10 +238,10 @@ test({ }, }); -test("normalizeGlobGlobstar", function (): void { +Deno.test("normalizeGlobGlobstar", function (): void { assertEquals(normalizeGlob(`**${SEP}..`, { globstar: true }), `**${SEP}..`); }); -test("joinGlobsGlobstar", function (): void { +Deno.test("joinGlobsGlobstar", function (): void { assertEquals(joinGlobs(["**", ".."], { globstar: true }), `**${SEP}..`); }); |