Model-based testing in XState
Learn all about when and how to use model-based testing with XState.
Model-based testing
Adopting model-based testing can lead to self-documenting, easy-to-maintain tests which are far more DRY than regular tests.
When to use XState Test
Model-based testing with XState: Model-based testing is good for many use cases but not for all use cases. What makes a good candidate for model-based testing?
Quickstart
Model-based testing with XState: How to get started quickly with model-based testing using XState and @xstate/test.
Test paths
Model-based testing with XState: Understanding test paths, including state, event, and transition coverage, multiple paths and condensing to a single path.
Assertions
Model-based testing with XState: How to use the setup and assert pattern when writing tests. Including examples.
Event cases
Model-based testing with XState: how to use eventCases in your test model to test your system with a variety of different values.
Jest in XState Test
Model-based testing with XState: How to implement model-based testing with Jest and XState’s @xstate/test package.
Vitest in XState Test
Model-based testing with XState: How to implement model-based testing with Vitest and XState’s @xstate/test package.
Cypress in XState Test
Model-based testing with XState: How to implement model-based testing with Cypress and XState’s @xstate/test package.
Playwright in XState Test
Model-based testing with XState: How to implement model-based testing with Playwright and XState’s @xstate/test package.