The Wayback Machine - https://web.archive.org/web/20221028150206/https://github.com/discordjs/discord.js/pull/5622
Skip to content
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

fix(DataResolver): fix circular dependency error with GuildTemplate #5622

Merged
merged 4 commits into from May 22, 2021

Conversation

cherryblossom000
Copy link
Contributor

@cherryblossom000 cherryblossom000 commented May 13, 2021

Please describe the changes this PR makes and why it should be merged:

Fixes #5600

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes


describe('resolveGuildTemplateCode', () => {
test('basic', () => {
expect(DataResolver.resolveGuildTemplateCode('https://discord.new/abc')).toBe('abc');
Copy link
Contributor Author

@cherryblossom000 cherryblossom000 May 13, 2021

Choose a reason for hiding this comment

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

I wasn't sure if this test is really necessary, but because I technically changed the code in resolveGuildTemplateCode, I added this just in case. I'm happy to remove it if this is unnecessary.

There don't seem to be many existing tests, so I just copied what was in test/escapeMarkdown.test.js.

/* eslint-disable max-len, no-undef */
/* eslint-env jest */
/* eslint-disable max-len */
Copy link
Contributor Author

@cherryblossom000 cherryblossom000 May 13, 2021

Choose a reason for hiding this comment

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

I noticed that jest is listed as a dev dependency in package.json, so I enabled the jest ESLint environment so that no-undef can still be enabled without spewing warnings about describe, test, and expect being undefined.

src/util/DataResolver.js Outdated Show resolved Hide resolved
iCrawl
iCrawl approved these changes May 22, 2021
@iCrawl iCrawl merged commit b376f31 into discordjs:master May 22, 2021
4 checks passed
@cherryblossom000 cherryblossom000 deleted the 5600 branch May 22, 2021
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
@iCrawl iCrawl added this to In progress in Version 13 Release via automation Jun 27, 2021
@iCrawl iCrawl moved this from In progress to Done in Version 13 Release Jun 27, 2021
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Circular dependency in DataResolver/GuildTemplate
2 participants