Skip to content

Commit 87638eb

Browse files
committed
test: output client logs on test failure
1 parent ca6aaa2 commit 87638eb

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/commands/start.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ import { deleteNetwork, findContainer } from '../utils/docker'
1212
chaiUse(chaiAsPromised)
1313
let testFailed = false
1414

15-
async function runCommand(args: string): Promise<ReturnType<typeof runCommandRaw>> {
15+
async function runCommand (args: string): Promise<ReturnType<typeof runCommandRaw>> {
1616
const result = await runCommandRaw(args)
1717

1818
if (result.error) {
19-
console.log(result.stdout)
20-
console.error(result.stderr)
19+
console.log('============\n=> ERROR:', result.error)
20+
console.log('============\n=> STDOUT:', result.stdout)
21+
console.error('============\n=> STDERR:', result.stderr)
2122
}
2223

2324
return result
@@ -72,7 +73,9 @@ describe('start command', () => {
7273
const containers = await docker.listContainers()
7374
for (const c of containers) console.log(` - ${c.Names.join(', ')}`)
7475

75-
await runCommand('logs client')
76+
const { stdout } = await runCommand('logs client')
77+
console.log('Client logs:\n', stdout)
78+
7679
}
7780

7881
await runCommand('stop')

0 commit comments

Comments
 (0)