An extremely lightweight method for running tests.
Describe provides a simple method for testing asynchronous and synchronous code within JavaScript projects.
describe( groupName, tests[, options] );
this.expect.describe.config( key, value )
Sets the global configuration for tests.
this.expect( subject, expected )
describe"assertions" thisexpect42 42; ;
By passing this.expect as the callback parameter to an asynchronous function, describe will know to wait for the result of the operation before checking to see if the result matches what was expected.
this.expect( expected )
callbacka+b; describe"assertions" addNumbersAsync2 2 thisexpect4; ;
callbacknull a+b; describe"assertions" addNumbersAsync2 2 thisexpect4; callbackMode: 'node' ;
var n = 0; for var i in arguments n+=argumentsi; return successn; ; describe"promise callback style" thisexpectaddThingsPromise2 2 4; callbackMode: 'promises';
An asynchronous method. Calls back with the results of all tests described up to that point. You should probably wait until you're done defining tests to call this.
passed: 1 total: 2 results: "sample test group": passed: 1 total: 2 results: "this test passed because its error is null": null "this test failed because there's an error": "Error or message"
Gets the results and outputs them either to the DOM or the console.
Each test group supports beforeEach, afterEach, beforeAll, and afterAll as test hooks.
var arr = bowties; describe'array stuff' bowties = 'cool'; arr = arrconcat123; arr = ; tests = null; thisexpectbowties 'cool'; thisexpectarrlength 3; arrpush5; thisexpectarrlength 3; ; ;