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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t think there’s a
jasmine-browserifypackage 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.jsandjasmine-html.jsat the top of my<head>, and require all my specs in a top-levelspec_entry.jsthat 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-nodeas long as you don’t assume the presence of a globaldocumentorwindow. However, you do have to remember to register your specs in thatspec_entry.js, unless you want to hack Browserify to get it to crawl your directories for.spec.jsfiles.I’d be very interested in a more elegant solution, though, that would transparently work with jasmine-node and browserify.