From 5523801a3d8e04b71bf99d473a7a3dd4a7b5b6bd Mon Sep 17 00:00:00 2001 From: Roni Choudhury Date: Thu, 18 Mar 2021 16:25:31 -0400 Subject: [PATCH] Test a real multinet property --- test/multinet.test.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/multinet.test.ts b/test/multinet.test.ts index 1e622c2..83552c3 100644 --- a/test/multinet.test.ts +++ b/test/multinet.test.ts @@ -1,9 +1,13 @@ import { multinetApi } from '../src/index'; +import { AxiosError } from 'axios'; -function add(a: number, b: number): number { - return a + b + 1; -} +const badApi = multinetApi('http://example.com'); -test('hello world', () => { - expect(add(3, 4)).toBe(7); +test('general', async () => { + expect(badApi).toEqual(expect.anything()); + + // The "bad api" object should fail when invoked. + await expect(badApi.workspaces()) + .rejects + .toHaveProperty('isAxiosError', true); });