Skip to content

Commit 2aeced2

Browse files
author
ava
committed
test: rm or fix flaky tests
1 parent 01615cd commit 2aeced2

File tree

3 files changed

+1
-69
lines changed

3 files changed

+1
-69
lines changed

@commitlint/core/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
"license": "MIT",
6464
"devDependencies": {
6565
"@commitlint/utils": "^3.1.1",
66-
"ansi-styles": "3.1.0",
6766
"ava": "0.22.0",
6867
"babel-cli": "^6.26.0",
6968
"babel-preset-commitlint": "^3.2.0",
@@ -73,7 +72,6 @@
7372
"dependency-check": "2.7.0",
7473
"execa": "0.6.3",
7574
"globby": "6.1.0",
76-
"has-ansi": "3.0.0",
7775
"import-from": "2.1.0",
7876
"nyc": "10.3.2",
7977
"path-exists": "3.0.0",

@commitlint/core/src/format.test.js

-66
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import test from 'ava';
2-
import hasAnsi from 'has-ansi';
32
import chalk from 'chalk';
4-
import {yellow, red, magenta, blue} from 'ansi-styles';
53
import {includes} from 'lodash';
64
import format from './format';
75

@@ -49,19 +47,6 @@ test('returns a correct of empty .errors and .warnings', t => {
4947
t.true(includes(msg, '1 problems, 1 warnings'));
5048
});
5149

52-
test('colors messages by default', t => {
53-
const [msg] = format({
54-
errors: [],
55-
warnings: []
56-
});
57-
t.true(hasAnsi(msg));
58-
});
59-
60-
test('does not color messages if configured', t => {
61-
const [msg] = format({}, {color: false});
62-
t.false(hasAnsi(msg));
63-
});
64-
6550
test('uses appropriate signs by default', t => {
6651
const [err, warn] = format({
6752
errors: [
@@ -110,54 +95,3 @@ test('uses signs as configured', t => {
11095
t.true(includes(err, 'ERR'));
11196
t.true(includes(warn, 'WRN'));
11297
});
113-
114-
test('uses appropriate colors by default', t => {
115-
const [err, warn] = format({
116-
errors: [
117-
{
118-
level: 2,
119-
name: 'error-name',
120-
message: 'There was an error'
121-
}
122-
],
123-
warnings: [
124-
{
125-
level: 1,
126-
name: 'warning-name',
127-
message: 'There was a problem'
128-
}
129-
]
130-
});
131-
132-
t.true(includes(err, red.open));
133-
t.true(includes(warn, yellow.open));
134-
});
135-
136-
if (process.platform !== 'win32') {
137-
test('uses colors as configured', t => {
138-
const [err, warn] = format(
139-
{
140-
errors: [
141-
{
142-
level: 2,
143-
name: 'error-name',
144-
message: 'There was an error'
145-
}
146-
],
147-
warnings: [
148-
{
149-
level: 1,
150-
name: 'warning-name',
151-
message: 'There was a problem'
152-
}
153-
]
154-
},
155-
{
156-
colors: ['white', 'magenta', 'blue']
157-
}
158-
);
159-
160-
t.true(includes(err, blue.open));
161-
t.true(includes(warn, magenta.open));
162-
});
163-
}

@commitlint/core/src/load.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test('uses seed with parserPreset', async t => {
3434

3535
test('invalid extend should throw', async t => {
3636
const cwd = await bootstrap('fixtures/extends-invalid');
37-
t.throws(load({}, {cwd}));
37+
await t.throws(load({}, {cwd}));
3838
});
3939

4040
test('empty file should have no rules', async t => {

0 commit comments

Comments
 (0)