You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This seems to be such an obvious bug that I feel like I'm missing something but I was following the typical "red-green-refactor" cycle of TDD and stumbled across a scenario where expect(undefined).to.be.defined was allowing a test to pass when used with Mocha. I've got a repo at https://github.com/mchandleraz/chai-wat that shows the issue.
I would expect a function that does not return anything to cause the 2nd test to fail (as the 3rd test does). Instead, only the 3rd test in my repo fails.
Have I found a bug, or is this expected?
Thanks!
The text was updated successfully, but these errors were encountered:
Up until ES6 proxies, there was no way for Chai or Mocha to know that a non-existent property such as defined was chained off of an existing property like be. This problem is fixed in Chai v4 in ES6 compatible environments, currently available on npm via chai@canary. This and related issues are discussed in length in #726. Gonna close this issue due to duplication but please feel free to discuss in that thread.
This seems to be such an obvious bug that I feel like I'm missing something but I was following the typical "red-green-refactor" cycle of TDD and stumbled across a scenario where
expect(undefined).to.be.defined
was allowing a test to pass when used with Mocha. I've got a repo at https://github.com/mchandleraz/chai-wat that shows the issue.I would expect a function that does not return anything to cause the 2nd test to fail (as the 3rd test does). Instead, only the 3rd test in my repo fails.
Have I found a bug, or is this expected?
Thanks!
The text was updated successfully, but these errors were encountered: