Open HeratPatel1 opened 6 years ago
seems like the jest is not compile the library, try to add the config on the jest config file? you can refer jest documents
Same issue here. I'm trying to write tests using ...
"devDependencies": {
"@types/enzyme": "^3.1.11",
"@types/enzyme-adapter-react-16": "^1.0.2",
"@types/faker": "^4.1.2",
"@types/fetch-mock": "^6.0.3",
"@types/jest": "^23.1.3",
"@types/react-test-renderer": "^16.0.1",
"@types/redux-mock-store": "^1.0.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"faker": "^4.1.0",
"fetch-mock": "^6.4.4",
"react-scripts-ts": "^2.16.0",
"react-test-renderer": "^16.4.1",
"redux-mock-store": "^1.5.3",
"typescript": "2.9.2"
}
but I'm getting the below error when import storage from "redux-persist/lib/storage";
$ yarn test
yarn run v1.7.0
$ react-scripts-ts test --env=jsdom
console.error node_modules\redux-persist\lib\storage\getStorage.js:40
redux-persist failed to create sync storage. falling back to memory storage.
and same error as @HeratPatel1 's when import storage from "redux-persist/es/storage";
I'm also running into the same problem. Also tried to switch from import storage from "redux-persist/es/storage"
to import storage from "redux-persist/lib/storage"
but the error ... persist (no pun intended).
This is huge disaster from my perspective. redux-persist
just shattered my unit test suites. I cannot find any better solution then just to get rid off redux-persist
completely. So if you have app with good coverage don't borther installing redux-persist
, better write your own custom solution.
I am also facing this issue, any updates on this
I am also facing this issue, any updates on this?
redux-persist - 5.9.1 react - 16.3.2 jest - 22.4.3
import storage from "redux-persist/es/storage";
({"Object.":function(module,exports,require,dirname,filename,global,jest){import createWebStorage from './createWebStorage';
^^^^^^
I also tried with
import storage from "redux-persist/lib/storage";
import React, { PureComponent } from 'react'; // eslint-disable-line import/no-unresolved ^^^^^^
console.error node_modules/redux-persist/lib/storage/getStorage.js:40 redux-persist failed to create sync storage. falling back to memory storage.