Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to save report in a single combined HTML file #184

Closed
aruiz-futurefinance opened this issue Jan 4, 2022 · 4 comments · Fixed by #200
Closed

Option to save report in a single combined HTML file #184

aruiz-futurefinance opened this issue Jan 4, 2022 · 4 comments · Fixed by #200
Assignees
Labels
enhancement New feature or request

Comments

@aruiz-futurefinance
Copy link

aruiz-futurefinance commented Jan 4, 2022

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
@aruiz-futurefinance aruiz-futurefinance added the enhancement New feature or request label Jan 4, 2022
@Hazyzh
Copy link
Owner

Hazyzh commented Jan 5, 2022

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.

@pinkfloydx33
Copy link

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
Copy link
Contributor

4ekki commented Feb 11, 2022

+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

@Hazyzh Hazyzh linked a pull request Mar 4, 2022 that will close this issue
@Hazyzh
Copy link
Owner

Hazyzh commented Mar 4, 2022

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
  }]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants