-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvitest.config.ts
More file actions
38 lines (33 loc) · 834 Bytes
/
vitest.config.ts
File metadata and controls
38 lines (33 loc) · 834 Bytes
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
30
31
32
33
34
35
36
37
38
import { defineConfig } from "vitest/config";
import {
type BuildOptions,
getAppVersion,
getBuildOptions,
resolveConfig,
testConfig
} from "./config/vite";
import { ConfigEnv } from "vite";
/**
* Vitest configuration.
* @see https://vitest.dev/config/
*/
export default defineConfig((env: ConfigEnv) => {
const options: BuildOptions = getBuildOptions(env);
const appVersion: string | null = getAppVersion(options.paths.root);
return {
/**
* @see https://vite.dev/config/shared-options.html#define
*/
define: {
"import.meta.env.APP_VERSION": JSON.stringify(appVersion)
},
/**
* @see https://vite.dev/config/shared-options.html#resolve
*/
resolve: resolveConfig(options),
/**
* @see https://vitest.dev/config/
*/
test: testConfig(options)
};
});