Skip to content

Commit

Permalink
chore: fix renaming mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Jun 7, 2019
1 parent 74c107b commit ca20e8b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions garden-service/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class ActionHelper implements TypeGuard {
async getEnvironmentStatus(
{ pluginName, log }: ActionHelperParams<GetEnvironmentStatusParams>,
): Promise<EnvironmentStatusMap> {
const handlers = this.getActionHelpers("getEnvironmentStatus", pluginName)
const handlers = this.getActionHandlers("getEnvironmentStatus", pluginName)
const logEntry = log.debug({
msg: "Getting status...",
status: "active",
Expand Down Expand Up @@ -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 }
Expand Down Expand Up @@ -229,7 +229,7 @@ export class ActionHelper implements TypeGuard {
async cleanupEnvironment(
{ pluginName, log }: ActionHelperParams<CleanupEnvironmentParams>,
): Promise<EnvironmentStatusMap> {
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 })
}
Expand Down Expand Up @@ -430,7 +430,7 @@ export class ActionHelper implements TypeGuard {
}

async getDebugInfo({ log }: { log: LogEntry }): Promise<DebugInfoMap> {
const handlers = this.getActionHelpers("getDebugInfo")
const handlers = this.getActionHandlers("getDebugInfo")
return Bluebird.props(mapValues(handlers, async (h) => h({ ...await this.commonParams(h, log) })))
}

Expand Down Expand Up @@ -598,7 +598,7 @@ export class ActionHelper implements TypeGuard {
/**
* Get a handler for the specified action.
*/
public getActionHelpers<T extends keyof PluginActions>(actionType: T, pluginName?: string): ActionHandlerMap<T> {
public getActionHandlers<T extends keyof PluginActions>(actionType: T, pluginName?: string): ActionHandlerMap<T> {
return this.filterActionHandlers(this.actionHandlers[actionType], pluginName)
}

Expand Down Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions garden-service/test/unit/src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ca20e8b

Please sign in to comment.