chore: Simplify global overrides of requestKubeResource and requestPatchKubeResource

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-04-21 10:58:15 -04:00
1 parent ad33504f75
commit 1195889477
2 files changed
+4 -12

No files matched your search

@@ -2,11 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getGlobalOverride } from "@k8slens/test-utils"; import { getGlobalOverrideForFunction } from "@k8slens/test-utils";
import requestKubeResourceInjectable from "./request-kube-resource.injectable"; import requestKubeResourceInjectable from "./request-kube-resource.injectable";
export default getGlobalOverride(requestKubeResourceInjectable, () => () => { export default getGlobalOverrideForFunction(requestKubeResourceInjectable);
throw new Error(
"Tried to call for kube resource without explicit override.",
);
});
@@ -2,11 +2,7 @@
* Copyright (c) OpenLens Authors. All rights reserved. * Copyright (c) OpenLens Authors. All rights reserved.
* Licensed under MIT License. See LICENSE in root directory for more information. * Licensed under MIT License. See LICENSE in root directory for more information.
*/ */
import { getGlobalOverride } from "@k8slens/test-utils"; import { getGlobalOverrideForFunction } from "@k8slens/test-utils";
import requestPatchKubeResourceInjectable from "./request-patch-kube-resource.injectable"; import requestPatchKubeResourceInjectable from "./request-patch-kube-resource.injectable";
export default getGlobalOverride(requestPatchKubeResourceInjectable, () => () => { export default getGlobalOverrideForFunction(requestPatchKubeResourceInjectable);
throw new Error(
"Tried to call patching of kube resource without explicit override.",
);
});