Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zoe-codez committed Oct 19, 2024
1 parent 1eff3a7 commit c8d5e0d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/extensions/internal.extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function FetchInternals({ logger, context: parentContext }: TServiceParam
...fetchWith
}: Partial<FetchArguments<BODY>>) {
const contentType = is.object(body) ? { "Content-Type": "application/json" } : {};
const result = await global.fetch(fetchCreateUrl(fetchWith), {
const result = await globalThis.fetch(fetchCreateUrl(fetchWith), {
body: is.object(body) ? JSON.stringify(body) : body,
headers: {
...contentType,
Expand Down
26 changes: 13 additions & 13 deletions src/testing/fetch-api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe("FetchAPI", () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass }) => {
lifecycle.onReady(async () => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "[]",
} as unknown as Response;
Expand All @@ -54,7 +54,7 @@ describe("FetchAPI", () => {
it("should format calendarSearch properly", async () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass }) => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "[]",
} as unknown as Response;
Expand All @@ -78,7 +78,7 @@ describe("FetchAPI", () => {
it("should format callService properly", async () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass }) => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "{}",
} as unknown as Response;
Expand All @@ -103,7 +103,7 @@ describe("FetchAPI", () => {
it("should format checkConfig properly", async () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass }) => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "{}",
} as unknown as Response;
Expand Down Expand Up @@ -166,7 +166,7 @@ describe("FetchAPI", () => {
it("should format fetchEntityCustomizations properly", async () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass }) => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "{}",
} as unknown as Response;
Expand All @@ -186,7 +186,7 @@ describe("FetchAPI", () => {
it("should format fetchEntityHistory properly", async () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass }) => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "{}",
} as unknown as Response;
Expand All @@ -207,7 +207,7 @@ describe("FetchAPI", () => {
expect.assertions(1);
const body = { magic: true };
await hassTestRunner.run(({ lifecycle, hass }) => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "{}",
} as unknown as Response;
Expand Down Expand Up @@ -276,7 +276,7 @@ describe("FetchAPI", () => {
it("should format getLogs properly", async () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass }) => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "[]",
} as unknown as Response;
Expand All @@ -296,7 +296,7 @@ describe("FetchAPI", () => {
it("should format getRawLogs properly", async () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass }) => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "{}",
} as unknown as Response;
Expand All @@ -317,7 +317,7 @@ describe("FetchAPI", () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass, mock_assistant }) => {
lifecycle.onReady(async () => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "{}",
} as unknown as Response;
Expand All @@ -337,7 +337,7 @@ describe("FetchAPI", () => {
it("should format updateEntity properly", async () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass }) => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "{}",
} as unknown as Response;
Expand Down Expand Up @@ -369,7 +369,7 @@ describe("FetchAPI", () => {
magic: true,
};
await hassTestRunner.run(({ lifecycle, hass }) => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "{}",
} as unknown as Response;
Expand All @@ -390,7 +390,7 @@ describe("FetchAPI", () => {
it("should format checkCredentials properly", async () => {
expect.assertions(1);
await hassTestRunner.run(({ lifecycle, hass }) => {
const spy = jest.spyOn(global, "fetch").mockImplementation(async () => {
const spy = jest.spyOn(globalThis, "fetch").mockImplementation(async () => {
return {
text: () => "{}",
} as unknown as Response;
Expand Down

0 comments on commit c8d5e0d

Please sign in to comment.