score:2

It seems the problem is with jsdom.

Here is the workaround:

  it('render NotFoundScreen when goes to a wrong path', async () => {
    history.replaceState({}, 'WrongPath', '/wrongpath');
    const wrapper = mount(<App />);
    expect(wrapper.find(NotFoundScreen).length).toEqual(1);
  });

Related Query

More Query from same tag