-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Working on problems with async execution
- Loading branch information
Showing
10 changed files
with
183 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
/** | ||
* Run this file with: | ||
* | ||
* nodeshould -s sources \ | ||
* -s lib/foo \ | ||
* -s lib/bar \ | ||
* -t '/test-*.js/' \ | ||
* -n '/should make happy/' | ||
* | ||
* @param s Directories that contain code that can be required. If a directory | ||
* is found at ./src or ./test, those directories will be automatically added | ||
* to the load path. | ||
* @param t Regular Expression that matches the test file or files that you | ||
* want to load. | ||
* @param n Regular Expression that matches the test label(s) that you want | ||
* to execute. | ||
*/ | ||
|
||
var Runner = require('node_should').Runner; | ||
var runner = new Runner(); | ||
runner.runFromTerminal(process.argv); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name" : "nodeshould", | ||
"version" : "0.0.1", | ||
"description" : "A small implementation of Shoulda for testing JavaScript applications with Node", | ||
"keywords" : ["shoulda", "test", "unit", "integration"], | ||
"homepage" : "http://github.com/lukebayes/node-should", | ||
"author" : { | ||
"name" : "Luke Bayes", | ||
"email" : "lbayes@patternpark.com", | ||
"url" : "http://lukebayes.com", | ||
}, | ||
"main" : "node_should.js", | ||
"test" : "runner.js", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
var EventEmitter = require('events').EventEmitter; | ||
var util = require('util'); | ||
|
||
var TestHandler = function() { | ||
EventEmitter.call(this); | ||
this.asyncHandlers = []; | ||
this.context = null; | ||
this.error = null; | ||
this.failure = null; | ||
this.handler = null; | ||
this.label = ''; | ||
} | ||
|
||
util.inherits(TestHandler, EventEmitter); | ||
|
||
TestHandler.create = function(context, label, handler) { | ||
var instance = new TestHandler(); | ||
instance.context = context; | ||
instance.handler = handler; | ||
instance.label = label; | ||
return instance; | ||
} | ||
|
||
TestHandler.prototype.execute = function() { | ||
} | ||
|
||
TestHandler.prototype.onComplete = function() { | ||
this.emit('complete', this); | ||
} | ||
|
||
TestHandler.prototype.addAsyncHandler = function(callback, timeout) { | ||
} | ||
|
||
TestHandler.prototype.asyncHandlerCount = function() { | ||
return this.asyncHandlers.length; | ||
} | ||
|
||
exports.TestHandler = TestHandler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.