Coder Social home page Coder Social logo

Comments (8)

chungheek avatar chungheek commented on May 26, 2024

@andreabisello Have you tried testing setting up as a "Test Results Processor"? I have setup my package.json such as this:
"jest": {
"setupFilesAfterEnv": [
"./src/setupTests.js"
],
"reporters": [
"default",
"./autoreporter.js"
],
"testResultsProcessor": "./node_modules/jest-html-reporter"
}
And then you can setup a jesthtmlreporter.config.json setup as:
{
"pageTitle": "Test Suite",
"outputPath": process.env.ENVIRONMENT+"-run.html"",
"includeFailureMsg": false,
"append": false
}

Not sure if it will work, but it might be worth a try?

from jest-html-reporter.

Hargne avatar Hargne commented on May 26, 2024

I am closing this due to inactivity. Feel free to open it again if you still feel it is valid.

from jest-html-reporter.

andreabisello avatar andreabisello commented on May 26, 2024

@chungheek @Hargne sorry i never saw the answer.
i will try, thanks

from jest-html-reporter.

andreabisello avatar andreabisello commented on May 26, 2024

@chungheek sorry i'm a bit confused
jesthtmlreporter.config.json
is only a json,
how can i put code as "process.env.ENVIRONMENT" there?

from jest-html-reporter.

Hargne avatar Hargne commented on May 26, 2024

You can also configure jest-html-reporter using jest.config.js

....
reporters: [
    default,
    [
      "./node_modules/jest-html-reporter",
      {
        pageTitle: "Test Suite Reporter",
        outputPath: `${process.env.ENVIRONMENT}-run.html`,
      }
    ]
  ]

from jest-html-reporter.

andreabisello avatar andreabisello commented on May 26, 2024

@Hargne
this is my jest.config.js
image
it now produce
image

from jest-html-reporter.

Hargne avatar Hargne commented on May 26, 2024

You have to make sure that the node environment variable ENVIRONMENT actually is set and that Jest can access your variables when running the tests.
This is outside the scope of this plugin though, so I would suggest reading up on Node Environment Variables and how they work.

from jest-html-reporter.

andreabisello avatar andreabisello commented on May 26, 2024

@Hargne understand,
so maybe ENVIRONMENT is not available when the plugin generate the output.
thanks you and @chungheek for the help

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.