Closed
Description
Description of the feature request
Problem statement
While running jest I would like to suppress the logs on the console to make it readable and clean.
jest CLI is offering --silent
option to prevent tests from printing messages through the console, but it doesn't seem to work with the logger.
Summary of the feature
Suggestions:
- the logger is silenced when running in jest with
--silent
- the logger is disabled when running in the test environment or when
NODE_ENV
is atest
- an option on the constructor to disable the logger
Code examples
jest --silent
Benefits for you and the wider AWS community
make the console readable and clean while running tests.
Describe alternatives you've considered
I have created a __mocks__/@aws-lambda-powertools/logger.ts
with this setup
export const Logger = jest.fn().mockImplementation(() => {
return {
debug: () => jest.fn(),
info: () => jest.fn(),
error: () => jest.fn(),
};
});
and this solves the issue.
Additional context
Related issues, RFCs
<
5709
div class="issue-timeline-loading-module__delaySkeletonLoad--qiw2o" data-testid="issue-timeline-loading">