8000 test: update ava to version 1.0.1 · coderbyheart/github@761d39e · GitHub
[go: up one dir, main page]

Skip to content

Commit 761d39e

Browse files
greenkeeper[bot]pvdlg
authored andcommitted
test: update ava to version 1.0.1
1 parent d65092f commit 761d39e

File tree

7 files changed

+65
-62
lines changed

7 files changed

+65
-62
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"url-join": "^4.0.0"
3636
},
3737
"devDependencies": {
38-
"ava": "^0.25.0",
38+
"ava": "^1.0.1",
3939
"clear-module": "^3.0.0",
4040
"codecov": "^3.0.0",
4141
"commitizen": "^3.0.0",

test/find-sr-issue.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ test.serial('Retries 4 times', async t => {
105105
.times(4)
106106
.reply(422);
107107

108-
const error = await t.throws(findSRIssues(client, title, owner, repo));
108+
const error = await t.throwsAsync(findSRIssues(client, title, owner, repo));
109109

110110
t.is(error.status, 422);
111111
t.true(github.isDone());
@@ -123,7 +123,7 @@ test.serial('Do not retry on 401 error', async t => {
123123
)
124124
.reply(401);
125125

126-
const error = await t.throws(findSRIssues(client, title, owner, repo));
126+
const error = await t.throwsAsync(findSRIssues(client, title, owner, repo));
127127

128128
t.is(error.status, 401);
129129
t.true(github.isDone());

test/get-client.test.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,11 @@ test('Use the same throttler when retrying', async t => {
189189
},
190190
})({githubToken: 'token'});
191191

192-
await t.throws(github.repos.createRelease());
193-
194-
const {time: a} = await t.throws(request.getCall(0).returnValue);
195-
const {time: b} = await t.throws(request.getCall(1).returnValue);
196-
const {time: c} = await t.throws(request.getCall(2).returnValue);
197-
const {time: d} = await t.throws(request.getCall(3).returnValue);
192+
await t.throwsAsync(github.repos.createRelease());
193+
const {time: a} = await t.throwsAsync(request.getCall(0).returnValue);
194+
const {time: b} = await t.throwsAsync(request.getCall(1).returnValue);
195+
const {time: c} = await t.throwsAsync(request.getCall(2).returnValue);
196+
const {time: d} = await t.throwsAsync(request.getCall(3).returnValue);
198197

199198
// Each retry should be done after `coreRate` ms
200199
t.true(inRange(b - a, coreRate - 50, coreRate + 50));

test/integration.test.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ test.serial('Verify GitHub auth', async t => {
4444
.get(`/repos/${owner}/${repo}`)
4545
.reply(200, {permissions: {push: true}});
4646

47-
await t.notThrows(t.context.m.verifyConditions({}, {cwd, env, options, logger: t.context.logger}));
47+
await t.notThrowsAsync(t.context.m.verifyConditions({}, {cwd, env, options, logger: t.context.logger}));
4848

4949
t.true(github.isDone());
5050
});
@@ -61,7 +61,7 @@ test.serial('Verify GitHub auth with publish options', async t => {
6161
.get(`/repos/${owner}/${repo}`)
6262
.reply(200, {permissions: {push: true}});
6363

64-
await t.notThrows(t.context.m.verifyConditions({}, {cwd, env, options, logger: t.context.logger}));
64+
await t.notThrowsAsync(t.context.m.verifyConditions({}, {cwd, env, options, logger: t.context.logger}));
6565

6666
t.true(github.isDone());
6767
});
@@ -85,7 +85,7 @@ test.serial('Verify GitHub auth and assets config', async t => {
8585
.get(`/repos/${owner}/${repo}`)
8686
.reply(200, {permissions: {push: true}});
8787

88-
await t.notThrows(t.context.m.verifyConditions({assets}, {cwd, env, options, logger: t.context.logger}));
88+
await t.notThrowsAsync(t.context.m.verifyConditions({assets}, {cwd, env, options, logger: t.context.logger}));
8989

9090
t.true(github.isDone());
9191
});
@@ -106,7 +106,9 @@ test.serial('Throw SemanticReleaseError if invalid config', async t => {
106106
repositoryUrl: 'invalid_url',
107107
};
108108

109-
const errors = [...(await t.throws(t.context.m.verifyConditions({}, {cwd, env, options, logger: t.context.logger})))];
109+
const errors = [
110+
...(await t.throwsAsync(t.context.m.verifyConditions({}, {cwd, env, options, logger: t.context.logger}))),
111+
];
110112

111113
t.is(errors[0].name, 'SemanticReleaseError');
112114
t.is(errors[0].code, 'EINVALIDASSETS');
@@ -318,7 +320,7 @@ test.serial('Verify, release and notify success', async t => {
318320
.post(`${uploadUri}?name=${escape('other_file.txt')}&label=${escape('Other File')}`)
319321
.reply(200, {browser_download_url: otherAssetUrl});
320322

321-
await t.notThrows(t.context.m.verifyConditions({}, {cwd, env, options, logger: t.context.logger}));
323+
await t.notThrowsAsync(t.context.m.verifyConditions({}, {cwd, env, options, logger: t.context.logger}));
322324
await t.context.m.publish({assets}, {cwd, env, options, nextRelease, logger: t.context.logger});
323325
await t.context.m.success(
324326
{assets, failTitle},
@@ -363,7 +365,7 @@ test.serial('Verify and notify failure', async t => {
363365
})
364366
.reply(200, {html_url: 'https://github.com/issues/1', number: 1});
365367

366-
await t.notThrows(t.context.m.verifyConditions({}, {cwd, env, options, logger: t.context.logger}));
368+
await t.notThrowsAsync(t.context.m.verifyConditions({}, {cwd, env, options, logger: t.context.logger}));
367369
await t.context.m.fail({failTitle}, {cwd, env, options, errors, logger: t.context.logger});
368370

369371
t.deepEqual(t.context.log.args[0], ['Verify GitHub authentication']);

test/publish.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ test.serial('Throw error without retries for 400 error', async t => {
227227
})
228228
.reply(400);
229229

230-
const error = await t.throws(publish(pluginConfig, {cwd, env, options, nextRelease, logger: t.context.logger}));
230+
const error = await t.throwsAsync(publish(pluginConfig, {cwd, env, options, nextRelease, logger: t.context.logger}));
231231

232232
t.is(error.status, 400);
233233
t.true(github.isDone());

test/success.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ test.serial('Ignore errors when adding comments and closing issues', async t =>
674674
.patch(`/repos/${owner}/${repo}/issues/3`, {state: 'closed'})
675675
.reply(200, {html_url: 'https://github.com/issues/3'});
676676

677-
const [error1, error2] = await t.throws(
677+
const [error1, error2] = await t.throwsAsync(
678678
success(pluginConfig, {env, options, commits, nextRelease, releases, logger: t.context.logger})
679679
);
680680

0 commit comments

Comments
 (0)
0