approvals
Version:
Approval Tests Library - Capturing Human Intelligence
16 lines (14 loc) • 481 B
text/typescript
import { expect } from "@jest/globals";
import path from "path";
import { Namer } from "../../Namer";
import { convertToFilename } from "../../Core/Namer";
export function getJestNamer(): Namer {
const state = expect.getState();
const file = path.parse(state.testPath as string);
const testPath = file.dir;
const testFileName = file.name;
const testName = convertToFilename(
`${testFileName}.${state.currentTestName}`,
);
return new Namer(testPath, testName);
}