I got an error SecurityError: localStorage is not available for opaque origin. I tried all advises about this problem:
- set
testURL: "http://localhost/"
, - set
testEnvironmentOptions: { url: 'https://localhost/' }
.
All this in jest.config.js but it doesn't work for me. My jest.config.js file:
modulePaths: ["<rootDir>/src"],
moduleNameMapper: {
"\\.(css|less|sass|scss)$": "identity-obj-proxy",
},
moduleDirectories: [
"node_modules",
],
setupFilesAfterEnv: ["mock-local-storage"],
testEnvironment: "jsdom",
verbose: true,
testURL: "http://localhost/",
};```
Help me please