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

Cannot require package.json from Wallaby bootstrap #123

Closed
endragor opened this issue May 21, 2015 · 2 comments
Closed

Cannot require package.json from Wallaby bootstrap #123

endragor opened this issue May 21, 2015 · 2 comments
Labels

Comments

@endragor
Copy link

I'd like to avoid Jest config duplication and use fields from the config in package.json. But for some reason require('./package.json') in bootstrap ends up with Cannot find module error. Am I missing something?
Can be reproduced in /~https://github.com/endragor/wallaby-jest-sample

@ArtemGovorov
Copy link
Member

It may be some Jest integration specific issue, I'll have a look. For now as a workaround you may require the file by its full path, like

const jestConfig = require(require('path').join(wallaby.projectCacheDir, 'package.json')).jest;

@ArtemGovorov
Copy link
Member

Fixed in core 1.0.51.

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

No branches or pull requests

2 participants