Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveb-p committed May 29, 2019
1 parent 9c20179 commit 2e7663f
Show file tree
Hide file tree
Showing 7 changed files with 5,200 additions and 661 deletions.
9 changes: 8 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
{
"extends": "es/2015/server",
"extends": [
"es/2015/server",
"plugin:jest/recommended"
],
"rules": {
"no-console" :"off"
},
"plugins": ["jest"],
"env": {
"jest/globals": true
}
}
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ const composeOptionsToArgs = function (composeOptions) {
* @param {?(string[]|Array<string|string[]>)} [options.composeOptions]
*/
const execCompose = (command, args, options) => new Promise((resolve, reject) => {
if (typeof options === 'undefined') {
options = {};
}
const composeOptions = options.composeOptions || [];
const commandOptions = options.commandOptions || [];
let composeArgs = composeOptionsToArgs(composeOptions);
Expand Down Expand Up @@ -82,11 +85,11 @@ const execCompose = (command, args, options) => new Promise((resolve, reject) =>

childProc.on('exit', exitCode => {
result.exitCode = exitCode;
if (exitCode !== 0) {
return reject(result);
if (exitCode === 0) {
resolve(result);
} else {
reject(result);
}

return resolve(result);
});

if (options.log) {
Expand Down
Loading

0 comments on commit 2e7663f

Please sign in to comment.