Skip to content

chore: cleaned up tests using native functionality - #665

Open
fearphage wants to merge 1 commit into
slackapi:mainfrom
fearphage:assertion-clean-up
Open

chore: cleaned up tests using native functionality#665
fearphage wants to merge 1 commit into
slackapi:mainfrom
fearphage:assertion-clean-up

Conversation

@fearphage

Copy link
Copy Markdown

Summary

Describe the goal of this PR. Mention any related Issue numbers.

  • Removed try-catch wrappers from tests
  • Replaced mock.returns(Promise.resolve(...)) with mock.resolves(...)
  • Cleaned up assertions
  • Remove async marker from synchronous tests

Details

Many tests were wrapped in try-catch blocks. This is a bit odd and awkward since failing tests fail by throwing AssertionErrors. I unwrapped the tests to allow them to fail as expected. The vast majority of this clean up is just using assert.rejects.

Note

The changes are much smaller than they appear. If you ignore the white space changes (from deleting the try-catch wrapper), it makes the changes much more easily digestible.

Requirements

@fearphage
fearphage requested a review from a team as a code owner August 6, 2026 21:14
@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7e1f1b5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@salesforce-cla

salesforce-cla Bot commented Aug 6, 2026

Copy link
Copy Markdown

Thanks for the contribution! Before we can merge this, we need @fearphage to sign the Salesforce Inc. Contributor License Agreement.

@zimeg

zimeg commented Aug 6, 2026

Copy link
Copy Markdown
Member

👋 Hey @fearphage! Before we review this could I ask you to sign the @salesforce-cla[bot] message above?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants