import * as React from 'react' ; import { ElementMatcher , Mocker , mock } from "./mocks" ; export interface Props { component : ElementMatcher ; by ? : Mocker ; } export class Remocking extends React . Component < Props > { componentWillUnmount ( ) { ( this . props as any ) . __unmock ( ) ; } render ( ) { return this . props . children ? React . Children . only ( this . props . children ) : null ; } }