Skip to content

Commit 0d6e8e3

Browse files
committed
changed expeted by indexOf quering
1 parent b98709a commit 0d6e8e3

File tree

8 files changed

+11
-19
lines changed

8 files changed

+11
-19
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ 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');
1615
module.dockerComposeUp(file).then(out => {
17-
expect(out.replace(/\\n|\\r/gm, '')).to.equal(expected.replace(/\\n|\\r/gm, ''));
16+
expect(out.indexOf('Creating network "tests_default" with the default driver')).to.not.equal(-1);
17+
expect(out.indexOf('Creating tests_mongo_1')).to.not.equal(-1);
18+
expect(out.indexOf('done')).to.not.equal(-1);
1819
done();
1920
}, done);
2021

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');
1615
module.dockerComposeStop(file).then(out => {
17-
expect(out.replace(/\\n|\\r/gm, '')).to.equal(expected.replace(/\\n|\\r/gm, ''));
16+
expect(out.indexOf('Stopping tests_mongo_1')).to.not.equal(-1);
17+
expect(out.indexOf('done')).to.not.equal(-1);
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');
1615
module.dockerComposeStart(file).then(out => {
17-
expect(out.replace(/\\n|\\r/gm, '')).to.equal(expected.replace(/\\n|\\r/gm, ''));
16+
expect(out.indexOf('Starting mongo')).to.not.equal(-1);
17+
expect(out.indexOf('done')).to.not.equal(-1);
1818
done();
1919
}, done);
2020

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ 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');
1615
module.dockerComposeDown(file).then(out => {
17-
expect(out.replace(/\\n|\\r/gm, '')).to.equal(expected.replace(/\\n|\\r/gm, ''));
16+
expect(out.indexOf('Stopping tests_mongo_1')).to.not.equal(-1);
17+
expect(out.indexOf('Removing tests_mongo_1')).to.not.equal(-1);
18+
expect(out.indexOf('done')).to.not.equal(-1);
19+
expect(out.indexOf('Removing network tests_default')).to.not.equal(-1);
1820
done();
1921
}, done);
2022

tests/00-module/expected/dc-down.expected.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/00-module/expected/dc-start.expected.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/00-module/expected/dc-stop.expected.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

tests/00-module/expected/dc-up.expected.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)