@@ -49,88 +49,88 @@ test('Load "conventional-changelog-angular" by default', async t => {
49
49
} ) ;
50
50
51
51
test ( 'Accept a "parserOpts" object as option' , async t => {
52
- const customParserOpts = {
52
+ const customParserOptions = {
53
53
headerPattern : / ^ # # (?< tag > .* ?) # # (?< shortDesc > .* ) $ / ,
54
54
headerCorrespondence : [ 'tag' , 'shortDesc' ] ,
55
55
} ;
56
- const changelogConfig = await loadChangelogConfig ( { parserOpts : customParserOpts } , { cwd} ) ;
56
+ const changelogConfig = await loadChangelogConfig ( { parserOpts : customParserOptions } , { cwd} ) ;
57
57
const angularChangelogConfig = await require ( 'conventional-changelog-angular' ) ;
58
58
59
- t . is ( customParserOpts . headerPattern , changelogConfig . parserOpts . headerPattern ) ;
60
- t . deepEqual ( customParserOpts . headerCorrespondence , changelogConfig . parserOpts . headerCorrespondence ) ;
59
+ t . is ( customParserOptions . headerPattern , changelogConfig . parserOpts . headerPattern ) ;
60
+ t . deepEqual ( customParserOptions . headerCorrespondence , changelogConfig . parserOpts . headerCorrespondence ) ;
61
61
t . deepEqual ( changelogConfig . parserOpts . noteKeywords , angularChangelogConfig . parserOpts . noteKeywords ) ;
62
62
t . deepEqual ( changelogConfig . writerOpts , angularChangelogConfig . writerOpts ) ;
63
63
} ) ;
64
64
65
65
test ( 'Accept a "writerOpts" object as option' , async t => {
66
- const customWriterOpts = { commitGroupsSort : 'title' , commitsSort : [ 'scope' , 'subject' ] } ;
67
- const changelogConfig = await loadChangelogConfig ( { writerOpts : customWriterOpts } , { cwd} ) ;
66
+ const customWriterOptions = { commitGroupsSort : 'title' , commitsSort : [ 'scope' , 'subject' ] } ;
67
+ const changelogConfig = await loadChangelogConfig ( { writerOpts : customWriterOptions } , { cwd} ) ;
68
68
const angularChangelogConfig = await require ( 'conventional-changelog-angular' ) ;
69
69
70
- t . is ( customWriterOpts . commitGroupsSort , changelogConfig . writerOpts . commitGroupsSort ) ;
71
- t . deepEqual ( customWriterOpts . commitsSort , changelogConfig . writerOpts . commitsSort ) ;
70
+ t . is ( customWriterOptions . commitGroupsSort , changelogConfig . writerOpts . commitGroupsSort ) ;
71
+ t . deepEqual ( customWriterOptions . commitsSort , changelogConfig . writerOpts . commitsSort ) ;
72
72
t . deepEqual ( changelogConfig . writerOpts . noteGroupsSort , angularChangelogConfig . writerOpts . noteGroupsSort ) ;
73
73
t . deepEqual ( changelogConfig . parserOpts , angularChangelogConfig . parserOpts ) ;
74
74
} ) ;
75
75
76
76
test ( 'Accept a partial "parserOpts" object as option that overwrite a preset' , async t => {
77
- const customParserOpts = {
77
+ const customParserOptions = {
78
78
headerPattern : / ^ # # (?< tag > .* ?) # # (?< shortDesc > .* ) $ / ,
79
79
headerCorrespondence : [ 'tag' , 'shortDesc' ] ,
80
80
} ;
81
- const changelogConfig = await loadChangelogConfig ( { parserOpts : customParserOpts , preset : 'angular' } , { cwd} ) ;
81
+ const changelogConfig = await loadChangelogConfig ( { parserOpts : customParserOptions , preset : 'angular' } , { cwd} ) ;
82
82
const angularChangelogConfig = await require ( 'conventional-changelog-angular' ) ;
83
83
84
- t . is ( customParserOpts . headerPattern , changelogConfig . parserOpts . headerPattern ) ;
85
- t . deepEqual ( customParserOpts . headerCorrespondence , changelogConfig . parserOpts . headerCorrespondence ) ;
84
+ t . is ( customParserOptions . headerPattern , changelogConfig . parserOpts . headerPattern ) ;
85
+ t . deepEqual ( customParserOptions . headerCorrespondence , changelogConfig . parserOpts . headerCorrespondence ) ;
86
86
t . truthy ( changelogConfig . parserOpts . noteKeywords ) ;
87
87
t . deepEqual ( changelogConfig . writerOpts , angularChangelogConfig . writerOpts ) ;
88
88
} ) ;
89
89
90
90
test ( 'Accept a "writerOpts" object as option that overwrite a preset' , async t => {
91
- const customWriterOpts = { commitGroupsSort : 'title' , commitsSort : [ 'scope' , 'subject' ] } ;
92
- const changelogConfig = await loadChangelogConfig ( { writerOpts : customWriterOpts , preset : 'angular' } , { cwd} ) ;
91
+ const customWriterOptions = { commitGroupsSort : 'title' , commitsSort : [ 'scope' , 'subject' ] } ;
92
+ const changelogConfig = await loadChangelogConfig ( { writerOpts : customWriterOptions , preset : 'angular' } , { cwd} ) ;
93
93
const angularChangelogConfig = await require ( 'conventional-changelog-angular' ) ;
94
94
95
- t . is ( customWriterOpts . commitGroupsSort , changelogConfig . writerOpts . commitGroupsSort ) ;
96
- t . deepEqual ( customWriterOpts . commitsSort , changelogConfig . writerOpts . commitsSort ) ;
95
+ t . is ( customWriterOptions . commitGroupsSort , changelogConfig . writerOpts . commitGroupsSort ) ;
96
+ t . deepEqual ( customWriterOptions . commitsSort , changelogConfig . writerOpts . commitsSort ) ;
97
97
t . truthy ( changelogConfig . writerOpts . noteGroupsSort ) ;
98
98
t . deepEqual ( changelogConfig . parserOpts , angularChangelogConfig . parserOpts ) ;
99
99
} ) ;
100
100
101
101
test ( 'Accept a partial "parserOpts" object as option that overwrite a config' , async t => {
102
- const customParserOpts = {
102
+ const customParserOptions = {
103
103
headerPattern : / ^ # # (?< tag > .* ?) # # (?< shortDesc > .* ) $ / ,
104
104
headerCorrespondence : [ 'tag' , 'shortDesc' ] ,
105
105
} ;
106
106
const changelogConfig = await loadChangelogConfig (
107
107
{
108
- parserOpts : customParserOpts ,
108
+ parserOpts : customParserOptions ,
109
109
config : 'conventional-changelog-angular' ,
110
110
} ,
111
111
{ cwd}
112
112
) ;
113
113
const angularChangelogConfig = await require ( 'conventional-changelog-angular' ) ;
114
114
115
- t . is ( customParserOpts . headerPattern , changelogConfig . parserOpts . headerPattern ) ;
116
- t . deepEqual ( customParserOpts . headerCorrespondence , changelogConfig . parserOpts . headerCorrespondence ) ;
115
+ t . is ( customParserOptions . headerPattern , changelogConfig . parserOpts . headerPattern ) ;
116
+ t . deepEqual ( customParserOptions . headerCorrespondence , changelogConfig . parserOpts . headerCorrespondence ) ;
117
117
t . truthy ( changelogConfig . parserOpts . noteKeywords ) ;
118
118
t . deepEqual ( changelogConfig . writerOpts , angularChangelogConfig . writerOpts ) ;
119
119
} ) ;
120
120
121
121
test ( 'Accept a "writerOpts" object as option that overwrite a config' , async t => {
122
- const customWriterOpts = { commitGroupsSort : 'title' , commitsSort : [ 'scope' , 'subject' ] } ;
122
+ const customWriterOptions = { commitGroupsSort : 'title' , commitsSort : [ 'scope' , 'subject' ] } ;
123
123
const changelogConfig = await loadChangelogConfig (
124
124
{
125
- writerOpts : customWriterOpts ,
125
+ writerOpts : customWriterOptions ,
126
126
config : 'conventional-changelog-angular' ,
127
127
} ,
128
128
{ cwd}
129
129
) ;
130
130
const angularChangelogConfig = await require ( 'conventional-changelog-angular' ) ;
131
131
132
- t . is ( customWriterOpts . commitGroupsSort , changelogConfig . writerOpts . commitGroupsSort ) ;
133
- t . deepEqual ( customWriterOpts . commitsSort , changelogConfig . writerOpts . commitsSort ) ;
132
+ t . is ( customWriterOptions . commitGroupsSort , changelogConfig . writerOpts . commitGroupsSort ) ;
133
+ t . deepEqual ( customWriterOptions . commitsSort , changelogConfig . writerOpts . commitsSort ) ;
134
134
t . truthy ( changelogConfig . writerOpts . noteGroupsSort ) ;
135
135
t . deepEqual ( changelogConfig . parserOpts , angularChangelogConfig . parserOpts ) ;
136
136
} ) ;
0 commit comments