-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modified tests for generateClientStreamCall
- Loading branch information
1 parent
2a183a3
commit a906a20
Showing
1 changed file
with
30 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,37 @@ | ||
const generateClientStreamCall = require('../../lib/callFactories/generateClientStreamCall') | ||
const mockServerReadableStream = {on: () => {}}; | ||
const generateClientStreamCall = require("../../lib/callFactories/generateClientStreamCall"); | ||
const mockServerReadableStream = { on: () => {} }; | ||
const fakeCallback = (err, object, trailer) => {}; | ||
const mockServerReadable = generateClientStreamCall(mockServerReadableStream, fakeCallback); | ||
|
||
describe('Unit tests for generating Client Stream Call', () => { | ||
|
||
describe('Client Stream should have properties', () => { | ||
|
||
test('Client Stream Call must have metaData property', () => { | ||
expect(mockServerReadable.hasOwnProperty('metaData')).toBe(true); | ||
}) | ||
|
||
test('Client Stream Call must have err property', () => { | ||
expect(mockServerReadable.hasOwnProperty('err')).toBe(true); | ||
}) | ||
|
||
test('Client Stream Call must have trailer property', () => { | ||
expect(mockServerReadable.hasOwnProperty('trailer')).toBe(true); | ||
}) | ||
const mockServerReadable = generateClientStreamCall( | ||
mockServerReadableStream, | ||
fakeCallback | ||
); | ||
|
||
describe("Unit tests for generating Client Stream Call", () => { | ||
describe("Client Stream should have properties", () => { | ||
test("Client Stream Call must have head property", () => { | ||
expect(mockServerReadable.hasOwnProperty("head")).toBe(true); | ||
}); | ||
}); | ||
|
||
describe('Client Stream should have methods', () => { | ||
|
||
test('Client Stream Call must have throw method', () => { | ||
expect(typeof mockServerReadable.throw === 'function').toBe(true); | ||
}) | ||
describe("Client Stream should have methods", () => { | ||
test("Client Stream Call must have throw method", () => { | ||
expect(typeof mockServerReadable.throw === "function").toBe(true); | ||
}); | ||
|
||
test('Client Stream Call must have setStatus method', () => { | ||
expect(typeof mockServerReadable.setStatus === 'function').toBe(true); | ||
}) | ||
test("Client Stream Call must have set method", () => { | ||
expect(typeof mockServerReadable.set === "function").toBe(true); | ||
}); | ||
|
||
test('Client Stream Call must have setMeta method', () => { | ||
expect(typeof mockServerReadable.setMeta === 'function').toBe(true); | ||
}) | ||
test("Client Stream Call must have catch method", () => { | ||
expect(typeof mockServerReadable.catch === "function").toBe(true); | ||
}); | ||
|
||
test('Client Stream Call must have send method', () => { | ||
expect(typeof mockServerReadable.send === 'function').toBe(true); | ||
}) | ||
test("Client Stream Call must have send method", () => { | ||
expect(typeof mockServerReadable.send === "function").toBe(true); | ||
}); | ||
|
||
test('Client Stream Call must have on method', () => { | ||
expect(typeof mockServerReadable.on === 'function').toBe(true); | ||
}) | ||
}) | ||
}) | ||
test("Client Stream Call must have on method", () => { | ||
expect(typeof mockServerReadable.on === "function").toBe(true); | ||
}); | ||
}); | ||
}); |