Coder Social home page Coder Social logo

Comments (6)

Benoit-Vasseur avatar Benoit-Vasseur commented on May 26, 2024 1

Ooh. Well yes the console.log is in the test file :/.

Do you know a way to be able to have those console.log pass to the reporter (those made in spec files) ?

from jest-html-reporter.

Domiii avatar Domiii commented on May 26, 2024 1

Same issue here.

Jest will not pass on logs made in the test specs to the reporter.

Uhm... I just want to see all console output related to a test suit. So I guess getting basic console.log output is not possible?

Debugging jest tests has been a mess from the start. Because of it's "(pseudo-)multi-threaded nature", console.log calls appear in confusing order and sometimes get swallowed whole. I was hoping that this plugin would sort the corresponding log calls to the corresponding tests, but I guess that would not be easily achievable. I guess it is time for a proper jest logging tool (Googling that only yields the problems with console.log)... :/

from jest-html-reporter.

Hargne avatar Hargne commented on May 26, 2024

Hi,

Interesting! It's difficult to see straight away what might have gone wrong.
Here's a few things to try to pin-point the issue:

Firstly I see that you are configuring Jest via package.json - make sure that you are putting the configurations at the very top as mentioned in the Jest manual:

If you'd like to use your package.json to store Jest's config, the "jest" key should be used on the top level so Jest will know how to find your settings.
source: https://jestjs.io/docs/en/configuration.html

Please also give it a try by configuring Jest within a jest.config.js file

Secondly, I ran a test to see if there was any issues - it did work as intended, please note that the console.log output is rendered below the test suite.

Finally, it would be awesome if you could send over the tests from the test spec where the console.logs are defined!

Thanks!

from jest-html-reporter.

Benoit-Vasseur avatar Benoit-Vasseur commented on May 26, 2024

Hello,

The console property is null in the data object :/.
I am using Jest 24. Do you have any idea why ?

deepinscreenshot_select-area_20190131093629

deepinscreenshot_select-area_20190131093444

from jest-html-reporter.

Hargne avatar Hargne commented on May 26, 2024

Hi,

Is the console log situated within the code being tested or the actual test itself?
Jest will not pass on logs made in the test specs to the reporter.

from jest-html-reporter.

Hargne avatar Hargne commented on May 26, 2024

Exactly: as of now, Jest does not forward any console.logs made within the test suites to the reporter - only those made within the actual code.

I will close this issue for now, but feel free to open it if you feel that it is still relevant.

from jest-html-reporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.