diff --git a/tests/nostr-login-permissions.test.mjs b/tests/nostr-login-permissions.test.mjs index 0fa80c4c..1a81e753 100644 --- a/tests/nostr-login-permissions.test.mjs +++ b/tests/nostr-login-permissions.test.mjs @@ -313,7 +313,7 @@ test("NIP-07 login falls back when structured permissions fail", async () => { const pubkey = result.pubkey; assert.equal(pubkey, HEX_PUBKEY); assert.ok(env.enableCalls.length >= 2, "should retry with alternate payloads"); - const [objectCall, stringCall] = env.enableCalls; + const [objectCall, stringCall, plainCall] = env.enableCalls; assert.ok(Array.isArray(objectCall?.permissions)); assert.equal( typeof objectCall.permissions[0], diff --git a/tests/nostr/dm-direct-message-flow.test.mjs b/tests/nostr/dm-direct-message-flow.test.mjs index 25759eeb..3da8e911 100644 --- a/tests/nostr/dm-direct-message-flow.test.mjs +++ b/tests/nostr/dm-direct-message-flow.test.mjs @@ -117,7 +117,11 @@ async function configureNostrTools() { const nostrTools = await import("nostr-tools"); - globalThis.__BITVID_CANONICAL_NOSTR_TOOLS__ = nostrTools; + Object.defineProperty(globalThis, "__BITVID_CANONICAL_NOSTR_TOOLS__", { + value: nostrTools, + writable: true, + configurable: true, + }); globalThis.NostrTools = nostrTools; globalThis.nostrToolsReady = Promise.resolve({ ok: true, value: nostrTools }); @@ -125,7 +129,11 @@ async function configureNostrTools() { if (previousCanonical === undefined) { delete globalThis.__BITVID_CANONICAL_NOSTR_TOOLS__; } else { - globalThis.__BITVID_CANONICAL_NOSTR_TOOLS__ = previousCanonical; + Object.defineProperty(globalThis, "__BITVID_CANONICAL_NOSTR_TOOLS__", { + value: previousCanonical, + writable: true, + configurable: true, + }); } if (previousNostrTools === undefined) {