From 39724ae057436ce8e627419e34ea7011afbd0586 Mon Sep 17 00:00:00 2001 From: Alice Fage Date: Mon, 31 Aug 2026 10:30:01 +1200 Subject: [PATCH] fix: scope node --test to compiled build output Bare 'node --test' discovers both the compiled tests in build/ and the TypeScript sources in src/. The src/*.test.ts files import sibling modules as '../../binary.index.js', which only exists under build/, so on Node >=22.6 (where .ts test files are picked up natively) they fail at module resolution with ERR_MODULE_NOT_FOUND. Restrict discovery to the compiled output, which is what these tests were always intended to run against. --- packages/builder/package.json | 2 +- packages/cli/package.json | 2 +- packages/core/package.json | 2 +- packages/tar/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/builder/package.json b/packages/builder/package.json index a9eae69..89dcfda 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -4,7 +4,7 @@ "main": "build/src/index.js", "types": "build/src/index.d.ts", "scripts": { - "test": "node --test" + "test": "node --test \"build/**/*.test.js\"" }, "repository": { "type": "git", diff --git a/packages/cli/package.json b/packages/cli/package.json index 9b12db8..e6357e9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -9,7 +9,7 @@ "directory": "packages/cli" }, "scripts": { - "test": "node --test" + "test": "node --test \"build/**/*.test.js\"" }, "author": { "name": "Land Information New Zealand", diff --git a/packages/core/package.json b/packages/core/package.json index f3f36ea..fa41378 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -4,7 +4,7 @@ "main": "build/src/index.js", "types": "build/src/index.d.ts", "scripts": { - "test": "node --test" + "test": "node --test \"build/**/*.test.js\"" }, "repository": { "type": "git", diff --git a/packages/tar/package.json b/packages/tar/package.json index d241205..fb54ecd 100644 --- a/packages/tar/package.json +++ b/packages/tar/package.json @@ -9,7 +9,7 @@ "directory": "packages/tar" }, "scripts": { - "test": "node --test" + "test": "node --test \"build/**/*.test.js\"" }, "author": { "name": "Land Information New Zealand",