Skip to content

Commit

Permalink
fix: type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
scnwwu committed Nov 15, 2023
1 parent 47acc72 commit 3af7082
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
27 changes: 15 additions & 12 deletions client/test/components/ContentNavigator/ContentDataProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
authentication,
} from "vscode";

import axios, { AxiosInstance } from "axios";
import axios, { AxiosInstance, HeadersDefaults } from "axios";
import { expect } from "chai";
import * as sinon from "sinon";
import { StubbedInstance, stubInterface } from "ts-sinon";
Expand Down Expand Up @@ -114,19 +114,22 @@ describe("ContentDataProvider", async function () {
axiosInstance.interceptors.response = {
use: () => null,
eject: () => null,
clear: () => null,
};
axiosInstance.defaults = {
headers: {
common: {
Authorization: "",
},
put: {},
post: {},
patch: {},
delete: {},
head: {},
get: {},
const defaultHeader: HeadersDefaults = {
common: {
Authorization: "",
},
put: {},
post: {},
patch: {},
delete: {},
head: {},
get: {},
};
axiosInstance.defaults = {
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
headers: defaultHeader as AxiosInstance["defaults"]["headers"],
};

stub = sinon.stub(axios, "create").returns(axiosInstance);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AxiosResponse } from "axios";
import { AxiosHeaders, AxiosResponse } from "axios";
import { expect } from "chai";

import PaginatedResultSet from "../../../src/components/LibraryNavigator/PaginatedResultSet";
Expand All @@ -7,7 +7,9 @@ const axiosResponseDefaults = {
status: 200,
statusText: "OK",
headers: {},
config: {},
config: {
headers: new AxiosHeaders(),
},
};

describe("PaginatedResultSet", async function () {
Expand Down

0 comments on commit 3af7082

Please sign in to comment.