diff --git a/lib/testrunner.js b/lib/testrunner.js index f88c680..84a4c5c 100644 --- a/lib/testrunner.js +++ b/lib/testrunner.js @@ -128,6 +128,7 @@ exports.run = function(files, callback) { files.forEach(function(file) { var opts = _.extend({}, options, file); + !opts.log && (opts.log = {}); opts.deps = absPaths(opts.deps); opts.code = absPath(opts.code); opts.tests = absPaths(opts.tests); diff --git a/readme.md b/readme.md index 5f78f69..8962d63 100644 --- a/readme.md +++ b/readme.md @@ -104,24 +104,36 @@ variable name to be used for the namespace object, followed by a colon: Defaults: { + // logging options + log: { - // log assertions overview - assertions: true, + // log assertions overview + assertions: true, - // log expected and actual values for failed tests - errors: true, + // log expected and actual values for failed tests + errors: true, - // log tests overview - tests: true, + // log tests overview + tests: true, - // log summary - summary: true, + // log summary + summary: true, - // log global summary (all files) - globalSummary: true, + // log global summary (all files) + globalSummary: true, - // log currently testing code file - testing: true + // log currently testing code file + testing: true + }, + + // run test coverage tool + coverage: false, + + // define dependencies, which are required then before code + deps: null, + + // define namespace your code will be attached to on global['your namespace'] + namespace: null } diff --git a/test/testrunner.js b/test/testrunner.js index 043724f..64a8fc8 100644 --- a/test/testrunner.js +++ b/test/testrunner.js @@ -8,14 +8,9 @@ var tr = require('../lib/testrunner'), var fixtures = __dirname + '/fixtures', chain = chainer(); -_.extend(tr.options.log, { - assertions: false, - tests: false, - summary: false, - globalSummary: false, - errors: false, - assertions: false -}); +tr.options.log = { + testing: true +}; // reset log stats every time .next is called chain.next = function() {