Last active
August 4, 2020 13:55
-
-
Save stephenwil/19cce070c842c1f283d9c3e6e49219a6 to your computer and use it in GitHub Desktop.
Been around the houses trying to get old library that still uses React.createClass to run through jest. Tried babel transform createclass but no luck. This simply patches React during testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import createClass from 'create-react-class' | |
import React from 'react' | |
Enzyme.configure({ adapter: new Adapter() }); | |
// Until lib-x gets updated to React 16 | |
Object.assign(React, { | |
createClass | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment