@@ -8,6 +8,7 @@ import type { ContextRPC, ContextTestEnvironment, ResolvedConfig, RunnerRPC, Run
88import type { PoolProcessOptions , ProcessPool , RunWithFiles } from '../pool'
99import type { WorkspaceProject } from '../workspace'
1010import { envsOrder , groupFilesByEnv } from '../../utils/test-helpers'
11+ import { wrapSerializableConfig } from '../../utils/config-helpers'
1112import { groupBy , resolve } from '../../utils'
1213import { createMethodsRPC } from './rpc'
1314
@@ -44,12 +45,6 @@ function createChildProcessChannel(project: WorkspaceProject) {
4445 return { channel, cleanup }
4546}
4647
47- function stringifyRegex ( input : RegExp | string ) : string {
48- if ( typeof input === 'string' )
49- return input
50- return `$$vitest:${ input . toString ( ) } `
51- }
52-
5348export function createForksPool ( ctx : Vitest , { execArgv, env } : PoolProcessOptions ) : ProcessPool {
5449 const numCpus
5550 = typeof nodeos . availableParallelism === 'function'
@@ -144,14 +139,7 @@ export function createForksPool(ctx: Vitest, { execArgv, env }: PoolProcessOptio
144139 return configs . get ( project ) !
145140
146141 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 )
155143
156144 configs . set ( project , config )
157145 return config
0 commit comments