35 lines
931 B
TypeScript
35 lines
931 B
TypeScript
import os from 'node:os'
|
|
import path from 'node:path'
|
|
import { existsSync } from 'node:fs'
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
const reportsDirectory = process.env.GHNQG_COVERAGE_DIR
|
|
?? (
|
|
existsSync('/Volumes/JZAO/HoloLake/artifacts')
|
|
? '/Volumes/JZAO/HoloLake/artifacts/hololake-native-quality/coverage/current'
|
|
: path.join(os.tmpdir(), 'hololake-ghnqg-coverage')
|
|
)
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
environment: 'jsdom',
|
|
setupFiles: ['./src/test/setup.ts'],
|
|
include: [
|
|
'src/lib/guanghuLivingSystem.test.ts',
|
|
'src/utils/planGuanghuLivingSystem.test.ts',
|
|
],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json-summary'],
|
|
reportsDirectory,
|
|
include: [
|
|
'src/lib/guanghuLivingSystem.ts',
|
|
'src/utils/planGuanghuLivingSystem.ts',
|
|
],
|
|
thresholds: {
|
|
lines: 100,
|
|
functions: 100,
|
|
},
|
|
},
|
|
},
|
|
})
|