jasmine/gulp-jasmine-browser

request static assets from local folder

Closed this issue · 2 comments

Is there a way I can access static assets like images or .json files from my specs using requests ? Would be great if I can do :

.pipe(jasmineBrowser.specRunner({console: true, rootFolder: './specs/static-assets/'}))

and then a request to 'foo.png' will get './specs/static-assets/foo.png'

In my case I'm developing a image processing library and I need to load images - right now serving these static assets using another local server but ideally I would like not to run these second server just for that. Maybe is just a configuration in specRunner() - but I didn't found anything...

Thanks! Keep it up!

rdy commented

I believe if you just piped your static asset using gulp.src into the spec runner it will already serve the files up. They will be mounted from their path relative to the working directory.

Thanks, that did the trick ! This is an example TypeScript project using webpack:

https://github.com/cancerberoSgx/javascript-sample-projects/blob/master/jasmine-headless-browser-typescript/