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

Don't throw if we can't find package.json #34

Merged
merged 1 commit into from
Dec 7, 2017

Conversation

samertm
Copy link
Contributor

@samertm samertm commented Dec 7, 2017

Don't throw if we can't find the package.json file for Jest, because it's possible to run jest without having a package.json at all.

Don't throw if we can't find the package.json file for Jest, because it's possible to run jest without having a package.json at all.
@palmerj3
Copy link
Collaborator

palmerj3 commented Dec 7, 2017

@samertm thanks for the PR! Could you tell me a situation where JS app with jest tests wouldn't have a package.json?

@samertm
Copy link
Contributor Author

samertm commented Dec 7, 2017

If you run jest with Bazel, it'll create a separate directory tree which mirrors your repo but is separate from it to run your test.

So if your git repo is ~/src/myrepo and your tests are in ~/src/myrepo/tests, it'll create a directory like ~/.cache/bazel/.../bin/tests/jest.runfiles/... with all of the files you need to run the test and it'll set the working directory to jest.runfiles.

I'll admit that it's a rare usecase, but Bazel is our main build system at Dropbox and we need this patch to get your plugin to work :P

@palmerj3
Copy link
Collaborator

palmerj3 commented Dec 7, 2017

@samertm good answer :) We are investigating bazel at Spotify as well so this is a much welcome change. I'll merge and push 3.4.0 in the next few min.

Thanks!!

@palmerj3 palmerj3 merged commit a61f1c2 into jest-community:master Dec 7, 2017
@samertm
Copy link
Contributor Author

samertm commented Dec 7, 2017

Thanks so much!

We just recently moved to Bazel for everything at Dropbox and I worked on integrating our static build system with Bazel. Feel free to drop me a line (my email is my first name @dropbox.com) if you think we can help :)

@palmerj3
Copy link
Collaborator

palmerj3 commented Dec 7, 2017

Very cool! I might actually take you up on that.

@palmerj3
Copy link
Collaborator

palmerj3 commented Dec 7, 2017

3.4.0 is published and available

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

Successfully merging this pull request may close these issues.

2 participants