forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathname_pattern.js
More file actions
79 lines (68 loc) · 2.36 KB
/
name_pattern.js
File metadata and controls
79 lines (68 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Flags: --test-name-pattern=enabled --test-name-pattern=yes --test-name-pattern=/pattern/i --test-name-pattern=/^DescribeForMatchWithAncestors\sNestedDescribeForMatchWithAncestors\sNestedTest$/
'use strict';
const common = require('../../../common');
const {
after,
afterEach,
before,
beforeEach,
describe,
it,
test,
} = require('node:test');
test('top level test disabled', common.mustNotCall());
test('top level skipped test disabled', { skip: true }, common.mustNotCall());
test('top level skipped test enabled', { skip: true }, common.mustNotCall());
it('top level it enabled', common.mustCall());
it('top level it disabled', common.mustNotCall());
it.skip('top level skipped it disabled', common.mustNotCall());
it.skip('top level skipped it enabled', common.mustNotCall());
describe('top level describe never disabled', common.mustCall());
describe.skip('top level skipped describe disabled', common.mustNotCall());
describe.skip('top level skipped describe enabled', common.mustNotCall());
test('top level runs because name includes PaTtErN', common.mustCall());
test('top level test enabled', common.mustCall(async (t) => {
t.beforeEach(common.mustCall());
t.afterEach(common.mustCall());
await t.test(
'nested test runs because name includes PATTERN',
common.mustCall(),
);
}));
describe('top level describe enabled', () => {
before(common.mustCall());
beforeEach(common.mustCall(3));
afterEach(common.mustCall(3));
after(common.mustCall());
it('nested it not disabled', common.mustCall());
it('nested it enabled', common.mustCall());
describe('nested describe not disabled', common.mustCall());
describe('nested describe enabled', common.mustCall(() => {
it('is enabled', common.mustCall());
}));
});
describe('yes', function() {
it('no', () => {});
it('yes', () => {});
describe('maybe', function() {
it('no', () => {});
it('yes', () => {});
});
});
describe('no', function() {
it('no', () => {});
it('yes', () => {});
describe('maybe', function() {
it('no', () => {});
it('yes', () => {});
});
});
describe('DescribeForMatchWithAncestors', () => {
it('NestedTest', () => common.mustNotCall());
describe('NestedDescribeForMatchWithAncestors', () => {
it('NestedTest', common.mustCall());
});
})
describe('DescribeForMatchWithAncestors', () => {
it('NestedTest', () => common.mustNotCall());
})