mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-31 17:19:56 +08:00
test: migrate test & utils (#14569)
#### PR Dependency Tree * **PR #14569** 👈 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 development test tooling to Vitest v4 and added Playwright browser test integration; normalized test configurations and CI shard matrix. * **Tests** * Added a large suite of new integration tests covering editor flows (edgeless, database, embeds, images, latex, code, clipboard, multi-editor, presentation, undo/redo, etc.). * Removed numerous end-to-end Playwright test suites across the same feature areas. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -4,9 +4,6 @@
|
||||
"version": "0.26.3",
|
||||
"description": "Affine Node.js server",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"run-test": "./scripts/run-test.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "affine bundle -p @affine/server",
|
||||
"dev": "nodemon ./src/index.ts",
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/debug": "^4.1.12",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"version": "0.26.3"
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"devDependencies": {
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"exports": {
|
||||
"./automation": "./src/automation.ts",
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
"graphql": "^16.9.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"@graphql-codegen/typescript-operations": "^4.6.1",
|
||||
"@types/lodash-es": "^4.17.12",
|
||||
"prettier": "^3.7.4",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "gql-gen --errors-only"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
"@types/react": "^19.0.1",
|
||||
"fake-indexeddb": "^6.0.0",
|
||||
"rxjs": "^7.8.2",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"electron": "*",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "../../../tsconfig.web.json",
|
||||
"include": ["./src"],
|
||||
"compilerOptions": {
|
||||
"types": ["build-config", "affine__env", "node"],
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
"fake-indexeddb": "^6.0.0",
|
||||
"idb": "^8.0.0",
|
||||
"socket.io-client": "^4.8.3",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@affine/error": "workspace:*",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "../../../tsconfig.web.json",
|
||||
"include": ["./src"],
|
||||
"compilerOptions": {
|
||||
"types": ["build-config", "affine__env", "node"],
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
"tsBuildInfoFile": "./dist/tsconfig.tsbuildinfo"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@blocksuite/affine": "workspace:*",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@blocksuite/affine": "workspace:*"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/aws4": "^1.11.6",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"version": "0.26.3"
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
"tailwind-merge": "^3.4.0",
|
||||
"tailwindcss": "^4.1.17",
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "affine bundle",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "../../../tsconfig.web.json",
|
||||
"include": ["./src", "./src/config.json"],
|
||||
"compilerOptions": {
|
||||
"types": ["build-config", "affine__env", "node"],
|
||||
"resolveJsonModule": true,
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
"tree-kill": "^1.2.2",
|
||||
"typescript": "^5.9.3",
|
||||
"uuid": "^13.0.0",
|
||||
"vitest": "^3.2.4",
|
||||
"vitest": "^4.0.18",
|
||||
"zod": "^3.25.76"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -24,13 +24,10 @@ export default defineConfig({
|
||||
setupFiles: [resolve(rootDir, './scripts/setup/global.ts')],
|
||||
include: ['./test/**/*.spec.ts'],
|
||||
testTimeout: 5000,
|
||||
poolOptions: {
|
||||
forks: {
|
||||
singleFork: true,
|
||||
},
|
||||
},
|
||||
pool: 'forks',
|
||||
maxWorkers: 1,
|
||||
coverage: {
|
||||
provider: 'istanbul', // or 'c8'
|
||||
provider: 'istanbul', // or 'istanbul'
|
||||
reporter: ['lcov'],
|
||||
reportsDirectory: resolve(rootDir, '.coverage/electron'),
|
||||
},
|
||||
|
||||
@@ -14,6 +14,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.9.3",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,19 +73,19 @@
|
||||
"devDependencies": {
|
||||
"@affine-tools/utils": "workspace:*",
|
||||
"@blocksuite/affine": "workspace:*",
|
||||
"@storybook/react": "^10.2.13",
|
||||
"@storybook/react-vite": "^10.2.13",
|
||||
"@storybook/react": "^10.2.14",
|
||||
"@storybook/react-vite": "^10.2.14",
|
||||
"@testing-library/dom": "^10.4.0",
|
||||
"@testing-library/react": "^16.1.0",
|
||||
"@types/bytes": "^3.1.5",
|
||||
"@types/react": "^19.0.1",
|
||||
"@types/react-dom": "^19.0.2",
|
||||
"@vanilla-extract/css": "^1.17.0",
|
||||
"storybook": "^10.2.13",
|
||||
"storybook": "^10.2.14",
|
||||
"typescript": "^5.9.3",
|
||||
"unplugin-swc": "^1.5.9",
|
||||
"vite": "^7.2.7",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"version": "0.26.3"
|
||||
}
|
||||
|
||||
@@ -112,6 +112,6 @@
|
||||
"fake-indexeddb": "^6.0.0",
|
||||
"happy-dom": "^20.3.0",
|
||||
"lodash-es": "^4.17.23",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
/**
|
||||
* @vitest-environment happy-dom
|
||||
*/
|
||||
import { afterEach } from 'node:test';
|
||||
|
||||
import { beforeEach, describe, expect, test, vi } from 'vitest';
|
||||
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
|
||||
|
||||
import { resolveLinkToDoc, toURLSearchParams } from '../utils';
|
||||
|
||||
|
||||
@@ -29,6 +29,6 @@
|
||||
"@affine-tools/cli": "workspace:*",
|
||||
"@affine-tools/utils": "workspace:*",
|
||||
"glob": "^11.0.0",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"@affine-tools/utils": "workspace:*",
|
||||
"path-to-regexp": "^8.3.0",
|
||||
"query-string": "^9.1.1",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^19.2.1",
|
||||
|
||||
@@ -14,6 +14,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^19.0.1",
|
||||
"vitest": "^3.2.4"
|
||||
"vitest": "^4.0.18"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user