Commit ba6e036
authored
fix(testing): handle undefined options in playwright preset (#34750)
## Current Behavior
When calling `nxE2EPreset(__filename)` without passing the optional
`options` parameter, the function throws a runtime error because
`options.openHtmlReport` accesses a property on `undefined`. Other
property accesses in the function already use optional chaining
(`options?.testDir`, `options?.generateBlobReports`), but this one was
missed.
Additionally, the `openHtmlReport` property documents a default value of
`'on-failure'` via JSDoc, but that default was never actually applied in
the code.
## Expected Behavior
Calling `nxE2EPreset(__filename)` without the `options` argument works
without errors. The `openHtmlReport` option correctly falls back to
`'on-failure'` when not specified, matching the documented `@default` in
the interface.
## Related Issue(s)
N/A - Discovered when upgrading NX and we didn't pass options1 parent ec8be2d commit ba6e036
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
0 commit comments