chore(electron): config vitest swc (#6282)

This commit is contained in:
EYHN 2024-03-25 03:55:23 +00:00
parent 82cacd09d6
commit d59e1389ec
No known key found for this signature in database
GPG Key ID: 46C9E26A75AB276C
3 changed files with 5 additions and 0 deletions

View File

@ -46,6 +46,7 @@
"@toeverything/infra": "workspace:*", "@toeverything/infra": "workspace:*",
"@types/mixpanel-browser": "^2.49.0", "@types/mixpanel-browser": "^2.49.0",
"@types/uuid": "^9.0.8", "@types/uuid": "^9.0.8",
"@vitejs/plugin-react-swc": "^3.6.0",
"builder-util-runtime": "^9.2.4", "builder-util-runtime": "^9.2.4",
"core-js": "^3.36.1", "core-js": "^3.36.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",

View File

@ -1,11 +1,13 @@
import { resolve } from 'node:path'; import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url'; import { fileURLToPath } from 'node:url';
import react from '@vitejs/plugin-react-swc';
import { defineConfig } from 'vitest/config'; import { defineConfig } from 'vitest/config';
const rootDir = fileURLToPath(new URL('../../..', import.meta.url)); const rootDir = fileURLToPath(new URL('../../..', import.meta.url));
export default defineConfig({ export default defineConfig({
plugins: [react()],
resolve: { resolve: {
alias: { alias: {
// prevent tests using two different sources of yjs // prevent tests using two different sources of yjs
@ -15,6 +17,7 @@ export default defineConfig({
}, },
test: { test: {
setupFiles: [resolve(rootDir, './scripts/setup/global.ts')],
include: ['./test/**/*.spec.ts'], include: ['./test/**/*.spec.ts'],
testTimeout: 5000, testTimeout: 5000,
poolOptions: { poolOptions: {

View File

@ -468,6 +468,7 @@ __metadata:
"@toeverything/infra": "workspace:*" "@toeverything/infra": "workspace:*"
"@types/mixpanel-browser": "npm:^2.49.0" "@types/mixpanel-browser": "npm:^2.49.0"
"@types/uuid": "npm:^9.0.8" "@types/uuid": "npm:^9.0.8"
"@vitejs/plugin-react-swc": "npm:^3.6.0"
async-call-rpc: "npm:^6.4.0" async-call-rpc: "npm:^6.4.0"
builder-util-runtime: "npm:^9.2.4" builder-util-runtime: "npm:^9.2.4"
core-js: "npm:^3.36.1" core-js: "npm:^3.36.1"