refactor(electron): fix vitest and add behavior test (#4655)

This commit is contained in:
Alex Yang authored and GitHub committed 2023-10-18 22:14:30 -05:00
1 parent b14a6bc29e
commit 97d8660a54
35 files changed
+256 -349

No files matched your search

+2 -9
View File
@@ -4,24 +4,17 @@ import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
const rootDir = fileURLToPath(new URL('../../..', import.meta.url));
const pluginOutputDir = resolve(
rootDir,
'./packages/frontend/electron/dist/plugins'
);
export default defineConfig({
resolve: {
alias: {
// prevent tests using two different sources of yjs
yjs: resolve(rootDir, 'node_modules/yjs'),
'@affine/electron': resolve(rootDir, 'packages/frontend/electron/src'),
},
},
define: {
'process.env.PLUGIN_DIR': JSON.stringify(pluginOutputDir),
},
test: {
include: ['./src/**/*.spec.ts'],
exclude: ['**/node_modules', '**/dist', '**/build', '**/out'],
include: ['./test/**/*.spec.ts'],
testTimeout: 5000,
singleThread: true,
threads: false,