Comparing version 0.6.0 to 0.7.0
@@ -118,3 +118,3 @@ require("source-map-support").install(); | ||
var Component = function () { | ||
function Component() { | ||
function Component(options) { | ||
_classCallCheck(this, Component); | ||
@@ -129,3 +129,3 @@ | ||
this.rootComponent.addComponent(this); | ||
this.onInit(); | ||
this.onInit(options); | ||
} | ||
@@ -141,3 +141,3 @@ | ||
key: "onInit", | ||
value: function onInit() {} | ||
value: function onInit(options) {} | ||
}, { | ||
@@ -144,0 +144,0 @@ key: "onProcess", |
{ | ||
"name": "horpyna", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "promised modules flow control core library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -11,3 +11,3 @@ import Root from "./root"; | ||
constructor() { | ||
constructor(options) { | ||
this.parentChannelManager = new ParentChannelManager(); | ||
@@ -20,3 +20,3 @@ this.channelManager = new ChannelManager(this); | ||
this.rootComponent.addComponent(this); | ||
this.onInit(); | ||
this.onInit(options); | ||
} | ||
@@ -28,3 +28,3 @@ | ||
*/ | ||
onInit() {} | ||
onInit(options) {} | ||
@@ -31,0 +31,0 @@ onProcess(request, response) { |
@@ -36,2 +36,12 @@ import sinon from "sinon"; | ||
it("should pass options to onInit", done => { | ||
let Component = class extends Horpyna.Component { | ||
onInit(options) { | ||
expect(options).to.be.equal(TEST_MESSAGE_A); | ||
done(); | ||
} | ||
}; | ||
new Component(TEST_MESSAGE_A); | ||
}); | ||
it("should output last response from response.prepare", done => { | ||
@@ -38,0 +48,0 @@ let spyComponent = sinon.spy(); |
Sorry, the diff of this file is not supported yet
1174
88701