diff --git a/tests/nostr-login-permissions.test.mjs b/tests/nostr-login-permissions.test.mjs index 13516f4a..576facb2 100644 --- a/tests/nostr-login-permissions.test.mjs +++ b/tests/nostr-login-permissions.test.mjs @@ -84,7 +84,11 @@ function setupLoginEnvironment({ enableImpl, getPublicKey = HEX_PUBKEY } = {}) { configurable: true, }); } catch (e) { - global.__BITVID_CANONICAL_NOSTR_TOOLS__ = toolkitStub; + try { + global.__BITVID_CANONICAL_NOSTR_TOOLS__ = toolkitStub; + } catch (ignore) { + // Ignore assignment errors if property is read-only + } } global.nostrToolsReady = Promise.resolve({ ok: true, value: toolkitStub }); diff --git a/tests/nostr/adapters.test.mjs b/tests/nostr/adapters.test.mjs index e111ee77..e101ff72 100644 --- a/tests/nostr/adapters.test.mjs +++ b/tests/nostr/adapters.test.mjs @@ -32,7 +32,9 @@ test("createNsecAdapter wires signing and cipher capabilities", async () => { configurable: true, }); } catch (e) { - globalThis.__BITVID_CANONICAL_NOSTR_TOOLS__ = canonicalTools; + try { + globalThis.__BITVID_CANONICAL_NOSTR_TOOLS__ = canonicalTools; + } catch (ignore) {} } globalThis.NostrTools = canonicalTools; globalThis.nostrToolsReady = Promise.resolve({ @@ -70,7 +72,9 @@ test("createNsecAdapter wires signing and cipher capabilities", async () => { configurable: true, }); } catch (e) { - globalThis.__BITVID_CANONICAL_NOSTR_TOOLS__ = previousCanonical; + try { + globalThis.__BITVID_CANONICAL_NOSTR_TOOLS__ = previousCanonical; + } catch (ignore) {} } } diff --git a/tests/nostr/nip07Adapter-race-condition.test.mjs b/tests/nostr/nip07Adapter-race-condition.test.mjs index a7e076cd..8534d6e5 100644 --- a/tests/nostr/nip07Adapter-race-condition.test.mjs +++ b/tests/nostr/nip07Adapter-race-condition.test.mjs @@ -1,3 +1,4 @@ +import '../test-helpers/setup-localstorage.mjs'; import assert from 'node:assert'; import { test, describe, beforeEach, afterEach } from 'node:test'; import { createNip07Adapter } from '../../js/nostr/adapters/nip07Adapter.js';