blob: 162cf767c1e538169ddf635e3aef84b2de468e5f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
import { Awaitable } from '@vitest/utils';
interface EnvironmentReturn {
teardown: (global: any) => Awaitable<void>;
}
interface VmEnvironmentReturn {
getVmContext: () => {
[key: string]: any;
};
teardown: () => Awaitable<void>;
}
interface Environment {
name: string;
/**
* @deprecated use `viteEnvironment` instead. Uses `name` by default
*/
transformMode?: "web" | "ssr";
/**
* Environment initiated by the Vite server. It is usually available
* as `vite.server.environments.${name}`.
*
* By default, fallbacks to `name`.
*/
viteEnvironment?: "client" | "ssr" | ({} & string);
setupVM?: (options: Record<string, any>) => Awaitable<VmEnvironmentReturn>;
setup: (global: any, options: Record<string, any>) => Awaitable<EnvironmentReturn>;
}
export type { Environment as E, VmEnvironmentReturn as V, EnvironmentReturn as a };
|