-
Notifications
You must be signed in to change notification settings - Fork 90
Add tests #925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add tests #925
Conversation
mwl.json
Outdated
| "cards": { "33025": { "deck_limit": 0 }, "33051": { "deck_limit": 0 } }, | ||
| "code": "startup-ban-list-24-01-for-classic-only", | ||
| "date_start": "2023-09-21", | ||
| "date_start": "2024-01-19", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some of these are intentional, namely NRDB classic does not handle formats well so the incorrect active date allows us to have startup balance updates available without being the default if the latest ban list is for startup and not standard
any (ignore active date) MWL entries have date_start values intentionally before their actual ones to avoid conflicts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes a lot of sense and explains what I was seeing, thanks!
Do you think there's value in leaving the dates corrected and removing the (ignore active date) note for archive/historical accuracy (and cleaning up the dropdown list) since the latest ban list is standard, and then just maintaining the temp older date and (ignore active date) note in the future for the latest startup list only until a new standard list is released?
test/validate_v1.ts
Outdated
| const currDate = new Date(mwl[i].date_start); | ||
|
|
||
| expect(currDate.getTime(), | ||
| `MWL entries out of order: ${mwl[i].name} (${mwl[i].date_start}) comes after ${mwl[i - 1].name} (${mwl[i - 1].date_start}) in the list, but has an earlier date` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alongside the comment about startup dates being intentionally incorrect, in the past we've hardcoded the intentionally incorrect ban lists to avoid testing them (see
netrunner-cards-json/test/validate_v2.ts
Line 513 in 2b0f0fc
| const ignoreRestrictions = new Set<string>( |
I think either having the same hardcoding as a stopgap, or just skipping entries that say "ignore active date" should be done here as well.
test/validate_v1.ts
Outdated
| }); | ||
| }); | ||
|
|
||
| it('mwl entries are listed in chronological order', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i actually think you don't need this test. we tend to just append anyway.
|
I don’t think so, namely because I think it’s one of those data points that will almost certainly fall out of sync because we (I) often forget to set the right date for the new MWL entry let alone correct the previous ones. Additionally with our current naming scheme the year and month for each MWL should provide enough context for most use cases is my thought.
-
________________________________
From: Matthew LeHew ***@***.***>
Sent: Thursday, November 20, 2025 12:11:19 PM
To: Null-Signal-Games/netrunner-cards-json ***@***.***>
Cc: Talha Ahsan ***@***.***>; Mention ***@***.***>
Subject: Re: [Null-Signal-Games/netrunner-cards-json] Add tests and correct JSON data (PR #925)
@matthewlehew commented on this pull request.
________________________________
In mwl.json<#925 (comment)>:
"name": "Sunset Ban List 24.01",
"subtypes": { "current": { "deck_limit": 0 } }
},
{
"cards": { "33025": { "deck_limit": 0 }, "33051": { "deck_limit": 0 } },
"code": "startup-ban-list-24-01-for-classic-only",
- "date_start": "2023-09-21",
+ "date_start": "2024-01-19",
Ah, that makes a lot of sense and explains what I was seeing, thanks!
Do you think there's value in leaving the dates corrected and removing the (ignore active date) note for archive/historical accuracy (and cleaning up the dropdown list) since the latest ban list is standard, and then just maintaining the temp older date and (ignore active date) note in the future for the latest startup list only until a new standard list is released?
—
Reply to this email directly, view it on GitHub<#925 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AASRE3FSBV5PFCNRJO234H335X74PAVCNFSM6AAAAACMWPVPXWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTIOBZGIZDGNBQGM>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
PR updated:
|
This PR adds a few tests, including one that tripped me up and one mentioned as a goal by @talha-ahsan in #920 (comment). It also includes a couple corrections resulting from the tests.
MWL test to ensure all items are listed in chronological order (to avoid placeholders being left in)This resulted in date_start corrections for sunset-ban-list-24-01, startup-ban-list-24-01-for-classic-only, and startup-ban-list-24-09-for-classic-only. New dates were pulled from relevant posts on nullsignal.games/blog.v2/card_sets.json test to ensure items are listed in chronological order.This resulted in swapping the order of core-set and draft, the first two items on the list. I couldn't find anything to indicate either had a wrong date.v2/card_cycles.jsontest to ensure every cycle had a unique position.