Hazyzh / jest-html-reporters

🌈 Reporter for jest test framework. 🌈
https://hazyzh.github.io/report.html
MIT License
522 stars 100 forks source link

urlForTestFiles error for Bitbucket urls #263

Closed knnmran closed 1 year ago

knnmran commented 1 year ago

I am getting an error on URL click for the test with following error message on Bitbucket:

An error occurred The provided path 'src/tests/page/example.test.js' is not a valid directory at revision '1234556'.

This is my jest config option: reporters: [ "default", ["jest-html-reporters", { ... "urlForTestFiles": 'https://bitbucket.exampl.org/projects/examp/repos/example/browse', ... }] ],

I am guessing it is because of "/" on this line. https://github.com/Hazyzh/jest-html-reporters/blob/812e39d4f023813eb549a456249913d032e7d692/src/components/MainTable.tsx#L101

Is it possible to use "path.join()" here?

Thank you.

Hazyzh commented 1 year ago

Hi @Kanan449 , what's url you get after you click the url link button? from the config it should be https://bitbucket.exampl.org/projects/examp/repos/example/browse/src/tests/page/example.test.js, is this your expected?

knnmran commented 1 year ago

Hi @Hazyzh

I am getting this URL: https://bitbucket.exampl.org/projects/examp/repos/example/browse//src/tests/page/example.test.js There are two forward slashes in "..browse//src..".

Github does not mind the URL path with two slashes, but Bitbucket does for some reason.

Hazyzh commented 1 year ago

Hi @Hazyzh

I am getting this URL: https://bitbucket.exampl.org/projects/examp/repos/example/browse//src/tests/page/example.test.js There are two forward slashes in "..browse//src..".

Github does not mind the URL path with two slashes, but Bitbucket does for some reason.

got it! will fix it soon.

Hazyzh commented 1 year ago

path.join() will import an extra package path, I will just removed the extra slash line.

Hazyzh commented 1 year ago

has published a new version. @Kanan449

knnmran commented 1 year ago

just tested the new version. issue is resolved.

this is a great report. thanks for the work.