import { expect } from "chai"; import axios from "axios"; import { BackendApi } from "../../src/backend/api"; describe("Backend API tests - Unit", function() { it("Instantiate Api class - expect pass - with a valid HTTP client instance", async () => { const backendUrl: string = "https://psyched-hook-280010.oa.r.appspot.com"; const backendApi: BackendApi = new BackendApi(axios.create({ baseURL: backendUrl })); expect(backendApi._axiosInstance.defaults.baseURL).to.eql(backendUrl); }); it("Instantiate Api class - expect failure - with an invalid HTTP client instance", async () => { const backendUrl: string = "https://psyched-hook-280010.oa.r.appspot.com"; const backendApi: BackendApi = new BackendApi(axios.create({ baseURL: undefined })); expect(backendApi._axiosInstance.defaults.baseURL).to.not.eql(backendUrl); }); });