Skip to content

Commit

Permalink
chore(package): update ava to version 1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
greenkeeper[bot] authored and pvdlg committed Dec 27, 2018
1 parent 1aefd98 commit 3819ca5
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -47,7 +47,7 @@
"yargs": "^12.0.0"
},
"devDependencies": {
"ava": "^0.25.0",
"ava": "^1.0.1",
"clear-module": "^3.0.0",
"codecov": "^3.0.0",
"commitizen": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/get-config.test.js
Expand Up @@ -480,7 +480,7 @@ test('Throw an Error if one of the shareable config cannot be found', async t =>
await outputJson(path.resolve(cwd, 'package.json'), {release: pkhOptions});
await outputJson(path.resolve(cwd, 'shareable1.json'), options1);

const error = await t.throws(t.context.getConfig({cwd}), Error);
const error = await t.throwsAsync(t.context.getConfig({cwd}), Error);

t.is(error.message, "Cannot find module 'non-existing-path'");
t.is(error.code, 'MODULE_NOT_FOUND');
Expand Down
8 changes: 4 additions & 4 deletions test/git.test.js
Expand Up @@ -42,7 +42,7 @@ test('Throw error if the last commit sha cannot be found', async t => {
// Create a git repository, set the current working directory at the root of the repo
const {cwd} = await gitRepo();

await t.throws(getGitHead({cwd}), Error);
await t.throwsAsync(getGitHead({cwd}), Error);
});

test('Unshallow and fetch repository', async t => {
Expand All @@ -67,7 +67,7 @@ test('Do not throw error when unshallow a complete repository', async t => {
const {cwd, repositoryUrl} = await gitRepo();
// Add commits to the master branch
await gitCommits(['First'], {cwd});
await t.notThrows(fetch(repositoryUrl, {cwd}));
await t.notThrowsAsync(fetch(repositoryUrl, {cwd}));
});

test('Fetch all tags on a detached head repository', async t => {
Expand Down Expand Up @@ -100,7 +100,7 @@ test('Verify if the commit `sha` is in the direct history of the current branch'

t.true(await isRefInHistory(commits[0].hash, {cwd}));
t.falsy(await isRefInHistory(otherCommits[0].hash, {cwd}));
await t.throws(isRefInHistory('non-existant-sha', {cwd}));
await t.throwsAsync(isRefInHistory('non-existant-sha', {cwd}));
});

test('Get the commit sha for a given tag or falsy if the tag does not exists', async t => {
Expand Down Expand Up @@ -206,7 +206,7 @@ test('Return falsy for invalid tag names', async t => {
test('Throws error if obtaining the tags fails', async t => {
const cwd = tempy.directory();

await t.throws(getTags({cwd}));
await t.throwsAsync(getTags({cwd}));
});

test('Return "true" if repository is up to date', async t => {
Expand Down
18 changes: 9 additions & 9 deletions test/index.test.js
Expand Up @@ -337,7 +337,7 @@ test('Call all "success" plugins even if one errors out', async t => {
'env-ci': () => ({isCi: true, branch: 'master', isPr: false}),
});

await t.throws(
await t.throwsAsync(
semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()})
);

Expand Down Expand Up @@ -372,7 +372,7 @@ test('Log all "verifyConditions" errors', async t => {
'env-ci': () => ({isCi: true, branch: 'master', isPr: false}),
});
const errors = [
...(await t.throws(
...(await t.throwsAsync(
semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()})
)),
];
Expand Down Expand Up @@ -417,7 +417,7 @@ test('Log all "verifyRelease" errors', async t => {
'env-ci': () => ({isCi: true, branch: 'master', isPr: false}),
});
const errors = [
...(await t.throws(
...(await t.throwsAsync(
semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()})
)),
];
Expand Down Expand Up @@ -519,7 +519,7 @@ test('Dry-run skips fail', async t => {
'env-ci': () => ({isCi: true, branch: 'master', isPr: false}),
});
const errors = [
...(await t.throws(
...(await t.throwsAsync(
semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()})
)),
];
Expand Down Expand Up @@ -957,7 +957,7 @@ test('Log both plugins errors and errors thrown by "fail" plugin', async t => {
'env-ci': () => ({isCi: true, branch: 'master', isPr: false}),
});

await t.throws(
await t.throwsAsync(
semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()})
);

Expand All @@ -982,7 +982,7 @@ test('Call "fail" only if a plugin returns a SemanticReleaseError', async t => {
'env-ci': () => ({isCi: true, branch: 'master', isPr: false}),
});

await t.throws(
await t.throwsAsync(
semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()})
);

Expand All @@ -999,7 +999,7 @@ test('Throw SemanticReleaseError if repositoryUrl is not set and cannot be found
'env-ci': () => ({isCi: true, branch: 'master', isPr: false}),
});
const errors = [
...(await t.throws(
...(await t.throwsAsync(
semanticRelease({}, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()})
)),
];
Expand Down Expand Up @@ -1036,7 +1036,7 @@ test('Throw an Error if plugin returns an unexpected value', async t => {
'./lib/get-logger': () => t.context.logger,
'env-ci': () => ({isCi: true, branch: 'master', isPr: false}),
});
const error = await t.throws(
const error = await t.throwsAsync(
semanticRelease(options, {cwd, env: {}, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}),
Error
);
Expand Down Expand Up @@ -1066,7 +1066,7 @@ test('Hide sensitive information passed to "fail" plugin', async t => {
'./lib/get-logger': () => t.context.logger,
'env-ci': () => ({isCi: true, branch: 'master', isPr: false}),
});
await t.throws(
await t.throwsAsync(
semanticRelease(options, {cwd, env, stdout: new WritableStreamBuffer(), stderr: new WritableStreamBuffer()}),
Error
);
Expand Down
6 changes: 3 additions & 3 deletions test/integration.test.js
Expand Up @@ -258,7 +258,7 @@ test('Exit with 1 if a plugin is not found', async t => {
release: {analyzeCommits: 'non-existing-path', success: false, fail: false},
});

const {code, stderr} = await t.throws(execa(cli, [], {env, cwd}));
const {code, stderr} = await t.throwsAsync(execa(cli, [], {env, cwd}));
t.is(code, 1);
t.regex(stderr, /Cannot find module/);
});
Expand All @@ -276,7 +276,7 @@ test('Exit with 1 if a shareable config is not found', async t => {
release: {extends: 'non-existing-path', success: false, fail: false},
});

const {code, stderr} = await t.throws(execa(cli, [], {env, cwd}));
const {code, stderr} = await t.throwsAsync(execa(cli, [], {env, cwd}));
t.is(code, 1);
t.regex(stderr, /Cannot find module/);
});
Expand All @@ -297,7 +297,7 @@ test('Exit with 1 if a shareable config reference a not found plugin', async t =
});
await writeJson(path.resolve(cwd, 'shareable.json'), shareable);

const {code, stderr} = await t.throws(execa(cli, [], {env, cwd}));
const {code, stderr} = await t.throwsAsync(execa(cli, [], {env, cwd}));
t.is(code, 1);
t.regex(stderr, /Cannot find module/);
});
Expand Down
10 changes: 5 additions & 5 deletions test/plugins/normalize.test.js
Expand Up @@ -62,7 +62,7 @@ test('Wrap plugin in a function that add the "pluginName" to the error"', async
'./plugin-error': './test/fixtures',
});

const error = await t.throws(plugin({options: {}}));
const error = await t.throwsAsync(plugin({options: {}}));

t.is(error.pluginName, './plugin-error');
});
Expand All @@ -72,7 +72,7 @@ test('Wrap plugin in a function that add the "pluginName" to multiple errors"',
'./plugin-errors': './test/fixtures',
});

