Trisha Shetty (Editor)

Unit.js

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Developer(s)
  
Nicolas Tallefourtane

Operating system
  
Cross-platform

Written in
  
JavaScript

Type
  
Unit Test

Unit.js is an open source unit testing framework for the JavaScript programming language.

Contents

Usage

A simple hello world test looks like the code below.


Support describe() and it(), describes a suite of tests and it() is an individual test specification. The name "it()" follows the idea of behavior-driven development and serves as the first word in the test name, which should be a complete sentence.

Assertion styles

Unit.js has multiple interfaces that allow the developer to choose the most comfortable and productive style.

Unit.js :

Assert :

Must.js :

Should.js :

References

Unit.js Wikipedia


Similar Topics