Skip to content

Commit a83a176

Browse files
author
Radium Zheng
committed
repro
1 parent e3a6de3 commit a83a176

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

test/pizza_service_proto_test.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {Pizza, PizzaSize} from 'rules_typescript_proto/test/proto/common/pizza_pb';
22
import {OrderPizzaRequest, OrderPizzaResponse} from 'rules_typescript_proto/test/proto/pizza_service_pb';
3-
import {PizzaService} from 'rules_typescript_proto/test/proto/pizza_service_pb_service';
3+
import {PizzaService,PizzaServiceClient} from 'rules_typescript_proto/test/proto/pizza_service_pb_service';
44

55
declare function require(module: string): any;
66

@@ -14,6 +14,12 @@ describe('DeliveryPerson', () => {
1414
expect(PizzaService).toBeDefined();
1515
});
1616

17+
it('PizzaServiceClient.orderPizza should return a UnaryResponse', () => {
18+
const client = new PizzaServiceClient('http://localhost', {});
19+
const response = client.orderPizza(new OrderPizzaRequest(), (_) => {});
20+
expect(typeof response.cancel).toBe('function');
21+
});
22+
1723
it('Generated code seems to work', () => {
1824
const request = new OrderPizzaRequest();
1925

test/rollup_test.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ describe('Rollup', () => {
2828
expect(typeof client.orderPizza).toBe('function');
2929
});
3030

31+
it('PizzaServiceClient.orderPizza should return a UnaryResponse', () => {
32+
const client = new bundle.PizzaServiceClient('http://localhost', {});
33+
const response = client.orderPizza(new bundle.OrderPizzaRequest(), (_) => {}); // This will throw
34+
expect(typeof response.cancel).toBe('function');
35+
})
36+
3137
it('should follow expected naming styles', () => {
3238
expect(new bundle.alllowercase().setTest(1)).toBeTruthy();
3339
expect(new bundle.ALLUPPERCASE().setTest(1)).toBeTruthy();

test/test_bundling.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export {alllowercase, ALLUPPERCASE, lowerCamelCase, m24M_, M2_M, M2M, M2M_, m42_M, M9, m_22M, M_2M, snake_case_snake_case, Upper_snake_Case, UpperCamelCase,} from 'rules_typescript_proto/test/proto/naming_styles_pb';
1+
export { alllowercase, ALLUPPERCASE, lowerCamelCase, m24M_, M2_M, M2M, M2M_, m42_M, M9, m_22M, M_2M, snake_case_snake_case, Upper_snake_Case, UpperCamelCase, } from 'rules_typescript_proto/test/proto/naming_styles_pb';
22
export { DeliveryPerson } from 'rules_typescript_proto/test/proto/common/delivery_person_pb';
33
export { Pizza, PizzaSize } from 'rules_typescript_proto/test/proto/common/pizza_pb';
44
export { PizzaService, PizzaServiceClient } from 'rules_typescript_proto/test/proto/pizza_service_pb_service';
5+
export { OrderPizzaRequest } from 'rules_typescript_proto/test/proto/pizza_service_pb';

0 commit comments

Comments
 (0)