@@ -70,7 +70,6 @@ it('passes fork options down to worker_threads.Worker, adding the defaults', ()
70
70
71
71
expect ( workerThreads . mock . calls [ 0 ] [ 0 ] ) . toBe ( thread . replace ( / \. t s $ / , '.js' ) ) ;
72
72
expect ( workerThreads . mock . calls [ 0 ] [ 1 ] ) . toEqual ( {
73
- env : process . env , // Default option.
74
73
eval : false ,
75
74
execArgv : [ '--inspect' , '-p' ] ,
76
75
execPath : 'hello' , // Added option.
@@ -84,23 +83,12 @@ it('passes fork options down to worker_threads.Worker, adding the defaults', ()
84
83
} ) ;
85
84
} ) ;
86
85
87
- it ( 'passes workerId to the thread and assign it to env.JEST_WORKER_ID' , ( ) => {
88
- // eslint-disable-next-line no-new
89
- new Worker ( {
90
- forkOptions : { } ,
91
- maxRetries : 3 ,
92
- workerId : 2 ,
93
- workerPath : '/tmp/foo' ,
94
- } ) ;
95
-
96
- expect ( workerThreads . mock . calls [ 0 ] [ 1 ] . env . JEST_WORKER_ID ) . toEqual ( '3' ) ;
97
- } ) ;
98
-
99
- it ( 'initializes the thread with the given workerPath' , ( ) => {
86
+ it ( 'initializes the thread with the given workerPath and workerId' , ( ) => {
100
87
const worker = new Worker ( {
101
88
forkOptions : { } ,
102
89
maxRetries : 3 ,
103
90
setupArgs : [ 'foo' , 'bar' ] ,
91
+ workerId : 2 ,
104
92
workerPath : '/tmp/foo/bar/baz.js' ,
105
93
} ) ;
106
94
@@ -109,6 +97,7 @@ it('initializes the thread with the given workerPath', () => {
109
97
false ,
110
98
'/tmp/foo/bar/baz.js' ,
111
99
[ 'foo' , 'bar' ] ,
100
+ '3' ,
112
101
] ) ;
113
102
} ) ;
114
103
0 commit comments