Skip to content

Commit 5172c47

Browse files
committed
test: log node-pty failure stdout
1 parent 1e8f17b commit 5172c47

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

tests/specs/cli.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,10 @@ export default testSuite(({ describe }, node: NodeApis) => {
326326

327327
onTestFail(() => {
328328
p.kill();
329-
console.log(p.logs);
329+
console.log({
330+
logs: p.logs,
331+
stdout: p.getStdout(),
332+
});
330333
});
331334

332335
expect(await p.output).toMatch(/EXIT_CODE:\s+130/);
@@ -351,7 +354,10 @@ export default testSuite(({ describe }, node: NodeApis) => {
351354

352355
onTestFail(() => {
353356
p.kill();
354-
console.log(p.logs);
357+
console.log({
358+
logs: p.logs,
359+
stdout: p.getStdout(),
360+
});
355361
});
356362

357363
expectMatchInOrder(await p.output, [
@@ -382,7 +388,10 @@ export default testSuite(({ describe }, node: NodeApis) => {
382388

383389
onTestFail(() => {
384390
p.kill();
385-
console.log(p.logs);
391+
console.log({
392+
logs: p.logs,
393+
stdout: p.getStdout(),
394+
});
386395
});
387396

388397
expect(await p.output).toMatch(/EXIT_CODE:\s+130/);

tests/utils/pty-shell/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,6 @@ export const ptyShell = (
127127
return Object.assign(childProcess, {
128128
output,
129129
logs,
130+
getStdout: () => buffer,
130131
});
131132
};

0 commit comments

Comments
 (0)