-
-
Notifications
You must be signed in to change notification settings - Fork 393
Expand file tree
/
Copy pathrstest.config.ts
More file actions
44 lines (43 loc) · 1.37 KB
/
rstest.config.ts
File metadata and controls
44 lines (43 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import { defineConfig, defineProject } from '@rstest/core';
import path from 'path';
export default defineConfig({
testEnvironment: 'node',
output: {
module: false, // Output in CommonJS format to ensure `require` is available
// Externalize webpack to avoid conflicts with nested webpack builds in ConfigTestCases
externals: [
'webpack',
/^webpack\//,
'@module-federation/enhanced',
/^@module-federation\//,
],
},
projects: [
defineProject({
name: 'unit',
testEnvironment: 'node',
globals: true,
include: [
path.resolve(__dirname, 'test/**/*.test.ts'),
path.resolve(__dirname, 'test/**/*.spec.ts'),
],
setupFiles: [path.resolve(__dirname, 'test/setupTestFramework.js')],
testTimeout: 30000,
}),
defineProject({
name: 'config-cases',
testEnvironment: 'node',
globals: true,
include: [path.resolve(__dirname, 'test/**/*.rstest.ts')],
exclude: {
patterns: [
// This file is a shared harness that runner entrypoints import.
// Running it directly would add an extra warmup-only test file.
path.resolve(__dirname, 'test/ConfigTestCases.rstest.ts'),
],
},
setupFiles: [path.resolve(__dirname, 'test/setupTestFramework.js')],
testTimeout: 60000, // webpack 编译耗时较长
}),
],
});