Skip to content

Commit

Permalink
repro
Browse files Browse the repository at this point in the history
  • Loading branch information
Radium Zheng committed Jan 21, 2020
1 parent e3a6de3 commit a83a176
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
8 changes: 7 additions & 1 deletion test/pizza_service_proto_test.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Pizza, PizzaSize} from 'rules_typescript_proto/test/proto/common/pizza_pb';
import {OrderPizzaRequest, OrderPizzaResponse} from 'rules_typescript_proto/test/proto/pizza_service_pb';
import {PizzaService} from 'rules_typescript_proto/test/proto/pizza_service_pb_service';
import {PizzaService,PizzaServiceClient} from 'rules_typescript_proto/test/proto/pizza_service_pb_service';

declare function require(module: string): any;

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

it('PizzaServiceClient.orderPizza should return a UnaryResponse', () => {
const client = new PizzaServiceClient('http://localhost', {});
const response = client.orderPizza(new OrderPizzaRequest(), (_) => {});
expect(typeof response.cancel).toBe('function');
});

it('Generated code seems to work', () => {
const request = new OrderPizzaRequest();

Expand Down
6 changes: 6 additions & 0 deletions test/rollup_test.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ describe('Rollup', () => {
expect(typeof client.orderPizza).toBe('function');
});

it('PizzaServiceClient.orderPizza should return a UnaryResponse', () => {
const client = new bundle.PizzaServiceClient('http://localhost', {});
const response = client.orderPizza(new bundle.OrderPizzaRequest(), (_) => {}); // This will throw
expect(typeof response.cancel).toBe('function');
})

it('should follow expected naming styles', () => {
expect(new bundle.alllowercase().setTest(1)).toBeTruthy();
expect(new bundle.ALLUPPERCASE().setTest(1)).toBeTruthy();
Expand Down
3 changes: 2 additions & 1 deletion test/test_bundling.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
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';
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';
export { DeliveryPerson } from 'rules_typescript_proto/test/proto/common/delivery_person_pb';
export { Pizza, PizzaSize } from 'rules_typescript_proto/test/proto/common/pizza_pb';
export { PizzaService, PizzaServiceClient } from 'rules_typescript_proto/test/proto/pizza_service_pb_service';
export { OrderPizzaRequest } from 'rules_typescript_proto/test/proto/pizza_service_pb';

0 comments on commit a83a176

Please sign in to comment.