@@ -72,6 +72,12 @@ function getApplicableTestSuites(
72
72
async function main ( ) {
73
73
const noCoverage = process . argv . indexOf ( '--no-coverage' ) !== - 1 ;
74
74
75
+ const statsFilenameIdx = process . argv . indexOf ( '--save-stats-to' ) ;
76
+ let statsFilename = '' ;
77
+ if ( statsFilenameIdx !== - 1 ) {
78
+ statsFilename = process . argv [ statsFilenameIdx + 1 ] as string ;
79
+ }
80
+
75
81
const platform = zPlatform . parse ( os . platform ( ) ) ;
76
82
77
83
const expectations = readJSON (
@@ -85,6 +91,9 @@ async function main() {
85
91
const applicableSuites = getApplicableTestSuites ( parsedSuitesFile , platform ) ;
86
92
87
93
console . log ( 'Planning to run the following test suites' , applicableSuites ) ;
94
+ if ( statsFilename ) {
95
+ console . log ( 'Test stats will be saved to' , statsFilename ) ;
96
+ }
88
97
89
98
let fail = false ;
90
99
const recommendations = [ ] ;
@@ -116,7 +125,9 @@ async function main() {
116
125
const tmpDir = fs . mkdtempSync (
117
126
path . join ( os . tmpdir ( ) , 'puppeteer-test-runner-' )
118
127
) ;
119
- const tmpFilename = path . join ( tmpDir , 'output.json' ) ;
128
+ const tmpFilename = statsFilename
129
+ ? statsFilename
130
+ : path . join ( tmpDir , 'output.json' ) ;
120
131
console . log ( 'Running' , JSON . stringify ( parameters ) , tmpFilename ) ;
121
132
const args = [
122
133
'-u' ,
0 commit comments