@adonisjs/inertia
Version:
Official Inertia.js adapter for AdonisJS
36 lines (35 loc) • 1.36 kB
TypeScript
import { type InlineConfig } from 'vite';
import type { Test } from '@japa/runner/core';
import { type ProviderNode } from '@adonisjs/core/types/app';
import { type ApplicationService } from '@adonisjs/core/types';
import { Vite } from '@adonisjs/vite';
import { type IncomingMessage, type ServerResponse } from 'node:http';
export declare const BASE_URL: import("node:url").URL;
/**
* Create a http server that will be closed automatically
* when the test ends
*/
export declare const httpServer: {
create: (callback: (req: IncomingMessage, res: ServerResponse) => any) => import("node:http").Server<typeof IncomingMessage, typeof ServerResponse>;
};
/**
* Mock the `view` macro on HttpContext to return a fake
*/
export declare function setupViewMacroMock(): void;
/**
* Runs a japa test in isolation
*/
export declare function runJapaTest(app: ApplicationService, callback: Parameters<Test['run']>[0]): Promise<void>;
/**
* Spin up a Vite server for the test
*/
export declare const setupVite: (options: InlineConfig) => Promise<Vite>;
/**
* Setup an AdonisJS app for testing
*/
export declare function setupApp(providers?: ProviderNode[]): Promise<{
ace: import("@adonisjs/core/ace").Kernel;
app: ApplicationService;
ignitor: import("@adonisjs/core").Ignitor;
}>;
export declare const setupFakeAdonisProject: () => Promise<void>;