Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrhooray/gulp-mocha-phantomjs
run client-side Mocha tests with PhantomJS
https://github.com/mrhooray/gulp-mocha-phantomjs
gulp javascript mocha mocha-phantomjs phantomjs
Last synced: 9 days ago
JSON representation
run client-side Mocha tests with PhantomJS
- Host: GitHub
- URL: https://github.com/mrhooray/gulp-mocha-phantomjs
- Owner: mrhooray
- Created: 2014-03-23T22:20:41.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-11-20T11:15:24.000Z (almost 7 years ago)
- Last Synced: 2024-10-04T16:04:57.763Z (about 1 month ago)
- Topics: gulp, javascript, mocha, mocha-phantomjs, phantomjs
- Language: JavaScript
- Homepage:
- Size: 56.6 KB
- Stars: 65
- Watchers: 1
- Forks: 35
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [gulp](https://github.com/wearefractal/gulp)-mocha-phantomjs [![Build Status](https://travis-ci.org/mrhooray/gulp-mocha-phantomjs.svg?branch=master)](https://travis-ci.org/mrhooray/gulp-mocha-phantomjs) [![Build status](https://ci.appveyor.com/api/projects/status/4ngkp3ijx27alr5u?svg=true)](https://ci.appveyor.com/project/mrhooray/gulp-mocha-phantomjs)
> run client-side [Mocha](https://github.com/visionmedia/mocha) tests with [PhantomJS](https://github.com/ariya/phantomjs)> a simple wrapper for [mocha-phantomjs-core](https://github.com/nathanboktae/mocha-phantomjs-core) library
## Warning
This project is no longer maintained.## Installation
### node
```shell
$ npm install gulp-mocha-phantomjs --save-dev
```## Usage
```html
Mocha
mocha.setup('bdd')
describe('true', function () {
it('should be true', function () {
true.should.equal(true);
});
});
mocha.run();
```
```javascript
var gulp = require('gulp');
var mochaPhantomJS = require('gulp-mocha-phantomjs');gulp.task('test', function () {
return gulp
.src('test/runner.html')
.pipe(mochaPhantomJS());
});
```Reporter can be chosen via `reporter` option:
```javascript
gulp.task('test', function () {
return gulp
.src('test/runner.html')
.pipe(mochaPhantomJS({reporter: 'spec'}));
});
```Output of mocha tests can be piped into a file via `dump` option:
```javascript
gulp.task('test', function () {
return gulp
.src('test/runner.html')
.pipe(mochaPhantomJS({reporter: 'spec', dump:'test.log'}));
});
```Test against remote by url:
```javascript
gulp.task('test', function () {
var stream = mochaPhantomJS();
stream.write({path: 'http://localhost:8000/index.html'});
stream.end();
return stream;
});
```Suppress PhantomJS’s console output:
```javascript
gulp.task('test', function() {
return gulp
.src('test/runner.html')
.pipe(mochaPhantomJS({
suppressStdout: true,
suppressStderr: true
}));
});
```Pass options to mocha and/or PhantomJS:
```javascript
gulp.task('test', function () {
return gulp
.src('test/runner.html')
.pipe(mochaPhantomJS({
reporter: 'tap',
mocha: {
grep: 'pattern'
},
phantomjs: {
viewportSize: {
width: 1024,
height: 768
},
useColors:true
}
}));
});
```## License
MIT