diff --git a/test/inc-testcase.js b/test/inc-testcase.js index 0cab4f0..056dbea 100644 --- a/test/inc-testcase.js +++ b/test/inc-testcase.js @@ -81,15 +81,29 @@ function incAssertCount() * This will be evolving throughout the life of the project. Mainly, it cannot * be run as part of a suite without multiple summary outputs. * - * @param {Object.} object containing tests + * @param {string|Object.} SUT module path; or object + * containing tests + * + * @param {Object.=} object containing tests, if first + * argument is provided * * @return {undefined} */ -module.exports = function( test_case ) +module.exports = function( _, __ ) { + var args = Array.prototype.slice.call( arguments ), + test_case = args.pop(), + sutpath = args.pop(); + var context = prepareCaseContext(), setUp = test_case.setUp; + // automatically include SUT if its module path was provided + if ( sutpath ) + { + context.Sut = common_require( sutpath ); + } + // if we're not running a suite, clear out the failures if ( !( suite ) ) {