File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 203203 "output" : []
204204 },
205205 "test:codeactions" : {
206- "command" : " node --test --test-reporter=spec lib/test/codeactions.test.js" ,
206+ "command" : " node --test --test-reporter=dot lib/test/codeactions.test.js" ,
207207 "env" : {
208208 "NODE_OPTIONS" : " --enable-source-maps"
209209 },
236236 "output" : []
237237 },
238238 "test:diagnostic" : {
239- "command" : " node --test --test-reporter=spec lib/test/diagnostic.test.js" ,
239+ "command" : " node --test --test-reporter=dot lib/test/diagnostic.test.js" ,
240240 "env" : {
241241 "NODE_OPTIONS" : " --enable-source-maps"
242242 },
291291 "output" : []
292292 },
293293 "test:gc" : {
294- "command" : " node --test --test-reporter=spec --expose-gc lib/test/gc.test.js" ,
294+ "command" : " node --test --test-reporter=dot lib/test/gc.test.js" ,
295295 "env" : {
296296 "NODE_OPTIONS" : " --enable-source-maps"
297297 },
Original file line number Diff line number Diff line change @@ -17,16 +17,19 @@ import {SimpleLogger} from '../logging/simple-logger.js';
1717import { WorkerPool } from '../util/worker-pool.js' ;
1818import { registerExecutionConstructorHook } from '../execution/base.js' ;
1919import { Console } from '../logging/logger.js' ;
20+ import v8 from 'node:v8' ;
21+ import vm from 'node:vm' ;
2022
2123let numLiveExecutors = 0 ;
2224let numLiveExecutions = 0 ;
2325
24- const collectGarbage = ( ( ) => {
25- if ( global . gc == null ) {
26- throw new Error ( 'gc.test must be invoked with --expose-gc' ) ;
26+ const collectGarbage = ( ) => {
27+ if ( ! global . gc ) {
28+ v8 . setFlagsFromString ( '--expose_gc' ) ;
29+ global . gc = vm . runInNewContext ( 'gc' ) ;
2730 }
28- return global . gc ;
29- } ) ( ) ;
31+ global . gc ! ( ) ;
32+ } ;
3033
3134beforeEach ( ( ) => {
3235 const executorFinalizationRegistry = new FinalizationRegistry ( ( ) => {
You can’t perform that action at this time.
0 commit comments