@nocobase/test 2.1.0-beta.7 → 2.1.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/vitest.mjs +16 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/test",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.8",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "./src/index.ts",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@faker-js/faker": "8.1.0",
|
|
54
|
-
"@nocobase/server": "2.1.0-beta.
|
|
54
|
+
"@nocobase/server": "2.1.0-beta.8",
|
|
55
55
|
"@playwright/test": "^1.45.3",
|
|
56
56
|
"@testing-library/jest-dom": "^6.4.2",
|
|
57
57
|
"@testing-library/react": "^14.0.0",
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"vitest-dom": "^0.1.1",
|
|
77
77
|
"ws": "^8.13.0"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "5099d561c5467292414c1e77ad6bad3730d97344"
|
|
80
80
|
}
|
package/vitest.mjs
CHANGED
|
@@ -10,6 +10,12 @@ const __filename = fileURLToPath(import.meta.url);
|
|
|
10
10
|
const __dirname = dirname(__filename);
|
|
11
11
|
|
|
12
12
|
const CORE_CLIENT_PACKAGES = ['sdk', 'client', 'client-v2', 'flow-engine'];
|
|
13
|
+
// 按路径填写要跳过服务端测试的插件目录(相对仓库根目录)
|
|
14
|
+
const skipPluginPaths = [
|
|
15
|
+
'packages/plugins/@nocobase/plugin-audit-logs',
|
|
16
|
+
'packages/plugins/@nocobase/plugin-backup-restore',
|
|
17
|
+
'packages/plugins/@nocobase/plugin-multi-app-share-collections',
|
|
18
|
+
];
|
|
13
19
|
|
|
14
20
|
const relativePathToAbsolute = (relativePath) => {
|
|
15
21
|
return path.resolve(process.cwd(), relativePath);
|
|
@@ -112,15 +118,23 @@ function getExclude(isServer) {
|
|
|
112
118
|
];
|
|
113
119
|
}
|
|
114
120
|
|
|
121
|
+
function getSkipPluginExcludes(isServer) {
|
|
122
|
+
if (!isServer) return [];
|
|
123
|
+
return skipPluginPaths
|
|
124
|
+
.map((p) => p.replace(/\\/g, '/').replace(/\/$/, ''))
|
|
125
|
+
.filter(Boolean)
|
|
126
|
+
.map((p) => `${p}/src/server/**`);
|
|
127
|
+
}
|
|
128
|
+
|
|
115
129
|
const defineServerConfig = () => {
|
|
116
130
|
return vitestConfig({
|
|
117
131
|
test: {
|
|
118
132
|
setupFiles: resolve(__dirname, './setup/server.ts'),
|
|
119
|
-
exclude: getExclude(true),
|
|
133
|
+
exclude: [...getExclude(true), ...getSkipPluginExcludes(true)],
|
|
120
134
|
retry: process.env.CI ? 2 : 0,
|
|
121
135
|
},
|
|
122
136
|
coverage: {
|
|
123
|
-
exclude: getExclude(true),
|
|
137
|
+
exclude: [...getExclude(true), ...getSkipPluginExcludes(true)],
|
|
124
138
|
},
|
|
125
139
|
});
|
|
126
140
|
};
|