From 3ef94c5473ac77366d009c7a7c665f695670f886 Mon Sep 17 00:00:00 2001 From: Chris Knight Date: Sun, 7 Jun 2020 14:20:33 +0100 Subject: refactor(std): remove testing dependencies from non-test code (#5838) --- std/fs/copy.ts | 2 +- std/fs/expand_glob.ts | 2 +- std/fs/walk.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'std/fs') diff --git a/std/fs/copy.ts b/std/fs/copy.ts index d45ac17c9..269340e85 100644 --- a/std/fs/copy.ts +++ b/std/fs/copy.ts @@ -2,7 +2,7 @@ import * as path from "../path/mod.ts"; import { ensureDir, ensureDirSync } from "./ensure_dir.ts"; import { isSubdir, getFileInfoType } from "./_util.ts"; -import { assert } from "../testing/asserts.ts"; +import { assert } from "../_util/assert.ts"; const isWindows = Deno.build.os === "windows"; diff --git a/std/fs/expand_glob.ts b/std/fs/expand_glob.ts index e5abdabcf..4b7b11885 100644 --- a/std/fs/expand_glob.ts +++ b/std/fs/expand_glob.ts @@ -14,7 +14,7 @@ import { walk, walkSync, } from "./walk.ts"; -import { assert } from "../testing/asserts.ts"; +import { assert } from "../_util/assert.ts"; const { cwd } = Deno; type FileInfo = Deno.FileInfo; diff --git a/std/fs/walk.ts b/std/fs/walk.ts index ccd5097a4..553e52b2e 100644 --- a/std/fs/walk.ts +++ b/std/fs/walk.ts @@ -1,7 +1,7 @@ // Documentation and interface for walk were adapted from Go // https://golang.org/pkg/path/filepath/#Walk // Copyright 2009 The Go Authors. All rights reserved. BSD license. -import { unimplemented, assert } from "../testing/asserts.ts"; +import { assert } from "../_util/assert.ts"; import { basename, join, normalize } from "../path/mod.ts"; const { readDir, readDirSync, stat, statSync } = Deno; @@ -107,7 +107,7 @@ export async function* walk( if (entry.isSymlink) { if (followSymlinks) { // TODO(ry) Re-enable followSymlinks. - unimplemented(); + throw new Error("unimplemented"); } else { continue; } @@ -159,7 +159,7 @@ export function* walkSync( for (const entry of readDirSync(root)) { if (entry.isSymlink) { if (followSymlinks) { - unimplemented(); + throw new Error("unimplemented"); } else { continue; } -- cgit v1.2.3