Debian Codegraph @

test/integration/fixtures/pending/skip-async-before-hooks.fixture.js

raw symbols SCIP
1 'use strict';
2 var assert = require('assert');
3
4 describe('outer suite', function() {
5 var runOrder = [];
6 before(function() {
7 runOrder.push('outer before');
8 });
9
10 it('should run test-1', function() {
11 runOrder.push('should run test-1');
12 });
13
14 describe('inner suite', function() {
15 before(function(done) {
16 runOrder.push('inner before');
17 var self = this;
18 setTimeout(function() {
19 self.skip(); // done() is not required
20 }, 0);
21 });
22
23 before(function() {
24 runOrder.push('inner before-2 should not run');
25 });
26
27 beforeEach(function() {
28 runOrder.push('beforeEach should not run');
29 });
30
31 afterEach(function() {
32 runOrder.push('afterEach should not run');
33 });
34
35 after(function() {
36 runOrder.push('inner after');
37 });
38
39 it('should not run this test', function() {
40 throw new Error('inner suite test should not run');
41 });
42
43 describe('skipped suite', function() {
44 before(function() {
45 runOrder.push('skipped suite before should not run');
46 });
47
48 it('should not run this test', function() {
49 throw new Error('skipped suite test should not run');
50 });
51
52 after(function() {
53 runOrder.push('skipped suite after should not run');
54 });
55 });
56 });
57
58 it('should run test-2', function() {
59 runOrder.push('should run test-2');
60 });
61
62 after(function() {
63 runOrder.push('outer after');
64 assert.deepStrictEqual(runOrder, [
65 'outer before',
66 'should run test-1', 'should run test-2',
67 'inner before', 'inner after',
68 'outer after'
69 ]);
70 throw new Error('should throw this error');
71 });
72 });