vitest-e2e
Version:
vitest e2e utils
33 lines (30 loc) • 2.28 kB
text/typescript
import { ExecaChildProcess } from 'execa';
import { Manifest } from 'vite';
export { browser, browserErrors, browserLogs, notifyRebuildComplete, page, resolvedConfig, rootDir, serverLogs, setViteUrl, slash, startDefaultServe, testDir, testName, testPath, viteConfig, viteServer, viteTestUrl, watcher } from './vitestSetup.cjs';
export { isBuild, isCI, isServe, isWindows, workspaceRoot } from './constants.cjs';
import 'playwright-chromium';
import 'rollup';
declare function readFile(filename: string): string;
declare function editFile(filename: string, replacer: (str: string) => string, runInBuild?: boolean): void;
declare function addFile(filename: string, content: string): void;
declare function renameDir(dirname: string, to: string): void;
declare function removeFile(filename: string): void;
declare function removeDir(dirname: string): void;
declare function listFiles(dir?: string): string[];
declare function listAssets(base?: string, assets?: string): string[];
declare function findAssetFile(match: string | RegExp, base?: string, assets?: string): string;
declare function readManifest(base?: string): Manifest;
/**
* Poll a getter until the value it returns includes the expected value.
*/
declare function untilUpdated(poll: () => string | Promise<string>, expected: string, runInBuild?: boolean): Promise<void>;
/**
* Retry `func` until it does not throw error.
*/
declare function withRetry(func: () => Promise<void>, runInBuild?: boolean): Promise<void>;
type UntilBrowserLogAfterCallback = (logs: string[]) => PromiseLike<void> | void;
declare function untilBrowserLogAfter(operation: () => any, target: string | RegExp | (string | RegExp)[], expectOrder?: boolean, callback?: UntilBrowserLogAfterCallback): Promise<string[]>;
declare function untilBrowserLogAfter(operation: () => any, target: string | RegExp | (string | RegExp)[], callback?: UntilBrowserLogAfterCallback): Promise<string[]>;
declare const formatSourcemapForSnapshot: (map: any) => any;
declare function killProcess(serverProcess: ExecaChildProcess): Promise<void>;
export { addFile, editFile, findAssetFile, formatSourcemapForSnapshot, killProcess, listAssets, listFiles, readFile, readManifest, removeDir, removeFile, renameDir, untilBrowserLogAfter, untilUpdated, withRetry };