Commit 2c89828
Fix retryFailedStep ignoredSteps exact-name matching (#5571)
* Fix retryFailedStep ignoredSteps exact-name matching
The wildcard check used `ignored.indexOf('*')` as a boolean. `-1` is
truthy in JavaScript (only `0` is falsy), so entries without `*` were
matched via `startsWith(slice(0, -1))` instead of exact compare, which
also chops the last character — broadening the match further.
`ignoredSteps: ['see']` silently ignored `seeElement`, `seeInField`,
`selectOption`, `sendPostRequest` — anything starting with `se`.
Compare against `-1` explicitly so exact-name entries only match
themselves, as the docs describe.
* fix(retryFailedStep): avoid mutating shared defaultConfig
Each call to retryFailedStep mutated the module-level defaultConfig via
Object.assign(defaultConfig, config), so config.when from a prior call leaked
into the next as customWhen and chained recursively. In tests this made
when() return undefined for closures that no longer had a live step.started
listener (e.g. after event.cleanDispatcher), causing the new regression test
to fail in the full unit suite even though it passed in isolation.
Use Object.assign({}, defaultConfig, config) so each registration gets an
independent config object. Rewrites the regression test to assert via
retryConfig.when() directly, which is now sound.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Michael Bodnarchuk <davert.ua@gmail.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent c07b826 commit 2c89828
2 files changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
189 | 206 | | |
190 | 207 | | |
191 | 208 | | |
| |||
0 commit comments