ConnectToCdpOptions
Options for connectToCdp.
Import:
import type { ConnectToCdpOptions } from 'obsidian-integration-testing';Signature:
export interface ConnectToCdpOptionsProperties
| Property | Type | Description |
|---|---|---|
| commandTimeoutInMilliseconds? | number | Timeout in milliseconds for individual CDP commands. |
| deadBootGraceInMilliseconds? | number | Grace window in milliseconds for fast-failing a dead boot of the owned instance — the renderer loaded but the app never bootstrapped (empty <body>, no window.app), the terminal state when the asar cannot run on the launched Electron shell. Once it has held this long a RendererFailedToInitializeError is thrown instead of waiting out the full readiness timeout. Ignored in attach mode (port set). Set 0 to disable fast-fail. |
| host? | string | CDP host. |
| isObsidianAppVisible? | boolean | Whether the Obsidian window is shown on screen. Defaults to true; set false to launch it off-screen. Ignored in attach mode (port set). |
| obsidianInstallerVersion? | string | Pins the Electron shell (installer build) the owned instance runs. Accepts 'x.y.z', 'public-latest', or 'catalyst-latest'. Ignored when port (attach mode) is set. When omitted, the installed shell is used. |
| obsidianVersion? | string | Pins the Obsidian app version (asar) the owned instance runs. Accepts 'x.y.z', 'public-latest', or 'catalyst-latest'. Ignored when port (attach mode) is set. When omitted, the installed version is used. |
| port? | number | CDP port of an already-running Obsidian to **attach** to. When omitted, an isolated instance is launched on an automatically chosen free port. |
| shouldDisableSandbox? | boolean | Whether to launch the owned instance with Chromium's sandbox disabled (--no-sandbox).Needed to boot on Linux without a correctly-configured setuid chrome-sandbox helper (e.g. an installer-extracted portable shell, or CI running as a non-root user); harmless on Windows/macOS. Ignored in attach mode (port set). |
| shouldRemoveVaultOnDispose? | boolean | Whether to remove the vault directory on CdpConnection.dispose. When omitted, defaults to true for an implicit throw-away temp vault (vault not given) and false when a vault path is given, so a real vault is never deleted. Set explicitly to override. |
| shouldThrowOnIncompatibleInstaller? | boolean | Whether an **unrunnable** installer↔app version pair fails fast before launch. When true (the default), an installer below the app's run floor throws IncompatibleInstallerVersionError from version resolution before anything is downloaded or launched. Set false to let the pin proceed to launch — where the reactive dead-boot fast-fail still catches the black-screen boot, and the 'unrunnable' verdict is surfaced on CdpConnection.compatibility rather than thrown. Ignored in attach mode (port set). |
| shouldThrowOnSilentAsarFallback? | boolean | Whether a post-boot **silent asar fallback** fails fast. When an asar is swapped onto an installer shell too old for it, the instance may silently revert to the installer's own bundled asar and run the **wrong (older)** version behind a healthy UI. When true (the default), the running app version is verified against the pin post-boot and a mismatch throws SilentAsarFallbackError. Set false to let the boot proceed — the mismatch is then surfaced on CdpConnection.asarFallback rather than thrown. Ignored in attach mode (port set) and when no asar is swapped. |
| shouldWarnOnCompatibilityIssues? | boolean | Whether the owned-instance compatibility **nag warnings** are emitted. Covers both the offline installer↔app warning and the post-boot runtime-Electron warning. When true (the default) each fires via the harness log; set false to silence both — the verdicts are still surfaced on CdpConnection.compatibility / CdpConnection.electronCompatibility, only the log is suppressed. Ignored in attach mode (port set). |
| vault? | string | Absolute path to an existing vault to open. When omitted, an empty temporary vault is created (and removed on dispose unless shouldRemoveVaultOnDispose says otherwise). |
Links to this page: