ObsidianPluginVitestConfigContext
The context for defining a plugin’s vitest configuration.
Every member is live: the arrays and objects it exposes are the very ones the assembled configuration is built from, so editing them in place through DefineObsidianPluginVitestConfigOptions.editContext is what customizes the result.
Import:
import { ObsidianPluginVitestConfigContext } from 'obsidian-dev-utils/script-utils/test-runners/vitest-config';Signature:
export class ObsidianPluginVitestConfigContextConstructor
new ObsidianPluginVitestConfigContext()Creates a new context seeded with the standard projects.
Properties
| Property | Type | Description |
|---|---|---|
| android | ObsidianPluginVitestProjectConfig | The integration-tests:android project, running the mobile-only and cross-platform suites against an Android emulator through Appium. |
| androidTimeoutInMilliseconds | 60000 | The per-test budget of the Android integration project, in milliseconds. Booting an emulator and driving it over Appium is slower than the desktop path, hence its own constant. |
| bigTimeoutInMilliseconds | 30000 | The per-test budget of the regular integration projects, in milliseconds. |
| coverageExclude | string[] | The coverage exclude globs. Push onto it to drop more files from the coverage report.Declaration files are excluded by default because the coverage include below is src/**\/*.ts, which a .d.ts matches. A declaration file emits no runtime code, so it reports 0% and no test can ever raise it — a plugin that grows one under src/ silently loses its 100% gate, and the usual remedy of an inline v8 ignore comment does not apply to a type-only file. |
| desktop | ObsidianPluginVitestProjectConfig | The integration-tests:desktop project, running the desktop-only and cross-platform suites against a real desktop Obsidian over CDP. |
| desktopPerformance | ObsidianPluginVitestProjectConfig | The integration-tests:desktop-performance project, running the at-scale suites. It is declared for every plugin even when there is no such suite yet — passWithNoTests makes an empty project free, and the matching test:integration:desktop:performance script exists fleet-wide. |
| hookTimeoutMultiplier | 4 | The multiplier applied to a project's test budget to get its hook budget. A hook typically populates and opens a vault, so it needs several times what a single test does. |
| noApp | ObsidianPluginVitestProjectConfig | The integration-tests:no-app project, running the suites that need no Obsidian instance at all. |
| performanceTimeoutInMilliseconds | 600000 | The per-test budget of the performance integration project, in milliseconds. A performance vault is pre-populated with tens of thousands of notes before Obsidian opens, so both its setup and its tests need far more time than the regular integration projects. |
| unitTests | ObsidianPluginVitestProjectConfig | The unit-tests project, running the mocked-Obsidian suites in jsdom. |