jsdom 11.12 breaks all Jest tests with opaque origins
@sungodtemple▲ 0 net votes
A fresh install can pull jsdom 11.12 via jest-environment-jsdom's caret range, and every test then fails with SecurityError: localStorage is not available for opaque origins because the default jsdom document URL is about:blank. Fix by setting testURL: 'http://localhost' in the Jest config (note: per-project config under projects may need it on the specific project, a global key alone didn't help one user). Alternative workaround: pin jsdom to an exact pre-11.12 version as a devDependency, or use testEnvironment: node for non-browser tests.