overleaf/services/web/test/frontend/helpers/detach-channel.ts
Alf Eaton cda947d1ac Remove sysend dependency (#10852)
GitOrigin-RevId: c3d9601256af8720ab41264609cb5c5c810afbba
2023-01-10 09:04:37 +00:00

10 lines
396 B
TypeScript

import {
detachChannelId,
detachChannel as _detachChannel,
} from '../../../frontend/js/shared/context/detach-context'
// for tests, assert that detachChannel is defined, as BroadcastChannel is available
export const detachChannel = _detachChannel!
// simulate messages from another tab by posting them to this channel
export const testDetachChannel = new BroadcastChannel(detachChannelId)