Skip to content

Commit f69a3b1

Browse files
Fixed tests that were failing on Windows due to different checkmark symbols
1 parent aee4fc2 commit f69a3b1

13 files changed

Lines changed: 119 additions & 99 deletions

test/fixtures/check.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
const chalk = require('chalk');
4+
const logSymbols = require('log-symbols');
5+
6+
// Export the check symbol (✔ on Mac/Linux, √ on Windows)
7+
// with the ANSI color sequences removed
8+
module.exports = chalk.stripColor(logSymbols.success);

test/specs/commit.spec.js

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const cli = require('../fixtures/cli');
44
const mocks = require('../fixtures/mocks');
55
const files = require('../fixtures/files');
6+
const check = require('../fixtures/check');
67
const chai = require('chai');
78

89
chai.should();
@@ -18,8 +19,8 @@ describe('bump --commit', () => {
1819
output.status.should.equal(0);
1920

2021
output.lines.should.deep.equal([
21-
'✔ Updated package.json to 2.0.0',
22-
'✔ Git commit',
22+
`${check} Updated package.json to 2.0.0`,
23+
`${check} Git commit`,
2324
]);
2425

2526
let git = mocks.git();
@@ -39,10 +40,10 @@ describe('bump --commit', () => {
3940
output.status.should.equal(0);
4041

4142
output.lines.should.deep.equal([
42-
'✔ Updated package.json to 1.1.0',
43-
'✔ Updated bower.json to 1.1.0',
44-
'✔ Updated component.json to 1.1.0',
45-
'✔ Git commit',
43+
`${check} Updated package.json to 1.1.0`,
44+
`${check} Updated bower.json to 1.1.0`,
45+
`${check} Updated component.json to 1.1.0`,
46+
`${check} Git commit`,
4647
]);
4748

4849
let git = mocks.git();
@@ -60,8 +61,8 @@ describe('bump --commit', () => {
6061
output.status.should.equal(0);
6162

6263
output.lines.should.deep.equal([
63-
'✔ Updated package.json to 1.1.0',
64-
'✔ Git commit',
64+
`${check} Updated package.json to 1.1.0`,
65+
`${check} Git commit`,
6566
]);
6667

6768
let git = mocks.git();
@@ -79,8 +80,8 @@ describe('bump --commit', () => {
7980
output.status.should.equal(0);
8081

8182
output.lines.should.deep.equal([
82-
'✔ Updated package.json to 1.0.1',
83-
'✔ Git commit',
83+
`${check} Updated package.json to 1.0.1`,
84+
`${check} Git commit`,
8485
]);
8586

8687
let git = mocks.git();

test/specs/grep.spec.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const cli = require('../fixtures/cli');
44
const files = require('../fixtures/files');
5+
const check = require('../fixtures/check');
56
const chai = require('chai');
67

78
chai.should();
@@ -21,10 +22,10 @@ describe('bump --grep', () => {
2122
output.status.should.equal(0);
2223

2324
output.lines.should.deep.equal([
24-
'✔ Updated package.json to 2.0.0',
25-
'✔ Updated README.md to 2.0.0',
26-
'✔ Updated script1.js to 2.0.0',
27-
'✔ Updated LICENSE to 2.0.0',
25+
`${check} Updated package.json to 2.0.0`,
26+
`${check} Updated README.md to 2.0.0`,
27+
`${check} Updated script1.js to 2.0.0`,
28+
`${check} Updated LICENSE to 2.0.0`,
2829
]);
2930

3031
files.json('package.json').version.should.equal('2.0.0');
@@ -48,10 +49,10 @@ describe('bump --grep', () => {
4849
output.status.should.equal(0);
4950

5051
output.lines.should.deep.equal([
51-
'✔ Updated package.json to 2.0.0',
52-
'✔ Updated README.md to 2.0.0',
53-
'✔ Updated script1.js to 2.0.0',
54-
'✔ Updated LICENSE to 2.0.0',
52+
`${check} Updated package.json to 2.0.0`,
53+
`${check} Updated README.md to 2.0.0`,
54+
`${check} Updated script1.js to 2.0.0`,
55+
`${check} Updated LICENSE to 2.0.0`,
5556
]);
5657

5758
files.text('README.md').should.match(/version 5.6.7 and v8.9.10 should not be changed/);
@@ -71,7 +72,7 @@ describe('bump --grep', () => {
7172
output.status.should.equal(0);
7273

7374
output.lines.should.deep.equal([
74-
'✔ Updated package.json to 5.0.0',
75+
`${check} Updated package.json to 5.0.0`,
7576
]);
7677

7778
files.json('package.json').version.should.equal('5.0.0');

test/specs/major.spec.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const cli = require('../fixtures/cli');
44
const files = require('../fixtures/files');
5+
const check = require('../fixtures/check');
56
const chai = require('chai');
67

78
chai.should();
@@ -32,9 +33,9 @@ describe('bump --major', () => {
3233
output.status.should.equal(0);
3334

3435
output.lines.should.deep.equal([
35-
'✔ Updated package.json to 1.0.0',
36-
'✔ Updated bower.json to 1.0.0',
37-
'✔ Updated component.json to 1.0.0',
36+
`${check} Updated package.json to 1.0.0`,
37+
`${check} Updated bower.json to 1.0.0`,
38+
`${check} Updated component.json to 1.0.0`,
3839
]);
3940

4041
files.json('package.json').should.deep.equal({ version: '1.0.0' });
@@ -51,7 +52,7 @@ describe('bump --major', () => {
5152
output.status.should.equal(0);
5253

5354
output.lines.should.deep.equal([
54-
'✔ Updated package.json to 1.0.0',
55+
`${check} Updated package.json to 1.0.0`,
5556
]);
5657

5758
files.json('package.json').should.deep.equal({ version: '1.0.0' });
@@ -66,7 +67,7 @@ describe('bump --major', () => {
6667
output.status.should.equal(0);
6768

6869
output.lines.should.deep.equal([
69-
'✔ Updated package.json to 2.0.0',
70+
`${check} Updated package.json to 2.0.0`,
7071
]);
7172

7273
files.json('package.json').should.deep.equal({ version: '2.0.0' });
@@ -81,7 +82,7 @@ describe('bump --major', () => {
8182
output.status.should.equal(0);
8283

8384
output.lines.should.deep.equal([
84-
'✔ Updated package.json to 2.0.0',
85+
`${check} Updated package.json to 2.0.0`,
8586
]);
8687

8788
files.json('package.json').should.deep.equal({ version: '2.0.0' });
@@ -96,7 +97,7 @@ describe('bump --major', () => {
9697
output.status.should.equal(0);
9798

9899
output.lines.should.deep.equal([
99-
'✔ Updated package.json to 2.0.0',
100+
`${check} Updated package.json to 2.0.0`,
100101
]);
101102

102103
files.json('package.json').should.deep.equal({ version: '2.0.0' });

test/specs/minor.spec.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const cli = require('../fixtures/cli');
44
const files = require('../fixtures/files');
5+
const check = require('../fixtures/check');
56
const chai = require('chai');
67

78
chai.should();
@@ -32,9 +33,9 @@ describe('bump --minor', () => {
3233
output.status.should.equal(0);
3334

3435
output.lines.should.deep.equal([
35-
'✔ Updated package.json to 0.1.0',
36-
'✔ Updated bower.json to 0.1.0',
37-
'✔ Updated component.json to 0.1.0',
36+
`${check} Updated package.json to 0.1.0`,
37+
`${check} Updated bower.json to 0.1.0`,
38+
`${check} Updated component.json to 0.1.0`,
3839
]);
3940

4041
files.json('package.json').should.deep.equal({ version: '0.1.0' });
@@ -51,7 +52,7 @@ describe('bump --minor', () => {
5152
output.status.should.equal(0);
5253

5354
output.lines.should.deep.equal([
54-
'✔ Updated package.json to 0.1.0',
55+
`${check} Updated package.json to 0.1.0`,
5556
]);
5657

5758
files.json('package.json').should.deep.equal({ version: '0.1.0' });
@@ -66,7 +67,7 @@ describe('bump --minor', () => {
6667
output.status.should.equal(0);
6768

6869
output.lines.should.deep.equal([
69-
'✔ Updated package.json to 1.3.0',
70+
`${check} Updated package.json to 1.3.0`,
7071
]);
7172

7273
files.json('package.json').should.deep.equal({ version: '1.3.0' });
@@ -81,7 +82,7 @@ describe('bump --minor', () => {
8182
output.status.should.equal(0);
8283

8384
output.lines.should.deep.equal([
84-
'✔ Updated package.json to 1.3.0',
85+
`${check} Updated package.json to 1.3.0`,
8586
]);
8687

8788
files.json('package.json').should.deep.equal({ version: '1.3.0' });
@@ -96,7 +97,7 @@ describe('bump --minor', () => {
9697
output.status.should.equal(0);
9798

9899
output.lines.should.deep.equal([
99-
'✔ Updated package.json to 1.3.0',
100+
`${check} Updated package.json to 1.3.0`,
100101
]);
101102

102103
files.json('package.json').should.deep.equal({ version: '1.3.0' });

test/specs/patch.spec.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const cli = require('../fixtures/cli');
44
const files = require('../fixtures/files');
5+
const check = require('../fixtures/check');
56
const chai = require('chai');
67

78
chai.should();
@@ -32,9 +33,9 @@ describe('bump --patch', () => {
3233
output.status.should.equal(0);
3334

3435
output.lines.should.deep.equal([
35-
'✔ Updated package.json to 0.0.1',
36-
'✔ Updated bower.json to 0.0.1',
37-
'✔ Updated component.json to 0.0.1',
36+
`${check} Updated package.json to 0.0.1`,
37+
`${check} Updated bower.json to 0.0.1`,
38+
`${check} Updated component.json to 0.0.1`,
3839
]);
3940

4041
files.json('package.json').should.deep.equal({ version: '0.0.1' });
@@ -51,7 +52,7 @@ describe('bump --patch', () => {
5152
output.status.should.equal(0);
5253

5354
output.lines.should.deep.equal([
54-
'✔ Updated package.json to 0.0.1',
55+
`${check} Updated package.json to 0.0.1`,
5556
]);
5657

5758
files.json('package.json').should.deep.equal({ version: '0.0.1' });
@@ -66,7 +67,7 @@ describe('bump --patch', () => {
6667
output.status.should.equal(0);
6768

6869
output.lines.should.deep.equal([
69-
'✔ Updated package.json to 1.2.4',
70+
`${check} Updated package.json to 1.2.4`,
7071
]);
7172

7273
files.json('package.json').should.deep.equal({ version: '1.2.4' });
@@ -81,7 +82,7 @@ describe('bump --patch', () => {
8182
output.status.should.equal(0);
8283

8384
output.lines.should.deep.equal([
84-
'✔ Updated package.json to 1.2.3',
85+
`${check} Updated package.json to 1.2.3`,
8586
]);
8687

8788
files.json('package.json').should.deep.equal({ version: '1.2.3' });
@@ -96,7 +97,7 @@ describe('bump --patch', () => {
9697
output.status.should.equal(0);
9798

9899
output.lines.should.deep.equal([
99-
'✔ Updated package.json to 1.2.3',
100+
`${check} Updated package.json to 1.2.3`,
100101
]);
101102

102103
files.json('package.json').should.deep.equal({ version: '1.2.3' });

test/specs/premajor.spec.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const cli = require('../fixtures/cli');
44
const files = require('../fixtures/files');
5+
const check = require('../fixtures/check');
56
const chai = require('chai');
67

78
chai.should();
@@ -32,9 +33,9 @@ describe('bump --premajor', () => {
3233
output.status.should.equal(0);
3334

3435
output.lines.should.deep.equal([
35-
'✔ Updated package.json to 1.0.0-beta.0',
36-
'✔ Updated bower.json to 1.0.0-beta.0',
37-
'✔ Updated component.json to 1.0.0-beta.0',
36+
`${check} Updated package.json to 1.0.0-beta.0`,
37+
`${check} Updated bower.json to 1.0.0-beta.0`,
38+
`${check} Updated component.json to 1.0.0-beta.0`,
3839
]);
3940

4041
files.json('package.json').should.deep.equal({ version: '1.0.0-beta.0' });
@@ -51,7 +52,7 @@ describe('bump --premajor', () => {
5152
output.status.should.equal(0);
5253

5354
output.lines.should.deep.equal([
54-
'✔ Updated package.json to 1.0.0-beta.0',
55+
`${check} Updated package.json to 1.0.0-beta.0`,
5556
]);
5657

5758
files.json('package.json').should.deep.equal({ version: '1.0.0-beta.0' });
@@ -66,7 +67,7 @@ describe('bump --premajor', () => {
6667
output.status.should.equal(0);
6768

6869
output.lines.should.deep.equal([
69-
'✔ Updated package.json to 2.0.0-beta.0',
70+
`${check} Updated package.json to 2.0.0-beta.0`,
7071
]);
7172

7273
files.json('package.json').should.deep.equal({ version: '2.0.0-beta.0' });
@@ -81,7 +82,7 @@ describe('bump --premajor', () => {
8182
output.status.should.equal(0);
8283

8384
output.lines.should.deep.equal([
84-
'✔ Updated package.json to 2.0.0-beta.0',
85+
`${check} Updated package.json to 2.0.0-beta.0`,
8586
]);
8687

8788
files.json('package.json').should.deep.equal({ version: '2.0.0-beta.0' });
@@ -96,7 +97,7 @@ describe('bump --premajor', () => {
9697
output.status.should.equal(0);
9798

9899
output.lines.should.deep.equal([
99-
'✔ Updated package.json to 2.0.0-alpha.0',
100+
`${check} Updated package.json to 2.0.0-alpha.0`,
100101
]);
101102

102103
files.json('package.json').should.deep.equal({ version: '2.0.0-alpha.0' });

test/specs/preminor.spec.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const cli = require('../fixtures/cli');
44
const files = require('../fixtures/files');
5+
const check = require('../fixtures/check');
56
const chai = require('chai');
67

78
chai.should();
@@ -32,9 +33,9 @@ describe('bump --preminor', () => {
3233
output.status.should.equal(0);
3334

3435
output.lines.should.deep.equal([
35-
'✔ Updated package.json to 0.1.0-beta.0',
36-
'✔ Updated bower.json to 0.1.0-beta.0',
37-
'✔ Updated component.json to 0.1.0-beta.0',
36+
`${check} Updated package.json to 0.1.0-beta.0`,
37+
`${check} Updated bower.json to 0.1.0-beta.0`,
38+
`${check} Updated component.json to 0.1.0-beta.0`,
3839
]);
3940

4041
files.json('package.json').should.deep.equal({ version: '0.1.0-beta.0' });
@@ -51,7 +52,7 @@ describe('bump --preminor', () => {
5152
output.status.should.equal(0);
5253

5354
output.lines.should.deep.equal([
54-
'✔ Updated package.json to 0.1.0-beta.0',
55+
`${check} Updated package.json to 0.1.0-beta.0`,
5556
]);
5657

5758
files.json('package.json').should.deep.equal({ version: '0.1.0-beta.0' });
@@ -66,7 +67,7 @@ describe('bump --preminor', () => {
6667
output.status.should.equal(0);
6768

6869
output.lines.should.deep.equal([
69-
'✔ Updated package.json to 1.3.0-beta.0',
70+
`${check} Updated package.json to 1.3.0-beta.0`,
7071
]);
7172

7273
files.json('package.json').should.deep.equal({ version: '1.3.0-beta.0' });
@@ -81,7 +82,7 @@ describe('bump --preminor', () => {
8182
output.status.should.equal(0);
8283

8384
output.lines.should.deep.equal([
84-
'✔ Updated package.json to 1.3.0-beta.0',
85+
`${check} Updated package.json to 1.3.0-beta.0`,
8586
]);
8687

8788
files.json('package.json').should.deep.equal({ version: '1.3.0-beta.0' });
@@ -96,7 +97,7 @@ describe('bump --preminor', () => {
9697
output.status.should.equal(0);
9798

9899
output.lines.should.deep.equal([
99-
'✔ Updated package.json to 1.3.0-alpha.0',
100+
`${check} Updated package.json to 1.3.0-alpha.0`,
100101
]);
101102

102103
files.json('package.json').should.deep.equal({ version: '1.3.0-alpha.0' });

0 commit comments

Comments
 (0)