Skip to content

Commit 928f82f

Browse files
greenkeeper[bot]pvdlg
authored andcommitted
chore(package): update xo to version 0.23.0
1 parent a35f990 commit 928f82f

File tree

7 files changed

+38
-38
lines changed

7 files changed

+38
-38
lines changed

index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const prepareGit = require('./lib/prepare');
44

55
let verified;
66

7-
async function verifyConditions(pluginConfig, context) {
7+
function verifyConditions(pluginConfig, context) {
88
const {options} = context;
99
// If the Git prepare plugin is used and has `assets` or `message` configured, validate them now in order to prevent any release if the configuration is wrong
1010
if (options.prepare) {
@@ -14,13 +14,13 @@ async function verifyConditions(pluginConfig, context) {
1414
pluginConfig.assets = defaultTo(pluginConfig.assets, preparePlugin.assets);
1515
pluginConfig.message = defaultTo(pluginConfig.message, preparePlugin.message);
1616
}
17-
await verifyGit(pluginConfig);
17+
verifyGit(pluginConfig);
1818
verified = true;
1919
}
2020

2121
async function prepare(pluginConfig, context) {
2222
if (!verified) {
23-
await verifyGit(pluginConfig);
23+
verifyGit(pluginConfig);
2424
verified = true;
2525
}
2626
await prepareGit(pluginConfig, context);

lib/git.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async function push(origin, branch, execaOpts) {
5959
*
6060
* @return {String} The sha of the head commit on the local repository
6161
*/
62-
async function gitHead(execaOpts) {
62+
function gitHead(execaOpts) {
6363
return execa.stdout('git', ['rev-parse', 'HEAD'], execaOpts);
6464
}
6565

lib/verify.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const VALIDATORS = {
2323
* @param {String|Array<String|Object>} [pluginConfig.assets] Files to include in the release commit. Can be files path or globs.
2424
* @param {String} [pluginConfig.message] The commit message for the release.
2525
*/
26-
module.exports = async pluginConfig => {
26+
module.exports = pluginConfig => {
2727
const options = resolveConfig(pluginConfig);
2828

2929
const errors = Object.entries(options).reduce(

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"semantic-release": "^15.0.0",
4141
"sinon": "^6.0.0",
4242
"tempy": "^0.2.1",
43-
"xo": "^0.22.0"
43+
"xo": "^0.23.0"
4444
},
4545
"engines": {
4646
"node": ">=8.3"

test/helpers/git-utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function initBareRepo(repositoryUrl, branch = 'master') {
6060
* @returns {Array<Commit>} The created commits, in reverse order (to match `git log` order).
6161
*/
6262
export async function gitCommits(messages, execaOpts) {
63-
await pReduce(messages, async (_, message) =>
63+
await pReduce(messages, (_, message) =>
6464
execa.stdout('git', ['commit', '-m', message, '--allow-empty', '--no-gpg-sign'], execaOpts)
6565
);
6666
return (await gitGetCommits(undefined, execaOpts)).slice(0, messages.length);

test/integration.test.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -97,29 +97,29 @@ test('Verify authentication only on the fist call', async t => {
9797
const nextRelease = {version: '2.0.0', gitTag: 'v2.0.0'};
9898
const options = {repositoryUrl, branch, prepare: ['@semantic-release/npm']};
9999

100-
await t.notThrows(t.context.m.verifyConditions({}, {cwd, options, logger: t.context.logger}));
100+
t.notThrows(() => t.context.m.verifyConditions({}, {cwd, options, logger: t.context.logger}));
101101
await t.context.m.prepare({}, {cwd, options: {repositoryUrl, branch}, nextRelease, logger: t.context.logger});
102102
});
103103

104-
test('Throw SemanticReleaseError if prepare config is invalid', async t => {
104+
test('Throw SemanticReleaseError if prepare config is invalid', t => {
105105
const message = 42;
106106
const assets = true;
107107
const options = {prepare: ['@semantic-release/npm', {path: '@semantic-release/git', message, assets}]};
108108

109-
const errors = [...(await t.throws(t.context.m.verifyConditions({}, {options, logger: t.context.logger})))];
109+
const errors = [...t.throws(() => t.context.m.verifyConditions({}, {options, logger: t.context.logger}))];
110110

111111
t.is(errors[0].name, 'SemanticReleaseError');
112112
t.is(errors[0].code, 'EINVALIDASSETS');
113113
t.is(errors[1].name, 'SemanticReleaseError');
114114
t.is(errors[1].code, 'EINVALIDMESSAGE');
115115
});
116116

117-
test('Throw SemanticReleaseError if config is invalid', async t => {
117+
test('Throw SemanticReleaseError if config is invalid', t => {
118118
const message = 42;
119119
const assets = true;
120120

121121
const errors = [
122-
...(await t.throws(t.context.m.verifyConditions({message, assets}, {options: {}, logger: t.context.logger}))),
122+
...t.throws(() => t.context.m.verifyConditions({message, assets}, {options: {}, logger: t.context.logger})),
123123
];
124124

125125
t.is(errors[0].name, 'SemanticReleaseError');

test/verify.test.js

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,88 @@
11
import test from 'ava';
22
import verify from '../lib/verify';
33

4-
test('Throw SemanticReleaseError if "assets" option is not a String or false or an Array of Objects', async t => {
4+
test('Throw SemanticReleaseError if "assets" option is not a String or false or an Array of Objects', t => {
55
const assets = true;
6-
const [error] = await t.throws(verify({assets}));
6+
const [error] = t.throws(() => verify({assets}));
77

88
t.is(error.name, 'SemanticReleaseError');
99
t.is(error.code, 'EINVALIDASSETS');
1010
});
1111

12-
test('Throw SemanticReleaseError if "assets" option is not an Array with invalid elements', async t => {
12+
test('Throw SemanticReleaseError if "assets" option is not an Array with invalid elements', t => {
1313
const assets = ['file.js', 42];
14-
const [error] = await t.throws(verify({assets}));
14+
const [error] = t.throws(() => verify({assets}));
1515

1616
t.is(error.name, 'SemanticReleaseError');
1717
t.is(error.code, 'EINVALIDASSETS');
1818
});
1919

20-
test('Verify "assets" is a String', async t => {
20+
test('Verify "assets" is a String', t => {
2121
const assets = 'file2.js';
2222

23-
await t.notThrows(verify({assets}));
23+
t.notThrows(() => verify({assets}));
2424
});
2525

26-
test('Verify "assets" is an Array of String', async t => {
26+
test('Verify "assets" is an Array of String', t => {
2727
const assets = ['file1.js', 'file2.js'];
2828

29-
await t.notThrows(verify({assets}));
29+
t.notThrows(() => verify({assets}));
3030
});
3131

32-
test('Verify "assets" is an Object with a path property', async t => {
32+
test('Verify "assets" is an Object with a path property', t => {
3333
const assets = {path: 'file2.js'};
3434

35-
await t.notThrows(verify({assets}));
35+
t.notThrows(() => verify({assets}));
3636
});
3737

38-
test('Verify "assets" is an Array of Object with a path property', async t => {
38+
test('Verify "assets" is an Array of Object with a path property', t => {
3939
const assets = [{path: 'file1.js'}, {path: 'file2.js'}];
4040

41-
await t.notThrows(verify({assets}));
41+
t.notThrows(() => verify({assets}));
4242
});
4343

44-
test('Verify disabled "assets" (set to false)', async t => {
44+
test('Verify disabled "assets" (set to false)', t => {
4545
const assets = false;
4646

47-
await t.notThrows(verify({assets}));
47+
t.notThrows(() => verify({assets}));
4848
});
4949

50-
test('Verify "assets" is an Array of glob Arrays', async t => {
50+
test('Verify "assets" is an Array of glob Arrays', t => {
5151
const assets = [['dist/**', '!**/*.js'], 'file2.js'];
5252

53-
await t.notThrows(verify({assets}));
53+
t.notThrows(() => verify({assets}));
5454
});
5555

56-
test('Verify "assets" is an Array of Object with a glob Arrays in path property', async t => {
56+
test('Verify "assets" is an Array of Object with a glob Arrays in path property', t => {
5757
const assets = [{path: ['dist/**', '!**/*.js']}, {path: 'file2.js'}];
5858

59-
await t.notThrows(verify({assets}));
59+
t.notThrows(() => verify({assets}));
6060
});
6161

62-
test('Throw SemanticReleaseError if "message" option is not a String', async t => {
62+
test('Throw SemanticReleaseError if "message" option is not a String', t => {
6363
const message = 42;
64-
const [error] = await t.throws(verify({message}));
64+
const [error] = t.throws(() => verify({message}));
6565

6666
t.is(error.name, 'SemanticReleaseError');
6767
t.is(error.code, 'EINVALIDMESSAGE');
6868
});
6969

70-
test('Throw SemanticReleaseError if "message" option is an empty String', async t => {
70+
test('Throw SemanticReleaseError if "message" option is an empty String', t => {
7171
const message = '';
72-
const [error] = await t.throws(verify({message}));
72+
const [error] = t.throws(() => verify({message}));
7373

7474
t.is(error.name, 'SemanticReleaseError');
7575
t.is(error.code, 'EINVALIDMESSAGE');
7676
});
7777

78-
test('Throw SemanticReleaseError if "message" option is a whitespace String', async t => {
78+
test('Throw SemanticReleaseError if "message" option is a whitespace String', t => {
7979
const message = ' \n \r ';
80-
const [error] = await t.throws(verify({message}));
80+
const [error] = t.throws(() => verify({message}));
8181

8282
t.is(error.name, 'SemanticReleaseError');
8383
t.is(error.code, 'EINVALIDMESSAGE');
8484
});
8585

86-
test('Verify undefined "message" and "assets"', async t => {
87-
await t.notThrows(verify({}));
86+
test('Verify undefined "message" and "assets"', t => {
87+
t.notThrows(() => verify({}));
8888
});

0 commit comments

Comments
 (0)