Skip to content

Commit 452ad79

Browse files
committed
test(logger): fix tests after merge issues
1 parent e4e989e commit 452ad79

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

packages/logger/tests/unit/injectLambdaContext.test.ts

+1-24
Original file line numberDiff line numberDiff line change
@@ -239,30 +239,8 @@ describe('Inject Lambda Context', () => {
239239
})
240240
);
241241
}
242-
243-
const lambda = new Lambda();
244-
// Act
245-
await lambda.handler({}, {} as Context);
246-
247-
// Assess
248-
expect(refreshSpy).toHaveBeenCalledTimes(1);
249-
});
250-
251-
it('refreshes sample rate calculation before each invocation using middleware for warm start only', async () => {
252-
// Prepare
253-
const logger = new Logger({ sampleRateValue: 0.5 });
254-
const refreshSpy = vi.spyOn(logger, 'refreshSampleRateCalculation');
255-
256-
const handler = middy(async () => {
257-
logger.info('Hello, world!');
258-
}).use(injectLambdaContext(logger));
259-
260-
// Act
261-
await handler(event, context);
242+
);
262243

263-
// Assess
264-
expect(refreshSpy).toHaveBeenCalledTimes(1);
265-
});
266244
describe('Correlation ID', () => {
267245
const testEvent = {
268246
headers: {
@@ -597,5 +575,4 @@ describe('Inject Lambda Context', () => {
597575
);
598576
});
599577
});
600-
);
601578
});

0 commit comments

Comments
 (0)