summaryrefslogtreecommitdiff
path: root/tests.ts
diff options
context:
space:
mode:
authorPig Fang <g-plane@hotmail.com>2018-06-05 15:58:50 +0800
committerRyan Dahl <ry@tinyclouds.org>2018-06-05 09:58:50 +0200
commit874db2a334eeaccd5f991e1e979073d75ba2932b (patch)
tree2391e4433984259eb8b16335201ddb2ef548c668 /tests.ts
parent71d789198bb07f78776aebee44c4c4be811650df (diff)
Add `console.assert` (#102)
Diffstat (limited to 'tests.ts')
-rw-r--r--tests.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests.ts b/tests.ts
index d4b188fda..406ac76e8 100644
--- a/tests.ts
+++ b/tests.ts
@@ -19,6 +19,18 @@ test(async function tests_fetch() {
assertEqual(json.name, "deno");
});
+test(function tests_console_assert() {
+ console.assert(true);
+
+ let hasThrown = false;
+ try {
+ console.assert(false);
+ } catch {
+ hasThrown = true;
+ }
+ assertEqual(hasThrown, true);
+});
+
test(async function tests_readFileSync() {
const data = readFileSync("package.json");
if (!data.byteLength) {