Skip to content

Commit

Permalink
fix: udpate tiny-react
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Jun 22, 2024
1 parent f696a95 commit ac889be
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions packages/tiny-react/src/hmr/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from "vitest";
import { type ViteHot, setupVite } from ".";
import * as refresh from ".";
import { useEffect, useReducer } from "../hooks";
import { render } from "../reconciler";
import { sleepFrame } from "../test-utils";
Expand All @@ -9,7 +9,7 @@ describe("hmr", () => {
it("basic", async () => {
const acceptCallbacks: ((newModule?: unknown) => void)[] = [];

const hot: ViteHot = {
const hot: refresh.ViteHot = {
accept: (callback) => {
acceptCallbacks.push(callback);
},
Expand Down Expand Up @@ -45,7 +45,10 @@ describe("hmr", () => {
return <div>1</div>;
}

const manager = setupVite(hot, runtime, false);
const manager = refresh.initialize(hot, runtime, {
mode: "vite",
debug: false,
});
ChildExport = manager.wrap("Child", Child, "useEffect");
manager.setup();
}
Expand Down Expand Up @@ -78,7 +81,10 @@ describe("hmr", () => {
return <div>2</div>;
}

const manager = setupVite(hot, runtime, false);
const manager = refresh.initialize(hot, runtime, {
mode: "vite",
debug: false,
});
manager.wrap("Child", Child, "");
manager.setup();
}
Expand Down Expand Up @@ -119,7 +125,10 @@ describe("hmr", () => {
return <div>3</div>;
}

const manager = setupVite(hot, runtime, false);
const manager = refresh.initialize(hot, runtime, {
mode: "vite",
debug: false,
});
manager.wrap("Child", Child, "useEffect");
manager.setup();
}
Expand Down

0 comments on commit ac889be

Please sign in to comment.