Skip to content

Instantly share code, notes, and snippets.

@BiosBoy
Created January 13, 2019 17:09
Show Gist options
  • Select an option

  • Save BiosBoy/29b474f70ef141da0b783ed0c0965f5e to your computer and use it in GitHub Desktop.

Select an option

Save BiosBoy/29b474f70ef141da0b783ed0c0965f5e to your computer and use it in GitHub Desktop.
// TODO: Remove these polyfills once the below issue is solved.
// It present here to allow Jest work with the last React environment.
// https://github.com/facebookincubator/create-react-app/issues/3199#issuecomment-332842582
global.requestAnimationFrame = cb => {
setTimeout(cb, 0);
};
global.matchMedia = window.matchMedia || function() {
return {
matches: false,
addListener: () => {},
removeListener: () => {}
};
};
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
Enzyme.configure({ adapter: new Adapter() });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment