Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/lib/SwaggerModem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 6 additions & 2 deletions test/SwaggerModem.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')

Expand Down