From 569069e54886b48bad2de2d09867df74e38f743c Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" <23040076+greenkeeper[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2020 11:13:09 +0000 Subject: [PATCH] chore(package): update xo to version 0.28.0 --- package.json | 7 +++-- test/integration.test.js | 2 +- test/load-changelog-config.test.js | 48 +++++++++++++++--------------- 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 3d4088df..738412b6 100644 --- a/package.json +++ b/package.json @@ -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" @@ -95,6 +95,9 @@ }, "xo": { "prettier": true, - "space": true + "space": true, + "rules": { + "unicorn/string-content": "off" + } } } diff --git a/test/integration.test.js b/test/integration.test.js index 46800f49..c1bd39f4 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -197,7 +197,7 @@ test('Accept a partial "parseOpts" and "writerOpts" objects as option', async t const changelog = await generateNotes( { preset: 'angular', - parserOpts: {headerPattern: /^(?\w*)(?:\((?.*)\)): (?.*)$/}, + parserOpts: {headerPattern: /^(?\w*)\((?.*)\): (?.*)$/}, writerOpts: {commitsSort: ['subject', 'scope']}, }, {cwd, options: {repositoryUrl}, lastRelease, nextRelease, commits} diff --git a/test/load-changelog-config.test.js b/test/load-changelog-config.test.js index 524ff1e7..5c6ac60e 100644 --- a/test/load-changelog-config.test.js +++ b/test/load-changelog-config.test.js @@ -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: /^##(?.*?)## (?.*)$/, 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: /^##(?.*?)## (?.*)$/, 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: /^##(?.*?)## (?.*)$/, 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); });