microsoft / microsoft/go-sqlcmd

Pattern used for catching expected errors in tests should be able to verify for precise expected error

Open
#176 1 comment 0 reactions 1 assignee View on GitHub

@stuartpa is already working on this.

Since Dec 9, 2022.

bug housekeeping testing
Dominant language
Go
Stars
595
Forks
91
Avg merge
9h 35m
Merged PRs (30d)
1

Description

I've been using this pattern for negative tests, that are expecting a failure:

defer func() { test.CatchExpectedError(recover(), t) }()

This pattern ends up causing a test to pass for any error, even an error that is an error in the test itself.

Invent a pattern that ensures tests don't accidentally pass because the test itself is throwing an error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.