Skip to content

instanceOf<T>

Cross-window instanceof check for DOM nodes. The mock has a single window, so it is a plain instanceof.

Import:

import 'obsidian-test-mocks/setup';

Signature:

function instanceOf(this: Node, type: new () => T): boolean

Parameters:

Parameter Type Description
this Node
type new () => T The constructor to check against.

Returns: boolean — true when this node is an instance of type.