From b53d66040204de00cda423654e5a8794661e79fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabio=20Jos=C3=A9?= Date: Mon, 29 Jul 2019 16:38:38 -0300 Subject: [PATCH] SDK Requirements: exports the receivers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fabio José --- test/sdk_test.js | 16 ++++++++++++---- v02/index.js | 6 ++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/test/sdk_test.js b/test/sdk_test.js index cbfae9c..b85125f 100644 --- a/test/sdk_test.js +++ b/test/sdk_test.js @@ -8,19 +8,27 @@ describe("The SDK Requirements", () => { expect(v02.event().spec.payload.specversion).to.equal("0.2"); }); - it("should have 'Spec' export", () => { + it("should exports 'Spec'", () => { expect(v02).to.have.property("Spec"); }); - it("should have 'StructuredHTTPEmitter' export", () => { + it("should exports 'StructuredHTTPEmitter'", () => { expect(v02).to.have.property("StructuredHTTPEmitter"); }); - it("should have 'BinaryHTTPEmitter' export", () => { + it("should exports 'StructuredHTTPReceiver'", () => { + expect(v02).to.have.property("StructuredHTTPReceiver"); + }); + + it("should exports 'BinaryHTTPEmitter'", () => { expect(v02).to.have.property("BinaryHTTPEmitter"); }); - it("should have 'event' export", () => { + it("should exports 'BinaryHTTPReceiver'", () => { + expect(v02).to.have.property("BinaryHTTPReceiver"); + }); + + it("should exports 'event'", () => { expect(v02).to.have.property("event"); }); }); diff --git a/v02/index.js b/v02/index.js index 9038d18..1c56461 100644 --- a/v02/index.js +++ b/v02/index.js @@ -3,6 +3,10 @@ const Spec = require("../lib/specs/spec_0_2.js"); const StructuredHTTPEmitter = require("../lib/bindings/http/emitter_structured_0_2.js"); const {HTTPBinary02} = require("../lib/bindings/http/emitter_binary_0_2.js"); +const StructuredHTTPReceiver = + require("../lib/bindings/http/receiver_structured_0_2.js"); +const BinaryHTTPReceiver = + require("../lib/bindings/http/receiver_binary_0_2.js"); function event() { return new Cloudevent(Spec); @@ -11,6 +15,8 @@ function event() { module.exports = { Spec, StructuredHTTPEmitter, + StructuredHTTPReceiver, BinaryHTTPEmitter : HTTPBinary02, + BinaryHTTPReceiver, event };