Skip to content

Commit

Permalink
chore(package): update xo to version 0.28.0
Browse files Browse the repository at this point in the history
  • Loading branch information
greenkeeper[bot] authored and pvdlg committed Mar 27, 2020
1 parent cbb5016 commit 569069e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 27 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"semantic-release": "^17.0.0",
"sinon": "^9.0.0",
"tempy": "^0.5.0",
"xo": "^0.27.0"
"xo": "^0.28.0"
},
"engines": {
"node": ">=10.18"
Expand Down Expand Up @@ -95,6 +95,9 @@
},
"xo": {
"prettier": true,
"space": true
"space": true,
"rules": {
"unicorn/string-content": "off"
}
}
}
2 changes: 1 addition & 1 deletion test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ test('Accept a partial "parseOpts" and "writerOpts" objects as option', async t
const changelog = await generateNotes(
{
preset: 'angular',
parserOpts: {headerPattern: /^(?<type>\w*)(?:\((?<scope>.*)\)): (?<subject>.*)$/},
parserOpts: {headerPattern: /^(?<type>\w*)\((?<scope>.*)\): (?<subject>.*)$/},
writerOpts: {commitsSort: ['subject', 'scope']},
},
{cwd, options: {repositoryUrl}, lastRelease, nextRelease, commits}
Expand Down
48 changes: 24 additions & 24 deletions test/load-changelog-config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,88 +49,88 @@ test('Load "conventional-changelog-angular" by default', async t => {
});

test('Accept a "parserOpts" object as option', async t => {
const customParserOpts = {
const customParserOptions = {
headerPattern: /^##(?<tag>.*?)## (?<shortDesc>.*)$/,
headerCorrespondence: ['tag', 'shortDesc'],
};
const changelogConfig = await loadChangelogConfig({parserOpts: customParserOpts}, {cwd});
const changelogConfig = await loadChangelogConfig({parserOpts: customParserOptions}, {cwd});
const angularChangelogConfig = await require('conventional-changelog-angular');

t.is(customParserOpts.headerPattern, changelogConfig.parserOpts.headerPattern);
t.deepEqual(customParserOpts.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence);
t.is(customParserOptions.headerPattern, changelogConfig.parserOpts.headerPattern);
t.deepEqual(customParserOptions.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence);
t.deepEqual(changelogConfig.parserOpts.noteKeywords, angularChangelogConfig.parserOpts.noteKeywords);
t.deepEqual(changelogConfig.writerOpts, angularChangelogConfig.writerOpts);
});

test('Accept a "writerOpts" object as option', async t => {
const customWriterOpts = {commitGroupsSort: 'title', commitsSort: ['scope', 'subject']};
const changelogConfig = await loadChangelogConfig({writerOpts: customWriterOpts}, {cwd});
const customWriterOptions = {commitGroupsSort: 'title', commitsSort: ['scope', 'subject']};
const changelogConfig = await loadChangelogConfig({writerOpts: customWriterOptions}, {cwd});
const angularChangelogConfig = await require('conventional-changelog-angular');

t.is(customWriterOpts.commitGroupsSort, changelogConfig.writerOpts.commitGroupsSort);
t.deepEqual(customWriterOpts.commitsSort, changelogConfig.writerOpts.commitsSort);
t.is(customWriterOptions.commitGroupsSort, changelogConfig.writerOpts.commitGroupsSort);
t.deepEqual(customWriterOptions.commitsSort, changelogConfig.writerOpts.commitsSort);
t.deepEqual(changelogConfig.writerOpts.noteGroupsSort, angularChangelogConfig.writerOpts.noteGroupsSort);
t.deepEqual(changelogConfig.parserOpts, angularChangelogConfig.parserOpts);
});

test('Accept a partial "parserOpts" object as option that overwrite a preset', async t => {
const customParserOpts = {
const customParserOptions = {
headerPattern: /^##(?<tag>.*?)## (?<shortDesc>.*)$/,
headerCorrespondence: ['tag', 'shortDesc'],
};
const changelogConfig = await loadChangelogConfig({parserOpts: customParserOpts, preset: 'angular'}, {cwd});
const changelogConfig = await loadChangelogConfig({parserOpts: customParserOptions, preset: 'angular'}, {cwd});
const angularChangelogConfig = await require('conventional-changelog-angular');

t.is(customParserOpts.headerPattern, changelogConfig.parserOpts.headerPattern);
t.deepEqual(customParserOpts.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence);
t.is(customParserOptions.headerPattern, changelogConfig.parserOpts.headerPattern);
t.deepEqual(customParserOptions.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence);
t.truthy(changelogConfig.parserOpts.noteKeywords);
t.deepEqual(changelogConfig.writerOpts, angularChangelogConfig.writerOpts);
});

test('Accept a "writerOpts" object as option that overwrite a preset', async t => {
const customWriterOpts = {commitGroupsSort: 'title', commitsSort: ['scope', 'subject']};
const changelogConfig = await loadChangelogConfig({writerOpts: customWriterOpts, preset: 'angular'}, {cwd});
const customWriterOptions = {commitGroupsSort: 'title', commitsSort: ['scope', 'subject']};
const changelogConfig = await loadChangelogConfig({writerOpts: customWriterOptions, preset: 'angular'}, {cwd});
const angularChangelogConfig = await require('conventional-changelog-angular');

t.is(customWriterOpts.commitGroupsSort, changelogConfig.writerOpts.commitGroupsSort);
t.deepEqual(customWriterOpts.commitsSort, changelogConfig.writerOpts.commitsSort);
t.is(customWriterOptions.commitGroupsSort, changelogConfig.writerOpts.commitGroupsSort);
t.deepEqual(customWriterOptions.commitsSort, changelogConfig.writerOpts.commitsSort);
t.truthy(changelogConfig.writerOpts.noteGroupsSort);
t.deepEqual(changelogConfig.parserOpts, angularChangelogConfig.parserOpts);
});

test('Accept a partial "parserOpts" object as option that overwrite a config', async t => {
const customParserOpts = {
const customParserOptions = {
headerPattern: /^##(?<tag>.*?)## (?<shortDesc>.*)$/,
headerCorrespondence: ['tag', 'shortDesc'],
};
const changelogConfig = await loadChangelogConfig(
{
parserOpts: customParserOpts,
parserOpts: customParserOptions,
config: 'conventional-changelog-angular',
},
{cwd}
);
const angularChangelogConfig = await require('conventional-changelog-angular');

t.is(customParserOpts.headerPattern, changelogConfig.parserOpts.headerPattern);
t.deepEqual(customParserOpts.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence);
t.is(customParserOptions.headerPattern, changelogConfig.parserOpts.headerPattern);
t.deepEqual(customParserOptions.headerCorrespondence, changelogConfig.parserOpts.headerCorrespondence);
t.truthy(changelogConfig.parserOpts.noteKeywords);
t.deepEqual(changelogConfig.writerOpts, angularChangelogConfig.writerOpts);
});

test('Accept a "writerOpts" object as option that overwrite a config', async t => {
const customWriterOpts = {commitGroupsSort: 'title', commitsSort: ['scope', 'subject']};
const customWriterOptions = {commitGroupsSort: 'title', commitsSort: ['scope', 'subject']};
const changelogConfig = await loadChangelogConfig(
{
writerOpts: customWriterOpts,
writerOpts: customWriterOptions,
config: 'conventional-changelog-angular',
},
{cwd}
);
const angularChangelogConfig = await require('conventional-changelog-angular');

t.is(customWriterOpts.commitGroupsSort, changelogConfig.writerOpts.commitGroupsSort);
t.deepEqual(customWriterOpts.commitsSort, changelogConfig.writerOpts.commitsSort);
t.is(customWriterOptions.commitGroupsSort, changelogConfig.writerOpts.commitGroupsSort);
t.deepEqual(customWriterOptions.commitsSort, changelogConfig.writerOpts.commitsSort);
t.truthy(changelogConfig.writerOpts.noteGroupsSort);
t.deepEqual(changelogConfig.parserOpts, angularChangelogConfig.parserOpts);
});
Expand Down

0 comments on commit 569069e

Please sign in to comment.