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

Function captureTestFile

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

Source from the content-addressed store, hash-verified

236
237/** The *.test.ts file that called scenario(), from the registration stack. */
238const captureTestFile = (): string | undefined => {
239 const stack = new Error().stack ?? "";
240 for (const line of stack.split("\n")) {
241 const match = /\(?(?:file:\/\/)?(\/[^():]+\.test\.ts)/.exec(line);
242 if (match) return match[1];
243 }
244 return undefined;
245};
246
247/**
248 * 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