Skip to content

Commit

Permalink
added tests for serverunarydecorator
Browse files Browse the repository at this point in the history
  • Loading branch information
iangeckeler committed Aug 6, 2019
1 parent 1dad6a0 commit 8e63409
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
17 changes: 17 additions & 0 deletions __tests__/callFactories/callDecorators/clientUnaryDecorator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const object = {};
const originalCall = {
hello: "hello"
};
const clientUnaryDecorator = require("../../../lib/callFactories/callDecorators/clientUnaryDecorator");

describe("Client unary decorator tests.", () => {
describe("decorator adds the right methods", () => {
//adds properties
beforeEach(() => {
clientUnaryDecorator(object, originalCall);
});
it("Has an on property", () => {
expect(object.hasOwnProperty("on")).toBeTruthy();
});
});
});
17 changes: 17 additions & 0 deletions __tests__/callFactories/callDecorators/serverStreamDecorator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const object = {};
const originalCall = {
hello: "hello"
};
const clientUnaryDecorator = require("../../../lib/callFactories/callDecorators/clientUnaryDecorator");

describe("Client unary decorator tests.", () => {
describe("decorator adds the right methods", () => {
//adds properties
beforeEach(() => {
clientUnaryDecorator(object, originalCall);
});
it("Has an on property", () => {
expect(object.hasOwnProperty("on")).toBeTruthy();
});
});
});
23 changes: 23 additions & 0 deletions __tests__/callFactories/callDecorators/serverUnaryDecorator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const object = {};
const originalCall = {
hello: "hello"
};
const serverUnaryDecorator = require("../../../lib/callFactories/callDecorators/serverUnaryDecorator");

describe("Server unary decorator tests.", () => {
describe("decorator adds the right methods", () => {
//adds properties
beforeEach(() => {
serverUnaryDecorator(object, originalCall);
});
it("Has an on property", () => {
expect(object.hasOwnProperty("set")).toBeTruthy();
});
it("Has a catch property", () => {
expect(object.hasOwnProperty("send")).toBeTruthy();
});
it("Has a throw property", () => {
expect(object.hasOwnProperty("throw")).toBeTruthy();
});
});
});

0 comments on commit 8e63409

Please sign in to comment.