O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chai

This is a fundamental assertion library following TDD/BDD that can be used in conjunction with any other libraries in order to have superior-quality tests. An assertion i

s any statement that has to be fulfilled, or else an error should be thrown and the test should be stopped. This is a very powerful tool to write easy-to-understand test cases.

It provides the following three interfaces to make test cases more readable and powerful:

  • should
  • expect
  • assert

Along with these three interfaces, we can use various natural language words. The full list can be found at http://www.chaijs.com/api/bdd/.

You must be wondering what the difference is between should and expect. Well, it is a natural question. Although should and expect do the same ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required