michael-s-molina edited a comment on pull request #13149:
URL: https://github.com/apache/superset/pull/13149#issuecomment-780741460


   @ktmud Setting `testEnv` to `enzyme` enables[ 
jest-environment-enzyme](https://github.com/enzymejs/enzyme-matchers/tree/master/packages/jest-environment-enzyme#readme)
 package. This package helps to configure Jest and React integration by setting 
enzyme adapter and adding React and enzyme to the global scope so we don't need 
to import them in our tests. As I can tell none of these benefits are being 
used because our tests are importing React and enzyme in test files and 
`spec/helpers/shim.ts` is configuring the adapter. Another thing that 
corroborates this thesis is that our tests successfully execute when we change 
`testEnv` to `js-dom`.
   
   The error happens when `testEnv` equals `enzyme` because 
`jest-environment-enzyme` depends on  js-dom 11.12.0 and `MutationObserver` was 
introduced in version 
[13.2.0](https://github.com/jsdom/jsdom/blob/master/Changelog.md). When we 
changed `testEnv` to `js-dom` the dependency used is 16.4.0 as you can see in 
the following image:
    
   <img width="679" alt="Screen Shot 2021-02-17 at 2 45 00 PM" 
src="https://user-images.githubusercontent.com/70410625/108246660-762d9600-7130-11eb-88ba-f0e52a8bcffa.png";>
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to