Comments (8)
@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.
I am closing this due to inactivity. Feel free to open it again if you still feel it is valid.
from jest-html-reporter.
@chungheek @Hargne sorry i never saw the answer.
i will try, thanks
from jest-html-reporter.
@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.
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.
@Hargne
this is my jest.config.js
it now produce
from jest-html-reporter.
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.
@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)
- TypeError: Cannot read property 'replace' of undefined HOT 1
- Html report broken when test response is html HOT 2
- Wrong coverage reported in constants HOT 1
- Assertion messages are malformed HOT 2
- Error: Could not resolve a module for a custom reporter.
- Doesn't support jest 28. HOT 4
- ENHANCEMENT: add configuration option for passing arbitrary data HOT 1
- code coverage export HOT 3
- Jest 29 HOT 1
- Extra Text in HTML Report HOT 4
- Is there a way I can Display something other than file path here? HOT 2
- TypeScript 5 support?
- appending adds several bodies and adds custom script several times
- Added into report configuration additional flag "includeStackTrace": false HOT 2
- The default colored console output is unreadable
- Make test suites collapsible (and collapse them by default) HOT 1
- Sort + append? HOT 1
- babel dependencies HOT 2
- How can we capture Request Payload & Response Json and show them to jest-html-reporter for REST API Automation framework? HOT 1
- [FIX] ENAMETOOLONG: name too long, ... errors due to too long name of generated temp directory HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jest-html-reporter.