September 2017
Intermediate to advanced
450 pages
11h 24m
English
Your Chai assertion library can do more than just providing utilities for assertions in your tests; it can also provide you configuration for them. These configuration options let you decide how you want your assertion failures to be presented to you by Chai. For example, the chai.config.includeStack flag is false by default. However, by configuring it to on, you can influence whether a stack trace is included in the assertion error message:
chai.config.includeStack = true;
The chai.config.showDiff flag is true by default, and it controls whether a difference of the expected value from the received value is displayed for the assertion:
chai.config.showDiff = false;
Finally, the chai.config.truncate threshold flag sets the ...
Read now
Unlock full access