File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ test.describe('Some test wrapper', () => {
4848 test (' Make sure a grpc call is made and is successful' , async ({ page }) => {
4949 // start by building a mock for the unary call that will be done
5050 // for example as soon as a given page is loaded
51- const mock = mockGrpcUnary (page , YourUnaryCall , {
51+ const mock = await mockGrpcUnary (page , YourUnaryCall , {
5252 message: YourUnaryCallResponse .encode ({
5353 // all the content of the response goes here as a classic JS object
5454 // this is the mock data that will be passed in the response
Original file line number Diff line number Diff line change @@ -39,15 +39,15 @@ export function readGrpcRequest(request: Request): Uint8Array | null {
3939 return ! requestBody ? null : unframeRequest ( requestBody ) ;
4040}
4141
42- export function mockGrpcUnary (
42+ export async function mockGrpcUnary (
4343 page : Page ,
4444 rpc : UnaryMethodDefinitionish ,
4545 response : GrpcResponse | ( ( request : Uint8Array | null ) => GrpcResponse )
46- ) : MockedGrpcCall {
46+ ) : Promise < MockedGrpcCall > {
4747 const url = `/${ rpc . service . serviceName } /${ rpc . methodName } ` ;
4848
4949 // note this wildcard route url base is done in order to match both localhost and deployed service usages.
50- page . route ( "**" + url , ( route ) => {
50+ await page . route ( "**" + url , ( route ) => {
5151 expect (
5252 route . request ( ) . method ( ) ,
5353 "ALL gRPC requests should be a POST request"
You can’t perform that action at this time.
0 commit comments