2
如果有重複,請原諒我。如何設置與MemoryRouter和Jest匹配的路徑? (不是位置或歷史)
我知道MemoryRouter有initialEntries和initialIndex,所以你可以設置路徑等「位置」和「歷史」。然而,「匹配」沒有得到更新......我需要爲我的反應應用和Jest測試設置「匹配」。
當我嘗試,
<MemoryRouter initialEntries={['/hello']} initialIndex={0}>
<Hello store={store} />
</MemoryRouter>
我越來越
match: { path: '/', url: '/', params: {} ... },
location: { path: '/hello', pathname: '/', ... },
history: { ..., location: { path: '/hello', pathname: '/', ... }}
我不知道是否有設置匹配的方式。提前致謝。