Skip to content

docs(test-utils): add Vitest setup guide and examples#10345

Open
chrisgervang wants to merge 1 commit into
masterfrom
chr/update-test-utils-docs-vitest
Open

docs(test-utils): add Vitest setup guide and examples#10345
chrisgervang wants to merge 1 commit into
masterfrom
chr/update-test-utils-docs-vitest

Conversation

@chrisgervang
Copy link
Copy Markdown
Collaborator

@chrisgervang chrisgervang commented May 27, 2026

For #10223

Background

Community feedback requested documentation for using @deck.gl/test-utils with Vitest, including setup instructions and working examples.

Change List

  • Add "Using with Vitest" section to the test-utils overview with quick start, Vitest Browser Mode setup, and a minimal vitest.config.ts example
  • Add Vitest examples to testLayer and generateLayerTests docs alongside existing tape examples
  • Update Usage sections to show the @deck.gl/test-utils/vitest import path

Note

Low Risk
Documentation-only changes with no runtime or API behavior impact.

Overview
Documents how to run layer lifecycle tests with Vitest using the @deck.gl/test-utils/vitest entry point (built-in vi.spyOn()), in response to community requests (#10223).

The overview gains a Using with Vitest section: install notes, why Vitest Browser Mode + Playwright is required (real WebGL2; JSDOM is not supported), a sample vitest.config.ts with SwiftShader flags, and a minimal ScatterplotLayer test.

testLayer and generateLayerTests pages now lead with Vitest examples (alongside existing tape samples) and their Usage blocks show imports from @deck.gl/test-utils/vitest instead of the default package path.

Reviewed by Cursor Bugbot for commit 22d6c5d. Bugbot is set up for automated code reviews on this repo. Configure here.

Addresses community feedback (discussion #10223) by documenting the
`@deck.gl/test-utils/vitest` entry point with setup instructions and
usage examples for testLayer and generateLayerTests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 83.386% (-0.004%) from 83.39% — chr/update-test-utils-docs-vitest into master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants