Turn off logging while unit testing
See original GitHub issueHi. I’m running unit tests, I was unable to turn off logging.
Here is similar issue: https://github.com/nestjs/nest/issues/3246
I found that for regular run we can do the following:
const app = await NestFactory.create(AppModule, {
logger: ['error', 'warn'],
});
but for unit tests, we cannot do so.
Maybe it’s worth adding a logger to option to DrivineModuleOptions
?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:13 (7 by maintainers)
Top Results From Across the Web
How can I disable logging while running unit tests in Python ...
I've found that for tests within unittest or similar a framework, the most effective way to safely disable unwanted logging in unit tests...
Read more >How can I disable logging while running unit tests in ... - Edureka
I am using a simple unit test based test runner to test my Django ... How can I disable logging while running unit...
Read more >How To Disable Logging While Running Django Unit Tests?
How To Disable Logging While Running Django Unit Tests? ;.disable(logging.CRITICAL) ; import sys import logging if len(sys.argv) > 1 and sys.argv ...
Read more >Logback - Disable logging in Unit Test - Mkyong.com
While the unit test is running in the IDE, the Logback is showing a lot of configuration or status like this :
Read more >How can I disable logging while running unit tests in Python ...
I've found that for tests within unittest or similar a framework, the most effective way to safely disable unwanted logging in unit tests...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For tests, I’m using EmptyLogger
Then in test:
@jasperblues thanks Jasper, that is very nice of you, lets do that after my PR’s will be merged 😉
I’m just migrating from OrientDB to Neo4j, and Drivine draw my attention while I was looking for solution in Node.js, so far it’s so cool, and only found minor bugs.
Today I’m trying to do my first deployment do testing servers with Neo4j+drivine, and hope to have time tomorrow to do some work on drivine
Good work 😃