jest-html-reporters-attach directory does not adhere to 'filename' configuration for javascript resources, resulting in multiple reports pointing to the same javascirpt resources
See original GitHub issueDescribe the bug
In a mono repository where tests are run against multiple libraries, each of which has it’s own unique name. the current process creates a ‘[filename].html’" in the ‘[publicPath]’ directory for each test. however all HTML have the same hardcoded script tag
<script src="./jest-html-reporters-attach/index.js"/>
with muliple projects this means that all html files display the exact same data as the last project that was run
To Reproduce
- in “ProjectA”
- configure “jest-html-reporters” in jest.config.js to
{ publicPath: './jestreports', filename: 'projectA-report.html' }
- in “ProjectB”
- configure “jest-html-reporters” in jest.config.js to
{ publicPath: './jestreports', filename: 'projectB-report.html' }
- run tests for both projects
Expected behavior
- two files for each project to appear in the
publicPath
=> “./jestreports” - projectA-report.html should contain results of it’s test
- projectB-report.html should contain results of it’s test
- the JavaScript resources for each report should use the
filename
attribute specified in the config - the
src
attribute of thescript
tag should then point to this specific resource folder
** Bub/Actual Behavior**
- when you open “projectA-report.html” it shows the results of “ProjectB” tests
- this is because both html files are hard coded to point to the same JavaScript source
<script src="./jest-html-reporters-attach/index.js"/>
- as shown here, two different reports point to the same JavaScript resources
the end result of this is that if you have more than one project for which you are using jest-html-reporters
the html file will only ever show data for the “last” test that was run.
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (8 by maintainers)
Top Results From Across the Web
Conflict: Multiple assets emit to the same filename
what I want to know is what tool writes an error like "Conflict: Multiple assets emit to the same filename slots.js". Why would...
Read more >How to make html files output to a different directory · Issue #665
The problem is when I use the publicPath attribute, multiple pages can not correctly reference js, css and other resources. This is the...
Read more >Naming Files, Paths, and Namespaces - Win32 apps
A file name is relative to the current directory if it does not begin with one of the following: A UNC name of...
Read more >Characters to Avoid in Filenames and Directories
Therefore, it is essential to play it safe and avoid common illegal filename and directory characters. Naming conventions are important in web folders...
Read more >File naming and structure - Research Data Management at ...
Descriptive file names are an important part of organizing, sharing, and keeping track of data files. Develop a naming convention based on ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @mwamufiya seems it’s a miss consider case. I release a new version 3.0.2 just now try to fix it, please have a try again.
and @theeko
addMsg
not working is a bug, also fixed in this version, please have a try.Thanks for report the issue.
@Hazyzh I found the issue:
addMsg
is accepting an object now instead of a string.I made
readme.md
changes: https://github.com/Hazyzh/jest-html-reporters/pull/183Thanks a lot for the fixes.