@nuxt/test-utils
Version:
Test utilities for Nuxt
39 lines (36 loc) • 1.34 kB
text/typescript
import * as _playwright_test from '@playwright/test';
export { expect } from '@playwright/test';
import { Response } from 'playwright-core';
import { T as TestOptions$1, G as GotoOptions, b as TestHooks } from './shared/test-utils.DgnIK8xl.mjs';
import '@nuxt/schema';
import 'tinyexec';
type ConfigOptions = {
nuxt: Partial<TestOptions$1> | undefined;
defaults: {
nuxt: Partial<TestOptions$1> | undefined;
};
};
type WorkerOptions = {
_nuxtHooks: TestHooks;
};
type TestOptions = {
goto: (url: string, options?: GotoOptions) => Promise<Response | null>;
};
/**
* Use a preconfigured Nuxt fixture.
*
* You can pass a `nuxt: {}` object in your device configuration, in the `use` key of your config file,
* or use the following syntax within your test file to configure your Nuxt fixture:
*
```ts
test.use({
nuxt: {
rootDir: fileURLToPath(new URL('.', import.meta.url)),
}
})
```
*
* In `playwright.config.ts` you can pass `defaults: { nuxt: {} }` object for merging with test.use nuxt options
*/
declare const test: _playwright_test.TestType<_playwright_test.PlaywrightTestArgs & _playwright_test.PlaywrightTestOptions & TestOptions, _playwright_test.PlaywrightWorkerArgs & _playwright_test.PlaywrightWorkerOptions & WorkerOptions & ConfigOptions>;
export { type ConfigOptions, test };