This repository was archived by the owner on Oct 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Expand file tree Collapse file tree 1 file changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -12,17 +12,33 @@ var testFiles = fs.readdirSync(testRoot).filter(function (filename) {
1212 return filename . indexOf ( 'test-http' ) === 0 ;
1313} ) ;
1414
15+ var defaultFlags = [
16+ '--allow-natives-syntax' ,
17+ '--expose-gc' ,
18+ '--expose-internals'
19+ ] ;
20+
21+ if ( process . version >= 'v8' ) defaultFlags . push ( '--expose-http2' ) ;
22+
1523var failedTests = [ ] ;
1624var numSuccesses = 0 ;
1725testFiles . forEach ( function ( filename ) {
1826 var testModulePath = path . join ( testRoot , filename ) ;
27+ var singleTestFlags = defaultFlags . concat ( [
28+ 'run-node-http-test.js' ,
29+ testModulePath
30+ ] ) ;
31+
32+ // this is the only test, that actually asserts the lack of http2 flag
33+ // therefore we have to remove it from the process we are about to run
34+ if ( filename === 'test-http2-noflag.js' ) {
35+ singleTestFlags = singleTestFlags . filter ( function ( flag ) {
36+ return flag !== '--expose-http2' ;
37+ } ) ;
38+ }
39+
1940 try {
20- child_process . execFileSync ( 'node' , [
21- '--allow-natives-syntax' ,
22- '--expose_gc' ,
23- 'run-node-http-test.js' ,
24- testModulePath
25- ] , { stdio : 'ignore' } ) ;
41+ child_process . execFileSync ( 'node' , singleTestFlags , { stdio : 'ignore' } ) ;
2642 console . log ( '✓ ' + filename ) ;
2743 numSuccesses ++ ;
2844 } catch ( e ) {
You can’t perform that action at this time.
0 commit comments