Packages
@dudousxd/nestjs-inertia-testing
expectInertia, InertiaTestingModule, and assertion helpers for testing NestJS Inertia controllers.
pnpm add -D @dudousxd/nestjs-inertia-testingnpm install --save-dev @dudousxd/nestjs-inertia-testingyarn add -D @dudousxd/nestjs-inertia-testingDrop-in test utilities for Vitest, Jest, and Node's built-in test runner.
Exports
| Export | Description |
|---|---|
expectInertia(response) | Fluent assertion chain from a supertest response |
assertInertia(payload) | Fluent assertion chain from a raw JSON payload |
InertiaAssertion | The assertion class (for type-level use) |
InertiaTestingModule.forTest(options?) | Pre-configured module wrapping InertiaModule.forRoot() |
createFakeInertiaRequest(opts?) | Create a fake request object for unit tests |
createFakeInertiaResponse() | Create a fake response object for unit tests |
Register framework matchers
// vitest.setup.ts
import '@dudousxd/nestjs-inertia-testing/vitest';
// jest.setup.ts
import '@dudousxd/nestjs-inertia-testing/jest';See Testing guide for full examples and the complete assertion API.