-
Notifications
You must be signed in to change notification settings - Fork 174
Expand file tree
/
Copy pathvitest.config.js
More file actions
26 lines (24 loc) · 783 Bytes
/
Copy pathvitest.config.js
File metadata and controls
26 lines (24 loc) · 783 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
import { resolve } from 'node:path'
import { env } from 'node:process'
import { defineConfig } from 'vitest/config'
let getPath
if (!!env.TEST_DIST || env.npm_lifecycle_event === 'test:dist') {
console.log('Testing build output from dist/')
getPath = name => resolve(import.meta.dirname, 'dist', `${name}.js`)
} else {
getPath = name => resolve(import.meta.dirname, 'src', `${name}.ts`)
}
export default defineConfig({
test: {
alias: {
'../src/test-events.ts': getPath('test-events'),
'yaml/cli': getPath('cli'),
'yaml/util': getPath('util'),
yaml: getPath('index')
},
globals: true,
setupFiles: ['tests/_setup.ts'],
include: ['tests/**/*.{js,ts}'],
exclude: ['tests/_*', 'tests/artifacts/', 'tests/json-test-suite/']
}
})