Package Spotlight: Chai

Package Spotlight: Chai

Chai is a TDD (test-driven development) and BDD (behavior-driven development) assertion library for JavaScript. This package allows you to assert what a test should have as a result. As a simple example consider the mathematical expression 2 + 2. You would assert that 2 + 2 = 4. If the actual result of that calculation is 4 the test passes. Any other result causes the assertion to fail.

An assertion library is a critical piece to being able to test the code that exists in the system. We have at least 5,000 assertions in our test cases (and growing). We have this many because we want to test many different instances. Say, as an example, we return a specific error code if someone doesn’t pass an expected result. We need an assert statement for each possible value that isn’t the expected to make sure the test passes (and therefore the code returns the failure as we would expect.)

Package Name: Chai
Website: https://www.chaijs.com/

a person standing on top of a mountain
Blog
Virginia

The Rise of Solo Travel

Over the past few years, solo trips have become a growing trend in the tourism industry. With more and more people deciding to travel alone, one factor has endured — tourists want to have fun!

Read More »
a person holding a flower
News
Virginia

Virginia Introduction

Traveling and experiencing new places has always been a passion for Virginia. Born in New York City and raised in Alabama, her love of travel

Read More »
a close up of a tree
Blog
Virginia

Holiday Promotions and Giveaways

Holiday season is almost here! Not only do holidays spread joy and bring family and friends together, but they can also be an excellent time to increase your website traffic.

Read More »

Request a Demonstration