mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Make KubeApi consume its dependencies while not breaking the extension API
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
1ef5677d61
commit
1be1b4418f
106 files changed
+972
-316
No files matched your search
@@ -10,7 +10,7 @@ import { renderFor } from "../test-utils/renderFor";
|
||||
import { Countdown } from "./countdown";
|
||||
import React from "react";
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
import { advanceFakeTime, useFakeTime } from "../../../common/test-utils/use-fake-time";
|
||||
import { advanceFakeTime, testUsingFakeTime } from "../../../common/test-utils/use-fake-time";
|
||||
import type { IComputedValue } from "mobx";
|
||||
import { observe } from "mobx";
|
||||
import { noop } from "../../../common/utils";
|
||||
@@ -20,7 +20,7 @@ describe("countdown", () => {
|
||||
let render: DiRender;
|
||||
|
||||
beforeEach(() => {
|
||||
useFakeTime("2015-10-21T07:28:00Z");
|
||||
testUsingFakeTime("2015-10-21T07:28:00Z");
|
||||
|
||||
di = createContainer("irrelevant");
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { RenderDelay } from "../render-delay";
|
||||
import type { DiRender } from "../../test-utils/renderFor";
|
||||
import { renderFor } from "../../test-utils/renderFor";
|
||||
import { getDiForUnitTesting } from "../../../getDiForUnitTesting";
|
||||
import { advanceFakeTime, useFakeTime } from "../../../../common/test-utils/use-fake-time";
|
||||
import { advanceFakeTime, testUsingFakeTime } from "../../../../common/test-utils/use-fake-time";
|
||||
import cancelIdleCallbackInjectable from "../cancel-idle-callback.injectable";
|
||||
import requestIdleCallbackInjectable from "../request-idle-callback.injectable";
|
||||
import type { RenderResult } from "@testing-library/react";
|
||||
@@ -21,7 +21,7 @@ describe("<RenderDelay/>", () => {
|
||||
|
||||
render = renderFor(di);
|
||||
|
||||
useFakeTime("2020-01-17 12:18:19");
|
||||
testUsingFakeTime("2020-01-17 12:18:19");
|
||||
|
||||
di.override(cancelIdleCallbackInjectable, () => clearTimeout);
|
||||
di.override(requestIdleCallbackInjectable, () => (callback, opts) => setTimeout(callback, opts.timeout) as any);
|
||||
|
||||
@@ -68,6 +68,7 @@ import shouldStartHiddenInjectable from "../../../main/electron-app/features/sho
|
||||
import fsInjectable from "../../../common/fs/fs.injectable";
|
||||
import joinPathsInjectable from "../../../common/path/join-paths.injectable";
|
||||
import homeDirectoryPathInjectable from "../../../common/os/home-directory-path.injectable";
|
||||
import { testUsingFakeTime } from "../../../common/test-utils/use-fake-time";
|
||||
|
||||
type Callback = (di: DiContainer) => void | Promise<void>;
|
||||
|
||||
@@ -167,6 +168,8 @@ export const getApplicationBuilder = () => {
|
||||
mainDi.register(mainExtensionsStateInjectable);
|
||||
});
|
||||
|
||||
testUsingFakeTime();
|
||||
|
||||
const { overrideForWindow, sendToWindow } = overrideChannels(mainDi);
|
||||
|
||||
const beforeApplicationStartCallbacks: Callback[] = [];
|
||||
|
||||
Reference in new issue
Block a user