Mocha is a feature-rich JavaScript test framework running on node.js and the browser. Mocha allows you to use any assertion library you want, if it throws an error, it will work. This means you can utilize libraries such as should.js, node's regular assert module, or others.

Mocha is a feature-rich JavaScript test framework running on node.js and the browser. Mocha allows you to use any assertion library you want, if it throws an error, it will work! This means you can utilize libraries such as should.js, node's regular assert module, or others. The following is a list of known assertion libraries for node and/or the browser:

  • should.js BDD style shown throughout these docs
  • expect.js expect() style assertions
  • chai expect(), assert() and should style assertions
  • better-assert c-style self-documenting assert()
history | excerpt history