busterjs/buster-test — pull request #10 by rosenfeld (2012-06-23 18:25:50+00:00)
Title: Allow more control over CSS when root element is body

I'm making some experiments to see how hard it would be for me to customize the test runner for usage with the Rails asset pipeline.

So, I've added the CSS to the asset pipeline but if I create an HTML reporter using body as the root option, there is no current way to prevent buster-test to try to add the CSS style element to the body.

I've also tried a small hack by creating an empty buster-test.js file in the assets path, but the Asset Pipeline would add an extra argument to it so that the src would be something like "/assets/buster/buster-test.js?body=1" and the regular expression currently in use wouldn't recognize it to find busterTestPath().

This pull request will allow me to prevent the reporter from trying to create the style element in the first place if I pass {cssPath: false} to the options. Alternatively I could pass {cssPath: '/assets/buster/html-report.css'}.