gulp-mocha-phantomjs ![Build Status](https://camo.githubusercontent.com/7cb100ae026678e2f56282323a92b0642682883b451dcd66bc7cb08ab88b7f6d/68747470733a2f2f7472617669732d63692e6f72672f6d72686f6f7261792f67756c702d6d6f6368612d7068616e746f6d6a732e7376673f6272616e63683d6d6173746572)
$ npm install gulp-mocha-phantomjs --save-dev
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mocha Test Runner</title>
<link rel="stylesheet" href="bower_components/mocha/mocha.css">
</head>
<body>
<div id="mocha"></div>
<script src="bower_components/mocha/mocha.js"></script>
<script src="bower_components/should/should.js"></script>
<script>mocha.setup('bdd')</script>
<script src="spec/test.js"></script>
<script>
if (window.mochaPhantomJS) {
mochaPhantomJS.run();
} else {
mocha.run();
}
</script>
</body>
</html>
var gulp = require('gulp');
var mochaPhantomJS = require('gulp-mocha-phantomjs');
gulp.task('test', function () {
return gulp
.src('test/runner.html')
.pipe(mochaPhantomJS());
});
The reporter can be chosen by supplying an object with reporter
property:
gulp.task('test', function () {
return gulp
.src('test/runner.html')
.pipe(mochaPhantomJS({reporter: 'nyan'}));
});
MIT