Script Testing
Coverage Strategy
Script behavior is verified at three levels:
- Schema/validator tests for script model and action payload rules.
AnimationManagerunit tests for hook execution, bindings, diagnostics, and trigger pulse behavior.- Docs live-demo e2e tests for UI path and API path parity with intermediate runtime state assertions.
Unit-Level Expectations
Validate:
- Script CRUD and export/import persistence.
- Hook execution (
onRun,onStateChange). - Strict script input typing (
boolean,number,trigger,string). - Binding ID behavior (
bindScript/unbindScript).
Live Demo Parity
For /docs/animation/script-live-demo-app.html:
- UI path and API path both run the same command chain.
- Machine state must pass an intermediate
armedstate before finalactive. - Script diagnostics/log panel must show command + hook runtime output.
Recommended Commands
pnpm run lintpnpm exec vitest run packages/animation-manager/tests/AnimationManager.test.tspnpm exec vitest run packages/schema-validator/tests/schemas/animation.test.ts packages/schema-validator/tests/validators/animation.test.tspnpm exec playwright test tests/e2e/animation.spec.ts -g "animation script live demo page"
Related
- Script live demo: /docs/animation/script-live-demo-app.html
- Script overview: /help/animation/script-overview