@@ -8,6 +8,7 @@ import type { ContextRPC, ContextTestEnvironment, ResolvedConfig, RunnerRPC, Run
8
8
import type { PoolProcessOptions , ProcessPool , RunWithFiles } from '../pool'
9
9
import type { WorkspaceProject } from '../workspace'
10
10
import { envsOrder , groupFilesByEnv } from '../../utils/test-helpers'
11
+ import { wrapSerializableConfig } from '../../utils/config-helpers'
11
12
import { groupBy , resolve } from '../../utils'
12
13
import { createMethodsRPC } from './rpc'
13
14
@@ -44,12 +45,6 @@ function createChildProcessChannel(project: WorkspaceProject) {
44
45
return { channel, cleanup }
45
46
}
46
47
47
- function stringifyRegex ( input : RegExp | string ) : string {
48
- if ( typeof input === 'string' )
49
- return input
50
- return `$$vitest:${ input . toString ( ) } `
51
- }
52
-
53
48
export function createForksPool ( ctx : Vitest , { execArgv, env } : PoolProcessOptions ) : ProcessPool {
54
49
const numCpus
55
50
= typeof nodeos . availableParallelism === 'function'
@@ -144,14 +139,7 @@ export function createForksPool(ctx: Vitest, { execArgv, env }: PoolProcessOptio
144
139
return configs . get ( project ) !
145
140
146
141
const _config = project . getSerializableConfig ( )
147
-
148
- const config = {
149
- ..._config ,
150
- // v8 serialize does not support regex
151
- testNamePattern : _config . testNamePattern
152
- ? stringifyRegex ( _config . testNamePattern )
153
- : undefined ,
154
- } as ResolvedConfig
142
+ const config = wrapSerializableConfig ( _config )
155
143
156
144
configs . set ( project , config )
157
145
return config
0 commit comments