Skip to content

Fix false positives in isThrowingExpectedErrors - #180

Open
aleskarova wants to merge 1 commit into
AlreadyBored:masterfrom
aleskarova:fix/false-positive-isThrowingExpectedErrors
Open

aleskarova wants to merge 1 commit into
AlreadyBored:masterfrom
aleskarova:fix/false-positive-isThrowingExpectedErrors

Conversation

@aleskarova

Copy link
Copy Markdown

The isThrowingExpectedErrors helper returned true when the function under test did not throw. This allowed tests requiring an exception to pass with incorrect implementations.

Added return INCORRECT_RESULT_MSG immediately after the f() call inside the try block. The helper now returns false when an expected exception is not thrown.

This fixes checks in simple-chain.test.js, transform-array.test.js, vigenere-cipher.test.js, and what-season.test.js.

Closes #179

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.

isThrowingExpectedErrors returns true when the function does not throw

1 participant