From 6a97e43ff69795c53c1b8dff63fc6a5cbdba8ca8 Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Tue, 18 Apr 2017 20:43:51 +0200 Subject: update mocha to 3.1.2 (#11625) --- .../hooks/after-hook-async-error.fixture.js | 21 +++ .../fixtures/hooks/after-hook-error.fixture.js | 19 +++ .../hooks/afterEach-hook-async-error.fixture.js | 21 +++ .../fixtures/hooks/afterEach-hook-error.fixture.js | 19 +++ .../hooks/before-hook-async-error-tip.fixture.js | 13 ++ .../hooks/before-hook-async-error.fixture.js | 21 +++ .../hooks/before-hook-error-tip.fixture.js | 11 ++ .../fixtures/hooks/before-hook-error.fixture.js | 19 +++ .../hooks/beforeEach-hook-async-error.fixture.js | 21 +++ .../hooks/beforeEach-hook-error.fixture.js | 19 +++ .../hooks/multiple-hook-async-error.fixture.js | 141 +++++++++++++++++++++ .../fixtures/hooks/multiple-hook-error.fixture.js | 131 +++++++++++++++++++ 12 files changed, 456 insertions(+) create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-async-error.fixture.js create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-error.fixture.js create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-async-error.fixture.js create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-error.fixture.js create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error-tip.fixture.js create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error.fixture.js create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error-tip.fixture.js create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error.fixture.js create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-async-error.fixture.js create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-error.fixture.js create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-async-error.fixture.js create mode 100644 tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-error.fixture.js (limited to 'tests/lib/mocha-3.1.2/test/integration/fixtures/hooks') diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-async-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-async-error.fixture.js new file mode 100644 index 0000000000..f3dfe7e1ae --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-async-error.fixture.js @@ -0,0 +1,21 @@ +'use strict'; + +describe('spec 1', function () { + after(function (done) { + console.log('after'); + process.nextTick(function () { + throw new Error('after hook error'); + }); + }); + it('should be called because error is in after hook', function () { + console.log('test 1'); + }); + it('should be called because error is in after hook', function () { + console.log('test 2'); + }); +}); +describe('spec 2', function () { + it('should be called, because hook error was in a sibling suite', function () { + console.log('test 3'); + }); +}); diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-error.fixture.js new file mode 100644 index 0000000000..7fc258f46d --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-error.fixture.js @@ -0,0 +1,19 @@ +'use strict'; + +describe('spec 1', function () { + after(function () { + console.log('after'); + throw new Error('after hook error'); + }); + it('should be called because error is in after hook', function () { + console.log('test 1'); + }); + it('should be called because error is in after hook', function () { + console.log('test 2'); + }); +}); +describe('spec 2', function () { + it('should be called, because hook error was in a sibling suite', function () { + console.log('test 3'); + }); +}); diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-async-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-async-error.fixture.js new file mode 100644 index 0000000000..442ad9321f --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-async-error.fixture.js @@ -0,0 +1,21 @@ +'use strict'; + +describe('spec 1', function () { + afterEach(function (done) { + console.log('after'); + process.nextTick(function () { + throw new Error('after each hook error'); + }); + }); + it('should be called because error is in after each hook', function () { + console.log('test 1'); + }); + it('should not be called', function () { + console.log('test 2'); + }); +}); +describe('spec 2', function () { + it('should be called, because hook error was in a sibling suite', function () { + console.log('test 3'); + }); +}); diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-error.fixture.js new file mode 100644 index 0000000000..5fb9a36c8d --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-error.fixture.js @@ -0,0 +1,19 @@ +'use strict'; + +describe('spec 1', function () { + afterEach(function () { + console.log('after'); + throw new Error('after each hook error'); + }); + it('should be called because error is in after each hook', function () { + console.log('test 1'); + }); + it('should not be called', function () { + console.log('test 2'); + }); +}); +describe('spec 2', function () { + it('should be called, because hook error was in a sibling suite', function () { + console.log('test 3'); + }); +}); diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error-tip.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error-tip.fixture.js new file mode 100644 index 0000000000..04801c1946 --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error-tip.fixture.js @@ -0,0 +1,13 @@ +'use strict'; + +describe('spec 1', function () { + it('should not blame me', function () { }); +}); +describe('spec 2', function () { + before(function (done) { + process.nextTick(function () { + throw new Error('before hook error'); + }); + }); + it('skipped'); +}); diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error.fixture.js new file mode 100644 index 0000000000..2530eec783 --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error.fixture.js @@ -0,0 +1,21 @@ +'use strict'; + +describe('spec 1', function () { + before(function (done) { + console.log('before'); + process.nextTick(function () { + throw new Error('before hook error'); + }); + }); + it('should not be called because of error in before hook', function () { + console.log('test 1'); + }); + it('should not be called because of error in before hook', function () { + console.log('test 2'); + }); +}); +describe('spec 2', function () { + it('should be called, because hook error was in a sibling suite', function () { + console.log('test 3'); + }); +}); diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error-tip.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error-tip.fixture.js new file mode 100644 index 0000000000..64df731573 --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error-tip.fixture.js @@ -0,0 +1,11 @@ +'use strict'; + +describe('spec 1', function () { + it('should not blame me', function () { }); +}); +describe('spec 2', function () { + before(function () { + throw new Error('before hook error'); + }); + it('skipped'); +}); diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error.fixture.js new file mode 100644 index 0000000000..547e54a243 --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error.fixture.js @@ -0,0 +1,19 @@ +'use strict'; + +describe('spec 1', function () { + before(function () { + console.log('before'); + throw new Error('before hook error'); + }); + it('should not be called because of error in before hook', function () { + console.log('test 1'); + }); + it('should not be called because of error in before hook', function () { + console.log('test 2'); + }); +}); +describe('spec 2', function () { + it('should be called, because hook error was in a sibling suite', function () { + console.log('test 3'); + }); +}); diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-async-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-async-error.fixture.js new file mode 100644 index 0000000000..6ce27784a6 --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-async-error.fixture.js @@ -0,0 +1,21 @@ +'use strict'; + +describe('spec 1', function () { + beforeEach(function (done) { + console.log('before'); + process.nextTick(function () { + throw new Error('before each hook error'); + }); + }); + it('should not be called because of error in before each hook', function () { + console.log('test 1'); + }); + it('should not be called because of error in before each hook', function () { + console.log('test 2'); + }); +}); +describe('spec 2', function () { + it('should be called, because hook error was in a sibling suite', function () { + console.log('test 3'); + }); +}); diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-error.fixture.js new file mode 100644 index 0000000000..4c0ab2f237 --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-error.fixture.js @@ -0,0 +1,19 @@ +'use strict'; + +describe('spec 1', function () { + beforeEach(function () { + console.log('before'); + throw new Error('before each hook error'); + }); + it('should not be called because of error in before each hook', function () { + console.log('test 1'); + }); + it('should not be called because of error in before each hook', function () { + console.log('test 2'); + }); +}); +describe('spec 2', function () { + it('should be called, because hook error was in a sibling suite', function () { + console.log('test 3'); + }); +}); diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-async-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-async-error.fixture.js new file mode 100644 index 0000000000..858bbb3c5e --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-async-error.fixture.js @@ -0,0 +1,141 @@ +'use strict'; + +before(function () { + console.log('root before'); +}); +beforeEach(function () { + console.log('root before each'); +}); +describe('1', function () { + beforeEach(function () { + console.log('1 before each'); + }); + + describe('1-1', function () { + before(function () { + console.log('1-1 before'); + }); + beforeEach(function (done) { + console.log('1-1 before each'); + process.nextTick(function () { + throw new Error('1-1 before each hook failed'); + }); + }); + it('1-1 test 1', function () { + console.log('1-1 test 1'); + }); + it('1-1 test 2', function () { + console.log('1-1 test 2'); + }); + afterEach(function () { + console.log('1-1 after each'); + }); + after(function (done) { + console.log('1-1 after'); + process.nextTick(function () { + throw new Error('1-1 after hook failed'); + }); + }); + }); + + describe('1-2', function () { + before(function () { + console.log('1-2 before'); + }); + beforeEach(function () { + console.log('1-2 before each'); + }); + it('1-2 test 1', function () { + console.log('1-2 test 1'); + }); + it('1-2 test 2', function () { + console.log('1-2 test 2'); + }); + afterEach(function (done) { + console.log('1-2 after each'); + process.nextTick(function () { + throw new Error('1-2 after each hook failed'); + }); + }); + after(function () { + console.log('1-2 after'); + }); + }); + + afterEach(function () { + console.log('1 after each'); + }); + + after(function () { + console.log('1 after'); + }); +}); + +describe('2', function () { + beforeEach(function (done) { + console.log('2 before each'); + process.nextTick(function () { + throw new Error('2 before each hook failed'); + }); + }); + + describe('2-1', function () { + before(function () { + console.log('2-1 before'); + }); + beforeEach(function () { + console.log('2-1 before each'); + }); + it('2-1 test 1', function () { + console.log('2-1 test 1'); + }); + it('2-1 test 2', function () { + console.log('2-1 test 2'); + }); + afterEach(function () { + console.log('2-1 after each'); + }); + after(function () { + console.log('2-1 after'); + }); + }); + + describe('2-2', function () { + before(function () { + console.log('2-2 before'); + }); + beforeEach(function () { + console.log('2-2 before each'); + }); + it('2-2 test 1', function () { + console.log('2-2 test 1'); + }); + it('2-2 test 2', function () { + console.log('2-2 test 2'); + }); + afterEach(function () { + console.log('2-2 after each'); + }); + after(function () { + console.log('2-2 after'); + }); + }); + + afterEach(function (done) { + console.log('2 after each'); + process.nextTick(function () { + throw new Error('2 after each hook failed'); + }); + }); + + after(function () { + console.log('2 after'); + }); +}); + +after(function () { + console.log('root after'); +}); +afterEach(function () { + console.log('root after each'); +}); diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-error.fixture.js new file mode 100644 index 0000000000..085978ef79 --- /dev/null +++ b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-error.fixture.js @@ -0,0 +1,131 @@ +'use strict'; + +before(function () { + console.log('root before'); +}); +beforeEach(function () { + console.log('root before each'); +}); +describe('1', function () { + beforeEach(function () { + console.log('1 before each'); + }); + + describe('1-1', function () { + before(function () { + console.log('1-1 before'); + }); + beforeEach(function () { + console.log('1-1 before each'); + throw new Error('1-1 before each hook failed'); + }); + it('1-1 test 1', function () { + console.log('1-1 test 1'); + }); + it('1-1 test 2', function () { + console.log('1-1 test 2'); + }); + afterEach(function () { + console.log('1-1 after each'); + }); + after(function () { + console.log('1-1 after'); + throw new Error('1-1 after hook failed'); + }); + }); + + describe('1-2', function () { + before(function () { + console.log('1-2 before'); + }); + beforeEach(function () { + console.log('1-2 before each'); + }); + it('1-2 test 1', function () { + console.log('1-2 test 1'); + }); + it('1-2 test 2', function () { + console.log('1-2 test 2'); + }); + afterEach(function () { + console.log('1-2 after each'); + throw new Error('1-2 after each hook failed'); + }); + after(function () { + console.log('1-2 after'); + }); + }); + + afterEach(function () { + console.log('1 after each'); + }); + + after(function () { + console.log('1 after'); + }); +}); + +describe('2', function () { + beforeEach(function () { + console.log('2 before each'); + throw new Error('2 before each hook failed'); + }); + + describe('2-1', function () { + before(function () { + console.log('2-1 before'); + }); + beforeEach(function () { + console.log('2-1 before each'); + }); + it('2-1 test 1', function () { + console.log('2-1 test 1'); + }); + it('2-1 test 2', function () { + console.log('2-1 test 2'); + }); + afterEach(function () { + console.log('2-1 after each'); + }); + after(function () { + console.log('2-1 after'); + }); + }); + + describe('2-2', function () { + before(function () { + console.log('2-2 before'); + }); + beforeEach(function () { + console.log('2-2 before each'); + }); + it('2-2 test 1', function () { + console.log('2-2 test 1'); + }); + it('2-2 test 2', function () { + console.log('2-2 test 2'); + }); + afterEach(function () { + console.log('2-2 after each'); + }); + after(function () { + console.log('2-2 after'); + }); + }); + + afterEach(function () { + console.log('2 after each'); + throw new Error('2 after each hook failed'); + }); + + after(function () { + console.log('2 after'); + }); +}); + +after(function () { + console.log('root after'); +}); +afterEach(function () { + console.log('root after each'); +}); -- cgit v1.2.3