Test passes when Assert.fail is called and on other assertions that should fail.
See original GitHub issue- [ x ] I’ve asked for help in the Truffle Gitter before filing this issue.
Issue
Truffle tests do not fail when I call Assert.fail("this should fail");
Steps to Reproduce
Write a test that calls Assert.fail(“this should fail”), and it won’t fail.
Expected Behavior
I expect the test to fail.
Actual Results
The test runs and passes
Environment
- Operating System: Max OS X Catalina
- Ethereum client: Truffle 5.1.11 default (ganache?)
- Truffle version (
truffle version
): v5.1.11 - node version (
node --version
): v10.16.3 - npm version (
npm --version
): 6.13.4
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Cypress assertion fails but test passes - Stack Overflow
One of the tests passes and the other fails when assertions are basically the same. Confused about how cypress handles async/promises. Why does ......
Read more >Assert.Fail - NUnit Docs
Fail. The Assert.Fail method provides you with the ability to generate a failure based on tests that are not encapsulated by the other...
Read more >Expected Failures | Apple Developer Documentation
If any assertions fail in a test after you call XCTExpectFailure , Xcode marks the test as an expected failure instead of a...
Read more >Using Fail Assertion in JUnit | Baeldung
When writing unit tests, we can use fail to explicitly create a failure under desired testing conditions.
Read more >TestNG showing as test passed even if assertion fails
However, if your test throws an exception, whether it is AssertionError or other exception, the test execution framework will consider your test ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@SidSethi Could you file a new issue, with more information, for the problem you’re encountering? Thanks!
[solved - kind of]
Am still seeing this issue with: truffle version 5.4.11 node version 14.17.3 solc version 0.5.17 ganache-cli version 6.12.2
Do i need to do something else to get the above fix https://github.com/trufflesuite/truffle/pull/2826?
turns out this was actually an out of gas error on a transaction, but for whatever reason truffle displays it as
Ambiguous event, possible interpretations
🤷♂️