-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
test(structures): add tests for several structures #11407
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?
test(structures): add tests for several structures #11407
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11407 +/- ##
==========================================
+ Coverage 31.62% 32.33% +0.71%
==========================================
Files 385 385
Lines 13918 13918
Branches 1096 1096
==========================================
+ Hits 4401 4500 +99
+ Misses 9383 9278 -105
- Partials 134 140 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9edce03 to
ac342cd
Compare
Qjuh
left a comment
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.
Apart from these little nitpicks LGTM
| }); | ||
|
|
||
| expect(patched.guildId).toBe(instance.guildId); | ||
| expect(patched.guildId).toBe(instance.guildId); |
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.
| expect(patched.guildId).toBe(instance.guildId); |
duplicate
| import { kPatch } from '../src/utils/symbols'; | ||
|
|
||
| /** | ||
| * For tests they should check |
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.
Maybe I should've said "don't quote me on that"
when I said this 😂
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.
My bad, I'll be sure to remove that :)
| expect(instance.guildId).toBe(data.guild_id); | ||
| expect(instance.consumed).toBe(data.consumed); |
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.
technically correct, but i'd rather be more explicit with what we're checking
| expect(instance.guildId).toBe(data.guild_id); | |
| expect(instance.consumed).toBe(data.consumed); | |
| expect(instance.consumed).toBe(data.consumed); | |
| expect(instance.guildId).toBeUndefined(); |
This PR currently adds tests for the following structures:
I intend on adding tests for more structures also to this PR (to help avoid the number of PRs in review).
Since #11406 will introduce URL getters for several structures, this PR will remain in draft until that is merged so that I can merge and add tests for those methods in one go (to help avoid additional PRs).
I have only added 2 tests for structures so far just so that I can get some initial feedback on the type of approach.