diff --git a/ts/wasm/__tests__/assets/api-mock.ts b/ts/wasm/__tests__/assets/api-mock.ts
index c3b6da9b8b7c99f0a0c85b717b8c19e88fb58a1b..f25ad365b9cb4d79c0fec23dde40bbb32c8de334 100644
--- a/ts/wasm/__tests__/assets/api-mock.ts
+++ b/ts/wasm/__tests__/assets/api-mock.ts
@@ -50,7 +50,12 @@ export class JsonRpcMock extends AProxyMockResolver {
     // here we assume that the request is valid
     const { method, params } = req.body;
 
-    const response = this.mockData[method](params);
+    const mockFn = this.mockData[method];
+
+    if (typeof mockFn !== "function")
+      throw new Error(`Method ${method} is not implemented`);
+
+    const response = mockFn(params);
 
     res.json(response);
   }