Skip to content

giuliojiang/jassert.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jassert.js

General purpose Node.js assert library.

Non-throwing

Errors do not cause execution to stop, but are recorded in internal statistics and printed to the console.

Disambiguation

Maybe you were looking for jassert https://www.npmjs.com/package/jassert

Examples

Install:

npm --save install jassert.js

Importing

var jassert = require("jassert.js");

Asserting true/false values

jassert.assert_true(true);

Asserting equality

jassert.assert_equal({hello: "world"}, {hello: "world"}); // fails
jassert.assert_equal_deep({hello: "world"}, {hello: "world"}); // passes

Getting result report

console.log(jassert.format());

Check if all tests passed

console.log(jassert.all_tests_passed());

Example output:

PASSED 5 tests
FAILED 4 tests

Reset state

jassert.reset();

Disable automatic stacktrace for failed tests

jassert.verbose = false;

About

Simple Node.js assert library compatible with my personal testsuites

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published