Coder Social home page Coder Social logo

Comments (9)

prashanth-sams avatar prashanth-sams commented on May 26, 2024

@Hargne would be great if you see what's wrong πŸ’―from the above test repo

from jest-html-reporter.

Hargne avatar Hargne commented on May 26, 2024

Hi,
Sorry for the late response (I am currently abroad with crappy-to-none internet connectivity)!

Just to rule it out: will the console.logs be outputted if you don't include testMatch or testPathIgnorePatterns?

from jest-html-reporter.

Hargne avatar Hargne commented on May 26, 2024

I just ran some tests and it seems like it is actually the verbose: true that is causing this. The logs will appear if verbose is set to false or not present at all.
There is more information about this matter in this stack overflow thread

from jest-html-reporter.

prashanth-sams avatar prashanth-sams commented on May 26, 2024

thanks @Hargne; let me give a try.

Just to rule it out: will the console.logs be outputted if you don't include testMatch or testPathIgnorePatterns?

  • Yes, it does work when I skip these

from jest-html-reporter.

Hargne avatar Hargne commented on May 26, 2024

It should work as intended as long as you remove the verbose: true from your config (see my previous post)

from jest-html-reporter.

jbournonville avatar jbournonville commented on May 26, 2024

Hello,
I have the same problem and even without verbose: true, I can't get console logs in the report.

module.exports = {
  testEnvironment: 'node',
  setupTestFrameworkScriptFile: './test/setupTests.js',
  reporters: [
    'default',
    [
      './node_modules/jest-html-reporter',
      {
        pageTitle: 'Test Report',
        outputPath: './test/testReport/report.html',
        includeFailureMsg: true,
        includeConsoleLog: true
      }
    ]
  ]
}

from jest-html-reporter.

Hargne avatar Hargne commented on May 26, 2024

@jbournonville is it possible to post one of the test specs that includes a console log?

from jest-html-reporter.

alexey-temnikov avatar alexey-temnikov commented on May 26, 2024

Have same issue, but for me it stopped working after upgrade to [email protected] (works fine with 24.5.0).
Interesting thing - regular downgrade by installing other version doesn't help - full revert of package-lock.json works though.

from jest-html-reporter.

Hargne avatar Hargne commented on May 26, 2024

Hi again,

In the latest release (https://github.com/Hargne/jest-html-reporter/releases/tag/2.7.0) I was able to manually catch all the console.logs per test and then output it to each test suite.

It should be noted that in order for this to work, you need to assign jest-html-reporter as a custom reporter in Jest via the "reporters" option (https://github.com/Hargne/jest-html-reporter/wiki/installation-and-usage#usage)
And you will probably also need to run jest together with the --verbose=false setting.

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.