MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / renderTestListText

Function renderTestListText

src/commands/test.ts:7926–7967  ·  view source on GitHub ↗
(page: Page<CliTest>)

Source from the content-addressed store, hash-verified

7924}
7925
7926function renderTestListText(page: Page<CliTest>): string {
7927 if (page.items.length === 0) {
7928 return page.nextToken ? `No tests on this page.\nnextToken: ${page.nextToken}` : 'No tests.';
7929 }
7930 const idWidth = Math.max(2, ...page.items.map(t => t.id.length));
7931 const nameWidth = Math.max(4, ...page.items.map(t => t.name.length));
7932 const typeWidth = 8;
7933 const fromWidth = 6;
7934 const statusWidth = 9;
7935
7936 const header =
7937 pad('ID', idWidth) +
7938 ' ' +
7939 pad('NAME', nameWidth) +
7940 ' ' +
7941 pad('TYPE', typeWidth) +
7942 ' ' +
7943 pad('FROM', fromWidth) +
7944 ' ' +
7945 pad('STATUS', statusWidth) +
7946 ' ' +
7947 'UPDATED';
7948
7949 const rows = page.items.map(
7950 t =>
7951 pad(t.id, idWidth) +
7952 ' ' +
7953 pad(t.name, nameWidth) +
7954 ' ' +
7955 pad(t.type, typeWidth) +
7956 ' ' +
7957 pad(t.createdFrom, fromWidth) +
7958 ' ' +
7959 pad(t.status, statusWidth) +
7960 ' ' +
7961 t.updatedAt,
7962 );
7963
7964 const lines = [header, ...rows];
7965 if (page.nextToken) lines.push('', `nextToken: ${page.nextToken}`);
7966 return lines.join('\n');
7967}
7968
7969function renderTestText(t: CliTest): string {
7970 // M2.1 piece 4: when the facade ships `projectName`, lead with a

Callers 1

runListFunction · 0.85

Calls 1

padFunction · 0.70

Tested by

no test coverage detected