-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
TypeError: Object.values is not a function #3687
Comments
We don't require |
@cpojer Is this documented somewhere? |
I've tried |
I'm running into the same issue. Found that it fails in some versions of node. Tests passed using 7.10.0 but not 6.10.3. I also got it to work with the older version of node by adding to package.json
and then in my test file adding:
If need to dig into the issue more, look at changes from #2755 |
Why do you need to document "if you call functions in an environment which does not support it, you have to polyfill it"? It makes perfect sense, and it's the same thing you would do if you use |
@SimenB I agree, but the polyfills were called on by Jest before. Now they're not. It's in the changelog as a breaking change, that satisfied me once I was pointed to it. :) Kind of a subtle line tho... could have been bolder ;) |
Just stumbled upon this thread with the same issue, if it helps anyone here's how I fixed it:
In polyfills.js I add the following line:
What this does I believe is tell Jest that when |
For those reluctant to install a dependency just for this, you can also add this to your setupFile:
|
I put a simple require in a other wise empty setup file, and it worked fine, had the babel polyfill used for older browsers anyway aurelia-jest-bl-bootstrap.js
jest-bl-cli-version.json
|
I got the same error message, when running tests in Travis, which passed locally but failed in CI and landed here. I found a different solution I'd just like to share so I or anyone else can find it later. In my case, I was testing with node 6.10.something and Stack Overflow pointed out that Object.values is not a function in node 6, but it is in 7. So I switched to 7, but yarn doesn't work with 7, so I switched to Node 8, which works. In .travis.yml
|
If anyone runs into this and can't figure out why, look to see if you are running an older version of Node |
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. |
My tests works fine on Jest 19.0.0, but it breaks when I upgrade to Jest 20.0.4 with the following error:
TypeError: Object.values is not a function
this is my .babelrc:
this is the code that breaks:
Object.values(USERS_ROLES)
The text was updated successfully, but these errors were encountered: