Skip to content

Commit 554a89b

Browse files
committed
Adds a function to get the name of the running cover function
1 parent 11537ff commit 554a89b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

core/Run.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,15 @@ namespace Moduless
207207
return true;
208208
}
209209

210+
/**
211+
* Returns the name of the cover function currently being tested.
212+
*/
213+
export function getRunningFunctionName()
214+
{
215+
return runningFunctionName;
216+
}
217+
let runningFunctionName = "";
218+
210219
/** */
211220
export async function runSingleCover(
212221
coverName: string,
@@ -216,7 +225,9 @@ namespace Moduless
216225
return;
217226

218227
const coverFunctionName = coverName.replace(coverFnPrefixReg, "");
228+
runningFunctionName = coverFunctionName;
219229
let coverResult = coverFunction();
230+
runningFunctionName = "";
220231

221232
if (coverResult === undefined || coverResult === null)
222233
{

0 commit comments

Comments
 (0)