1
1
import tsconfigPaths from 'vite-tsconfig-paths' ;
2
2
import { defineConfig } from 'vitest/config' ;
3
+ import { timeout as testTimeout } from './internal/e2e/src/timeout' ;
4
+ import { boolEnv , isCI , isNotPlatform } from './internal/testing/src/env' ;
3
5
4
6
// By default, Vite bypasses node_packages to native Node; meaning, imports to
5
7
// packages that match the tsconfig paths wont work because Node will require the
@@ -10,10 +12,66 @@ const inline = [/@graphql-mesh\/.*/, /@omnigraph\/.*/];
10
12
11
13
export default defineConfig ( {
12
14
plugins : [ tsconfigPaths ( ) ] ,
13
- test : { server : { deps : { inline } } } ,
14
15
resolve : {
15
16
alias : {
16
17
graphql : 'graphql/index.js' , // TODO: why duplicate graphql errors when there's no multiple graphqls installed? mistery
17
18
} ,
18
19
} ,
20
+ test : {
21
+ server : { deps : { inline } } ,
22
+ projects : [
23
+ {
24
+ extends : true ,
25
+ test : {
26
+ name : 'unit' ,
27
+ include : [ '**/*.(test|spec).ts' ] ,
28
+ } ,
29
+ } ,
30
+ {
31
+ extends : true ,
32
+ test : {
33
+ name : 'e2e' ,
34
+ include : [
35
+ '**/*.e2e.ts' ,
36
+ ...( isCI ( ) && isNotPlatform ( 'linux' )
37
+ ? [
38
+ // TODO: containers are not starting on non-linux environments
39
+ '!**/e2e/auto-type-merging' ,
40
+ '!**/e2e/neo4j-example' ,
41
+ '!**/e2e/soap-demo' ,
42
+ '!**/e2e/mysql-employees' ,
43
+ '!**/e2e/opentelemetry' ,
44
+ '!**/e2e/graphos-polling' ,
45
+ ]
46
+ : [ ] ) ,
47
+ ] ,
48
+ hookTimeout : testTimeout ,
49
+ testTimeout,
50
+ retry : boolEnv ( 'CI' ) ? 3 : 0 ,
51
+ } ,
52
+ } ,
53
+ {
54
+ extends : true ,
55
+ test : {
56
+ name : 'bench' ,
57
+ hookTimeout : testTimeout ,
58
+ testTimeout,
59
+ benchmark : {
60
+ include : [ 'bench/**/*.bench.ts' , 'e2e/**/*.bench.ts' ] ,
61
+ reporters : [ 'verbose' ] ,
62
+ outputJson : 'bench/results.json' ,
63
+ } ,
64
+ } ,
65
+ } ,
66
+ {
67
+ extends : true ,
68
+ test : {
69
+ name : 'memtest' ,
70
+ include : [ '**/*.memtest.ts' ] ,
71
+ hookTimeout : testTimeout ,
72
+ testTimeout,
73
+ } ,
74
+ } ,
75
+ ] ,
76
+ } ,
19
77
} ) ;
0 commit comments