Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
willybrauner committed Oct 18, 2023
1 parent 552a2ca commit b69111f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion examples/example-client/src/pages/YoloPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { useLocation, useStack } from "@cher-ami/router";
import { transitionsHelper } from "../helper/transitionsHelper";
const componentName: string = "YoloPage";

interface IProps {}
interface IProps {
time: {
datetime: string;
};
}

const YoloPage = forwardRef((props: IProps, handleRef: ForwardedRef<any>) => {
const rootRef = useRef(null);
Expand All @@ -21,6 +25,7 @@ const YoloPage = forwardRef((props: IProps, handleRef: ForwardedRef<any>) => {
return (
<div className={componentName} ref={rootRef}>
{componentName}
<div>fetch props datetime: {props.time?.datetime}</div>

<br />
<br />
Expand Down
5 changes: 5 additions & 0 deletions examples/example-client/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ export const routesList: TRoute[] = [
{
path: "/yolo",
component: YoloPage,
getStaticProps: async (props, currentLang) => {
const res = await fetch("https://worldtimeapi.org/api/ip");
const time = await res.json();
return { time };
},
},
{
path: "/hello",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"build:example-ssr": "pnpm --filter ./examples/example-ssr run build",
"size": "size-limit",
"size-why": "size-limit -- --why",
"test": "jest && npm run size",
"test": "jest",
"test:watch": "jest --watch",
"pre-publish": "npm run build && npm run test"
},
Expand Down

0 comments on commit b69111f

Please sign in to comment.