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

chore: Replace catch with assert.rejects|throws in tests (part 2) #3653

Merged
merged 4 commits into from
May 6, 2021

Conversation

mdrichardson
Copy link
Contributor

Partially addresses: #3426
#minor

Description

We has some awkward usage of

try {
  methodThatShouldFail()
  assert.fail('not whatever')
} catch (err) {
	assert.strictEqual(err.message, 'whatever');
}

That I converted to

assert.throws(
	() => methodThatShouldFail(),
	Error('whatever')
);

Note

There's a commit with a bunch of no-op linting fixes. I recommend mostly reviewing the other one.

@mdrichardson mdrichardson requested review from a team as code owners May 5, 2021 22:15
@coveralls
Copy link

coveralls commented May 5, 2021

Pull Request Test Coverage Report for Build 817416466

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.06%) to 85.434%

Totals Coverage Status
Change from base Build 817396671: 1.06%
Covered Lines: 19225
Relevant Lines: 21402

💛 - Coveralls

@mdrichardson mdrichardson merged commit 89b43cc into microsoft:main May 6, 2021
@mdrichardson mdrichardson deleted the tryCatchPt2 branch May 6, 2021 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants