I'm trying to skip tests if a condition returns true using this.skip()
inside an "it", but I'm getting an error "this.skip is not a function".
this is the simple code I'm trying to check it on:
var async = require('async');
var should = require('chai').should();
var chai = require('chai'),
should = chai.should();
expect = chai.expect;
chai.use(require('chai-sorted'));
describe('Testing skip...\n', function() {
this.timeout(1000);
it('test1', (done) => {
this.skip();
console.log("1")
done();
});
it('test2', (done) => {
console.log("2");
done();
});
});
I installed "mocha@5.2.0 " since I saw it only works on since "mocha v3.0.0", but I still cant get it to work, and none of the past discussions on the subject seems to fix my problem.