MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / captureTestFile

Function captureTestFile

e2e/src/scenario.ts:233–240  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

231
232/** The *.test.ts file that called scenario(), from the registration stack. */
233const captureTestFile = (): string | undefined => {
234 const stack = new Error().stack ?? "";
235 for (const line of stack.split("\n")) {
236 const match = /\(?(?:file:\/\/)?(\/[^():]+\.test\.ts)/.exec(line);
237 if (match) return match[1];
238 }
239 return undefined;
240};
241
242/**
243 * This scenario's code as a reader sees it: the file minus import statements

Callers 1

scenarioFunction · 0.85

Calls 1

execMethod · 0.80

Tested by

no test coverage detected