Over a million developers have joined DZone.

Doctest.js - A Humane JavaScript Test Framework

DZone's Guide to

Doctest.js - A Humane JavaScript Test Framework

· Web Dev Zone ·
Free Resource

Learn how Crafter’s Git-based content management system is reinventing modern digital experiences.

Doctest.js is a test runner and testing framework for JavaScript.  Doctest uses a novel approach to testing: example and expected result. Each test is a chunk of code that prints out results and side effects, and then the expected result is matched against that to see if the test passed or failed.

Doctest is based on the Python doctest module originally written by Tim Peters. Spy was inspired some by Jasmine's Spy class, and carries over ideas from MiniMock.  If you've used Python's doctest and found it annoying or not widely useful for doctest: doctest.js fixes all those problems.

Requirements: None
Demo: http:/ / doctestjs. org/
License: MIT License




Crafter CMS is a modern Git-based platform for building innovative websites and content-rich digital experiences. Download this white paper now.


Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}