forked from zhouruizhe/gmTouringMiniApp
Initial commit: gmTouringMiniApp project
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { resolve } from 'node:path'
|
||||
import { defineConfig } from 'vitest/config'
|
||||
|
||||
const hmrServer = new EventEmitter()
|
||||
|
||||
// Keep unit tests independent from uni-app's compiler and file watchers.
|
||||
export default defineConfig({
|
||||
plugins: [{
|
||||
name: 'unit-test-disable-hmr-socket',
|
||||
enforce: 'post',
|
||||
configResolved(config) {
|
||||
config.server.hmr = { server: hmrServer }
|
||||
},
|
||||
}],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
setupFiles: [resolve(__dirname, 'test/setupTests.ts')],
|
||||
include: ['test/**/*.test.ts'],
|
||||
pool: 'forks',
|
||||
poolOptions: {
|
||||
forks: {
|
||||
singleFork: true,
|
||||
},
|
||||
},
|
||||
server: {
|
||||
deps: {
|
||||
inline: ['@pmun/utils'],
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user