Skip to content

Commit

Permalink
fix: get log forwarding (#803)
Browse files Browse the repository at this point in the history
* failing test case

* fix failing test case
  • Loading branch information
MichaelGoberling committed May 8, 2024
1 parent 52a296e commit fb90f2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/commands/app/config/get/log-forwarding.js
Expand Up @@ -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()
Expand Down
11 changes: 11 additions & 0 deletions test/commands/app/config/get/log-forwarding.test.js
Expand Up @@ -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(
Expand Down

0 comments on commit fb90f2e

Please sign in to comment.