forked from wevm/mppx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
84 lines (82 loc) · 2.76 KB
/
vitest.config.ts
File metadata and controls
84 lines (82 loc) · 2.76 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
import path from 'node:path'
import { playwright } from '@vitest/browser-playwright'
import { defineConfig } from 'vitest/config'
// Shared aliases used by both projects
const alias = {
'mppx/client': path.resolve(import.meta.dirname, 'src/client'),
'mppx/mcp-sdk/client': path.resolve(import.meta.dirname, 'src/mcp-sdk/client'),
'mppx/mcp-sdk/server': path.resolve(import.meta.dirname, 'src/mcp-sdk/server'),
'mppx/proxy': path.resolve(import.meta.dirname, 'src/proxy'),
'mppx/server': path.resolve(import.meta.dirname, 'src/server'),
'mppx/tempo': path.resolve(import.meta.dirname, 'src/tempo'),
'mppx/hono': path.resolve(import.meta.dirname, 'src/middlewares/hono'),
'mppx/express': path.resolve(import.meta.dirname, 'src/middlewares/express'),
'mppx/nextjs': path.resolve(import.meta.dirname, 'src/middlewares/nextjs'),
'mppx/elysia': path.resolve(import.meta.dirname, 'src/middlewares/elysia'),
'mppx/stripe': path.resolve(import.meta.dirname, 'src/stripe'),
'mppx/stripe/client': path.resolve(import.meta.dirname, 'src/stripe/client'),
'mppx/stripe/server': path.resolve(import.meta.dirname, 'src/stripe/server'),
mppx: path.resolve(import.meta.dirname, 'src'),
'~test': path.resolve(import.meta.dirname, 'test'),
}
export default defineConfig({
test: {
coverage: {
exclude: ['test/**'],
},
globalSetup: ['./test/setup.global.ts'],
projects: [
{
test: {
name: 'node',
alias,
include: ['src/**/*.test.ts'],
exclude: ['src/**/*.browser.test.ts', 'src/cli/**/*.test.ts'],
typecheck: {
include: ['src/**/*.test-d.ts'],
},
globals: true,
retry: 3,
setupFiles: ['./test/setup.ts'],
hookTimeout: 60_000,
},
},
{
test: {
name: 'cli',
alias,
include: ['src/cli/**/*.test.ts'],
globals: true,
retry: 3,
setupFiles: ['./test/setup.ts'],
hookTimeout: 60_000,
},
},
{
resolve: {
alias: {
// constantTimeEqual uses node:crypto which is unavailable in browser.
// The browser tests don't exercise challenge verification, so a shim is fine.
'./internal/constantTimeEqual.js': path.resolve(
import.meta.dirname,
'test/browser/constantTimeEqual.shim.ts',
),
},
},
test: {
name: 'browser',
alias,
include: ['src/**/*.browser.test.ts'],
globals: true,
retry: 1,
browser: {
enabled: true,
headless: true,
provider: playwright(),
instances: [{ browser: 'chromium' }],
},
},
},
],
},
})