Skip to content

Commit

Permalink
test: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Oct 16, 2019
1 parent d234ff6 commit 6b6b5ef
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/babel-helper-transform-fixture-test-runner/test/index.js
Expand Up @@ -35,4 +35,17 @@ describe("helper-transform-fixture-test-runner", function() {
);
}
});
it("should print correct trace position when error is thrown in the first line", () => {
const opts = {
filename: `${__filename}.fake4`,
};
runCodeInTestContext(
`try { throw new Error()} catch (e) {
opts.stack = e.stack
}
`,
opts,
);
expect(opts.stack).toContain(opts.filename + ":1:13");
});
});

0 comments on commit 6b6b5ef

Please sign in to comment.