mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-22 08:38:08 +02:00
feat(cli): add Slack community CTA on errors, crashes, setup, and help (#277)
* feat(cli): show Slack CTA on help and unexpected errors * feat(cli): show Slack CTA after crashes * feat(setup): show Slack community note after setup * chore: refresh Python lockfile versions
This commit is contained in:
parent
6b2f7c3365
commit
66517fc320
14 changed files with 350 additions and 29 deletions
40
packages/cli/test/io/tty.test.ts
Normal file
40
packages/cli/test/io/tty.test.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { isWritableTtyOutput } from '../../src/io/tty.js';
|
||||
|
||||
describe('isWritableTtyOutput', () => {
|
||||
it('accepts writable TTY-like output', () => {
|
||||
const output = {
|
||||
isTTY: true,
|
||||
columns: 80,
|
||||
on: () => undefined,
|
||||
write: () => undefined,
|
||||
};
|
||||
|
||||
expect(isWritableTtyOutput(output)).toBe(true);
|
||||
});
|
||||
|
||||
it('rejects non-TTY output', () => {
|
||||
expect(isWritableTtyOutput({ write: () => undefined })).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects output missing stream event support', () => {
|
||||
expect(
|
||||
isWritableTtyOutput({
|
||||
isTTY: true,
|
||||
columns: 80,
|
||||
write: () => undefined,
|
||||
}),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects output missing column metadata', () => {
|
||||
const output = {
|
||||
isTTY: true,
|
||||
on: () => undefined,
|
||||
write: () => undefined,
|
||||
};
|
||||
|
||||
expect(isWritableTtyOutput(output)).toBe(false);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue