File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ testSuite({
118
118
xhr . simulateReadyStateChange ( ReadyState . COMPLETE ) ;
119
119
const response = await responsePromise ;
120
120
121
- assertEquals ( 'value' , response . data ) ;
121
+ assertEquals ( 'value' , /** @type { !MockReply } */ ( response ) . data ) ;
122
122
const headers = /** @type {!Object } */ ( xhr . getLastRequestHeaders ( ) ) ;
123
123
assertElementsEquals ( DEFAULT_UNARY_HEADERS , Object . keys ( headers ) ) ;
124
124
assertElementsEquals ( DEFAULT_UNARY_HEADER_VALUES , Object . values ( headers ) ) ;
@@ -294,8 +294,18 @@ class MockReply {
294
294
}
295
295
296
296
/**
297
- * @param {function(string): !MockReply } responseDeSerializeFn
298
- * @return {!MethodDescriptor<!MockRequest, !MockReply> }
297
+ * Typedef for allowed response types.
298
+ *
299
+ * Number is allowed specifically for supporting falsy responses `0`, see:
300
+ * https://github.com/grpc/grpc-web/pull/1025
301
+ *
302
+ * @typedef {!MockReply|number }
303
+ */
304
+ let AllowedResponseType ;
305
+
306
+ /**
307
+ * @param {function(string): !AllowedResponseType } responseDeSerializeFn
308
+ * @return {!MethodDescriptor<!MockRequest, !AllowedResponseType> }
299
309
*/
300
310
function createMethodDescriptor ( responseDeSerializeFn ) {
301
311
return new MethodDescriptor (
You can’t perform that action at this time.
0 commit comments