Any best way to run the jasmine HTML reporter with browserify styled code? I also want to be able to run this headless with phantomjs, thus the need for the HTML reporter.
I don't think there's a jasmine-browserify
package yet, and it doesn't really match Browserify/NPM's way of doing things (avoid global exports).
For now, I just include /node_modules/jasmine-reporters/ext/jasmine.js
and jasmine-html.js
at the top of my <head>
, and require all my specs in a top-level spec_entry.js
that I then use as the entry point for a Browserify bundle that I put right afterwards in the <head>
. (Note that if the entry point is not top-level, you'll have a bad time due to a long-lasting, gnarly bug in Browserify).
This plays nicely with jasmine-node
as long as you don't assume the presence of a global document
or window
. However, you do have to remember to register your specs in that spec_entry.js
, unless you want to hack Browserify to get it to crawl your directories for .spec.js
files.
I'd be very interested in a more elegant solution, though, that would transparently work with jasmine-node and browserify.