Skip to content

Commit eec56ca

Browse files
greenkeeper[bot]pvdlg
authored andcommitted
chore(package): update ava to version 3.1.0
1 parent 32494d1 commit eec56ca

File tree

6 files changed

+39
-50
lines changed

6 files changed

+39
-50
lines changed

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
"ava": {
77
"files": [
88
"test/**/*.test.js"
9-
],
10-
"helpers": [
11-
"test/helpers/**/*"
129
]
1310
},
1411
"bugs": {
@@ -28,7 +25,7 @@
2825
"micromatch": "^3.1.10"
2926
},
3027
"devDependencies": {
31-
"ava": "^2.0.0",
28+
"ava": "^3.1.0",
3229
"codecov": "^3.0.0",
3330
"conventional-changelog-atom": "^2.0.0",
3431
"conventional-changelog-conventionalcommits": "^4.1.0",

test/analyze-commit.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import test from 'ava';
2-
import analyzeCommit from '../lib/analyze-commit';
1+
const test = require('ava');
2+
const analyzeCommit = require('../lib/analyze-commit');
33

44
test('Match breaking change', t => {
55
const commit = {

test/compare-release-types.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import test from 'ava';
2-
import compareReleaseTypes from '../lib/compare-release-types';
1+
const test = require('ava');
2+
const compareReleaseTypes = require('../lib/compare-release-types');
33

44
test('Compares release types', t => {
55
t.true(compareReleaseTypes('patch', 'minor'));

test/integration.test.js

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import test from 'ava';
2-
import {stub} from 'sinon';
3-
import {analyzeCommits} from '..';
1+
const test = require('ava');
2+
const {stub} = require('sinon');
3+
const {analyzeCommits} = require('..');
44

55
const cwd = process.cwd();
66

@@ -234,7 +234,7 @@ test('Process rules in order and apply highest match', async t => {
234234
t.true(t.context.log.calledWith('Analysis of %s commits complete: %s release', 2, 'minor'));
235235
});
236236

237-
test('Process rules in order and apply highest match from config even if default has an higher match', async t => {
237+
test('Process rules in order and apply highest match = require(config even if default has an higher match', async t => {
238238
const commits = [
239239
{hash: '123', message: 'Chore: First chore (fixes #123)'},
240240
{hash: '456', message: 'Docs: update README (fixes #456) \n\n BREAKING CHANGE: break something'},
@@ -351,17 +351,15 @@ test('Throw error if "preset" doesn`t exist', async t => {
351351
});
352352

353353
test('Throw error if "releaseRules" is not an Array or a String', async t => {
354-
await t.throwsAsync(
355-
analyzeCommits({releaseRules: {}}, {cwd}),
356-
/Error in commit-analyzer configuration: "releaseRules" must be an array of rules/
357-
);
354+
await t.throwsAsync(analyzeCommits({releaseRules: {}}, {cwd}), {
355+
message: /Error in commit-analyzer configuration: "releaseRules" must be an array of rules/,
356+
});
358357
});
359358

360359
test('Throw error if "releaseRules" option reference a requierable module that is not an Array or a String', async t => {
361-
await t.throwsAsync(
362-
analyzeCommits({releaseRules: './test/fixtures/release-rules-invalid'}, {cwd}),
363-
/Error in commit-analyzer configuration: "releaseRules" must be an array of rules/
364-
);
360+
await t.throwsAsync(analyzeCommits({releaseRules: './test/fixtures/release-rules-invalid'}, {cwd}), {
361+
message: /Error in commit-analyzer configuration: "releaseRules" must be an array of rules/,
362+
});
365363
});
366364

367365
test('Throw error if "config" doesn`t exist', async t => {
@@ -372,13 +370,12 @@ test('Throw error if "config" doesn`t exist', async t => {
372370
});
373371

374372
test('Throw error if "releaseRules" reference invalid commit type', async t => {
375-
await t.throwsAsync(
376-
analyzeCommits({preset: 'eslint', releaseRules: [{tag: 'Update', release: 'invalid'}]}, {cwd}),
377-
/Error in commit-analyzer configuration: "invalid" is not a valid release type\. Valid values are:\[?.*\]/
378-
);
373+
await t.throwsAsync(analyzeCommits({preset: 'eslint', releaseRules: [{tag: 'Update', release: 'invalid'}]}, {cwd}), {
374+
message: /Error in commit-analyzer configuration: "invalid" is not a valid release type\. Valid values are:\[?.*\]/,
375+
});
379376
});
380377

381-
test('Re-Throw error from "conventional-changelog-parser"', async t => {
378+
test('Re-Throw error = require("conventional-changelog-parser"', async t => {
382379
const commits = [{message: 'Fix: First fix (fixes #123)'}, {message: 'Update: Second feature (fixes #456)'}];
383380
await t.throwsAsync(analyzeCommits({parserOpts: {headerPattern: '\\'}}, {cwd, commits, logger: t.context.logger}));
384381
});

test/load-parser-config.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import test from 'ava';
2-
import loadParserConfig from '../lib/load-parser-config';
1+
const test = require('ava');
2+
const loadParserConfig = require('../lib/load-parser-config');
33

44
const cwd = process.cwd();
55

test/load-release-rules.test.js

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import test from 'ava';
2-
import loadReleaseRules from '../lib/load-release-rules';
3-
import testReleaseRules from './fixtures/release-rules';
1+
const test = require('ava');
2+
const loadReleaseRules = require('../lib/load-release-rules');
3+
const testReleaseRules = require('./fixtures/release-rules');
44

55
const cwd = process.cwd();
66

@@ -40,36 +40,31 @@ test('Preserve release rules set to "false" or "null"', t => {
4040
});
4141

4242
test('Throw error if "releaseRules" reference invalid commit type', t => {
43-
t.throws(
44-
() => loadReleaseRules({releaseRules: [{tag: 'Update', release: 'invalid'}]}, {cwd}),
45-
/Error in commit-analyzer configuration: "invalid" is not a valid release type\. Valid values are:\[?.*\]/
46-
);
43+
t.throws(() => loadReleaseRules({releaseRules: [{tag: 'Update', release: 'invalid'}]}, {cwd}), {
44+
message: /Error in commit-analyzer configuration: "invalid" is not a valid release type\. Valid values are:\[?.*\]/,
45+
});
4746
});
4847

4948
test('Throw error if a rule in "releaseRules" does not have a release type', t => {
50-
t.throws(
51-
() => loadReleaseRules({releaseRules: [{tag: 'Update'}]}, {cwd}),
52-
/Error in commit-analyzer configuration: rules must be an object with a "release" property/
53-
);
49+
t.throws(() => loadReleaseRules({releaseRules: [{tag: 'Update'}]}, {cwd}), {
50+
message: /Error in commit-analyzer configuration: rules must be an object with a "release" property/,
51+
});
5452
});
5553

5654
test('Throw error if "releaseRules" is not an Array or a String', t => {
57-
t.throws(
58-
() => loadReleaseRules({releaseRules: {}}, {cwd}),
59-
/Error in commit-analyzer configuration: "releaseRules" must be an array of rules/
60-
);
55+
t.throws(() => loadReleaseRules({releaseRules: {}}, {cwd}), {
56+
message: /Error in commit-analyzer configuration: "releaseRules" must be an array of rules/,
57+
});
6158
});
6259

6360
test('Throw error if "releaseRules" option reference a requierable module that is not an Array or a String', t => {
64-
t.throws(
65-
() => loadReleaseRules({releaseRules: './test/fixtures/release-rules-invalid'}, {cwd}),
66-
/Error in commit-analyzer configuration: "releaseRules" must be an array of rules/
67-
);
61+
t.throws(() => loadReleaseRules({releaseRules: './test/fixtures/release-rules-invalid'}, {cwd}), {
62+
message: /Error in commit-analyzer configuration: "releaseRules" must be an array of rules/,
63+
});
6864
});
6965

7066
test('Throw error if "releaseRules" contains an undefined rule', t => {
71-
t.throws(
72-
() => loadReleaseRules({releaseRules: [{type: 'feat', release: 'minor'}, undefined]}, {cwd}),
73-
/Error in commit-analyzer configuration: rules must be an object with a "release" property/
74-
);
67+
t.throws(() => loadReleaseRules({releaseRules: [{type: 'feat', release: 'minor'}, undefined]}, {cwd}), {
68+
message: /Error in commit-analyzer configuration: rules must be an object with a "release" property/,
69+
});
7570
});

0 commit comments

Comments
 (0)