Skip to content

Commit

Permalink
base test for redirect types
Browse files Browse the repository at this point in the history
  • Loading branch information
jeetiss committed Oct 6, 2023
1 parent f0dd8de commit 09719e7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/wouter/test/redirect.test-d.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { describe, it, assertType } from "vitest";
import { Redirect } from "wouter";

describe("Redirect types", () => {
it("should have required prop href", () => {
// @ts-expect-error
assertType(<Redirect />);
assertType(<Redirect href="/" />);
});

it("should support state prop", () => {
assertType(<Redirect href="/" state={{ a: "foo" }} />);
assertType(<Redirect href="/" state={null} />);
assertType(<Redirect href="/" state={undefined} />);
assertType(<Redirect href="/" state="string" />);
});
});

0 comments on commit 09719e7

Please sign in to comment.