Created
February 5, 2017 15:08
-
-
Save NiGhTTraX/cb8ecd2d25beff6cf26bb09f55e25e4e to your computer and use it in GitHub Desktop.
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
function createSpy() { | |
const _renderSpy = sinon.spy(); | |
return class Spy extends Component { | |
static get lastProps() { | |
return _renderSpy.args[_renderSpy.callCount - 1][0]; | |
} | |
render() { | |
_renderSpy(this.props); | |
return <div>I am a fake component, here to spy on you!</div>; | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment