Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
gulp-mocha-co
Advanced tools
This gulp plugin is based on Sindre Sorhus gulp-mocha plugin, but pointing to mocha-co
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 with npm
npm install --save-dev gulp-mocha-co
var gulp = require('gulp');
var mocha = require('gulp-mocha-co');
gulp.task('default', function () {
gulp.src('test.js')
.pipe(mocha({reporter: 'nyan'}));
});
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);
});
});
Btw, you can just keep using gulp-mocha and good ol mocha and add this code to your tests:
var co = require('co');
// ....
it('should work', function(done){
co(function *(){
yield whatever;
})(done)
})
See this issue
Type: String
Default: bdd
Values: bdd
, tdd
, qunit
, exports
The interface to use.
Type: String
Default: dot
Values: reporters
The reporter that will be used.
This option can also be used to utilize third-party reporters. For example if you npm install mocha-lcov-reporter
you can then do use mocha-lcov-reporter
as value.
Type: Array
Accepted globals.
Type: Number
Default: 2000
Test-case timeout in milliseconds.
Type: Boolean
Default: false
Bail on the first test failure.
Type: Boolean
Default: false
Ignore global leaks.
Type: String
Only run tests matching the given pattern which is internally compiled to a RegExp.
Based on Sindre Sorhus work MIT © Sindre Sorhus
FAQs
Run Mocha tests with co generators
The npm package gulp-mocha-co receives a total of 5 weekly downloads. As such, gulp-mocha-co popularity was classified as not popular.
We found that gulp-mocha-co demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.