Because PhantomJS doesn't support function.bind we polyfill it https://groups.google.com/forum/#!msg/phantomjs/r0hPOmnCUpc/uxusqsl2LNoJ https://github.com/ariya/phantomjs/issues/10522
setupMocha
prepares mocha
for tests to be loaded. It must be run before
we run test-defining code. If we don't, describe
and it
will not yet be defined.
Prepare and verify settings, put defaults in place.
loadTests
actually pulls in your test files, then installs window.runTests()
,
which adds the mocha div to your page and runs the tests.
Sets up code coverage if configured. No code coverage under phantomjs since we're not using a grunt plugin that understands code coverage.
harness
This file can be used to very quickly set up a mocha-based browser testing environment, and is compatible with
grunt-mocha
. You'll just need to set the path for three files inrequirejs
: