chai: Cannot read property 'not' of undefined

前端 未结 1 494
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-28 09:34

I am new to chai and mocha and I use the sample code for my first test case. Here is my code.

var chai = require(\"chai\");
var mocha =         


        
相关标签:
1条回答
  • 2021-01-28 09:52

    If I run your code with Chai 4, it works. When I downgrade it to Chai 3 I get the error you get. does was added as a no-op assertion in Chai 4.0.0. You are using a version of Chai that predates 4.0.0.

    If you check the releases information, you'll find for version 4.0.0, this:

    Add does and but as new no-op assertion. (Related Issues: #700, #339 PRs: #621, #701)

    (You can find the same information in the Github release, with the added benefit that the issue numbers are links to the actual issues.)

    0 讨论(0)
提交回复
热议问题