Skip to content

chore: improve tests for True and False asserters.#1744

Closed
ccoVeille wants to merge 1 commit into
stretchr:masterfrom
ccoveille-forks:improve-tests-true-false
Closed

chore: improve tests for True and False asserters.#1744
ccoVeille wants to merge 1 commit into
stretchr:masterfrom
ccoveille-forks:improve-tests-true-false

Conversation

@ccoVeille
Copy link
Copy Markdown
Collaborator

Summary

We are now testing the failure messages for the assert package.

Changes

Only the tests are updated, code is unchanged.

Using captureTestingT helper helps us to check:

  • the result of the asserter
  • the error message reported by the asserter

Previously the tests were checking only the result of the asserter, but not the error message.

Motivation

It allows us to make sure the error message reported are OK.

Here I'm limiting the scope to show how it could help us.

Related issues

This is a proof of concept PR that follows up #1737 that was closed because:

Only the tests are updated, code is unchanged.

Previously, the tests were checking only the result of the asserter.
Using captureTestingT helper allows to check the error message
@ccoVeille ccoVeille force-pushed the improve-tests-true-false branch from ab19c8c to f5fed19 Compare May 17, 2025 15:39
@ccoVeille ccoVeille marked this pull request as draft May 17, 2025 15:50
@ccoVeille ccoVeille closed this May 17, 2025
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.

1 participant