Aviary
Packages

@dudousxd/nestjs-inertia-testing

expectInertia, InertiaTestingModule, and assertion helpers for testing NestJS Inertia controllers.

pnpm add -D @dudousxd/nestjs-inertia-testing
npm install --save-dev @dudousxd/nestjs-inertia-testing
yarn add -D @dudousxd/nestjs-inertia-testing

Drop-in test utilities for Vitest, Jest, and Node's built-in test runner.

Exports

ExportDescription
expectInertia(response)Fluent assertion chain from a supertest response
assertInertia(payload)Fluent assertion chain from a raw JSON payload
InertiaAssertionThe 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.

On this page