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 85fe942 commit 1f6138f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/jest-jasmine2/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ async function jasmine2(
fn: Global.TestFn,
timeout?: number,
) => {
const stack = getCallsite(1, runtime.getSourceMaps());
let stack = getCallsite(1, runtime.getSourceMaps());
const it = original(testName, fn, timeout);

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

Expand Down

0 comments on commit 1f6138f

Please sign in to comment.