c8 icon indicating copy to clipboard operation
c8 copied to clipboard

feature: report: ability to use dynamic source maps for `?count=x` imported files

Open coderaiser opened this issue 3 years ago • 6 comments

This is example of changes that can be made to get support of loaded and transformed files (#325).

As I understand, the problem can be somewhere in v8-to-instanbul when we are going to apply coverage. The thing is files sizes is different, and offsets different too, and they should be converted somehow 🤔. And there is conversion but it returns Infinity and NaN for some reason.

Checklist
  • [ ] npm test, tests passing
  • [ ] npm run test:snap (to update the snapshot)
  • [ ] tests and/or benchmarks are included
  • [ ] documentation is changed or added

coderaiser avatar Jan 02 '22 13:01 coderaiser

@coderaiser I would love to close out some of these long standing PRs. Any chance I could bother you to write a test for this, and we can get it merged?

bcoe avatar Jun 10 '24 00:06 bcoe

Ia have no idea how to test this, if you know the best way for this, will be amazing to have support of dynamic imports merged with this or any other PR.

coderaiser avatar Jun 10 '24 04:06 coderaiser

@coderaiser mind rebasing and we can go from there?

I think what we could potentially do would be to try to write a test based on a fixture of output from Node.js

bcoe avatar Jun 10 '24 15:06 bcoe

Just rebased

coderaiser avatar Jun 10 '24 19:06 coderaiser

@coderaiser looks like something is weird here, quite a few failing tests.

bcoe avatar Jun 11 '24 03:06 bcoe

The thing is this is not a full solution, I didn’t figure out the full way of fixing this behaviour, you can take a look at repository it https://github.com/coderaiser/c8-reproduce, the problem in resulting coverage file that should be merged for files a.jsand a.js?any-quary, so file can be re-imported in tests and it was mirrored in coverage files.

coderaiser avatar Jun 11 '24 06:06 coderaiser