Commit 9f4382a
committed
fix(ApiDataFactory): Improve cleanup reliability in _after() method
- Add error handling to catch and log deletion failures without breaking Promise.all
- Explicitly clear created items array after successful cleanup
- Check for undefined deletePromise before adding to promises array
This should help prevent test failures where data from previous tests
accumulates, especially in CI environments where timing may differ.
The cleanup now:
1. Catches individual deletion errors to prevent Promise.all rejection
2. Logs deletion errors for debugging
3. Clears the created items tracker after all deletions complete
4. Handles cases where _requestDelete returns undefined1 parent 8ee6c69 commit 9f4382a
1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
245 | 252 | | |
246 | 253 | | |
247 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
248 | 260 | | |
249 | 261 | | |
250 | 262 | | |
| |||
0 commit comments