question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Logger statements in the Reports

See original GitHub issue

Is your feature request related to a problem? Please describe. I have been using jest framework for integration testing and going to develop some 1000+ jest tests for the same. I am using jest-html-reporter for reporting. Is there anyway I can publish additional logging statements/test steps in the reports for both pass and fail test cases?

Describe the solution you’d like I am requesting for some additional feature to print statements/steps in both passed and failed tests case, so that by looking report only one can able to analysis. Something like below :

test(Dummy Test, () => { step("Step 1 : Connecting internet ") step("Step 2 : Connecting to VM ") step("Step 3 : Asserting connections details ") expect(status).toEqual(200) step("Test completed ") });

Describe alternatives you’ve considered If not the above solution, is there any way that I can print console.log in the report? I am using “includeConsoleLog : true” in jest.config.js and also “verbose=false” , but still I am not able to print console.log Currently my jest.config.js looking like this :

“reporters”: [ “default”, [“jest-html-reporters”, { “publicPath”: “./html-report”, “filename”: “report.html”, “expand”: true, includeConsoleLog : true, }] ],

Additional context Add any other context or screenshots about the feature request here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Hazyzhcommented, Aug 9, 2020

Hi @tajeshwarbhumra ; we don’t have the property includeConsoleLog in global config. so the setting includeConsoleLog : true is meaningless.

Jest framework does not include the console output info in the native output data. so we can not show it in the report. as @aruiz-caritsqa said above, you can use addAttach to log text. This is a bit hack way. but anyway, it can work now and we can improve it once we can get console info from native output data.

And @aruiz-caritsqa, looking forward to you create a PR to add the addMsg function.

0reactions
Hazyzhcommented, Aug 15, 2020

New version(2.0.3) which include the addMsg function has been released . Thanks for the contribution of @aruiz-caritsqa .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Report on Your Application With a Logger, Log Levels ...
A logger provides logging methods that print out the provided text and associate it with a level of importance, which is a log...
Read more >
Logger in Java - Java Logging Example - DigitalOcean
Java Logger provides logging in java programming. ... In this java logging tutorial, we will learn basic features of Java Logger.
Read more >
Java Logging Basics - The Ultimate Guide To Logging - Loggly
Loggers are responsible for capturing events (called LogRecords) and passing them to the appropriate Appender. Appenders (also called Handlers in some logging ......
Read more >
Logging HOWTO — Python 3.11.1 documentation
Basic Logging Tutorial: Logging is a means of tracking events that happen when ... Report events that occur during normal operation of a...
Read more >
Java Logging API - Tutorial - Vogella.com
Logging is the process of writing log messages during the execution of a program to a central place. This logging allows you to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found