Skip to content

Commit

Permalink
Assert deepstrictEqual on command input
Browse files Browse the repository at this point in the history
  • Loading branch information
Keegan Irby committed Nov 13, 2024
1 parent 8747438 commit eafbaf0
Showing 1 changed file with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,53 +15,53 @@ describe('LiveTailSession', async function () {

it('builds StartLiveTailCommand: no stream Filter, no event filter.', function () {
const session = buildLiveTailSession({ type: 'all' }, undefined)
validateStartLiveTailCommand(
session.buildStartLiveTailCommand(),
assert.deepStrictEqual(
session.buildStartLiveTailCommand().input,
new StartLiveTailCommand({
logGroupIdentifiers: [testLogGroupArn],
logEventFilterPattern: undefined,
logStreamNamePrefixes: undefined,
logStreamNames: undefined,
})
}).input
)
})

it('builds StartLiveTailCommand: with prefix stream Filter', function () {
const session = buildLiveTailSession({ type: 'prefix', filter: testFilter }, undefined)
validateStartLiveTailCommand(
session.buildStartLiveTailCommand(),
assert.deepStrictEqual(
session.buildStartLiveTailCommand().input,
new StartLiveTailCommand({
logGroupIdentifiers: [testLogGroupArn],
logEventFilterPattern: undefined,
logStreamNamePrefixes: [testFilter],
logStreamNames: undefined,
})
}).input
)
})

it('builds StartLiveTailCommand: with specific stream Filter', function () {
const session = buildLiveTailSession({ type: 'specific', filter: testFilter }, undefined)
validateStartLiveTailCommand(
session.buildStartLiveTailCommand(),
assert.deepStrictEqual(
session.buildStartLiveTailCommand().input,
new StartLiveTailCommand({
logGroupIdentifiers: [testLogGroupArn],
logEventFilterPattern: undefined,
logStreamNamePrefixes: undefined,
logStreamNames: [testFilter],
})
}).input
)
})

it('builds StartLiveTailCommand: with log event Filter', function () {
const session = buildLiveTailSession({ type: 'all' }, testFilter)
validateStartLiveTailCommand(
session.buildStartLiveTailCommand(),
assert.deepStrictEqual(
session.buildStartLiveTailCommand().input,
new StartLiveTailCommand({
logGroupIdentifiers: [testLogGroupArn],
logEventFilterPattern: testFilter,
logStreamNamePrefixes: undefined,
logStreamNames: undefined,
})
}).input
)
})

Expand All @@ -77,8 +77,4 @@ describe('LiveTailSession', async function () {
awsCredentials: testAwsCredentials,
})
}

function validateStartLiveTailCommand(actual: StartLiveTailCommand, expected: StartLiveTailCommand) {
assert.strictEqual(JSON.stringify(actual), JSON.stringify(expected))
}
})

0 comments on commit eafbaf0

Please sign in to comment.