Skip to content

onWindowMigrated

Calls a listener when the element is migrated to another window. The mock never calls it, since tests have a single window.

Import:

import 'obsidian-test-mocks/setup';

Signature:

function onWindowMigrated(this: HTMLElement, _listener: (win: Window) => unknown): () => void

Parameters:

Parameter Type Description
this HTMLElement
_listener (win: Window) => unknown The callback to call with the new window. Never called by the mock.

Returns: () => void — A function that removes the handler; a no-op in the mock.