summaryrefslogtreecommitdiff
path: root/cli/js/process_test.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-02-21 10:36:13 -0500
committerGitHub <noreply@github.com>2020-02-21 10:36:13 -0500
commitdd8a10948195f231a6a9eb652e3f208813904ad6 (patch)
treef9a4afeb67bbead882c29c2458a5f1f99e2e42db /cli/js/process_test.ts
parentd9efb8c02a0036d755c35e8e9c88d58bd45a9e2b (diff)
refactor: remove unneeded ErrorKinds (#3936)
Diffstat (limited to 'cli/js/process_test.ts')
-rw-r--r--cli/js/process_test.ts23
1 files changed, 5 insertions, 18 deletions
diff --git a/cli/js/process_test.ts b/cli/js/process_test.ts
index dce4d9918..51ba8bfb3 100644
--- a/cli/js/process_test.ts
+++ b/cli/js/process_test.ts
@@ -6,16 +6,7 @@ import {
assertEquals,
assertStrContains
} from "./test_util.ts";
-const {
- kill,
- run,
- DenoError,
- ErrorKind,
- readFile,
- open,
- makeTempDir,
- writeFile
-} = Deno;
+const { kill, run, readFile, open, makeTempDir, writeFile } = Deno;
test(function runPermissions(): void {
let caughtError = false;
@@ -23,8 +14,7 @@ test(function runPermissions(): void {
Deno.run({ args: ["python", "-c", "print('hello world')"] });
} catch (e) {
caughtError = true;
- assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
- assertEquals(e.name, "PermissionDenied");
+ assert(e instanceof Deno.Err.PermissionDenied);
}
assert(caughtError);
});
@@ -78,8 +68,7 @@ testPerm({ run: true }, function runNotFound(): void {
error = e;
}
assert(error !== undefined);
- assert(error instanceof DenoError);
- assertEquals(error.kind, ErrorKind.NotFound);
+ assert(error instanceof Deno.Err.NotFound);
});
testPerm(
@@ -332,8 +321,7 @@ if (Deno.build.os !== "win") {
Deno.kill(Deno.pid, Deno.Signal.SIGCONT);
} catch (e) {
caughtError = true;
- assertEquals(e.kind, Deno.ErrorKind.PermissionDenied);
- assertEquals(e.name, "PermissionDenied");
+ assert(e instanceof Deno.Err.PermissionDenied);
}
assert(caughtError);
});
@@ -370,8 +358,7 @@ if (Deno.build.os !== "win") {
}
assert(!!err);
- assertEquals(err.kind, Deno.ErrorKind.InvalidInput);
- assertEquals(err.name, "InvalidInput");
+ assert(err instanceof TypeError);
p.close();
});