jest-mongodb icon indicating copy to clipboard operation
jest-mongodb copied to clipboard

Conflict with tests that require window/document

Open powderham opened this issue 5 years ago • 2 comments
trafficstars

Thanks a lot for creating this package. I have installed it and it works perfectly for interracting with mongo in my tests.

However it comes with a regression which is tests that require the window/dom (e.g. from react testing library document.createElement) require the default testEnvironment: jsdom which this overwrites.

Is there a way to prevent this overwriting such functionality?

powderham avatar Feb 21 '20 11:02 powderham

You should be able to solve this by adding this to the top of any test files that require window/document:

/**
 * @jest-environment jsdom
 */

helloitsjoe avatar Oct 16 '20 12:10 helloitsjoe

Can anyone help here https://github.com/kulshekhar/ts-jest/issues/3913

ChandanaMummaneni avatar Nov 22 '22 05:11 ChandanaMummaneni