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

can't run tests that uses "Request js" #214

Closed
sahas- opened this issue Jan 15, 2015 · 4 comments
Closed

can't run tests that uses "Request js" #214

sahas- opened this issue Jan 15, 2015 · 4 comments

Comments

@sahas-
Copy link

sahas- commented Jan 15, 2015

I'm using https://github.com/request/request in my code, unit test fails with below error
/node_modules/request/node_modules/tough-cookie/lib/cookie.js: Cannot read property 'buffer' of undefined,

I do have below setting in my package.config and it doesn't help
"jest":{
"unmockedModulePathPatterns": ["/node_modules/request"]
}

any suggestions to mock node modules?

@jeffmo
Copy link
Contributor

jeffmo commented Jan 15, 2015

Just to verify: Can you confirm which version of jest you're using?

Secondly: Could you post a gist of that file (node_modules/request/node_modules/tough-cookie/lib/cookie.js)? I took a look at the file in the tough-cookie repo, but I don't even see any references to 'buffer' in there (wondering if it's a different version from master?)
https://github.com/goinstant/tough-cookie/blob/master/lib/cookie.js

@sahas-
Copy link
Author

sahas- commented Jan 15, 2015

using jest-cli 0.2.1 and dont see buffer references in tough-cookie.
here is the gist showing complete error https://gist.github.com/sahas-/affabaa522e78109c141
gist of cookie.js https://gist.github.com/sahas-/7224495ae9188b4f5ba8

@cpojer
Copy link
Member

cpojer commented Oct 16, 2015

Please feel free to reopen if this is still a problem with jest 0.5

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants