From c098612c944e34ae19a39cf467945cac940ee5ec Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Tue, 4 Aug 2026 16:44:47 -0400 Subject: [PATCH] Make 'npm test' run the real unit suite package.json had no "test" script, so `npm test` failed with "Missing script" and the obvious fallback -- `node --test tests/*.test.mjs` -- reports ~10 bogus failures. Those files are not broken: the runner sets NODE_ENV=test (so nostrToolsBootstrap uses the mock toolkit) and imports tests/test-helpers/setup-localstorage.mjs, and without that harness they fail on missing globals. tests/modal-accessibility.test.mjs, for example, is 8/8 under the runner and 0/1 under a bare node --test. Aliasing test -> run-unit-tests.mjs means the obvious command is also the correct one, so nobody re-derives that false failure list. CI is unaffected (it calls test:unit and the shards, which are unchanged). Co-Authored-By: Claude Fable 5 --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index f0cbc788..bd7b396e 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "test:smoke": "node scripts/agent/smoke-test.mjs", "test:dm:unit": "node scripts/run-targeted-tests.mjs tests/dm-db.test.mjs tests/dm-decryptor.test.mjs tests/dm-normalization.test.mjs tests/nostr-send-direct-message.test.mjs", "test:dm:integration": "node scripts/run-targeted-tests.mjs tests/nostr/dm-direct-message-flow.test.mjs", + "test": "node scripts/run-unit-tests.mjs", "test:unit": "node scripts/run-unit-tests.mjs", "test:unit:shard1": "cross-env UNIT_TEST_SHARD=1/3 node scripts/run-unit-tests.mjs", "test:unit:shard2": "cross-env UNIT_TEST_SHARD=2/3 node scripts/run-unit-tests.mjs",