2023-07-28 06:06:50 +03:00
|
|
|
import { resolve } from 'node:path';
|
|
|
|
import { fileURLToPath } from 'node:url';
|
|
|
|
|
|
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
|
2023-10-18 18:30:08 +03:00
|
|
|
const rootDir = fileURLToPath(new URL('../../..', import.meta.url));
|
|
|
|
const pluginOutputDir = resolve(
|
|
|
|
rootDir,
|
|
|
|
'./packages/frontend/electron/dist/plugins'
|
|
|
|
);
|
2023-07-28 06:06:50 +03:00
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
// prevent tests using two different sources of yjs
|
|
|
|
yjs: resolve(rootDir, 'node_modules/yjs'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
define: {
|
|
|
|
'process.env.PLUGIN_DIR': JSON.stringify(pluginOutputDir),
|
|
|
|
},
|
|
|
|
test: {
|
|
|
|
include: ['./src/**/*.spec.ts'],
|
|
|
|
exclude: ['**/node_modules', '**/dist', '**/build', '**/out'],
|
|
|
|
testTimeout: 5000,
|
|
|
|
singleThread: true,
|
|
|
|
threads: false,
|
|
|
|
coverage: {
|
|
|
|
provider: 'istanbul', // or 'c8'
|
|
|
|
reporter: ['lcov'],
|
|
|
|
reportsDirectory: resolve(rootDir, '.coverage/electron'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|