diff --git a/scripts/run-unit-tests.mjs b/scripts/run-unit-tests.mjs index c17d265a..fcfaee27 100755 --- a/scripts/run-unit-tests.mjs +++ b/scripts/run-unit-tests.mjs @@ -14,10 +14,9 @@ process.env.NODE_ENV = "test"; // failing on main, unnoticed). Each entry MUST cite why and link the triage item. // Remove an entry as soon as its file is fixed. See todo/TODO_2026-06-20_pre-launch.md todo-11b. const QUARANTINE = new Map([ - ["tests/user-blocks.test.mjs", "HANG — triage todo-11b"], - ["tests/nostr-count-fallback.test.mjs", "FAIL — triage todo-11b"], + ["tests/user-blocks.test.mjs", "HANG — async leak; needs a deterministic rewrite. triage todo-11b"], ["tests/nwc-client.test.mjs", "FAIL — mocks nostr-tools but is shadowed by the frozen canonical toolkit the bootstrap installs (real @noble rejects the fake keys). The underlying production bug (parseNwcUri passed a hex secret to getPublicKey, which needs bytes — NWC connection broken) is FIXED and guarded by tests/nwc-parse-uri.test.mjs; this file needs a mock-injection rework. triage todo-11b (NWC / item #3)"], - ["tests/nostr-publish-rejection.test.mjs", "FAIL — triage todo-11b"], + ["tests/nostr-publish-rejection.test.mjs", "FAIL — multi-precondition setup. Diagnosed 2026-06-25: (1) testPublishVideoNoteDefaultsToLiveModeInDev needs dev mode — set globalThis.__BITVID_DEV_MODE_OVERRIDE__=true BEFORE the first (dynamic) config-importing import (~line 50); (2) the publishNip71Video sub-test then fails (publishVideo's NIP-71 invocation path) — needs FEATURE_PUBLISH_NIP71/condition triage; possibly more after. triage todo-11b"], ]); const rootDir = path.dirname(fileURLToPath(new URL("../package.json", import.meta.url))); diff --git a/tests/nostr-count-fallback.test.mjs b/tests/nostr-count-fallback.test.mjs index 2903b2c2..a0298f59 100644 --- a/tests/nostr-count-fallback.test.mjs +++ b/tests/nostr-count-fallback.test.mjs @@ -178,8 +178,10 @@ async function testUnsupportedRelaySkipsWarningsAndFallsBack() { assert.equal(listCalls, 1, "fallback should query list once when COUNT fails"); assert.equal(result?.fallback, true, "unsupported relay should trigger fallback"); + // Unsupported-relay tracking moved from NostrClient to its ConnectionManager + // (the client only re-exposes pool/relays/etc.); assert on the manager. assert.ok( - client.countUnsupportedRelays.has(unsupportedRelay), + client.connectionManager.countUnsupportedRelays.has(unsupportedRelay), "unsupported relay should be remembered for future requests" ); assert.equal( diff --git a/todo/TODO_2026-06-20_pre-launch.md b/todo/TODO_2026-06-20_pre-launch.md index 8cff01c7..470fd1f1 100644 --- a/todo/TODO_2026-06-20_pre-launch.md +++ b/todo/TODO_2026-06-20_pre-launch.md @@ -746,8 +746,10 @@ test below was failing on `main` unnoticed). Fixed + guarded by the real-tools `tests/nwc-parse-uri.test.mjs`. The mock-based `nwc-client.test.mjs` STAYS quarantined — its nostr-tools mock is shadowed by the frozen canonical toolkit the bootstrap installs; needs a mock-injection rework. - - `nostr-count-fallback` — `TypeError: Cannot read 'has' of undefined` — likely - a stale harness mock missing a field. + - `nostr-count-fallback` — ✅ DONE + UN-QUARANTINED 2026-06-25: STALE TEST after a + refactor. `countUnsupportedRelays` moved from `NostrClient` to its + `ConnectionManager`; the test read it off the client (undefined.has). Repointed the + assertion at `client.connectionManager.countUnsupportedRelays`. No behavior change. - `admin-list-store` — ✅ DONE + UN-QUARANTINED 2026-06-25: STALE HARNESS (no production change, no assertion weakened). Community curator lists are fetched via the BATCHED SubscriptionManager (cold-start relay-storm fix) which the harness @@ -755,8 +757,15 @@ test below was failing on `main` unnoticed). parseCommunityBlacklistReferences decoded them twice; and createListEvent omitted the `d` tag that selectNewestEventsForReferences matches on. Fixed all three to be faithful to production. See TEST_INTEGRITY.md. - - `nostr-publish-rejection` — rejection-path assertion. - - `user-blocks` — HANGS (async leak); needs a deterministic rewrite. + - `nostr-publish-rejection` — STILL QUARANTINED. Partially diagnosed 2026-06-25: + multi-precondition setup. (1) `testPublishVideoNoteDefaultsToLiveModeInDev` needs + dev mode — set `globalThis.__BITVID_DEV_MODE_OVERRIDE__=true` BEFORE the first + (dynamic) config-importing import (~line 50). (2) The `publishNip71Video` sub-test + then fails — `publishVideo`'s NIP-71 invocation path needs FEATURE_PUBLISH_NIP71 / + condition triage; possibly more after. Quarantine note carries the steps. + - `nostr-publish-rejection`, `nwc-client`, `user-blocks` remain quarantined + (see QUARANTINE map in run-unit-tests.mjs for the precise reason on each). + - `user-blocks` — STILL QUARANTINED: HANGS (async leak); needs a deterministic rewrite. ### 12. Promotion: `unstable → beta` - [ ] After this batch soaks and the high-priority items land, promote `unstable → beta`