applyObsidianTheme
Switches Obsidian to its dark or light theme, saves the config at once, and waits until the theme is both on screen and on disk.
Use it instead of app.changeTheme in a capture suite: see the module comment for the reload that silently undoes a bare changeTheme. The theme is recorded, and captureObsidianScreenshot then refuses any frame whose body is no longer in it, so a theme lost after this call fails the capture by name instead of rewriting a committed frame.
Import:
import { applyObsidianTheme } from 'obsidian-integration-testing';Signature:
function applyObsidianTheme(params: ApplyObsidianThemeParams): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
params |
ApplyObsidianThemeParams | The theme, how long to wait, and transport / vault overrides. |
Returns: Promise<void> — A Promise that resolves once the theme is applied and saved.
Links to this page: