Comparing version 0.2.2 to 0.2.3
// Based on http://wiki.commonjs.org/wiki/Unit_Testing/1.0#Assert with | ||
// modifications to handle promises | ||
({define:typeof define!="undefined"?define:function(deps, factory){module.exports = factory.apply(this, deps.map(require));}}). | ||
(function(define){ | ||
define(["promised-io/promise", "assert"],function(promise, assert){ | ||
@@ -34,2 +34,3 @@ var exports = {}; | ||
return exports; | ||
}); | ||
}); | ||
})(typeof define!="undefined"?define:function(deps, factory){module.exports = factory.apply(this, deps.map(require));}); |
@@ -1,6 +0,6 @@ | ||
(define || function(deps, factory){module.exports = factory.apply(this, deps.map(require));})( | ||
["promised-io/promise", "promised-io/process"],function(promise, process){ | ||
(function(define){ | ||
define(["promised-io/promise", "promised-io/process"],function(promise, processModule){ | ||
var when = promise.when, | ||
all = promise.all, | ||
print = process.print, | ||
print = processModule.print, | ||
onError; | ||
@@ -136,3 +136,3 @@ function run(tests, args){ | ||
if(typeof process !== "undefined"){ | ||
process.addListener("uncaughtException", function(e){ | ||
process.on("uncaughtException", function(e){ | ||
if(onError){ | ||
@@ -148,2 +148,3 @@ onError(e); | ||
return run.run = run; | ||
}); | ||
}); | ||
})(typeof define!="undefined"?define:function(deps, factory){module.exports = factory.apply(this, deps.map(require));}); |
{ | ||
"name": "patr", | ||
"author": "Kris Zyp", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"contributors": [], | ||
@@ -31,3 +31,3 @@ "keywords": [ | ||
"dependencies": { | ||
"promised-io": "0.2.1" | ||
"promised-io": "0.2.2" | ||
}, | ||
@@ -34,0 +34,0 @@ "directories": { "lib": "./lib" }, |
@@ -54,2 +54,18 @@ Promised-based Asynchronous Test Runner (patr) is a very simple, easy-to-use test | ||
Asynchronous assert module | ||
====================== | ||
Patr includes an "assert" module (patr/assert) that is upgraded for promise-based asynchronous | ||
code blocks. In particular, the "throws" method can be used to enforce that a code block | ||
will eventually throw (or reject) even if it happens asynchronously. For example: | ||
var assert = require("patr/assert"); | ||
exports.testFile = function(){ | ||
return assert.throws(function(){ | ||
// asserts that this must throw/reject eventually | ||
return fs.readFile("non-existent file"); | ||
}); | ||
}; | ||
Advanced Testing | ||
@@ -56,0 +72,0 @@ ============ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9065
176
89
+ Addedpromised-io@0.2.2(transitive)
Updatedpromised-io@0.2.2