class A {
componentWillMount() {}
componentWillUnmount() {}
render(){ return <div />; }
}
const componentWillMount = spyOn(A.prototype, 'componentWillMount');
const componentWillUnmount = spyOn(A.prototype, 'componentWillUnmount');
mount(
<Router>
<A path="/foo" />
</Router>
);
expect(componentWillMount).not.toHaveBeenCalled();
act(() => {
route('/foo');
});