File tree Expand file tree Collapse file tree 4 files changed +75
-7
lines changed
fixtures/report-declaration-order Expand file tree Collapse file tree 4 files changed +75
-7
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,16 @@ test.before(t => {
6
6
t . snapshot ( id ( - 2 ) , 'in a before hook' ) ;
7
7
} ) ;
8
8
9
+ test . beforeEach ( t => {
10
+ t . snapshot ( id ( - 1.5 ) , 'in a beforeEach hook' ) ;
11
+ } ) ;
12
+
9
13
test . afterEach ( t => {
10
- t . snapshot ( id ( - 1 ) , 'in an after hook' ) ;
14
+ t . snapshot ( id ( - 1 ) , 'in an afterEach hook' ) ;
15
+ } ) ;
16
+
17
+ test . afterEach . always ( t => {
18
+ t . snapshot ( id ( - 0.5 ) , 'in an afterEachAlways hook' ) ;
11
19
} ) ;
12
20
13
21
test ( 'B - declare some snapshots' , t => {
Original file line number Diff line number Diff line change @@ -10,36 +10,96 @@ Generated by [AVA](https://avajs.dev).
10
10
11
11
'index: -2'
12
12
13
+ ## beforeEach hook for B - declare some snapshots
14
+
15
+ > in a beforeEach hook
16
+
17
+ 'index: -1.5'
18
+
19
+ ## beforeEach hook for A - declare some more snapshots
20
+
21
+ > in a beforeEach hook
22
+
23
+ 'index: -1.5'
24
+
25
+ ## beforeEach hook for C - declare some snapshots in a try()
26
+
27
+ > in a beforeEach hook
28
+
29
+ 'index: -1.5'
30
+
31
+ ## beforeEach hook for E - discard some snapshots in a try()
32
+
33
+ > in a beforeEach hook
34
+
35
+ 'index: -1.5'
36
+
37
+ ## beforeEach hook for D - more snapshots with ids
38
+
39
+ > in a beforeEach hook
40
+
41
+ 'index: -1.5'
42
+
13
43
## afterEach hook for B - declare some snapshots
14
44
15
- > in an after hook
45
+ > in an afterEach hook
16
46
17
47
'index: -1'
18
48
19
49
## afterEach hook for A - declare some more snapshots
20
50
21
- > in an after hook
51
+ > in an afterEach hook
22
52
23
53
'index: -1'
24
54
25
55
## afterEach hook for C - declare some snapshots in a try()
26
56
27
- > in an after hook
57
+ > in an afterEach hook
28
58
29
59
'index: -1'
30
60
31
61
## afterEach hook for E - discard some snapshots in a try()
32
62
33
- > in an after hook
63
+ > in an afterEach hook
34
64
35
65
'index: -1'
36
66
37
67
## afterEach hook for D - more snapshots with ids
38
68
39
- > in an after hook
69
+ > in an afterEach hook
40
70
41
71
'index: -1'
42
72
73
+ ## afterEach.always hook for B - declare some snapshots
74
+
75
+ > in an afterEachAlways hook
76
+
77
+ 'index: -0.5'
78
+
79
+ ## afterEach.always hook for A - declare some more snapshots
80
+
81
+ > in an afterEachAlways hook
82
+
83
+ 'index: -0.5'
84
+
85
+ ## afterEach.always hook for C - declare some snapshots in a try()
86
+
87
+ > in an afterEachAlways hook
88
+
89
+ 'index: -0.5'
90
+
91
+ ## afterEach.always hook for E - discard some snapshots in a try()
92
+
93
+ > in an afterEachAlways hook
94
+
95
+ 'index: -0.5'
96
+
97
+ ## afterEach.always hook for D - more snapshots with ids
98
+
99
+ > in an afterEachAlways hook
100
+
101
+ 'index: -0.5'
102
+
43
103
## B - declare some snapshots
44
104
45
105
> Snapshot 1
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ test('snapshot reports are sorted in declaration order', async t => {
45
45
}
46
46
}
47
47
48
- const ids = [ ...matchAll ( report , / ' i n d e x : ( [ - \d ] + ) ' / g) ] . map ( match => Number ( match [ 1 ] ) ) ;
48
+ const ids = [ ...matchAll ( report , / ' i n d e x : ( [ - . \d ] + ) ' / g) ] . map ( match => Number ( match [ 1 ] ) ) ;
49
49
const sortedIds = [ ...ids ] . sort ( ( a , b ) => a - b ) ;
50
50
51
51
t . deepEqual ( ids , sortedIds ) ;
You can’t perform that action at this time.
0 commit comments