Skip to content

temporary-vault

Manages temporary vault lifecycle for integration tests.

Class Description
TemporaryVault A temporary Obsidian vault for integration tests. Creates a temp directory and registers it in the running Obsidian instance so that the Obsidian CLI can target it via cwd. A handle owns the directory only when it created it. TemporaryVault.dispose deletes an owned directory and leaves a borrowed one in place — see TemporaryVaultConstructorOptions.shouldRemoveDirectoryOnDispose, which overrides that default.
Interface Description
TemporaryVaultConstructorOptions Options for the TemporaryVault constructor.
Type Description
PopulateFileContent Content value for a single entry in a PopulateFilesParams map. - string — text file (written as UTF-8). - Uint8Array — binary file (written as raw bytes; Buffer is accepted because Buffer extends Uint8Array). - undefined — empty folder (the key must end with /).
PopulateFilesParams A map of vault-relative paths to their content, used by TemporaryVault.populate. Paths ending with / denote folders and must have an undefined value. All other paths are written as files.