From eafbaf0798a96bd7d45777a007d9e0286b3b3eca Mon Sep 17 00:00:00 2001 From: Keegan Irby Date: Wed, 13 Nov 2024 15:09:55 -0800 Subject: [PATCH] Assert deepstrictEqual on command input --- .../registry/liveTailSession.test.ts | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/packages/core/src/test/awsService/cloudWatchLogs/registry/liveTailSession.test.ts b/packages/core/src/test/awsService/cloudWatchLogs/registry/liveTailSession.test.ts index b1c5dfa3b4e..07bab07983a 100644 --- a/packages/core/src/test/awsService/cloudWatchLogs/registry/liveTailSession.test.ts +++ b/packages/core/src/test/awsService/cloudWatchLogs/registry/liveTailSession.test.ts @@ -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 ) }) @@ -77,8 +77,4 @@ describe('LiveTailSession', async function () { awsCredentials: testAwsCredentials, }) } - - function validateStartLiveTailCommand(actual: StartLiveTailCommand, expected: StartLiveTailCommand) { - assert.strictEqual(JSON.stringify(actual), JSON.stringify(expected)) - } })