diff --git a/src/commands/app/config/get/log-forwarding.js b/src/commands/app/config/get/log-forwarding.js index 7cc42d8e..9ad7ab62 100644 --- a/src/commands/app/config/get/log-forwarding.js +++ b/src/commands/app/config/get/log-forwarding.js @@ -14,7 +14,7 @@ const LogForwarding = require('../../../../lib/log-forwarding') class LogForwardingCommand extends BaseCommand { async run () { - const lf = await LogForwarding.init(await this.getFullConfig().aio) + const lf = await LogForwarding.init((await this.getFullConfig()).aio) const localConfig = lf.getLocalConfig() const serverConfig = await lf.getServerConfig() diff --git a/test/commands/app/config/get/log-forwarding.test.js b/test/commands/app/config/get/log-forwarding.test.js index 02992f6f..07105f20 100644 --- a/test/commands/app/config/get/log-forwarding.test.js +++ b/test/commands/app/config/get/log-forwarding.test.js @@ -44,6 +44,17 @@ beforeEach(async () => { LogForwarding.init.mockResolvedValue(lf) }) +test('get log forwarding settings (expect init to be passed a config)', async () => { + const localConfig = new LogForwarding.LogForwardingConfig() + const serverConfig = new LogForwarding.LogForwardingConfig() + + lf.getLocalConfig.mockReturnValue(localConfig) + lf.getServerConfig.mockResolvedValue(serverConfig) + + await command.run() + expect(LogForwarding.init).toHaveBeenCalledWith(command.appConfig.aio) +}) + test('get log forwarding settings (local and server are the same)', async () => { return new Promise(resolve => { const localConfig = new LogForwarding.LogForwardingConfig(