Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

patr

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

patr - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

5

lib/assert.js
// 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));});

11

lib/runner.js

@@ -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 @@ ============

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc