Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decorators break line reporting #463

Closed
mikebm opened this issue Mar 6, 2018 · 1 comment
Closed

Decorators break line reporting #463

mikebm opened this issue Mar 6, 2018 · 1 comment

Comments

@mikebm
Copy link

mikebm commented Mar 6, 2018

  • Issue
    Breakage started in 22.0.1. Possibly by this PR

When you have a class or method decorator in your typescript, then the jest line reporting is incorrect.

Unsure for exact reasons, but our package.json had the following in it which also causes this breakage. Removing the decorators causes it to start working. Leaving the decorators and removing the following from package.json also fixes it.

	"unmockedModulePathPatterns": [
		"<rootDir>/node_modules/ts-jest/.*"
	],

Work around:
npm install source-map-support --save-dev
In your setupTestFrameworkScriptFile, add require('source-map-support').install();

  • Expected behavior
    The reported line error should match up with the correct line number.

  • Link to a minimal repo that reproduces this issue
    git clone https://github.com/mikebm/jestbug.git
    cd jestbug
    npm install
    npm test

@mikebm
Copy link
Author

mikebm commented Mar 6, 2018

For unknown reasons on why we had this in our package.json, I was able to remove it and everything passes. Maybe it was necessary for something for an older version?

Now that this is removed, this issue is no longer a problem. I will leave the ticket open in case anyone feels like digging further, but feel free to close it otherwise.

"unmockedModulePathPatterns": [
"/node_modules/ts-jest/.*"
],

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants