Skip to content

Wrong line number in stack trace #6108

Closed
@randing89

Description

@randing89

I've tried to reproduce this issue with minimum code in https://github.com/randing89/line-number-bug

The line number is incorrect unless retainLines was set in .babelrc. However, I don't think it is expected as babel-jest has already set the sourceMaps to both in https://github.com/facebook/jest/blob/master/packages/babel-jest/src/index.js#L78

It looks like the exception thrown out from https://github.com/facebook/jest/blob/master/packages/jest-runtime/src/index.js#L555 was not transformed with source map. Or maybe I just crewed up with the configuration.

Screenshot:
image

System info:

npx: installed 1 in 1.62s

  System:
    OS: macOS High Sierra 10.13.4
    CPU: x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  Binaries:
    Node: 10.0.0 - ~/.nvm/versions/node/v10.0.0/bin/node
    Yarn: 1.5.1 - ~/.yarn/bin/yarn
    npm: 5.6.0 - ~/.nvm/versions/node/v10.0.0/bin/npm
  npmPackages:
    jest: ^22.4.3 => 22.4.3 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions