diff --git a/docs/index.html b/docs/index.html index 587f933..914089c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -45,14 +45,14 @@
Alternatively for large numbers of tests you may want to export your own object containing the tests, however this -is essentially the as above:
module.exports = {
+is essentially the same as above:module.exports = {
'test String#length': function(beforeExit, assert) {
assert.equal(6, 'foobar'.length);
}
};
If you prefer not to use quoted keys:
exports.testsStringLength = function(beforeExit, assert) {
assert.equal(6, 'foobar'.length);
};
The argument passed to each callback is beforeExit and assert.
-The context ("this") of each test function is a Test object. You can pass a function to beforeExit to make sure the assertions are run before the tests exit. This is can be used to verify that tests have indeed been run. beforeExit is a shortcut for listening to the exit event on this. The second parameter assert is the assert object localized to that test. It makes sure that assertions in asynchronous callbacks are associated with the correct test.
exports.testAsync = function(beforeExit, assert) {
+The context ("this") of each test function is a Test object. You can pass a function to beforeExit to make sure the assertions are run before the tests exit. This can be used to verify that tests have indeed been run. beforeExit is a shortcut for listening to the exit event on this. The second parameter assert is the assert object localized to that test. It makes sure that assertions in asynchronous callbacks are associated with the correct test.exports.testAsync = function(beforeExit, assert) {
var n = 0;
setTimeout(function() {
++n;
@@ -81,7 +81,7 @@ Expresso 0.9.0
comparisons, opposed to assert.equal() which uses ==.assert.eql('foo', 'foo');
assert.eql([1,2], [1,2]);
assert.eql({ foo: 'bar' }, { foo: 'bar' });
assert.includes(obj, val[, msg])
Assert that obj is within val. This method supports Arrays
-and Stringss.
assert.includes([1,2,3], 3);
+and Strings.assert.includes([1,2,3], 3);
assert.includes('foobar', 'foo');
assert.includes('foobar', 'bar');
assert.response(server, req, res|fn[, msg|fn])
Performs assertions on the given server, which should not call
listen(), as this is handled internally by expresso and the server
@@ -137,7 +137,7 @@
Expresso 0.9.0
so the following is equivalent to the command above:$ expresso
If you wish to unshift a path to require.paths before
running tests, you may use the -I or --include flag.
$ expresso --include lib test/*
The previous example is typically what I would recommend, since expresso
supports test coverage via node-jscoverage (bundled with expresso),
-so you will need to expose an instrumented version of you library.
To instrument your library, simply run node-jscoverage,
+so you will need to expose an instrumented version of your library.
To instrument your library, simply run node-jscoverage,
passing the src and dest directories:
$ node-jscoverage lib lib-cov
Now we can run our tests again, using the lib-cov directory that has been
instrumented with coverage statements:
$ expresso -I lib-cov test/*
The output will look similar to below, depending on your test coverage of course :)

To make this process easier expresso has the -c or --cov which essentially
does the same as the two commands above. The following two commands will
@@ -171,4 +171,4 @@
Expresso 0.9.0
}, 100);
Note that you only have one "shot" at exporting. You have to export all of your test functions in the same loop as the first one. That means you can't progressively add more test functions to the exports object.