diff --git a/src/bin/start.js b/src/bin/start.js index 3aea114..7d6b5b7 100755 --- a/src/bin/start.js +++ b/src/bin/start.js @@ -19,7 +19,7 @@ if (!Array.isArray(services)) { } if (!namedArguments.expect) { - namedArguments.expect = 200 + namedArguments.expect = -1 } utils.printArguments({ services, test, namedArguments }) diff --git a/src/index.js b/src/index.js index 9c2c44c..01c049c 100644 --- a/src/index.js +++ b/src/index.js @@ -38,7 +38,7 @@ function waitAndRun ({ start, url, runFn, namedArguments }) { ) const isSuccessfulHttpCode = status => (status >= 200 && status < 300) || status === 304 - const validateStatus = namedArguments.expect + const validateStatus = namedArguments.expect !== -1 ? status => status === namedArguments.expect : isSuccessfulHttpCode diff --git a/src/utils.js b/src/utils.js index abd1a69..27416aa 100644 --- a/src/utils.js +++ b/src/utils.js @@ -244,9 +244,9 @@ function printArguments ({ services, test, namedArguments }) { services.forEach((service, k) => { console.log('%d: starting server using command "%s"', k + 1, service.start) console.log( - 'and when url "%s" is responding with HTTP status code %d', + 'and when url "%s" is responding with HTTP status code %s', service.url, - namedArguments.expect + namedArguments.expect === -1 ? '2xx or 304' : namedArguments.expect.toString() ) })