Commit 08de5ae
committed
frontend: apiDiscovery: Tighten fallback logging and spy cleanup
Bound the aggregated-discovery fallback log to a type plus the top-level
key list (capped at 10 entries) instead of dumping the whole payload.
A real discovery response can carry thousands of entries and burying
the devtools obscures the actual signal we wanted to surface in #4840.
Errors on the rejected branch still pass through raw so stacks survive.
Reword the legacy .catch log to say "fetch or parse" since the same
handler also catches res.json() rejections, not only transport errors.
Hoist the console.debug spy to a beforeEach/afterEach pair scoped to
the new describe block so the cleanup runs even when an assertion
throws, and restore only that single spy rather than vi.restoreAllMocks
which would clobber the file-level vi.mock for ./fetch.
Signed-off-by: Rudraksha Singh Sengar <rudraksharss@gmail.com>1 parent 2e5a5b0 commit 08de5ae
2 files changed
Lines changed: 69 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
| |||
582 | 591 | | |
583 | 592 | | |
584 | 593 | | |
585 | | - | |
586 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
587 | 604 | | |
588 | | - | |
| 605 | + | |
589 | 606 | | |
590 | 607 | | |
591 | 608 | | |
592 | | - | |
593 | 609 | | |
594 | 610 | | |
595 | 611 | | |
| |||
608 | 624 | | |
609 | 625 | | |
610 | 626 | | |
611 | | - | |
612 | 627 | | |
613 | 628 | | |
614 | 629 | | |
| |||
623 | 638 | | |
624 | 639 | | |
625 | 640 | | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
626 | 653 | | |
627 | 654 | | |
628 | 655 | | |
629 | | - | |
630 | 656 | | |
631 | 657 | | |
632 | 658 | | |
| |||
639 | 665 | | |
640 | 666 | | |
641 | 667 | | |
642 | | - | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
643 | 671 | | |
644 | 672 | | |
645 | 673 | | |
646 | 674 | | |
647 | 675 | | |
648 | | - | |
649 | 676 | | |
650 | 677 | | |
651 | 678 | | |
| |||
658 | 685 | | |
659 | 686 | | |
660 | 687 | | |
661 | | - | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
662 | 691 | | |
663 | 692 | | |
664 | 693 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
20 | 36 | | |
21 | 37 | | |
22 | 38 | | |
| |||
183 | 199 | | |
184 | 200 | | |
185 | 201 | | |
186 | | - | |
| 202 | + | |
187 | 203 | | |
188 | 204 | | |
189 | 205 | | |
190 | 206 | | |
191 | 207 | | |
192 | 208 | | |
193 | 209 | | |
194 | | - | |
| 210 | + | |
195 | 211 | | |
196 | 212 | | |
197 | 213 | | |
| |||
206 | 222 | | |
207 | 223 | | |
208 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
209 | 229 | | |
210 | 230 | | |
211 | 231 | | |
212 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
213 | 236 | | |
214 | 237 | | |
215 | 238 | | |
216 | 239 | | |
217 | 240 | | |
218 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
219 | 245 | | |
220 | 246 | | |
221 | 247 | | |
| |||
0 commit comments