effect-ownership.test.ts (719B)
1 import test from 'node:test'; 2 import assert from 'node:assert/strict'; 3 import { 4 createExtensionAdapter, 5 extensionOwnershipCapture 6 } from '../../src/lib/nostr/extension.ts'; 7 import { 8 publicEffectSnapshot, 9 stopPublicEffect, 10 type PublicEffectLease 11 } from '../../src/lib/runtime/effect-ownership.ts'; 12 await test('actual owner/lock modules remain inert and cannot manufacture a connected SSR capture', () => { 13 assert.equal(typeof window, 'undefined'); 14 assert.equal(extensionOwnershipCapture(createExtensionAdapter()), undefined); 15 const fake = {} as PublicEffectLease; 16 assert.equal(publicEffectSnapshot(fake), undefined); 17 stopPublicEffect(fake); 18 assert.equal(publicEffectSnapshot(fake), undefined); 19 });