Skip to content

@dudousxd/nestjs-inertia-testing

Terminal window
pnpm add -D @dudousxd/nestjs-inertia-testing

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

ExportDescription
expectInertia(response)Fluent assertion chain from a supertest response
assertInertia(payload)Fluent assertion chain from a raw JSON payload
InertiaTestingModulePre-configured NestJS testing module
createFakeInertiaRequest(opts)Creates a fake req.inertia for unit tests
expectInertiaRequest(req)Assertion chain against a fake request

See Testing guide for full examples.

vitest.setup.ts
import '@dudousxd/nestjs-inertia-testing/vitest';