New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-mocha-co

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-mocha-co - npm Package Compare versions

Comparing version 0.4.1-co.1 to 0.4.1-co.2

2

package.json
{
"name": "gulp-mocha-co",
"version": "0.4.1-co.1",
"version": "0.4.1-co.2",
"description": "Run Mocha tests with co generators",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -1,17 +0,32 @@

# [gulp](https://github.com/wearefractal/gulp)-mocha [![Build Status](https://secure.travis-ci.org/sindresorhus/gulp-mocha.png?branch=master)](http://travis-ci.org/sindresorhus/gulp-mocha)
## Information
> Run [Mocha](http://visionmedia.github.io/mocha/) tests
This gulp plugin is based on Sindre Sorhus gulp-mocha plugin, but pointing to [mocha-co](https://www.npmjs.org/package/mocha-co)
*Keep in mind that this is just a thin wrapper around Mocha and your issue is most likely with Mocha.*
## Use
In order to have your tests running with mocha-co you need to launch gulp with the ES6 flag '--harmony'
You can do it with
````
node --harmony `which gulp`
````
or creating an alias
````
alias gulp='node --harmony `which gulp`'
````
Then you can run your tasks as normal
````
gulp test
````
## Install
Install with [npm](https://npmjs.org/package/gulp-mocha)
Install with [npm](https://npmjs.org/package/gulp-mocha-co)
```
npm install --save-dev gulp-mocha
npm install --save-dev gulp-mocha-co
```
## Example

@@ -21,10 +36,32 @@

var gulp = require('gulp');
var mocha = require('gulp-mocha');
var mocha = require('gulp-mocha-co');
gulp.task('default', function () {
gulp.src('test.js')
.pipe(mocha({reporter: 'nyan'}));
gulp.src('test.js')
.pipe(mocha({reporter: 'nyan'}));
});
```
## Code with generators
```js
describe('My test with generators', function(){
before(function *(){
yield whatever.doSomething()
});
beforeEach(function(){
var returnedThing = yield whatever.returnWhatever()
});
it('Should have the things', function*(){
var thingsExist = yield parser.checkIfThingsExist();
expect(thingsExist).to.equals(true);
});
});
```
## API

@@ -94,3 +131,3 @@

## License
Based on Sindre Sorhus work
MIT © [Sindre Sorhus](http://sindresorhus.com)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc