mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-13 08:15:14 +02:00
fix(cli): preserve tree continuation guides
This commit is contained in:
parent
39f0320c2b
commit
5e057f97e3
2 changed files with 12 additions and 4 deletions
|
|
@ -88,7 +88,13 @@ describe('formatCommandTree', () => {
|
|||
aliases: [],
|
||||
arguments: [],
|
||||
children: [
|
||||
{ name: 'beta', description: 'b', aliases: [], arguments: [], children: [] },
|
||||
{
|
||||
name: 'beta',
|
||||
description: 'b',
|
||||
aliases: [],
|
||||
arguments: [],
|
||||
children: [{ name: 'leaf', description: 'l', aliases: [], arguments: [], children: [] }],
|
||||
},
|
||||
{
|
||||
name: 'alpha',
|
||||
description: 'a',
|
||||
|
|
@ -101,7 +107,8 @@ describe('formatCommandTree', () => {
|
|||
const lines = formatCommandTree(tree).trimEnd().split('\n');
|
||||
expect(lines[0]).toMatch(/^root\s+top$/);
|
||||
expect(lines[1]).toMatch(/^ ├── beta\s+b$/);
|
||||
expect(lines[2]).toMatch(/^ └── alpha <id> \(al\)\s+a$/);
|
||||
expect(lines[3]).toMatch(/^ └── inner\s+i$/);
|
||||
expect(lines[2]).toMatch(/^ │ └── leaf\s+l$/);
|
||||
expect(lines[3]).toMatch(/^ └── alpha <id> \(al\)\s+a$/);
|
||||
expect(lines[4]).toMatch(/^ └── inner\s+i$/);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue