Skip to main content

Role - Tests

Use role-tests for Vitest suites, fixtures, and test-only helpers.

Why Use This Preset?

  1. Keeps test code under the same strict type-checking baseline as production code.
  2. Prevents test JavaScript and declaration files from leaking into build output.
  3. Leaves test globals and environment types explicit in each project instead of assuming one runner or runtime.

Usage

tsconfig.tests.json
json
{
  "extends": [
    "@cbnventures/nova/presets/tsconfig/dx-essentials.json",
    "@cbnventures/nova/presets/tsconfig/dx-strict.json",
    "@cbnventures/nova/presets/tsconfig/role-tests.json",
    "@cbnventures/nova/presets/tsconfig/runtime-node.json"
  ],
  "compilerOptions": {
    "types": [
      "@types/node",
      "vitest/globals"
    ]
  }
}

What This Preset Configures

SettingValueDescription
declarationfalseDoes not create declarations for test code.
declarationMapfalseDoes not create declaration maps.
noEmittrueChecks tests without writing build output.