Comprehensive test package for tsParticles core engine using Vitest and jsdom.
- Install dependencies from the repository root
- Run all tests or watch specific test files
- Check coverage reports for CI validation
From the repository root:
pnpm i
pnpm --filter @tsparticles/tests testpnpm prettify— Format source code with Prettierpnpm prettify:ci— Check formatting (CI mode)pnpm lint— Run ESLint and auto-fix issuespnpm lint:ci— Check linting (CI mode)pnpm build— Lint, format, and run testspnpm build:ci— CI build with strict checkspnpm test— Run all testspnpm test:particle— Run Particle-specific tests onlypnpm test:ui— Run tests in watch mode with UIpnpm test:ci— CI test run with coverage
Tests use:
- Vitest as the test runner
- jsdom for DOM simulation
- canvas package for canvas testing
- Custom fixtures in
src/Fixture/ - Coverage tracking via v8 provider (see
vitest.config.ts)
- Tests require workspace dependencies to be built first
- Canvas tests need the native
canvaspackage; install it if missing - Ensure deterministic tests: avoid timing assertions without explicit ticks
- Main docs: https://particles.js.org/docs/
- Repository README: https://github.com/tsparticles/tsparticles/blob/main/README.md