From a1bd5dd7219f1c2becbd6a16e724060575a55ae5 Mon Sep 17 00:00:00 2001 From: juergba Date: Fri, 27 Sep 2019 15:29:18 +0200 Subject: [PATCH] additional test --- .../allow-uncaught/this-skip-it.fixture.js | 21 ++++++++++++++++ .../integration/options/allowUncaught.spec.js | 25 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 test/integration/fixtures/options/allow-uncaught/this-skip-it.fixture.js create mode 100644 test/integration/options/allowUncaught.spec.js diff --git a/test/integration/fixtures/options/allow-uncaught/this-skip-it.fixture.js b/test/integration/fixtures/options/allow-uncaught/this-skip-it.fixture.js new file mode 100644 index 0000000000..ce1c3b0a96 --- /dev/null +++ b/test/integration/fixtures/options/allow-uncaught/this-skip-it.fixture.js @@ -0,0 +1,21 @@ +'use strict'; + +describe('test suite', () => { + it('test1', function () { }); + it('test2', function (done) { + var self = this; + setTimeout(function () { + self.skip(); + throw new Error("should not throw"); + }, 10); + }); + it('test3', function () { + this.skip(); + throw new Error("should not throw"); + }); + it('test4', function () { }); + it('test5', function () { + this.skip(); + throw new Error("should not throw"); + }); +}); diff --git a/test/integration/options/allowUncaught.spec.js b/test/integration/options/allowUncaught.spec.js new file mode 100644 index 0000000000..a3d8739ffe --- /dev/null +++ b/test/integration/options/allowUncaught.spec.js @@ -0,0 +1,25 @@ +'use strict'; + +var path = require('path').posix; +var helpers = require('../helpers'); +var runMochaJSON = helpers.runMochaJSON; + +describe('--allow-uncaught', function() { + var args = ['--allow-uncaught']; + + it('should run with conditional `this.skip()`', function(done) { + var fixture = path.join('options', 'allow-uncaught', 'this-skip-it'); + runMochaJSON(fixture, args, function(err, res) { + if (err) { + return done(err); + } + + expect(res, 'to have passed') + .and('to have passed test count', 2) + .and('to have pending test count', 3) + .and('to have passed test', 'test1', 'test4') + .and('to have pending test order', 'test2', 'test3', 'test5'); + done(); + }); + }); +});