The docs codebase uses Vitest as its test runner. EachDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/github/docs/llms.txt
Use this file to discover all available pages before exploring further.
src/ subject directory contains its own tests/ subdirectory. Playwright handles end-to-end browser tests separately.
Running tests
Run the full suite
vitest.config.ts:
playwright-*.spec.ts) are excluded from this glob and must be run separately.
Run a specific subject
Pass the path of a test directory or file to scope the run:Fixture-based test suites
Several test suites require a local fixture server. Usenpm run fixture-test instead of npm test for these:
ROOT=src/fixtures/fixtures and runs tests under src/fixtures/tests/.
Named test suite aliases
package.json defines several aliases for common test scenarios. Use these instead of constructing long environment variable chains by hand.
- Fixtures
- Search
- Article API
- Changelogs
- Landings
- Languages
src/fixtures/tests/ with the fixture root and translations fixture root set.Playwright end-to-end tests
Browser tests use Playwright and require a running local server pointed at the fixture root.src/fixtures/playwright.config.ts using the Google Chrome project. The start-for-playwright server must be running, or Playwright’s webServer configuration will start it automatically.
Test configuration
The Vitest configuration lives invitest.config.ts at the repo root:
@/ alias maps to src/, so test files can use import { foo } from '@/rest/lib/config' instead of relative paths.
Test structure
Each subject directory follows the same layout:tests/ subdirectory inside it. Vitest will automatically discover files matching the glob patterns.
Adding tests to CI
The.github/workflows/test.yml workflow runs Vitest tests in a matrix. Each row in the matrix corresponds to a subject directory name:
main — tests not listed as required checks will not block merges.
Search tests and Elasticsearch
Thetest:search and test:languages suites send real queries to Elasticsearch. They require a running Elasticsearch instance:
ELASTICSEARCH_URL is not set, so they will not break CI runs without the service.
Getting help
- Slack:
#docs-engineering - Repo:
github/docs-engineering