Skip to content

Jest giving wrong line number for error #5446

Closed
@zwhitchcox

Description

@zwhitchcox

Do you want to request a feature or report a bug?
Bug report

What is the current behavior?
It gives the line number a few lines above where the error actually is. The error should be on line 7, where Object.assign is run, but it is giving the error on line 10.

Sourcemaps appear to be working, but this particular instance, they didn't for some reason.

I made a repo https://github.com/zwhitchcox/jest-bug, you just have to git clone, yarn install and yarn test

What is the expected behavior?
To give the correct line number

Please provide your exact Jest configuration and mention your Jest, node,
yarn/npm version and operating system.

Node: v8.4.0
Jest: 22.1.4
OS: GalliumOS (basically Ubuntu 14.04)
yarn: 1.1.0

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