Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
UpperCod committed Mar 17, 2021
1 parent 7fcf3e2 commit ad6597e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/use-router/use-router.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ import { useRoute } from "./use-router.js";

it("useRouter", () => {
const hooks = createHooks(() => {});

let render = 0;
function load() {
const [result] = useRoute("/[...any]");
const result = useRoute("/[...any]");

expect(result).to.deep.equal({ any: "" });
if (render++) {
expect(result[0]).to.deep.equal({ any: "" });
} else {
expect(result).to.undefined;
}
}

hooks.load(load);

hooks.cleanEffects()();
});

0 comments on commit ad6597e

Please sign in to comment.