Hazyzh/jest-html-reporters

Option to save report in a single combined HTML file

aruiz-futurefinance opened this issue · 4 comments

Is your feature request related to a problem? Please describe.

  • Add an option to save the report in one HTML file - as was previously created
    • After upgrading to the latest v3.0.3 of jest-html-reporters, I've found that the report is now split into multiple files
    • This is an issue because we upload our reports to AWS S3 buckets, and when we open the reports, we just get a blank page because the ./jest-html-reporters-attach/master-report/index.js file cannot be accessed
    • To fix this, we would probably need to call getSignedUrl() for the ./jest-html-reporters-attach/master-report/index.js & ./jest-html-reporters-attach/master-report/result.js files, then search for and replace the file names with the updated url... which is a lot of extra effort

Describe the solution you'd like

  • An option such as consolidateHtmlReport/JEST_HTML_REPORTERS_CONSOLIDATE_HTML_REPORT which would output one .HTML file as previous

Describe alternatives you've considered

  • I can't think of an alternative to this - but I'm sure one exists

Is your feature request related to a problem? Please describe.

  • Add an option to save the report in one HTML file - as was previously created

    • After upgrading to the latest v3.0.3 of jest-html-reporters, I've found that the report is now split into multiple files
    • This is an issue because we upload our reports to AWS S3 buckets, and when we open the reports, we just get a blank page because the ./jest-html-reporters-attach/master-report/index.js file cannot be accessed
    • To fix this, we would probably need to call getSignedUrl() for the ./jest-html-reporters-attach/master-report/index.js & ./jest-html-reporters-attach/master-report/result.js files, then search for and replace the file names with the updated url... which is a lot of extra effort

Describe the solution you'd like

  • An option such as consolidateHtmlReport/JEST_HTML_REPORTERS_CONSOLIDATE_HTML_REPORT which would output one .HTML file as previous

Describe alternatives you've considered

  • I can't think of an alternative to this - but I'm sure one exists

hm... is it possible to push the whole folder resource to S3?
it's ok to put test result and js in html file , but by this way there are some issue hard to fix.

Running into the same issue; we upload the report into a custom azure-devops report viewer which can only handle a single file. Previously we were using the combined file perfectly, but no longer an option if we wish to upgrade

4ekki commented

+1 for this one. It was way easier to integrate single file to Jenkins, than manage multiple files and relative paths.

UPD In case anyone else will search for the latest version with single file, it's 2.1.6

I added a new config option inlineSource in latest version v3.0.6.
As I said there are some issue hard to fix for this way, but those are some edge cases, normal user would not encounter those issue.

  ...
  ["jest-html-reporters", {
    "publicPath": "./html-report",
    "filename": "report.html",
    "inlineSource": true
  }]