Skip to content

Commit b533be7

Browse files
committed
Fix tests
1 parent dca4aa1 commit b533be7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/core/test/submission/TestSubmissionClient.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe("TestSubmissionClient", () => {
1313
config.heartbeatServerUrl = "http://heartbeat.localhost:5000";
1414

1515
test("should submit events", async () => {
16-
const fetchMock = TestSubmissionClient.prototype.fetch = jest.fn()
16+
const fetchMock = TestSubmissionClient.prototype.apiFetch = jest.fn()
1717
.mockReturnValueOnce(new Response(202, "", undefined, undefined, undefined));
1818

1919
const events = [{ type: "log", message: "From js client", reference_id: "123454321" }];
@@ -28,7 +28,7 @@ describe("TestSubmissionClient", () => {
2828
});
2929

3030
test("should submit invalid object data", async () => {
31-
const fetchMock = TestSubmissionClient.prototype.fetch = jest.fn()
31+
const fetchMock = TestSubmissionClient.prototype.apiFetch = jest.fn()
3232
.mockReturnValueOnce(new Response(202, "", undefined, undefined, undefined));
3333

3434
const events: Event[] = [{
@@ -49,7 +49,7 @@ describe("TestSubmissionClient", () => {
4949
});
5050

5151
test("should submit user description", async () => {
52-
const fetchMock = TestSubmissionClient.prototype.fetch = jest.fn()
52+
const fetchMock = TestSubmissionClient.prototype.apiFetch = jest.fn()
5353
.mockReturnValueOnce(new Response(202, "", undefined, 1, undefined))
5454
.mockReturnValueOnce(new Response(202, "", undefined, undefined, JSON.stringify(new ServerSettings({}, 1))));
5555

@@ -71,7 +71,7 @@ describe("TestSubmissionClient", () => {
7171
});
7272

7373
test("should submit heartbeat", async () => {
74-
const fetchMock = TestSubmissionClient.prototype.fetch = jest.fn()
74+
const fetchMock = TestSubmissionClient.prototype.apiFetch = jest.fn()
7575
.mockReturnValueOnce(new Response(200, "", undefined, undefined, undefined));
7676

7777
const client = new TestSubmissionClient(config);
@@ -82,7 +82,7 @@ describe("TestSubmissionClient", () => {
8282
});
8383

8484
test("should get project settings", async () => {
85-
const fetchMock = TestSubmissionClient.prototype.fetch = jest.fn()
85+
const fetchMock = TestSubmissionClient.prototype.apiFetch = jest.fn()
8686
.mockReturnValueOnce(new Response(200, "", undefined, undefined, JSON.stringify(new ServerSettings({}, 1))));
8787

8888
const client = new TestSubmissionClient(config);

packages/core/test/submission/TestSubmissionClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from "../../src/submission/DefaultSubmissionClient.js";
66

77
export class TestSubmissionClient extends DefaultSubmissionClient {
8-
public fetch<T>(url: string, options: FetchOptions): Promise<Response> {
8+
public apiFetch<T>(url: string, options: FetchOptions): Promise<Response<T>> {
99
throw new Error("Missing mock");
1010
}
1111
}

0 commit comments

Comments
 (0)