b0VIM 7.3LQfgozalajarti.local~gozala/Projects/test-commonjs/lib/test.jsutf-8 3210#"! Utpsad!eoM+  r d b Q = 9   z h d X T  > + '   o 6 2  y N J / oIEgG#iI)Y( 8wsYA0n]D2! , , unit: unit , units: unit , mute: options.mute { name: name units.push(('function' == typeof unit ? Test : Suite)( var unit = unitMap[name] if (0 !== name.indexOf('test')) continue for (var name in unitMap) { , unitMap = options.units , units = [] var log = options.logfunction Suite(options) { */ * assert objects per test. * Assertions constructor. Constructor is used to construct individual * @param {Assert} Assert * smart enough to indent results for this suite. * Logger for this Suite. If this is sub-suite logger provided will be * @param {Log} log * List of test functions / sublists of test functions. * @param {Object} tests * Options with keys: * @param {Object} options * by calling `run` method on returned instance. * Test suite / group constructor. All the tests in the suite can be executed/**} } } this.complete() else assert.error(e) if (ERR_EXPECT == e.name) assert.fail(e) } catch(e) { if (sync) this.complete() if (failFast) this.pass() unit(assert, complete) if (!this.mute) this.log.print(this.name) try { , complete = this.complete = this.complete.bind(this, callback) , assert = this.assert , failFast = unit.length == 0 , sync = unit.length <= 1 var unit = this.unit, run: function run(callback) { } callback(this, this.completed = true) if (this.completed) return this.error(new Error(ERR_COMPLETED_COMPLETE)), complete: function complete(callback) { } if (!this.mute) this.log.error(e) this.errors.push(e), error: function error(e) { } if (!this.mute) this.log.fail(e) this.fails.push(e) if (this.completed) return this.error(new Error(ERR_COMPLETED_ASSERT)), fail: function fail(e) { } if (!this.mute) this.log.pass(message) this.passes.push(message) if (this.completed) return this.error(new Error(ERR_COMPLETED_ASSERT)) message = message || '', pass: function pass(message) {, completed: false */ * the asserts that are executed after test is finished. * Wheather or not test execution is finished. Used for logging errors for all/**, passes: null */ * @type {String[]} * Array of the passed assertion messages./**, errors: null */ * @type {Error[]} * Array of the exceptions that occured during execurtion of this unit./**, fails: null */ * @type {AssertError[]} * Array of all the `AssertError`s for the this unit./**, unit: null */ * @type {Function} * CommonJS test function that is being wrapped by this object./**, log: null */ * @type {Logger} * and suites will get sub-loggers of this one. * Instance of Logger used to log results of the tests. All the nested tests/**, name: null */ * @param {String} * Name of the test unit./**{ constructor: TestTest.prototype =} return self self.assert = options.Assert(self) }) , errors: { value: [] } , fails: { value: [] } , passes: { value: [] } , log: { value: options.log } , unit: { value: options.unit } , mute: { value: options.mute } { name: { value: options.name } var self = Object.create(Test.prototype,function Test(options) { */ * Test constructor. Wrapper of the CommonJS test function./** , ERR_EXPECT = 'AssertionError' , ERR_COMPLETED_COMPLETE = 'Attemt to complete test more then one times' , ERR_COMPLETED_ASSERT = 'Assert in completed test' // constancts , Log = require('./log').Logvar Assert = require('./assert').Assert'use strict'ad\DsiG/ 3 z j d   W = 7 ' ! i S M : 4 D >  @  tlMGCq< wWHB(c]XVDCexports.run = run} }) ) + ' Errors:' + suite.errors.length + ' Failed:' + suite.fails.length ( 'Passed:' + suite.passes.length log.print if (suite.mute) return if (callback) return callback(suite) ).run(function(suite) { } , log: log , mute: units.mute === true , units: units { name: 'Running all tests:' Suite( var log = Log()function run(units, callback) { */ * Runs passed tests./**} } }, []) return value.concat(unit[name]) return this.units.reduce(function(value, unit) { return function Property() {function UnitedProprerty(name) {) } , errors: { get: UnitedProprerty('errors') } , fails: { get: UnitedProprerty('fails') }, { passes: { get: UnitedProprerty('passes') } } } else this.complete(this) } units[this.index ++].run(this.next) if (this.index < units.length) { var units = this.units , next: function next() { */ * callback passed to the run method is called instead. * Runs next test / suite of tests. If no tests are left in the suite /** } this.next() this.next = this.next.bind(this) this.complete = callback if (!this.mute) this.log.print(this.name) , run: function run(callback) { */ * Function that will be called once whole suite is executed * @param {Function} callback * Passed callback is called after all tests are finished. * Calling this function executes all the tests in this and all the subsuites. /** , complete: null */ * @type {Function} * Callback that is called when all the tests in the suite are executed. /** , index: 0 */ * @type {Number} * Index of the test that will be executed on calling `next`. /** , units: null */ * @type {Suite|Test[]} * List of tests / suites to run on execution. /** , passes: null */ * @type {String[]} * Array of the passed assertion messages. /** , errors: null */ * @type {Error[]} * Array of the exceptions that occured during execurtion of this unit. /** , fails: null */ * @type {AssertError[]} * Array of all the `AssertError`s for the this unit. /** , log: null */ * @type {Logger} * and suites will get sub-loggers of this one. * Instance of Logger used to log results of the tests. All the nested tests /** , name: null */ * @param {String} * Name of the test unit. /** { constructor: SuiteSuite.prototype = Object.create(} }) , units: { value: units } , log: { value: log } , mute: { value: options.mute } { name: { value: options.name } return Object.create(Suite.prototype, } })) , log: log.section() , Assert: unitMap.Assert || Assert