-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
airbnb-browser-shims version: ^2.1.0
Jest Version: ^21.2.1
This seems to be an issue with browser shims' compatibility with jsdom
. A simple reconstruction of this issue would be to create a test file:
/* testfile.test.jsx */
/**
* @jest-environment jsdom
*/
import 'airbnb-browser-shims';
describe('any test', () => {
it('should do something', () => {
console.log('it will fail before tests are run');
});
});
This throws an error:
● Test suite failed to run
TypeError: Cannot read property 'parentNode' of undefined
at node_modules/matchmedia-polyfill/matchMedia.js:18:15
at Object.<anonymous> (node_modules/matchmedia-polyfill/matchMedia.js:46:2)
at Object.<anonymous> (node_modules/airbnb-browser-shims/browser-only.js:27:3)
at Object.<anonymous> (node_modules/airbnb-browser-shims/index.js:7:1)
at Object.<anonymous> (tests/DirectionProvider_test.jsx:14:1)
at next (native)
at next (native)
Metadata
Metadata
Assignees
Labels
No labels