Skip to content

Commit 6fc9338

Browse files
committed
used myTrim
1 parent fcfbf2b commit 6fc9338

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

tests/00-module/002-dc-up.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ describe('docker-compose up tests', function () {
1212
var file = __dirname + '/../docker-compose.yaml';
1313
it('Execute command up', done => {
1414

15-
var expected = fs.readFileSync('./tests/00-module/expected/dc-up.expected.txt', 'utf-8').trim();
15+
var expected = fs.readFileSync('./tests/00-module/expected/dc-up.expected.txt', 'utf-8');
1616
module.dockerComposeUp(file).then(out => {
17-
expect(out.trim()).to.equal(expected);
17+
expect(out.replace(/^\s+|\s+$/gm, '')).to.equal(expected.replace(/^\s+|\s+$/gm, ''));
1818
done();
1919
}, done);
2020

tests/00-module/003-dc-stop.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ describe('docker-compose stop tests', function () {
1212
var file = __dirname + '/../docker-compose.yaml';
1313
it('Execute command stop', done => {
1414

15-
var expected = fs.readFileSync('./tests/00-module/expected/dc-stop.expected.txt', 'utf-8').trim();
15+
var expected = fs.readFileSync('./tests/00-module/expected/dc-stop.expected.txt', 'utf-8');
1616
module.dockerComposeStop(file).then(out => {
17-
expect(out.trim()).to.equal(expected);
17+
expect(out.replace(/^\s+|\s+$/gm, '')).to.equal(expected.replace(/^\s+|\s+$/gm, ''));
1818
done();
1919
}, done);
2020

tests/00-module/004-dc-start.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ describe('docker-compose start tests', function () {
1212
var file = __dirname + '/../docker-compose.yaml';
1313
it('Execute command start', done => {
1414

15-
var expected = fs.readFileSync('./tests/00-module/expected/dc-start.expected.txt', 'utf-8').trim();
15+
var expected = fs.readFileSync('./tests/00-module/expected/dc-start.expected.txt', 'utf-8');
1616
module.dockerComposeStart(file).then(out => {
17-
expect(out.trim()).to.equal(expected);
17+
expect(out.replace(/^\s+|\s+$/gm, '')).to.equal(expected.replace(/^\s+|\s+$/gm, ''));
1818
done();
1919
}, done);
2020

tests/00-module/005-dc-down.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ describe('docker-compose down tests', function () {
1212
var file = __dirname + '/../docker-compose.yaml';
1313
it('Execute command down', done => {
1414

15-
var expected = fs.readFileSync('./tests/00-module/expected/dc-down.expected.txt', 'utf-8').trim();
15+
var expected = fs.readFileSync('./tests/00-module/expected/dc-down.expected.txt', 'utf-8');
1616
module.dockerComposeDown(file).then(out => {
17-
expect(out.trim()).to.equal(expected);
17+
expect(out.replace(/^\s+|\s+$/gm, '')).to.equal(expected.replace(/^\s+|\s+$/gm, ''));
1818
done();
1919
}, done);
2020

0 commit comments

Comments
 (0)