forked from forcedotcom/mobile-mcp-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.base.mts
More file actions
86 lines (71 loc) · 2.77 KB
/
vitest.config.base.mts
File metadata and controls
86 lines (71 loc) · 2.77 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import { defineConfig } from 'vitest/config';
import { resolve, dirname } from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default defineConfig({
// Resolve workspace package aliases to their compiled JavaScript files
// This is needed when tests import workspace packages that are defined in tsconfig.base.json
resolve: {
alias: {
'@salesforce/workflow-magi': resolve(__dirname, 'packages/workflow-magi/dist/index.js'),
'@salesforce/magen-mcp-workflow': resolve(__dirname, 'packages/mcp-workflow/dist/index.js'),
},
},
// Specifies the test environment to use
// 'node' is used for running tests in a Node.js environment
test: {
environment: 'node',
// Glob patterns for test files to include
// Matches any .test.ts or .spec.ts files in the tests directory
include: ['tests/**/*.{test,spec}.ts'],
// Glob patterns for files to exclude from testing
// Excludes node_modules and any files in the dist directory
exclude: ['node_modules', 'dist'],
// Enables code coverage reporting
coverage: {
// Specifies the coverage provider to use (v8 is the default)
provider: 'v8',
// Types of coverage reports to generate
reporter: ['text', 'json', 'html'],
// Directory where coverage reports will be generated
reportsDirectory: './coverage',
// Whether to include all files in coverage report, even if they're not tested
all: true,
// Files to exclude from coverage reporting
exclude: [
'node_modules/',
'dist/',
'**/*.d.ts',
'**/*.test.ts',
'**/*.config.ts',
'**/config.ts', // Type-only config files (e.g., orchestrator config)
'**/types/',
'**/index.ts',
'**/coverage/',
'**/update-type-declarations.ts',
'**/tools/tool.ts', // Interface-only file with no executable code
'**/templates/**', // Template files should not be included in coverage
],
// Files to include in coverage reporting
include: ['src/**/*.ts'],
// Coverage thresholds that will cause the test to fail if not met
// These are percentages (0-100)
thresholds: {
statements: 80,
branches: 80,
functions: 80,
lines: 80,
},
},
// Timeout in milliseconds for each test. Tests that take longer than this will fail.
testTimeout: 5000,
// Timeout in milliseconds for each hook(beforeEach, beforeAll, etc).
// Hooks that take longer than this will fail.
hookTimeout: 20000,
// Whether to show console output during test execution
silent: false,
// Whether to show test progress in the console
reporters: ['default'],
},
});