forked from stephenh/ts-proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example-test.ts
33 lines (32 loc) · 976 Bytes
/
example-test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { DashStateClientImpl } from './example';
import { EMPTY } from 'rxjs';
describe('grpc-web', () => {
it('at least compiles', () => {
// TODO move the hand-run `client-ts` integration into here, but for now
// at least check that things compile
const rpc = {
unary: jest.fn(),
invoke: jest.fn(),
};
const client = new DashStateClientImpl(rpc);
client.UserSettings({});
});
it('binds rpc function', () => {
const rpc = {
unary: jest.fn(),
invoke: jest.fn(),
};
const client = new DashStateClientImpl(rpc);
const userSettings = client.UserSettings;
userSettings({});
});
it('throws on client streaming call', () => {
const rpc = {
unary: jest.fn(),
invoke: jest.fn(),
};
const client = new DashStateClientImpl(rpc);
const call = () => client.ChangeUserSettingsStream(EMPTY)
expect(call).toThrowError("ts-proto does not yet support client streaming!")
});
});