Skip to content

varar.config.json

One varar.config.json sits at the root of your project. It is the single source of truth for what is an oath and where the step definitions are, and the same file is read identically by the varar CLI, the language server, and the test-framework adapters — so all of them always agree.

The file is the same in every language port. Unknown keys are an error rather than being ignored, because a typo’d config that silently discovers nothing is the worst failure mode this file has.

{
"$schema": "https://varar.dev/varar.config.schema.json",
"docs": {
"include": ["varar/**/*.md"],
"exclude": ["varar/drafts/**"]
},
"steps": ["src/varar/**/*.steps.ts"],
"snippets": {}
}

An object with include and exclude, both arrays of plain globs. A file is an oath iff it matches include and does not match exclude.

  • There is no default: an empty or absent include discovers nothing.
  • Globs are plain — no ! prefix. Exclusion is what exclude is for.
  • The array shorthand ("docs": [...]) is not accepted; the object is the canonical shape.

The extension does not decide anything: a file is an oath because it matches these globs, not because it is called .md.

Under vitest, the plugin drives vitest’s own include/exclude from these globs; see Run oaths through vitest.

An array of globs matching your step-definition files. Also no default.

On the JVM ports, entries are fully-qualified class names rather than file globs, because that is how the JVM loads them. An entry may also be a package wildcard: varar.* includes every step class directly in the varar package (star-import semantics — it does not recurse into sub-packages).

An object mapping a language id (e.g. typescript) to a step-definition template, used by the editor’s Generate Step Definition action. Omit it to use the built-in template for each language. See Editor support.

Accepted and ignored by Varar — it is there so your editor can validate and complete the file.

The drift baseline is a separate, generated file: varar.lock.json, written by the runner and committed alongside your oaths. See Drift detection.