jasmine / jasmine-browser-runner

Serve and run your Jasmine specs in a browser
50 stars 25 forks source link

jasmine-browser-runner do not support absolute paths for src and spec dirs #15

Closed marianobntz-silohub closed 8 months ago

marianobntz-silohub commented 2 years ago

I spent quite some time figuring out why my tests were not found in the runner, I discovered that srcDir and specDir are joined with the project baseDir when finding the files...

In the server.js file, the userJs method, it uses getUrl that will always join this.projectBaseDir with the arguments...

It breaks when I pass absolute paths in the config file.

Would be nice to support them. Thanks

sgravrock commented 2 years ago

I'd be happy to review a PR that stops the base dir from being prepended to paths that are already absolute. In the meantime, you should probably be able to make it work by setting projectBaseDir to "/", at least if you're not on Windows.

marianobntz-silohub commented 2 years ago

I'd be happy to review a PR that stops the base dir from being prepended to paths that are already absolute. In the meantime, you should probably be able to make it work by setting projectBaseDir to "/", at least if you're not on Windows.

Nope, that is why posted the issue, it does not work with "/" at the beginning of the path.

joeyparrish commented 8 months ago

I have a fix for this. I'll post a PR soon.