dai-shi / waku

⛩️ The minimal React framework
https://waku.gg
MIT License
3.91k stars 102 forks source link

test: unit and type tests for createPages #692

Closed pmelab closed 2 weeks ago

pmelab commented 2 weeks ago

I have not yet found a way to add type-tests for CreatePage and CreateLayout. Since the generic is on the function and not on the argument, the path property always resolves to never. I'm not sure if a test is even possible in this case. Any suggestions are welcome.

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview May 3, 2024 6:50am
codesandbox-ci[bot] commented 2 weeks ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

dai-shi commented 2 weeks ago

How about something like 403f4775 ?

pmelab commented 2 weeks ago

How about something like 403f477 ?

Haha, yeah obviously. I was tunnel-visioned on ts-expect.

dai-shi commented 2 weeks ago

Same. I thought about using TypeEqual first.

pmelab commented 2 weeks ago

It looks good overall. Let me know when it's ready to merge.

Lets go!