Files
AFFiNE-Mirror/packages/frontend/apps/electron/vitest.config.ts
T
DarkSky aca47445aa feat(client): migration old package to rspack (#15068)
#### PR Dependency Tree


* **PR #15068** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Chores**
* Upgraded Vitest across packages to 4.1.8 and bumped Tailwind PostCSS
to 4.3.0
* CLI/tooling updated to support the media-capture-playground package
and adjust build/dev server behavior

* **Bug Fixes**
  * Improved workspace deletion reliability in the Electron app

* **Refactor**
* Simplified media capture playground build setup (build/config
adjustments)

* **Tests**
* Made tests more robust by preserving/restoring environment state
during runs
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-02 12:00:50 +08:00

35 lines
937 B
TypeScript

// TODO(@forehalo): reuse '@affine-tools/utils' once it's ready to switch to esm module
import { resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
const rootDir = fileURLToPath(new URL('../../../..', import.meta.url));
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/apps/electron/src'
),
},
},
test: {
setupFiles: [resolve(rootDir, './scripts/setup/global.ts')],
include: ['./test/**/*.spec.ts'],
testTimeout: 60000,
hookTimeout: 30000,
pool: 'forks',
maxWorkers: 1,
coverage: {
provider: 'istanbul', // or 'istanbul'
reporter: ['lcov'],
reportsDirectory: resolve(rootDir, '.coverage/electron'),
},
},
});