Skip to content

createFragment

Creates an empty document fragment.

Import:

import 'obsidian-test-mocks/setup';

Signature:

function createFragment(callback: ((el: DocumentFragment) => void) | undefined): DocumentFragment

Parameters:

Parameter Type Description
callback ((el: DocumentFragment) => void) | undefined Called with the new fragment, typically to fill it, before it is returned.

Returns: DocumentFragment — The new fragment.