lib/assert.js
function(){
		var self = this;

		// Can only start a module that hasn't been started yet
		self.requireState( munit.ASSERT_STATE_DEFAULT, self.trigger );

		// Setup and trigger module
		self.start = self.end = Date.now();

		// Parent namespaces sometimes don't have tests
		// Also close out paths that aren't part of the focus
		if ( ! self.callback || ! munit.render.focusPath( self.nsPath ) ) {
			self.state = munit.ASSERT_STATE_CLOSED;
			return self._close();
		}

		// Trigger test setup first
		self._setup(function( e, setupCallback ) {
			if ( e ) {
				self.fail( "[munit] Failed to setup '" + self.nsPath + "' module", setupCallback, e );
				return self.close();
			}

			// Run test
			self.callback( self, self.queue );

			// If module isn't finished, then prove that it's supposed to be asynchronous
			if ( self.state < munit.ASSERT_STATE_TEARDOWN ) {
				// Only tear it down if no timeout is specified
				if ( self.options.timeout < 1 ) {
					self.close();
				}
				// Delayed close
				else if ( ! self.isAsync ) {
					self.isAsync = true;
					self._timerStart = Date.now();
					self._timeid = setTimeout(function(){
						if ( self.state < munit.ASSERT_STATE_TEARDOWN ) {
							self.close();
						}
					}, self.options.timeout );
				}
			}
		});

		return self;
	}
function(){
		var self = this;

		// Can only start a module that hasn't been started yet
		self.requireState( munit.ASSERT_STATE_DEFAULT, self.trigger );

		// Setup and trigger module
		self.start = self.end = Date.now();

		// Parent namespaces sometimes don't have tests
		// Also close out paths that aren't part of the focus
		if ( ! self.callback || ! munit.render.focusPath( self.nsPath ) ) {
			self.state = munit.ASSERT_STATE_CLOSED;
			return self._close();
		}

		// Trigger test setup first
		self._setup(function( e, setupCallback ) {
			if ( e ) {
				self.fail( "[munit] Failed to setup '" + self.nsPath + "' module", setupCallback, e );
				return self.close();
			}

			// Run test
			self.callback( self, self.queue );

			// If module isn't finished, then prove that it's supposed to be asynchronous
			if ( self.state < munit.ASSERT_STATE_TEARDOWN ) {
				// Only tear it down if no timeout is specified
				if ( self.options.timeout < 1 ) {
					self.close();
				}
				// Delayed close
				else if ( ! self.isAsync ) {
					self.isAsync = true;
					self._timerStart = Date.now();
					self._timeid = setTimeout(function(){
						if ( self.state < munit.ASSERT_STATE_TEARDOWN ) {
							self.close();
						}
					}, self.options.timeout );
				}
			}
		});

		return self;
	}
function ( ) { var self = this ; // Can only start a module that hasn't been started yet self . requireState ( munit . ASSERT_STATE_DEFAULT , self . trigger ) ; // Setup and trigger module self . start = self . end = Date . now ( ) ; // Parent namespaces sometimes don't have tests // Also close out paths that aren't part of the focus if ( ! self . callback || ! munit . render . focusPath ( self . nsPath ) ) { self . state = munit . ASSERT_STATE_CLOSED ; return self . _close ( ) ; } // Trigger test setup first self . _setup ( function ( e , setupCallback ) { if ( e ) { self . fail ( "[munit] Failed to setup '" + self . nsPath + "' module" , setupCallback , e ) ; return self . close ( ) ; } // Run test self . callback ( self , self . queue ) ; // If module isn't finished, then prove that it's supposed to be asynchronous if ( self . state < munit . ASSERT_STATE_TEARDOWN ) { // Only tear it down if no timeout is specified if ( self . options . timeout < 1 ) { self . close ( ) ; } // Delayed close else if ( ! self . isAsync ) { self . isAsync = true ; self . _timerStart = Date . now ( ) ; self . _timeid = setTimeout ( function ( ) { if ( self . state < munit . ASSERT_STATE_TEARDOWN ) { self . close ( ) ; } } , self . options . timeout ) ; } } } ) ; return self ; }
Trigger module's tests
Trigger module s tests