Skip to content

Commit 0a1cded

Browse files
committed
tests: update layer tests
1 parent f78da0b commit 0a1cded

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

layers/tests/e2e/layerPublisher.class.test.functionCode.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { SSMClient } from '@aws-sdk/client-ssm';
1717
const logger = new Logger({
1818
logLevel: 'DEBUG',
1919
});
20-
const metrics = new Metrics();
20+
const metrics = new Metrics({ logger });
2121
const tracer = new Tracer();
2222

2323
// Instantiating these clients and the respective providers/persistence layers

layers/tests/e2e/layerPublisher.test.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ import {
1717
TEARDOWN_TIMEOUT,
1818
} from './constants.js';
1919

20+
vi.hoisted(() => {
21+
process.env.AWS_PROFILE = 'aamorosi-Admin';
22+
});
23+
2024
/**
2125
* This test has two stacks:
2226
* 1. LayerPublisherStack - publishes a layer version using the LayerPublisher construct and containing the Powertools utilities from the repo
@@ -143,15 +147,10 @@ describe('Layers E2E tests', () => {
143147
const logs = invocationLogs.getFunctionLogs('WARN');
144148

145149
expect(logs.length).toBe(1);
146-
expect(
147-
invocationLogs.doesAnyFunctionLogsContains(
148-
/Namespace should be defined, default used/,
149-
'WARN'
150-
)
151-
).toBe(true);
152-
/* expect(logEntry.message).toEqual(
150+
const logEntry = TestInvocationLogs.parseFunctionLog(logs[0]);
151+
expect(logEntry.message).toEqual(
153152
'Namespace should be defined, default used'
154-
); */
153+
);
155154
}
156155
);
157156

packages/metrics/src/Metrics.ts

+1
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,7 @@ class Metrics extends Utility implements MetricsInterface {
749749
serviceName: this.dimensions.service,
750750
defaultDimensions: this.defaultDimensions,
751751
singleMetric: true,
752+
logger: this.#logger,
752753
});
753754
}
754755

0 commit comments

Comments
 (0)