diff --git a/packages/babel-helper-transform-fixture-test-runner/test/index.js b/packages/babel-helper-transform-fixture-test-runner/test/index.js index 2ec3d6bb2cce..b0f220380a4e 100644 --- a/packages/babel-helper-transform-fixture-test-runner/test/index.js +++ b/packages/babel-helper-transform-fixture-test-runner/test/index.js @@ -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"); + }); });