const errors = [...(await t.throws(plugin({options: {}})))];
const errors = [...(await t.throwsAsync(plugin({options: {}})))];
for (const error of errors) {
t.is(error.pluginName, './plugin-errors');
}
Expand Down Expand Up @@ -107,7 +107,7 @@ test('Wrap "analyzeCommits" plugin in a function that validate the output of the
{}
);

const error = await t.throws(plugin({options: {}}));
const error = await t.throwsAsync(plugin({options: {}}));

t.is(error.code, 'EANALYZECOMMITSOUTPUT');
t.is(error.name, 'SemanticReleaseError');
Expand All @@ -125,7 +125,7 @@ test('Wrap "generateNotes" plugin in a function that validate the output of the
{}
);

const error = await t.throws(plugin({options: {}}));
const error = await t.throwsAsync(plugin({options: {}}));

t.is(error.code, 'EGENERATENOTESOUTPUT');
t.is(error.name, 'SemanticReleaseError');
Expand All @@ -143,7 +143,7 @@ test('Wrap "publish" plugin in a function that validate the output of the plugin
{}
);

const error = await t.throws(plugin({options: {}}));
const error = await t.throwsAsync(plugin({options: {}}));

t.is(error.code, 'EPUBLISHOUTPUT');
t.is(error.name, 'SemanticReleaseError');
Expand Down
10 changes: 5 additions & 5 deletions test/plugins/pipeline.test.js
Expand Up @@ -83,7 +83,7 @@ test('Stop execution and throw error if a step rejects', async t => {
const step2 = stub().rejects(new Error('test error'));
const step3 = stub().resolves(3);

const error = await t.throws(pipeline([step1, step2, step3])(0), Error);
const error = await t.throwsAsync(pipeline([step1, step2, step3])(0), Error);
t.is(error.message, 'test error');
t.true(step1.calledWith(0));
t.true(step2.calledWith(0));
Expand All @@ -98,7 +98,7 @@ test('Throw all errors from the first step throwing an AggregateError', async t
const step2 = stub().rejects(new AggregateError([error1, error2]));
const step3 = stub().resolves(3);

const errors = await t.throws(pipeline([step1, step2, step3])(0));
const errors = await t.throwsAsync(pipeline([step1, step2, step3])(0));

t.deepEqual([...errors], [error1, error2]);
t.true(step1.calledWith(0));
Expand All @@ -113,7 +113,7 @@ test('Execute all even if a Promise rejects', async t => {
const step2 = stub().rejects(error1);
const step3 = stub().rejects(error2);

const errors = await t.throws(pipeline([step1, step2, step3], {settleAll: true})(0));
const errors = await t.throwsAsync(pipeline([step1, step2, step3], {settleAll: true})(0));

t.deepEqual([...errors], [error1, error2]);
t.true(step1.calledWith(0));
Expand All @@ -129,7 +129,7 @@ test('Throw all errors from all steps throwing an AggregateError', async t => {
const step1 = stub().rejects(new AggregateError([error1, error2]));
const step2 = stub().rejects(new AggregateError([error3, error4]));

const errors = await t.throws(pipeline([step1, step2], {settleAll: true})(0));
const errors = await t.throwsAsync(pipeline([step1, step2], {settleAll: true})(0));

t.deepEqual([...errors], [error1, error2, error3, error4]);
t.true(step1.calledWith(0));
Expand All @@ -145,7 +145,7 @@ test('Execute each function in series passing a transformed input even if a step
const step4 = stub().resolves(4);
const getNextInput = (prevResult, result) => prevResult + result;

const errors = await t.throws(pipeline([step1, step2, step3, step4], {settleAll: true, getNextInput})(0));
const errors = await t.throwsAsync(pipeline([step1, step2, step3, step4], {settleAll: true, getNextInput})(0));

t.deepEqual([...errors], [error2, error3]);
t.true(step1.calledWith(0));
Expand Down
12 changes: 6 additions & 6 deletions test/verify.test.js
Expand Up @@ -7,7 +7,7 @@ test('Throw a AggregateError', async t => {
const {cwd} = await gitRepo();
const options = {};

const errors = [...(await t.throws(verify({cwd, options})))];
const errors = [...(await t.throwsAsync(verify({cwd, options})))];

t.is(errors[0].name, 'SemanticReleaseError');
t.is(errors[0].code, 'ENOREPOURL');
Expand All @@ -27,7 +27,7 @@ test('Throw a SemanticReleaseError if does not run on a git repository', async t
const cwd = tempy.directory();
const options = {};

const errors = [...(await t.throws(verify({cwd, options})))];
const errors = [...(await t.throwsAsync(verify({cwd, options})))];

t.is(errors[0].name, 'SemanticReleaseError');
t.is(errors[0].code, 'ENOGITREPO');
Expand All @@ -39,7 +39,7 @@ test('Throw a SemanticReleaseError if the "tagFormat" is not valid', async t =>
const {cwd, repositoryUrl} = await gitRepo(true);
const options = {repositoryUrl, tagFormat: `?\${version}`};

const errors = [...(await t.throws(verify({cwd, options})))];
const errors = [...(await t.throwsAsync(verify({cwd, options})))];

t.is(errors[0].name, 'SemanticReleaseError');
t.is(errors[0].code, 'EINVALIDTAGFORMAT');
Expand All @@ -51,7 +51,7 @@ test('Throw a SemanticReleaseError if the "tagFormat" does not contains the "ver
const {cwd, repositoryUrl} = await gitRepo(true);
const options = {repositoryUrl, tagFormat: 'test'};

const errors = [...(await t.throws(verify({cwd, options})))];
const errors = [...(await t.throwsAsync(verify({cwd, options})))];

t.is(errors[0].name, 'SemanticReleaseError');
t.is(errors[0].code, 'ETAGNOVERSION');
Expand All @@ -63,7 +63,7 @@ test('Throw a SemanticReleaseError if the "tagFormat" contains multiple "version
const {cwd, repositoryUrl} = await gitRepo(true);
const options = {repositoryUrl, tagFormat: `\${version}v\${version}`};

const errors = [...(await t.throws(verify({cwd, options})))];
const errors = [...(await t.throwsAsync(verify({cwd, options})))];

t.is(errors[0].name, 'SemanticReleaseError');
t.is(errors[0].code, 'ETAGNOVERSION');
Expand All @@ -75,5 +75,5 @@ test('Return "true" if all verification pass', async t => {
const {cwd, repositoryUrl} = await gitRepo(true);
const options = {repositoryUrl, tagFormat: `v\${version}`};

await t.notThrows(verify({cwd, options}));
await t.notThrowsAsync(verify({cwd, options}));
});

0 comments on commit 3819ca5

Please sign in to comment.