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

Function declareTest

src/test/testlib.ts:197–224  ·  view source on GitHub ↗

* @param avaDeclareFunction either test or test.serial

(
    title: string | undefined,
    macros: AvaMacro<any[], Context>[],
    avaDeclareFunction: Function & { skip: Function },
    args: any[],
    skip = false
  )

Source from the content-addressed store, hash-verified

195 * @param avaDeclareFunction either test or test.serial
196 */
197 function declareTest(
198 title: string | undefined,
199 macros: AvaMacro<any[], Context>[],
200 avaDeclareFunction: Function & { skip: Function },
201 args: any[],
202 skip = false
203 ) {
204 const wrappedMacros = macros.map((macro) => {
205 return async function (t: ExecutionContext<Context>, ...args: any[]) {
206 return concurrencyLimiter(
207 errorPostprocessor(async () => {
208 let i = 0;
209 for (const func of beforeEachFunctions) {
210 await func(t);
211 i++;
212 }
213 return macro(t, ...args);
214 })
215 );
216 };
217 });
218 const computedTitle = computeTitle(title, macros, ...args);
219 (automaticallySkip || skip ? avaDeclareFunction.skip : avaDeclareFunction)(
220 computedTitle,
221 wrappedMacros,
222 ...args
223 );
224 }
225 function test(...inputArgs: any[]) {
226 assertOrderingForDeclaringTest();
227 // TODO is this safe to disable?

Callers 2

testFunction · 0.70
createTestInterfaceFunction · 0.70

Calls 3

errorPostprocessorFunction · 0.85
macroFunction · 0.85
computeTitleFunction · 0.85

Tested by 1

testFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…