Overview of Inertia application testing strategies
Depending on the goal, there are three primary ways to test an Inertia application:
- End-to-end (E2E) Tests: Use browser automation tools like Cypress or Capybara. These test the application at the user layer, executing actual JavaScript in the browser. They provide high confidence but are slower.
- Client-Side Unit Tests: Use frameworks like Vitest, Jest, or Mocha to test JavaScript page components in isolation using Node.js.
- Endpoint Tests: Use Inertia Rails' provided test helpers for RSpec or Minitest to verify server-side responses, props, and components.