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

Sourcemaps break error reporting in Jest #1372

Closed
TimonVS opened this issue Dec 21, 2017 · 8 comments
Closed

Sourcemaps break error reporting in Jest #1372

TimonVS opened this issue Dec 21, 2017 · 8 comments

Comments

@TimonVS
Copy link

TimonVS commented Dec 21, 2017

Sourcemaps seem to break error reporting in Jest. Every time TypeORM throw an error while running tests with Jest I get something like this:

ENOENT: no such file or directory, open '/Users/timon/Projects/typeorm-jest-bug/src/metadata-builder/EntityMetadataValidator.ts'

Removing the sourcemap for EntityMetadataValidator.ts seems to fix the problem. It also only happens in Jest, when I run the code in Node it works perfectly fine.

I made a repository as to easily reproduce the bug: https://github.com/TimonVS/typeorm-jest-bug

@pleerock
Copy link
Member

Im not familiar with jest and don't know how it works. And its not clear to me why it uses your project path, e.g.

'/Users/.../www/clonned/typeorm-jest-bug/src/error/DataTypeNotSupportedError.ts'

Can you try to debug and find a source of problem?

@pleerock
Copy link
Member

Adding jest expert @hmil

@hmil
Copy link
Contributor

hmil commented Dec 22, 2017

I'm no Jest expert but your test repo gets fixed by downgrading jest and ts-jest to versions 21.x.x

--- a/package.json
+++ b/package.json
@@ -5,8 +5,8 @@
   "devDependencies": {
     "@types/jest": "^21.1.8",
     "@types/node": "^8.0.29",
-    "jest": "^22.0.3",
-    "ts-jest": "^22.0.0",
+    "jest": "^21.0.0",
+    "ts-jest": "^21.0.0",
     "ts-node": "3.3.0",
     "typescript": "2.5.2"
   },

Try to isolate whether it's due to ts-jest or jest and file an issue over there.

@TimonVS
Copy link
Author

TimonVS commented Dec 22, 2017

Yep, it seems to be an issue with Jest itself. I'll dive deeper and file an issue in the Jest repo. Thanks for the help!

@TimonVS TimonVS closed this as completed Dec 22, 2017
@pleerock
Copy link
Member

thank you for your help @hmil

@lightsofapollo
Copy link

Fairly sure this is related to jestjs/jest#5121

@91debug
Copy link

91debug commented Jan 17, 2018

thank you @hmil bro!

@canhnht
Copy link

canhnht commented Jan 19, 2018

Thank you @hmil !

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

6 participants