Skip to content

assertValidConfigDirectory

Throws unless configDirectory is a structurally valid Obsidian config folder name.

Mirrors the two recoverable clauses of Obsidian’s own validateConfigDir: the name must start with a dot and must not be the bare dot. A path separator is rejected on top of those, because the override names a single folder directly inside the vault, never a nested path.

Import:

import { assertValidConfigDirectory } from 'obsidian-integration-testing';

Signature:

function assertValidConfigDirectory(configDirectory: string): void

Parameters:

ParameterTypeDescription
configDirectorystringThe candidate config folder name, e.g. '.obsidian-desktop'.

Returns: void