-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZKUI-204: Reset the history afterEach test
To make sure the route not depends on other tests.
- Loading branch information
1 parent
f8ab3e8
commit 1f9fe15
Showing
3 changed files
with
128 additions
and
113 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
import '@testing-library/jest-dom'; | ||
import fetch from 'node-fetch'; | ||
import { history } from './src/react/utils/test.tsx'; | ||
|
||
window.fetch = (url, ...rest) => | ||
fetch(/^https?:/.test(url) ? url : new URL(url, 'http://localhost'), ...rest); | ||
|
||
afterEach(() => { | ||
history.push('/'); | ||
}); |
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
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