MCPcopy
hub / github.com/jestjs/jest / keyToTestName

Function keyToTestName

packages/jest-snapshot-utils/src/utils.ts:125–131  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

123 `${normalizeTestNameForKey(testName)} ${count}`;
124
125export const keyToTestName = (key: string): string => {
126 if (!/ \d+$/.test(key)) {
127 throw new Error('Snapshot keys must end with a number.');
128 }
129 const testNameWithoutCount = key.replace(/ \d+$/, '');
130 return denormalizeTestNameFromKey(testNameWithoutCount);
131};
132
133export const getSnapshotData = (
134 snapshotPath: string,

Callers 2

utils.test.tsFile · 0.90

Calls 2

testMethod · 0.45

Tested by

no test coverage detected