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

ts-jest is not installed properly #59

Closed
Tallyb opened this issue Jul 11, 2017 · 10 comments
Closed

ts-jest is not installed properly #59

Tallyb opened this issue Jul 11, 2017 · 10 comments

Comments

@Tallyb
Copy link
Contributor

Tallyb commented Jul 11, 2017

The package.json configuration
"bundleDependencies": false,
is incorrect (array expected), and cause ts-jest to be incorrectly installed under inner node_modules, which in some cases may cause jest not to find it. Should be installed on top level node_modules

@thymikee
Copy link
Owner

Can you elaborate on this? I'm not sure what's this about

@Tallyb
Copy link
Contributor Author

Tallyb commented Jul 11, 2017

bundleDependencies structure has changed to contain an array. The value false is not valid.
I use npm 5.0.3 and the ts-jest was installed under jest-preset-angular/node_modules and not directly under node_modules.
I now see that this property is generated in my installed package.json, and does not exist on the original one, so it may be some local configuration that is misbehaving.
I am closing this issue.

@Tallyb Tallyb closed this as completed Jul 11, 2017
@dominique-mueller
Copy link

Well, I'm having the same issue here. ts-jest is expected under node_modules/ts-jest -- but actually lives under node_modules/jest-preset-angular/node_modules/ts-jest. I'm assuming it has either something to do with npm v5, or some other updated dependency.

I got it working by:

  • moving the jest.config.json Jest configuration file to the project root folder (before it was in a config subfolder)
  • installing ts-jest into the root node_modules folder by adding it as a devDependency to my project

Still, this seems like an actual issue - but I'm not sure where the issue comes from (this preset, ts-jest, jest) ...

@thymikee
Copy link
Owner

Does it happen with npm v3/4 or Yarn?

@Tallyb
Copy link
Contributor Author

Tallyb commented Jul 14, 2017

I am not using yarn, and it happened to me also with npm 4. Also with the new npm 5.2.0
@dominique-mueller - do you use it in a lerna project?

@Tallyb
Copy link
Contributor Author

Tallyb commented Jul 17, 2017

@thymikee maybe upgrading the tyoescript dev dependency will do the trick?

@thymikee
Copy link
Owner

@dominique-mueller you need to specify rootDir if your config is not in the root of your project (from where you run Jest). It's a bug in Jest 20, still unresolved

@thymikee
Copy link
Owner

@Tallyb my dev dependencies are not affecting your deps

@dominique-mueller
Copy link

@thymikee I'll try that one out, thanks!

dominique-mueller added a commit to dominique-mueller/angular-notifier that referenced this issue Jul 25, 2017
- Revert jest config path (by defining the rootDir property, see thymikee/jest-preset-angular#59)
@dominique-mueller
Copy link

@thymikee Awesome, defining the rootDir fixed it! Thanks so much!

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

3 participants