summaryrefslogtreecommitdiff
path: root/tests.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests.ts')
-rw-r--r--tests.ts23
1 files changed, 20 insertions, 3 deletions
diff --git a/tests.ts b/tests.ts
index b9fcbf37f..59aeafcf8 100644
--- a/tests.ts
+++ b/tests.ts
@@ -1,5 +1,22 @@
-import { test, assert } from "./deno_testing/testing.ts";
+// This test is executed as part of integration_test.go
+// But it can also be run manually:
+// ./deno tests.ts
+import { test, assert, assertEqual } from "./deno_testing/testing.ts";
+import { readFileSync } from "deno";
-test(async function test_matchTesters() {
- assert(false, "assert failed on purpose.");
+test(async function tests_test() {
+ assert(true);
+});
+
+test(async function tests_readFileSync() {
+ let data = readFileSync("package.json");
+ if (!data.byteLength) {
+ throw Error(
+ `Expected positive value for data.byteLength ${data.byteLength}`
+ );
+ }
+ const decoder = new TextDecoder("utf-8");
+ const json = decoder.decode(data);
+ const pkg = JSON.parse(json);
+ assertEqual(pkg.name, "deno");
});