Skip to content

Commit

Permalink
Add hacky fix for bad each location in Jasmine
Browse files Browse the repository at this point in the history
  • Loading branch information
apexskier committed Aug 16, 2020
1 parent 8100b47 commit fd208c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/jest-jasmine2/src/index.ts
Expand Up @@ -50,9 +50,12 @@ async function jasmine2(
if (config.testLocationInResults === true) {
function wrapIt(original: (...args: Array<unknown>) => unknown) {
return (...args: Array<unknown>) => {
const stack = getCallsite(1, runtime.getSourceMaps());
let stack = getCallsite(1, runtime.getSourceMaps());
const it = original(...args);

if (stack.getFileName().includes('/jest-each/')) {
stack = getCallsite(4, runtime.getSourceMaps());
}
// @ts-expect-error
it.result.__callsite = stack;

Expand Down

0 comments on commit fd208c7

Please sign in to comment.