Skip to content

Conversation

@AsadHumayun
Copy link
Contributor

This PR currently adds tests for the following structures:

  • Emoji
  • Entitlement

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.

@vercel
Copy link

vercel bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
discord-js Skipped Skipped Jan 29, 2026 7:47pm
discord-js-guide Skipped Skipped Jan 29, 2026 7:47pm

Request Review

@vercel vercel bot temporarily deployed to Preview – discord-js January 27, 2026 21:15 Inactive
@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.33%. Comparing base (c71228a) to head (e2e2f30).

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     
Flag Coverage Δ
structures 42.60% <ø> (+6.93%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AsadHumayun AsadHumayun force-pushed the feat/add-tests-several-structures branch from 9edce03 to ac342cd Compare January 27, 2026 21:21
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 27, 2026 21:21 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js January 27, 2026 21:21 Inactive
Copy link
Member

@Qjuh Qjuh left a 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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expect(patched.guildId).toBe(instance.guildId);

duplicate

@github-project-automation github-project-automation bot moved this from Todo to Review in Progress in discord.js Jan 28, 2026
@vercel vercel bot temporarily deployed to Preview – discord-js January 29, 2026 19:47 Inactive
@vercel vercel bot temporarily deployed to Preview – discord-js-guide January 29, 2026 19:47 Inactive
import { kPatch } from '../src/utils/symbols';

/**
* For tests they should check
Copy link
Member

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 😂

Copy link
Contributor Author

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 :)

Comment on lines +29 to +30
expect(instance.guildId).toBe(data.guild_id);
expect(instance.consumed).toBe(data.consumed);
Copy link
Member

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

Suggested change
expect(instance.guildId).toBe(data.guild_id);
expect(instance.consumed).toBe(data.consumed);
expect(instance.consumed).toBe(data.consumed);
expect(instance.guildId).toBeUndefined();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Review in Progress

Development

Successfully merging this pull request may close these issues.

3 participants