@@ -9,22 +9,24 @@ test.afterEach.always(t => {
9
9
t . context . back ( ) ;
10
10
} ) ;
11
11
12
- test ( 'extends-empty should have no rules' , async t => {
12
+ test . serial ( 'extends-empty should have no rules' , async t => {
13
13
t . context . back = chdir ( 'fixtures/extends-empty' ) ;
14
14
const actual = await load ( ) ;
15
15
t . deepEqual ( actual . rules , { } ) ;
16
16
} ) ;
17
17
18
- test ( 'uses seed as configured' , async t => {
18
+ test . serial ( 'uses seed as configured' , async t => {
19
19
t . context . back = chdir ( 'fixtures/extends-empty' ) ;
20
20
const actual = await load ( { rules : { foo : 'bar' } } ) ;
21
21
t . is ( actual . rules . foo , 'bar' ) ;
22
22
} ) ;
23
23
24
- test ( 'uses seed with parserPreset' , async t => {
24
+ test . serial ( 'uses seed with parserPreset' , async t => {
25
25
t . context . back = chdir ( 'fixtures/parser-preset' ) ;
26
26
27
- const { parserPreset : actual } = await load ( { parserPreset : './conventional-changelog-custom' } ) ;
27
+ const { parserPreset : actual } = await load ( {
28
+ parserPreset : './conventional-changelog-custom'
29
+ } ) ;
28
30
t . is ( actual . name , './conventional-changelog-custom' ) ;
29
31
t . deepEqual ( actual . opts , {
30
32
parserOpts : {
@@ -33,24 +35,24 @@ test('uses seed with parserPreset', async t => {
33
35
} ) ;
34
36
} ) ;
35
37
36
- test ( 'invalid extend should throw' , t => {
38
+ test . serial ( 'invalid extend should throw' , t => {
37
39
t . context . back = chdir ( 'fixtures/extends-invalid' ) ;
38
40
t . throws ( load ( ) ) ;
39
41
} ) ;
40
42
41
- test ( 'empty file should have no rules' , async t => {
43
+ test . serial ( 'empty file should have no rules' , async t => {
42
44
t . context . back = chdir ( 'fixtures/empty-object-file' ) ;
43
45
const actual = await load ( ) ;
44
46
t . deepEqual ( actual . rules , { } ) ;
45
47
} ) ;
46
48
47
- test ( 'empty file should extend nothing' , async t => {
49
+ test . serial ( 'empty file should extend nothing' , async t => {
48
50
t . context . back = chdir ( 'fixtures/empty-file' ) ;
49
51
const actual = await load ( ) ;
50
52
t . deepEqual ( actual . extends , [ ] ) ;
51
53
} ) ;
52
54
53
- test ( 'recursive extends' , async t => {
55
+ test . serial ( 'recursive extends' , async t => {
54
56
t . context . back = chdir ( 'fixtures/recursive-extends' ) ;
55
57
const actual = await load ( ) ;
56
58
t . deepEqual ( actual , {
@@ -63,30 +65,88 @@ test('recursive extends', async t => {
63
65
} ) ;
64
66
} ) ;
65
67
66
- test ( 'parser preset overwrites completely instead of merging ', async t => {
67
- t . context . back = chdir ( 'fixtures/parser-preset-override ' ) ;
68
+ test . serial ( 'recursive extends with json file ', async t => {
69
+ t . context . back = chdir ( 'fixtures/recursive-extends-json ' ) ;
68
70
const actual = await load ( ) ;
71
+ t . deepEqual ( actual , {
72
+ extends : [ './first-extended' ] ,
73
+ rules : {
74
+ zero : 0 ,
75
+ one : 1 ,
76
+ two : 2
77
+ }
78
+ } ) ;
79
+ } ) ;
69
80
70
- t . is ( actual . parserPreset . name , './custom' ) ;
71
- t . is ( typeof actual . parserPreset . opts , 'object' ) ;
72
- t . deepEqual ( actual . parserPreset . opts , {
73
- b : 'b' ,
74
- parserOpts : {
75
- headerPattern : / .* /
81
+ test . serial ( 'recursive extends with yaml file' , async t => {
82
+ t . context . back = chdir ( 'fixtures/recursive-extends-yaml' ) ;
83
+ const actual = await load ( ) ;
84
+ t . deepEqual ( actual , {
85
+ extends : [ './first-extended' ] ,
86
+ rules : {
87
+ zero : 0 ,
88
+ one : 1 ,
89
+ two : 2
90
+ }
91
+ } ) ;
92
+ } ) ;
93
+
94
+ test . serial ( 'recursive extends with js file' , async t => {
95
+ t . context . back = chdir ( 'fixtures/recursive-extends-js' ) ;
96
+ const actual = await load ( ) ;
97
+ t . deepEqual ( actual , {
98
+ extends : [ './first-extended' ] ,
99
+ rules : {
100
+ zero : 0 ,
101
+ one : 1 ,
102
+ two : 2
103
+ }
104
+ } ) ;
105
+ } ) ;
106
+
107
+ test . serial ( 'recursive extends with package.json file' , async t => {
108
+ t . context . back = chdir ( 'fixtures/recursive-extends-package' ) ;
109
+ const actual = await load ( ) ;
110
+ t . deepEqual ( actual , {
111
+ extends : [ './first-extended' ] ,
112
+ rules : {
113
+ zero : 0 ,
114
+ one : 1 ,
115
+ two : 2
76
116
}
77
117
} ) ;
78
118
} ) ;
79
119
80
- test ( 'recursive extends with parserPreset' , async t => {
120
+ test . serial (
121
+ 'parser preset overwrites completely instead of merging' ,
122
+ async t => {
123
+ t . context . back = chdir ( 'fixtures/parser-preset-override' ) ;
124
+ const actual = await load ( ) ;
125
+
126
+ t . is ( actual . parserPreset . name , './custom' ) ;
127
+ t . is ( typeof actual . parserPreset . opts , 'object' ) ;
128
+ t . deepEqual ( actual . parserPreset . opts , {
129
+ b : 'b' ,
130
+ parserOpts : {
131
+ headerPattern : / .* /
132
+ }
133
+ } ) ;
134
+ }
135
+ ) ;
136
+
137
+ test . serial ( 'recursive extends with parserPreset' , async t => {
81
138
t . context . back = chdir ( 'fixtures/recursive-parser-preset' ) ;
82
139
const actual = await load ( ) ;
83
140
84
141
t . is ( actual . parserPreset . name , './conventional-changelog-custom' ) ;
85
142
t . is ( typeof actual . parserPreset . opts , 'object' ) ;
86
- t . deepEqual ( actual . parserPreset . opts . parserOpts . headerPattern , / ^ ( \w * ) (?: \( ( .* ) \) ) ? - ( .* ) $ / ) ;
143
+ t . deepEqual (
144
+ actual . parserPreset . opts . parserOpts . headerPattern ,
145
+ / ^ ( \w * ) (?: \( ( .* ) \) ) ? - ( .* ) $ /
146
+ ) ;
87
147
} ) ;
88
148
89
- test ( 'ignores unknow keys' , async t => {
149
+ test . serial ( 'ignores unknow keys' , async t => {
90
150
t . context . back = chdir ( 'fixtures/trash-file' ) ;
91
151
const actual = await load ( ) ;
92
152
t . deepEqual ( actual , {
@@ -98,7 +158,7 @@ test('ignores unknow keys', async t => {
98
158
} ) ;
99
159
} ) ;
100
160
101
- test ( 'ignores unknow keys recursively' , async t => {
161
+ test . serial ( 'ignores unknow keys recursively' , async t => {
102
162
t . context . back = chdir ( 'fixtures/trash-extend' ) ;
103
163
const actual = await load ( ) ;
104
164
t . deepEqual ( actual , {
@@ -110,7 +170,7 @@ test('ignores unknow keys recursively', async t => {
110
170
} ) ;
111
171
} ) ;
112
172
113
- test ( 'supports legacy .conventional-changelog-lintrc' , async t => {
173
+ test . serial ( 'supports legacy .conventional-changelog-lintrc' , async t => {
114
174
t . context . back = chdir ( 'fixtures/legacy' ) ;
115
175
const actual = await load ( ) ;
116
176
t . deepEqual ( actual , {
@@ -121,16 +181,19 @@ test('supports legacy .conventional-changelog-lintrc', async t => {
121
181
} ) ;
122
182
} ) ;
123
183
124
- test ( 'commitlint.config.js overrides .conventional-changelog-lintrc' , async t => {
125
- t . context . back = chdir ( 'fixtures/overriden-legacy' ) ;
126
- const actual = await load ( ) ;
127
- t . deepEqual ( actual , {
128
- extends : [ ] ,
129
- rules : {
130
- legacy : false
131
- }
132
- } ) ;
133
- } ) ;
184
+ test . serial (
185
+ 'commitlint.config.js overrides .conventional-changelog-lintrc' ,
186
+ async t => {
187
+ t . context . back = chdir ( 'fixtures/overriden-legacy' ) ;
188
+ const actual = await load ( ) ;
189
+ t . deepEqual ( actual , {
190
+ extends : [ ] ,
191
+ rules : {
192
+ legacy : false
193
+ }
194
+ } ) ;
195
+ }
196
+ ) ;
134
197
135
198
function chdir ( target ) {
136
199
const to = path . resolve ( cwd , target . split ( '/' ) . join ( path . sep ) ) ;
0 commit comments