From 3a057065a5bb4a1ba666242d4733375180a6f66a Mon Sep 17 00:00:00 2001 From: Adam Fisher Date: Tue, 4 Aug 2026 14:19:17 +0000 Subject: [PATCH] Fix failing test, watch-mode default, and update imports for Deno 2 The example test asserted result === true but mod.ts exported false. It now exports true. script/test ran `deno test --watch`, which never exits. It now runs once, with the watch loop behind --watch. The std assert import from deno.land/std@0.153.0 does not resolve on Deno 2; the module moved to jsr:@std/assert. deno.lock updated to match. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- typescript-deno/deno.lock | 17 ++++++++++++++++- typescript-deno/script/test | 6 +++++- typescript-deno/src/mod.test.ts | 2 +- typescript-deno/src/mod.ts | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/typescript-deno/deno.lock b/typescript-deno/deno.lock index a1f6fd9..e0d0f41 100644 --- a/typescript-deno/deno.lock +++ b/typescript-deno/deno.lock @@ -1,5 +1,20 @@ { - "version": "3", + "version": "5", + "specifiers": { + "jsr:@std/assert@*": "1.0.19", + "jsr:@std/internal@^1.0.12": "1.0.14" + }, + "jsr": { + "@std/assert@1.0.19": { + "integrity": "eaada96ee120cb980bc47e040f82814d786fe8162ecc53c91d8df60b8755991e", + "dependencies": [ + "jsr:@std/internal" + ] + }, + "@std/internal@1.0.14": { + "integrity": "291516b3d4c35024d6ffbc0a9df5bf4c64116e05b50012cf846710152d2ffdf7" + } + }, "remote": { "https://deno.land/std@0.153.0/fmt/colors.ts": "ff7dc9c9f33a72bd48bc24b21bbc1b4545d8494a431f17894dbc5fe92a938fc4", "https://deno.land/std@0.153.0/testing/_diff.ts": "141f978a283defc367eeee3ff7b58aa8763cf7c8e0c585132eae614468e9d7b8", diff --git a/typescript-deno/script/test b/typescript-deno/script/test index 7a2d381..f3f2ab4 100755 --- a/typescript-deno/script/test +++ b/typescript-deno/script/test @@ -2,4 +2,8 @@ set -e -deno test src --watch +if [[ "${1:-}" == "--watch" ]]; then + deno test src --watch +else + deno test src +fi diff --git a/typescript-deno/src/mod.test.ts b/typescript-deno/src/mod.test.ts index 5223dd6..99d2474 100644 --- a/typescript-deno/src/mod.test.ts +++ b/typescript-deno/src/mod.test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "https://deno.land/std@0.153.0/testing/asserts.ts"; +import { assertEquals } from "jsr:@std/assert"; import { result } from "./mod.ts"; Deno.test("Pairing test", () => { diff --git a/typescript-deno/src/mod.ts b/typescript-deno/src/mod.ts index b2f9891..de4efbc 100644 --- a/typescript-deno/src/mod.ts +++ b/typescript-deno/src/mod.ts @@ -1,4 +1,4 @@ -const result = false; +const result = true; if (import.meta.main) { console.info(`Running %cmod.ts`, "color: blue");