From 134752cb80a245d1afd08008cfb541c1e199df03 Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Mon, 29 Apr 2019 15:18:28 +0200 Subject: [PATCH] Add test for returning the correct exit code --- test/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/index.js b/test/index.js index c344ade..346a24e 100644 --- a/test/index.js +++ b/test/index.js @@ -53,6 +53,12 @@ test('ensure container gets started', async assert => { assert.end(); }); +test('ensure exit code is returned correctly', async assert => { + assert.equal(0, (await compose.down({ cwd: path.join(__dirname), log: true })).exitCode); + assert.equal(0, (await compose.upAll({ cwd: path.join(__dirname), log: true })).exitCode); + assert.equal(1, (await compose.logs('non_existent_service', { cwd: path.join(__dirname) })).exitCode); +}); + test('ensure container gets started with --build option', async assert => { await compose.down({ cwd: path.join(__dirname), log: true, config: 'docker-compose-build.yml' }); await compose.upAll({ cwd: path.join(__dirname), log: true, config: 'docker-compose-build.yml', commandOptions: [ '--build' ]});