Test for expected failure in Mocha

后端 未结 9 1984
终归单人心
终归单人心 2020-12-10 01:29

Using Mocha, I am attempting to test whether a constructor throws an error. I haven\'t been able to do this using the expect syntax, so I\'d like to do the following:

<
9条回答
  •  猫巷女王i
    2020-12-10 02:13

    Chai now has

    should.fail() and expect.fail()

    https://github.com/chaijs/chai/releases/tag/2.1.0

提交回复
热议问题