@trackunit/react-vite-test-setup 0.0.146 → 0.0.148-alpha-965e4725884.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +6 -0
- package/index.esm.js +6 -0
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -843,6 +843,12 @@ vitest.afterEach(async () => {
|
|
|
843
843
|
vitest.vi.clearAllMocks();
|
|
844
844
|
react.cleanup();
|
|
845
845
|
await flushPromisesInAct();
|
|
846
|
+
// jsdom keeps window.history across tests in a file. Reset after cleanup() so any
|
|
847
|
+
// router history has been destroyed and this is not seen as a navigation. Some specs
|
|
848
|
+
// replace window.history with a stub that has no replaceState.
|
|
849
|
+
if (typeof window !== "undefined" && typeof window.history.replaceState === "function") {
|
|
850
|
+
window.history.replaceState(null, "", "/");
|
|
851
|
+
}
|
|
846
852
|
});
|
|
847
853
|
const setupResponseForTanstackRouter = () => {
|
|
848
854
|
// Polyfill for Response global that TanStack Router v1+ requires
|
package/index.esm.js
CHANGED
|
@@ -822,6 +822,12 @@ afterEach(async () => {
|
|
|
822
822
|
vi.clearAllMocks();
|
|
823
823
|
cleanup();
|
|
824
824
|
await flushPromisesInAct();
|
|
825
|
+
// jsdom keeps window.history across tests in a file. Reset after cleanup() so any
|
|
826
|
+
// router history has been destroyed and this is not seen as a navigation. Some specs
|
|
827
|
+
// replace window.history with a stub that has no replaceState.
|
|
828
|
+
if (typeof window !== "undefined" && typeof window.history.replaceState === "function") {
|
|
829
|
+
window.history.replaceState(null, "", "/");
|
|
830
|
+
}
|
|
825
831
|
});
|
|
826
832
|
const setupResponseForTanstackRouter = () => {
|
|
827
833
|
// Polyfill for Response global that TanStack Router v1+ requires
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-vite-test-setup",
|
|
3
3
|
"description": "Test setup utilities for React applications",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.148-alpha-965e4725884.0",
|
|
5
5
|
"repository": "https://github.com/Trackunit/manager",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
7
7
|
"engines": {
|