I got the following error after upgrading to Jest v20, where they deleted automatic babel-polyfill
due to memory leaks:
TypeError: Object.values is not a function
I understand that I need polyfill this on my own, I use babel-preset-env
and have the following file .babelrc
:
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
},
"test": {
"presets": [
"react",
"stage-3",
["env", {
"targets": {
"browsers": [
"firefox >= 36",
"chrome >= 38",
"opera >= 25",
"safari >= 9",
"ios >= 9"
],
"node": "6.11.4"
},
"useBuiltIns": "usage",
"include": ["es7.object.values"],
"debug": true
}],
"jest"
],
"plugins": [
"transform-class-properties"
],
}
}
I see what es7.object.values
fills in the debug output:
Using polyfills:
...
es7.object.values {"chrome":"38","firefox":"36","ios":"9","safari":"9","node":"6.11.4"}
But I still get the error message, help!
source
share