mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Organise code for "resolve-system-proxy" in one place as behaviour instead of in many places
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi> Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
parent
6b72f7b49d
commit
9ea440ad5e
@ -3,8 +3,8 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import type { RequestChannel } from "../channel/request-channel-injection-token";
|
||||
import { requestChannelInjectionToken } from "../channel/request-channel-injection-token";
|
||||
import type { RequestChannel } from "../../../../common/utils/channel/request-channel-injection-token";
|
||||
import { requestChannelInjectionToken } from "../../../../common/utils/channel/request-channel-injection-token";
|
||||
|
||||
export type ResolveSystemProxyChannel = RequestChannel<string, string>;
|
||||
|
||||
@ -3,9 +3,9 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import resolveSystemProxyChannelInjectable from "../../../common/utils/resolve-system-proxy/resolve-system-proxy-channel.injectable";
|
||||
import resolveSystemProxyChannelInjectable from "../common/resolve-system-proxy-channel.injectable";
|
||||
import resolveSystemProxyInjectable from "./resolve-system-proxy.injectable";
|
||||
import { requestChannelListenerInjectionToken } from "../../../common/utils/channel/request-channel-listener-injection-token";
|
||||
import { requestChannelListenerInjectionToken } from "../../../../common/utils/channel/request-channel-listener-injection-token";
|
||||
|
||||
const resolveSystemProxyChannelResponderInjectable = getInjectable({
|
||||
id: "resolve-system-proxy-channel-responder",
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import electronInjectable from "./electron.injectable";
|
||||
import withErrorLoggingInjectable from "../../../common/utils/with-error-logging/with-error-logging.injectable";
|
||||
import withErrorLoggingInjectable from "../../../../common/utils/with-error-logging/with-error-logging.injectable";
|
||||
|
||||
const resolveSystemProxyFromElectronInjectable = getInjectable({
|
||||
id: "resolve-system-proxy-from-electron",
|
||||
@ -3,14 +3,14 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import { getDiForUnitTesting } from "../../getDiForUnitTesting";
|
||||
import { getDiForUnitTesting } from "../../../../main/getDiForUnitTesting";
|
||||
import resolveSystemProxyFromElectronInjectable from "./resolve-system-proxy-from-electron.injectable";
|
||||
import electronInjectable from "./electron.injectable";
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import type electron from "electron";
|
||||
import { getPromiseStatus } from "../../../common/test-utils/get-promise-status";
|
||||
import logErrorInjectable from "../../../common/log-error.injectable";
|
||||
import { getPromiseStatus } from "../../../../common/test-utils/get-promise-status";
|
||||
import logErrorInjectable from "../../../../common/log-error.injectable";
|
||||
import type { DiContainer } from "@ogre-tools/injectable";
|
||||
|
||||
describe("technical: resolve-system-proxy-from-electron", () => {
|
||||
@ -3,7 +3,7 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { resolveSystemProxyInjectionToken } from "../../../common/utils/resolve-system-proxy/resolve-system-proxy-injection-token";
|
||||
import { resolveSystemProxyInjectionToken } from "../common/resolve-system-proxy-injection-token";
|
||||
import resolveSystemProxyFromElectronInjectable from "./resolve-system-proxy-from-electron.injectable";
|
||||
|
||||
const resolveSystemProxyInjectable = getInjectable({
|
||||
@ -3,9 +3,9 @@
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { resolveSystemProxyInjectionToken } from "../../../common/utils/resolve-system-proxy/resolve-system-proxy-injection-token";
|
||||
import requestFromChannelInjectable from "../channel/request-from-channel.injectable";
|
||||
import resolveSystemProxyChannelInjectable from "../../../common/utils/resolve-system-proxy/resolve-system-proxy-channel.injectable";
|
||||
import { resolveSystemProxyInjectionToken } from "../common/resolve-system-proxy-injection-token";
|
||||
import requestFromChannelInjectable from "../../../../renderer/utils/channel/request-from-channel.injectable";
|
||||
import resolveSystemProxyChannelInjectable from "../common/resolve-system-proxy-channel.injectable";
|
||||
|
||||
const resolveSystemProxyInjectable = getInjectable({
|
||||
id: "resolve-system-proxy-for-renderer",
|
||||
@ -4,12 +4,12 @@
|
||||
*/
|
||||
import type { AsyncFnMock } from "@async-fn/jest";
|
||||
import asyncFn from "@async-fn/jest";
|
||||
import type { ApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../renderer/components/test-utils/get-application-builder";
|
||||
import type { ResolveSystemProxy } from "../../common/utils/resolve-system-proxy/resolve-system-proxy-injection-token";
|
||||
import { resolveSystemProxyInjectionToken } from "../../common/utils/resolve-system-proxy/resolve-system-proxy-injection-token";
|
||||
import resolveSystemProxyFromElectronInjectable from "../../main/utils/resolve-system-proxy/resolve-system-proxy-from-electron.injectable";
|
||||
import { getPromiseStatus } from "../../common/test-utils/get-promise-status";
|
||||
import type { ApplicationBuilder } from "../../../renderer/components/test-utils/get-application-builder";
|
||||
import { getApplicationBuilder } from "../../../renderer/components/test-utils/get-application-builder";
|
||||
import type { ResolveSystemProxy } from "./common/resolve-system-proxy-injection-token";
|
||||
import { resolveSystemProxyInjectionToken } from "./common/resolve-system-proxy-injection-token";
|
||||
import resolveSystemProxyFromElectronInjectable from "./main/resolve-system-proxy-from-electron.injectable";
|
||||
import { getPromiseStatus } from "../../../common/test-utils/get-promise-status";
|
||||
|
||||
describe("resolve-system-proxy", () => {
|
||||
let applicationBuilder: ApplicationBuilder;
|
||||
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { asLegacyGlobalFunctionForExtensionApi } from "../as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api";
|
||||
import { resolveSystemProxyInjectionToken } from "../../common/utils/resolve-system-proxy/resolve-system-proxy-injection-token";
|
||||
import { resolveSystemProxyInjectionToken } from "../../behaviours/proxy/resolve-system-proxy/common/resolve-system-proxy-injection-token";
|
||||
|
||||
/**
|
||||
* Resolves URL-specific proxy information from system. See more here: https://www.electronjs.org/docs/latest/api/session#sesresolveproxyurl
|
||||
|
||||
@ -99,7 +99,7 @@ import rollbackHelmReleaseInjectable from "./helm/helm-service/rollback-helm-rel
|
||||
import updateHelmReleaseInjectable from "./helm/helm-service/update-helm-release.injectable";
|
||||
import waitUntilBundledExtensionsAreLoadedInjectable from "./start-main-application/lens-window/application-window/wait-until-bundled-extensions-are-loaded.injectable";
|
||||
import { registerMobX } from "@ogre-tools/injectable-extension-for-mobx";
|
||||
import electronInjectable from "./utils/resolve-system-proxy/electron.injectable";
|
||||
import electronInjectable from "../behaviours/proxy/resolve-system-proxy/main/electron.injectable";
|
||||
|
||||
export function getDiForUnitTesting(opts: { doGeneralOverrides?: boolean } = {}) {
|
||||
const {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user