Skip to content

Commit

Permalink
fix: Fix infinite test
Browse files Browse the repository at this point in the history
  • Loading branch information
Masquerade-Circus committed Mar 12, 2022
1 parent 7d7947c commit e517bb5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/hooks_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { v } from "../lib";
v.use(plugin);
v.use(nodePlugin);

describe("Hooks", () => {
describe.only("Hooks", () => {
describe("State hook", () => {
it("should handle a component state", async () => {
let Counter = () => {
Expand All @@ -24,6 +24,7 @@ describe("Hooks", () => {
await new Promise((resolve) => setTimeout(() => resolve(), 2050));
result = v.update(Counter);
expect(result).toEqual("<div>2</div>");
v.unmount(Counter);
});

it("should handle subcomponents state and v.onCleanup", async () => {
Expand All @@ -50,6 +51,7 @@ describe("Hooks", () => {
await new Promise((resolve) => setTimeout(() => resolve(), 2050));
result = v.update(Counter);
expect(result).toEqual("<div>2 <div>not ok</div></div>");
v.unmount(Counter);
});

it("array getter-setter based state", async () => {
Expand All @@ -65,6 +67,7 @@ describe("Hooks", () => {
await new Promise((resolve) => setTimeout(() => resolve(), 2050));
result = v.update(Counter);
expect(result).toEqual("<div>2</div>");
v.unmount(Counter);
});
});

Expand Down

0 comments on commit e517bb5

Please sign in to comment.