eventemitter-ex
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -50,2 +50,9 @@ (function () { | ||
EventEmitterEx.prototype.startPipeline = function startPipeline (/* arguments */) { | ||
var args = Array.prototype.slice.call(arguments); | ||
args.unshift('end'); | ||
return this.emitAsync.apply(this, args); | ||
}; | ||
EventEmitterEx.prototype.pipeExcept = function pipeExcept (ee) { | ||
@@ -52,0 +59,0 @@ var self = this, |
{ | ||
"name": "eventemitter-ex", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "EventEmitter extensions", | ||
@@ -8,3 +8,4 @@ "main": "EventEmitterEx.js", | ||
"spec": "mocha test", | ||
"test": "jshint --exclude-path=.gitignore . && mocha test" | ||
"test": "jshint --exclude-path=.gitignore . && mocha test", | ||
"coveralls": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage" | ||
}, | ||
@@ -26,3 +27,5 @@ "repository": { | ||
"pipe", | ||
"extensions" | ||
"extensions", | ||
"map", | ||
"flatMap" | ||
], | ||
@@ -33,2 +36,4 @@ "author": "Mikhail Mazurskiy <mikhail.mazursky@gmail.com> (ash2k.com)", | ||
"chai": "2.x.x", | ||
"coveralls": "^2.x.x", | ||
"istanbul": "^0.x.x", | ||
"jshint": "2.x.x", | ||
@@ -35,0 +40,0 @@ "mocha": "2.x.x", |
@@ -6,1 +6,3 @@ # eventemitter-ex | ||
[![Build Status](https://travis-ci.org/ash2k/eventemitter-ex.svg?branch=master)](https://travis-ci.org/ash2k/eventemitter-ex) | ||
[![npm version](https://badge.fury.io/js/eventemitter-ex.svg)](https://badge.fury.io/js/eventemitter-ex) | ||
[![Coverage Status](https://coveralls.io/repos/ash2k/eventemitter-ex/badge.svg?branch=master)](https://coveralls.io/r/ash2k/eventemitter-ex?branch=master) |
@@ -61,4 +61,35 @@ (function () { | ||
describe('#startPipeline()', function () { | ||
it('should call emitAsync() with "end" event type', function () { | ||
var A = 42, B = 17, mockEmitter = sinon.mock(emitter); | ||
mockEmitter | ||
.expects('emitAsync') | ||
.withExactArgs('end', A, B); | ||
emitter.startPipeline(A, B); | ||
}); | ||
it('should return self', function () { | ||
var mockEmitter = sinon.mock(emitter); | ||
mockEmitter | ||
.expects('emitAsync') | ||
.withExactArgs('end') | ||
.returnsThis(); | ||
emitter.startPipeline().should.be.equal(emitter); | ||
}); | ||
}); | ||
describe('#pipeExcept()', function () { | ||
it('should throw on invalid argument', function () { | ||
expect(function () { | ||
emitter.pipeExcept({}); | ||
}).to.throw(TypeError, /Expecting EventEmitter or EventEmitterEx/); | ||
}); | ||
var i = 0; | ||
@@ -65,0 +96,0 @@ [EventEmitter, EEX].forEach(function (SourceType) { |
Sorry, the diff of this file is not supported yet
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
42641
636
8
7