MCPcopy
hub / github.com/TypeStrong/ts-node / computeTitle

Function computeTitle

src/test/testlib.ts:146–164  ·  view source on GitHub ↗
(
    title: string | undefined,
    macros?: AvaMacro<Args, any>[],
    ...args: Args
  )

Source from the content-addressed store, hash-verified

144 let hookDeclared = false;
145 let suiteOrTestDeclared = false;
146 function computeTitle<Args extends any[]>(
147 title: string | undefined,
148 macros?: AvaMacro<Args, any>[],
149 ...args: Args
150 ) {
151 for (const macro of macros ?? []) {
152 if (macro.title) {
153 title = macro.title(title, ...args);
154 }
155 }
156 assert(title);
157 // return `${ titlePrefix }${ separator }${ title }`;
158 if (titlePrefix != null && title != null) {
159 return `${titlePrefix}${separator}${title}`;
160 }
161 if (titlePrefix == null && title != null) {
162 return title;
163 }
164 }
165 function parseArgs(args: any[]) {
166 const title =
167 typeof args[0] === 'string' ? (args.shift() as string) : undefined;

Callers 2

declareTestFunction · 0.85
createTestInterfaceFunction · 0.85

Calls 1

titleMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…