diff --git a/src/lib/SwaggerModem.js b/src/lib/SwaggerModem.js index ff12488..aed7421 100644 --- a/src/lib/SwaggerModem.js +++ b/src/lib/SwaggerModem.js @@ -93,9 +93,8 @@ class SwaggerModem extends Modem { * in a URL. */ - if (options.options._query.stream === 'true') { - options.isStream = true - } + options.isStream = ['follow', 'logs', 'stream'] + .some(key => options.options._query[key] === 'true') /** * The options are ready to go: diff --git a/test/SwaggerModem.js b/test/SwaggerModem.js index 70bbb31..da628b2 100644 --- a/test/SwaggerModem.js +++ b/test/SwaggerModem.js @@ -39,7 +39,6 @@ tap.test('SwaggerModem', async t => { const id = res.Id req = builder.ContainerAttach({ id, - logs: true, stream: false, stdout: true, stderr: true @@ -49,9 +48,14 @@ tap.test('SwaggerModem', async t => { /** * Verify that we didn't get a streaming object: + * + * We could test against an empty string but when the test fails we will + * get the entire streaming object displayed as 'not matching' the empty + * string. Checking the type means that we get a much more compact error + * message! */ - t.equal(res, '') + t.type(res, 'string') t.comment('deleting the created container')