You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug customInfos - - doesn't work when the Key/Value Pairs object is stringified and assigned to process.env.JEST_HTML_REPORTERS_CUSTOM_INFOS in the globalSetup
To Reproduce
Steps to reproduce the behavior:
In the js for globalSetup, create a json object and assign it - viz.
and specify this in package.json: "customInfos" : "JEST_HTML_REPORTERS_CUSTOM_INFOS"
Once the test is executed, the following warning message is displayed in console log: the value of Custom info env must be a json string point to an Object
However, when the customInfos is specified directly in package json as below, it works as expected:
``"customInfos" : [{ title: "Environment", value: "dev" }, { title: "Browser", value: "chrome" }]`
Expected behavior
Dynamically constructing the customInfos object as specified in #1 is expected to work as in #3.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: Mac iOS13
Browser: Chrome/Firefox/Safari
Version: package versions 2.1.0 and above
Additional context
REF: #32 for the original feature request and impl.. of JEST_HTML_REPORTERS_CUSTOM_INFOS
Describe the bug
customInfos - - doesn't work when the Key/Value Pairs object is stringified and assigned to process.env.JEST_HTML_REPORTERS_CUSTOM_INFOS in the globalSetup
To Reproduce
Steps to reproduce the behavior:
and specify this in package.json:
"customInfos" : "JEST_HTML_REPORTERS_CUSTOM_INFOS"
Once the test is executed, the following warning message is displayed in console log:
the value of Custom info env must be a json string point to an Object
However, when the
customInfos
is specified directly in package json as below, it works as expected:``"customInfos" : [{ title: "Environment", value: "dev" }, { title: "Browser", value: "chrome" }]`
Expected behavior
Dynamically constructing the customInfos object as specified in #1 is expected to work as in #3.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
REF: #32 for the original feature request and impl.. of JEST_HTML_REPORTERS_CUSTOM_INFOS
Adjusting
jest-html-reporters/index.js
Line 40 in 841ce98
const infos = JSON.parse(customInfos);
fixes the issueThe text was updated successfully, but these errors were encountered: