Skip to content

Commit d5151c5

Browse files
committed
fix test cases that inspect the logs
1 parent f0cb44b commit d5151c5

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

packages/core/src/awsService/appBuilder/explorer/nodes/deployedNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export async function generateDeployedNode(
9696
.Configuration as Lambda.FunctionConfiguration
9797
newDeployedResource = new LambdaFunctionNode(lambdaNode, regionCode, configuration)
9898
} catch (error: any) {
99-
getLogger().error('Error getting Lambda configuration')
99+
getLogger().error('Error getting Lambda configuration %O', error)
100100
throw ToolkitError.chain(error, 'Error getting Lambda configuration', {
101101
code: 'lambdaClientError',
102102
})

packages/core/src/test/awsService/appBuilder/samProject.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('samProject', () => {
7878
// simulate error when no samconfig.toml file in directory
7979
const result = await getStackName(projectRoot)
8080
assert.deepStrictEqual(result, {})
81-
assertLogsContain('No stack name or region information available in samconfig.toml', true, 'info')
81+
assertLogsContain('No stack name or region information available in samconfig.toml: %O', true, 'info')
8282
})
8383

8484
it('returns empty object give error parsing samconfig file', async () => {

packages/core/src/test/lambda/vue/remoteInvoke/invokeLambda.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ describe('RemoteInvokeWebview', () => {
198198
new Error('Failed to read selected file')
199199
)
200200
assert.strictEqual(loggerErrorStub.calledOnce, true)
201-
assert.strictEqual(loggerErrorStub.firstCall.args[0], 'readFileSync: Failed to read file at path %O')
201+
assert.strictEqual(loggerErrorStub.firstCall.args[0], 'readFileSync: Failed to read file at path %s %O')
202202
assert.strictEqual(loggerErrorStub.firstCall.args[1], fileUri.fsPath)
203203
assert(loggerErrorStub.firstCall.args[2] instanceof Error)
204204
} finally {

packages/core/src/test/lambda/vue/samInvokeBackend.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ describe('SamInvokeWebview', () => {
446446
new Error('Failed to read selected file')
447447
)
448448
assert.strictEqual(loggerErrorStub.calledOnce, true)
449-
assert.strictEqual(loggerErrorStub.firstCall.args[0], 'readFileSync: Failed to read file at path %O')
449+
assert.strictEqual(loggerErrorStub.firstCall.args[0], 'readFileSync: Failed to read file at path %s %O')
450450
assert.strictEqual(loggerErrorStub.firstCall.args[1], fileUri.fsPath)
451451
assert(loggerErrorStub.firstCall.args[2] instanceof Error)
452452
} finally {

packages/core/src/test/shared/applicationBuilder/explorer/nodes/deployedNode.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ describe('generateDeployedNode', () => {
223223
lambdaDeployedNodeInput.resourceTreeEntity
224224
)
225225

226-
assert(loggerErrorStub.calledOnceWith('Error getting Lambda configuration'))
227-
assert(loggerErrorStub.neverCalledWith('Error getting Lambda V3 configuration'))
226+
assert(loggerErrorStub.calledOnceWith('Error getting Lambda configuration %O'))
227+
assert(loggerErrorStub.neverCalledWith('Error getting Lambda V3 configuration %O'))
228228
assert(deployedResourceNodes.length === 1)
229229

230230
// Check placeholder propertries
@@ -375,10 +375,10 @@ describe('generateDeployedNode', () => {
375375
unsupportTypeInput.resourceTreeEntity
376376
)
377377

378-
assert(loggerInfoStub.calledOnceWith('Details are missing or are incomplete for:'))
378+
assert(loggerInfoStub.calledOnceWith('Details are missing or are incomplete for: %O'))
379379

380380
// Check deployedResourceNodes array propertries
381-
assert(loggerErrorStub.neverCalledWith('Error getting Lambda V3 configuration'))
381+
assert(loggerErrorStub.neverCalledWith('Error getting Lambda V3 configuration %O'))
382382

383383
// Check deployedResourceNodes array propertries
384384
assert(deployedResourceNodes.length === 1)

0 commit comments

Comments
 (0)