From 07ba9eed5ae1d191e052a2f1a803143bf08b99fd Mon Sep 17 00:00:00 2001 From: Jon Edvald Date: Fri, 7 Jun 2019 22:39:51 +0200 Subject: [PATCH] chore: fix renaming mistake --- garden-service/src/actions.ts | 12 ++++++------ garden-service/test/unit/src/actions.ts | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/garden-service/src/actions.ts b/garden-service/src/actions.ts index 1ce4c2c777..95cc213214 100644 --- a/garden-service/src/actions.ts +++ b/garden-service/src/actions.ts @@ -143,7 +143,7 @@ export class ActionHelper implements TypeGuard { async getEnvironmentStatus( { pluginName, log }: ActionHelperParams, ): Promise { - const handlers = this.getActionHelpers("getEnvironmentStatus", pluginName) + const handlers = this.getActionHandlers("getEnvironmentStatus", pluginName) const logEntry = log.debug({ msg: "Getting status...", status: "active", @@ -185,7 +185,7 @@ export class ActionHelper implements TypeGuard { ) } - const prepareHandlers = this.getActionHelpers("prepareEnvironment", pluginName) + const prepareHandlers = this.getActionHandlers("prepareEnvironment", pluginName) const needPrep = Object.entries(prepareHandlers).filter(([name]) => { const status = statuses[name] || { ready: false } @@ -229,7 +229,7 @@ export class ActionHelper implements TypeGuard { async cleanupEnvironment( { pluginName, log }: ActionHelperParams, ): Promise { - const handlers = this.getActionHelpers("cleanupEnvironment", pluginName) + const handlers = this.getActionHandlers("cleanupEnvironment", pluginName) await Bluebird.each(values(handlers), async (h) => h({ ...await this.commonParams(h, log) })) return this.getEnvironmentStatus({ pluginName, log }) } @@ -430,7 +430,7 @@ export class ActionHelper implements TypeGuard { } async getDebugInfo({ log }: { log: LogEntry }): Promise { - const handlers = this.getActionHelpers("getDebugInfo") + const handlers = this.getActionHandlers("getDebugInfo") return Bluebird.props(mapValues(handlers, async (h) => h({ ...await this.commonParams(h, log) }))) } @@ -598,7 +598,7 @@ export class ActionHelper implements TypeGuard { /** * Get a handler for the specified action. */ - public getActionHelpers(actionType: T, pluginName?: string): ActionHandlerMap { + public getActionHandlers(actionType: T, pluginName?: string): ActionHandlerMap { return this.filterActionHandlers(this.actionHandlers[actionType], pluginName) } @@ -633,7 +633,7 @@ export class ActionHelper implements TypeGuard { { actionType: T, pluginName?: string, defaultHandler?: PluginActions[T] }, ): PluginActions[T] { - const handlers = Object.values(this.getActionHelpers(actionType, pluginName)) + const handlers = Object.values(this.getActionHandlers(actionType, pluginName)) if (handlers.length) { return handlers[handlers.length - 1] diff --git a/garden-service/test/unit/src/actions.ts b/garden-service/test/unit/src/actions.ts index 2bb8e2dedb..577e6fa071 100644 --- a/garden-service/test/unit/src/actions.ts +++ b/garden-service/test/unit/src/actions.ts @@ -321,9 +321,9 @@ describe("ActionHelper", () => { }) }) - describe("getActionHelpers", () => { + describe("getActionHandlers", () => { it("should return all handlers for a type", async () => { - const handlers = actions.getActionHelpers("prepareEnvironment") + const handlers = actions.getActionHandlers("prepareEnvironment") expect(Object.keys(handlers)).to.eql([ "test-plugin",