From 82a2437c0967871d6b942105c98c3382978cad29 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 6 Aug 2020 00:30:36 +0530 Subject: towards integration tests with fault injection --- packages/taler-wallet-core/src/headless/NodeHttpLib.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'packages/taler-wallet-core/src/headless/NodeHttpLib.ts') diff --git a/packages/taler-wallet-core/src/headless/NodeHttpLib.ts b/packages/taler-wallet-core/src/headless/NodeHttpLib.ts index d109c3b7c..59730ab30 100644 --- a/packages/taler-wallet-core/src/headless/NodeHttpLib.ts +++ b/packages/taler-wallet-core/src/headless/NodeHttpLib.ts @@ -45,7 +45,7 @@ export class NodeHttpLib implements HttpRequestLibrary { } private async req( - method: "post" | "get", + method: "POST" | "GET", url: string, body: any, opt?: HttpRequestOptions, @@ -72,6 +72,7 @@ export class NodeHttpLib implements HttpRequestLibrary { { httpStatusCode: resp.status, requestUrl: url, + requestMethod: method, }, ), ); @@ -88,6 +89,7 @@ export class NodeHttpLib implements HttpRequestLibrary { { httpStatusCode: resp.status, requestUrl: url, + requestMethod: method, }, ), ); @@ -100,6 +102,7 @@ export class NodeHttpLib implements HttpRequestLibrary { { httpStatusCode: resp.status, requestUrl: url, + requestMethod: method, }, ), ); @@ -112,6 +115,7 @@ export class NodeHttpLib implements HttpRequestLibrary { } return { requestUrl: url, + requestMethod: method, headers, status: resp.status, text: async () => resp.data, @@ -120,7 +124,7 @@ export class NodeHttpLib implements HttpRequestLibrary { } async get(url: string, opt?: HttpRequestOptions): Promise { - return this.req("get", url, undefined, opt); + return this.req("GET", url, undefined, opt); } async postJson( @@ -128,6 +132,6 @@ export class NodeHttpLib implements HttpRequestLibrary { body: any, opt?: HttpRequestOptions, ): Promise { - return this.req("post", url, body, opt); + return this.req("POST", url, body, opt); } } -- cgit v1.2.3