0.0.6 • Published 7 years ago

jassert.js v0.0.6

Weekly downloads
1
License
GPL-2.0
Repository
github
Last release
7 years ago

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;
0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago