/
constants.ts
51 lines (45 loc) · 1.01 KB
/
constants.ts
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
39
40
41
42
43
44
45
46
47
48
49
50
51
import url from 'node:url'
import { resolve } from 'pathe'
import { isNode } from './utils/env'
export const rootDir = isNode ? resolve(url.fileURLToPath(import.meta.url), '../../') : import.meta.url
export const distDir = isNode ? resolve(url.fileURLToPath(import.meta.url), '../../dist') : import.meta.url
// if changed, update also jsdocs and docs
export const defaultPort = 51204
export const EXIT_CODE_RESTART = 43
export const API_PATH = '/__vitest_api__'
export const configFiles = [
'vitest.config.ts',
'vitest.config.mts',
'vitest.config.cts',
'vitest.config.js',
'vitest.config.mjs',
'vitest.config.cjs',
'vite.config.ts',
'vite.config.mts',
'vite.config.cts',
'vite.config.js',
'vite.config.mjs',
'vite.config.cjs',
]
export const globalApis = [
// suite
'suite',
'test',
'describe',
'it',
// chai
'chai',
'expect',
'assert',
// typecheck
'expectTypeOf',
'assertType',
// utils
'vitest',
'vi',
// hooks
'beforeAll',
'afterAll',
'beforeEach',
'afterEach',
]