mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix test failures due to incomplete overrides
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
4875f24af3
commit
cf0ca414ea
@ -12,7 +12,7 @@ import checkForPlatformUpdatesInjectable from "./check-for-platform-updates.inje
|
||||
import type { UpdateChannel, ReleaseChannel } from "../../../common/update-channels";
|
||||
import { getPromiseStatus } from "../../../../../common/test-utils/get-promise-status";
|
||||
import loggerInjectable from "../../../../../common/logger.injectable";
|
||||
import type { Logger } from "../../../../../common/logger";
|
||||
import { noop } from "../../../../../common/utils";
|
||||
|
||||
describe("check-for-platform-updates", () => {
|
||||
let checkForPlatformUpdates: CheckForPlatformUpdates;
|
||||
@ -37,7 +37,13 @@ describe("check-for-platform-updates", () => {
|
||||
|
||||
logErrorMock = jest.fn();
|
||||
|
||||
di.override(loggerInjectable, () => ({ error: logErrorMock }) as unknown as Logger);
|
||||
di.override(loggerInjectable, () => ({
|
||||
error: logErrorMock,
|
||||
debug: noop,
|
||||
info: noop,
|
||||
silly: noop,
|
||||
warn: noop,
|
||||
}));
|
||||
|
||||
checkForPlatformUpdates = di.inject(checkForPlatformUpdatesInjectable);
|
||||
});
|
||||
|
||||
@ -12,7 +12,7 @@ import asyncFn from "@async-fn/jest";
|
||||
import { getPromiseStatus } from "../../../../../common/test-utils/get-promise-status";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
import loggerInjectable from "../../../../../common/logger.injectable";
|
||||
import type { Logger } from "../../../../../common/logger";
|
||||
import { noop } from "../../../../../common/utils";
|
||||
|
||||
describe("download-platform-update", () => {
|
||||
let downloadPlatformUpdate: DownloadPlatformUpdate;
|
||||
@ -43,7 +43,13 @@ describe("download-platform-update", () => {
|
||||
di.override(electronUpdaterInjectable, () => electronUpdaterFake);
|
||||
|
||||
logErrorMock = jest.fn();
|
||||
di.override(loggerInjectable, () => ({ error: logErrorMock }) as unknown as Logger);
|
||||
di.override(loggerInjectable, () => ({
|
||||
error: logErrorMock,
|
||||
debug: noop,
|
||||
info: noop,
|
||||
silly: noop,
|
||||
warn: noop,
|
||||
}));
|
||||
|
||||
downloadPlatformUpdate = di.inject(downloadPlatformUpdateInjectable);
|
||||
});
|
||||
|
||||
@ -16,6 +16,7 @@ import loggerInjectable from "../../common/logger.injectable";
|
||||
import type { Logger } from "../../common/logger";
|
||||
import requestPublicHelmRepositoriesInjectable from "./child-features/preferences/renderer/adding-of-public-helm-repository/public-helm-repositories/request-public-helm-repositories.injectable";
|
||||
import showErrorNotificationInjectable from "../../renderer/components/notifications/show-error-notification.injectable";
|
||||
import { noop } from "../../common/utils";
|
||||
|
||||
describe("listing active helm repositories in preferences", () => {
|
||||
let builder: ApplicationBuilder;
|
||||
@ -32,7 +33,13 @@ describe("listing active helm repositories in preferences", () => {
|
||||
execFileMock = asyncFn();
|
||||
showErrorNotificationMock = jest.fn();
|
||||
|
||||
loggerStub = { error: jest.fn() } as unknown as Logger;
|
||||
loggerStub = {
|
||||
error: jest.fn(),
|
||||
debug: noop,
|
||||
info: noop,
|
||||
silly: noop,
|
||||
warn: noop,
|
||||
};
|
||||
|
||||
builder.beforeApplicationStart((mainDi) => {
|
||||
mainDi.override(readYamlFileInjectable, () => readYamlFileMock);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user