File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
heft-plugins/heft-jest-plugin/src Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -161,8 +161,12 @@ function parseJestArgsToHeft(args: string[]): IHeftJestArgs {
161161
162162 // Handle --outputFile (skip with its value)
163163 if ( arg === '--outputFile' ) {
164- // Skip this and the next argument (the file path)
165- i += 2 ;
164+ // Skip this and the next argument (the file path) if it exists
165+ if ( i + 1 < args . length ) {
166+ i += 2 ;
167+ } else {
168+ i ++ ;
169+ }
166170 continue ;
167171 }
168172 if ( arg . startsWith ( '--outputFile=' ) ) {
@@ -172,8 +176,12 @@ function parseJestArgsToHeft(args: string[]): IHeftJestArgs {
172176
173177 // Handle --reporters (skip with its value)
174178 if ( arg === '--reporters' ) {
175- // Skip this and the next argument (the reporter)
176- i += 2 ;
179+ // Skip this and the next argument (the reporter) if it exists
180+ if ( i + 1 < args . length ) {
181+ i += 2 ;
182+ } else {
183+ i ++ ;
184+ }
177185 continue ;
178186 }
179187 if ( arg . startsWith ( '--reporters=' ) ) {
@@ -183,7 +191,12 @@ function parseJestArgsToHeft(args: string[]): IHeftJestArgs {
183191
184192 // Handle --config (skip with its value as Heft has its own config handling)
185193 if ( arg === '--config' || arg === '-c' ) {
186- i += 2 ;
194+ // Skip this and the next argument (the config path) if it exists
195+ if ( i + 1 < args . length ) {
196+ i += 2 ;
197+ } else {
198+ i ++ ;
199+ }
187200 continue ;
188201 }
189202 if ( arg . startsWith ( '--config=' ) ) {
You can’t perform that action at this time.
0 commit comments