diff options
author | Florian Dold <florian@dold.me> | 2021-03-04 13:42:08 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-03-04 13:42:08 +0100 |
commit | 050461f28da4c97733af412d41c4ac75be877012 (patch) | |
tree | 8cdbb2f6738193d56b8d366fa0b70f3e331f0e4c /packages/taler-wallet-cli/src/integrationtests/harness.ts | |
parent | 032c486eaf8c6c1a87c5b3afc609898b41eba59b (diff) | |
download | wallet-core-050461f28da4c97733af412d41c4ac75be877012.tar.xz |
test merchant issue reported by MS
Diffstat (limited to 'packages/taler-wallet-cli/src/integrationtests/harness.ts')
-rw-r--r-- | packages/taler-wallet-cli/src/integrationtests/harness.ts | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/packages/taler-wallet-cli/src/integrationtests/harness.ts b/packages/taler-wallet-cli/src/integrationtests/harness.ts index a2d2b8e13..169aa8aa4 100644 --- a/packages/taler-wallet-cli/src/integrationtests/harness.ts +++ b/packages/taler-wallet-cli/src/integrationtests/harness.ts @@ -277,7 +277,9 @@ export class GlobalTestState { } assertAxiosError(e: any): asserts e is AxiosError { - return e.isAxiosError; + if (!e.isAxiosError) { + throw Error("expected axios error"); + } } assertTrue(b: boolean): asserts b { @@ -1191,6 +1193,14 @@ export class MerchantApiClient { }); } + async deleteInstance(instanceId: string) { + const baseUrl = this.baseUrl; + const url = new URL(`private/instances/${instanceId}`); + await axios.delete(url.href, { + headers: this.makeAuthHeader(), + }); + } + async createInstance(req: MerchantInstanceConfig): Promise<void> { const baseUrl = this.baseUrl; const url = new URL("private/instances", baseUrl); @@ -1209,10 +1219,14 @@ export class MerchantApiClient { async getInstanceFullDetails(instanceId: string): Promise<any> { const url = new URL(`private/instances/${instanceId}`, this.baseUrl); - const resp = await axios.get(url.href, { - headers: this.makeAuthHeader(), - }); - return resp.data; + try { + const resp = await axios.get(url.href, { + headers: this.makeAuthHeader(), + }); + return resp.data; + } catch (e) { + throw e; + } } makeAuthHeader(): Record<string, string> { |