Add failsafe error catch if card object is undefined during metadata initialisation #477

Merged
Vylpes merged 5 commits from feature/473-card-object-undefined into release/0.10.0 2025-12-01 22:02:40 +00:00
Owner
  • Add unit tests for the failsafe

#473

- Add unit tests for the failsafe #473
Add unit tests for the failsafe on card object being undefined
Some checks failed
Test / build (push) Failing after 54s
0029babb13
Fix tests
All checks were successful
Test / build (push) Successful in 53s
52c6ecd1cd
Fix failsafe not taking into account if a json file has other series in it
All checks were successful
Test / build (push) Successful in 55s
5d74e00357
Vylpes requested review from Copilot 2025-11-12 18:08:30 +00:00
Copilot requested changes 2025-11-12 18:16:25 +00:00
Dismissed
Copilot left a comment
Member

I'll review this diff for you. This appears to be a bug fix with added test coverage for the CardMetadataFunction.

Summary

The changes fix a bug where only the first series in a JSON file was validated for cards, and adds comprehensive unit tests to prevent regression.

Verdict

Approve with minor fixes - The core bug fix is solid and the tests are valuable. Just fix the typo in the function name and consider the validation ordering question.

I'll review this diff for you. This appears to be a bug fix with added test coverage for the `CardMetadataFunction`. ## Summary The changes fix a bug where only the first series in a JSON file was validated for cards, and adds comprehensive unit tests to prevent regression. ## Verdict **Approve with minor fixes** - The core bug fix is solid and the tests are valuable. Just fix the typo in the function name and consider the validation ordering question.
@ -0,0 +1,43 @@
import {CardMetadata} from "../../../src/contracts/SeriesMetadata";
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Required to test non-confirmed json data
export default function GenenerateSeriesMetadata(id: number, name: string, generateSeries: number = 1, generateCards: number | number[] = 1): any[] {
Member

Typo in Function Name

Typo in Function Name
Vylpes marked this conversation as resolved
Fix typo
All checks were successful
Test / build (push) Successful in 52s
448073c6cd
Vylpes dismissed Copilot's review 2025-11-22 10:14:20 +00:00
Vylpes merged commit 46cb8a84e7 into release/0.10.0 2025-12-01 22:02:40 +00:00
Vylpes deleted branch feature/473-card-object-undefined 2025-12-01 22:02:40 +00:00
Sign in to join this conversation.
No description provided.