Skip to content

[codex] use native-dom test environment#2

Draft
Dunqing wants to merge 1 commit into
mainfrom
codex/use-native-dom-test-environment
Draft

[codex] use native-dom test environment#2
Dunqing wants to merge 1 commit into
mainfrom
codex/use-native-dom-test-environment

Conversation

@Dunqing
Copy link
Copy Markdown
Owner

@Dunqing Dunqing commented May 12, 2026

Summary

  • Replace the direct happy-dom dev dependency with the published vitest-environment-native-dom package.
  • Switch Vitest from environment: "happy-dom" to environment: "native-dom".
  • Regenerate the lockfile so happy-dom is no longer resolved or installed.

Why

The native-dom environment now supports the app's DOM test surface without the local environment wrapper, and local benchmarks show it is faster than happy-dom for this suite.

Validation

  • vp install --frozen-lockfile
  • vp check
  • vp test run - 25 files / 203 tests passed
  • vp why happy-dom - no output

Benchmark Notes

Recent local wall-clock benchmark:

  • vp test run: native-dom mean 1.445s
  • vp test run --environment happy-dom: happy-dom mean 1.675s
  • native-dom was about 1.16x faster

Memory was effectively neutral in local max-RSS sampling: native-dom averaged 541.8 MiB and happy-dom averaged 547.3 MiB.

@Dunqing Dunqing force-pushed the codex/use-native-dom-test-environment branch from 37be2b7 to 9b07570 Compare May 12, 2026 01:02
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.

1 participant