jotaijs / jotai-scope

MIT License
55 stars 4 forks source link

test(scope): turn examples into test cases #31

Closed yf-yang closed 4 months ago

codesandbox-ci[bot] commented 4 months 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.

yf-yang commented 4 months ago

@dai-shi I found some test cases (even when I run them locally) are broken and suspect I can't directly import those examples because jotai-scope package resolution is incorrect? Do you have any suggestion?

yf-yang commented 4 months ago

Specifically, I'd like to know why examples can resolve to correct ScopeProvider in the repository, but the test cases can't.

yf-yang commented 4 months ago

Resolve by copy codes from examples.

I'm wondering if there is any way to share codes between examples and tests.

dai-shi commented 4 months ago

btw, I'm migrating to new setup: https://github.com/zustandjs/zustand-valtio/pull/2 I'll work on some repos in jotaijs, but for jotai-scope it's up to you, you can follow my setup, or do with your own setup.

I'm wondering if there is any way to share codes between examples and tests.

It's also up to you, but my goal was to make examples standalone apps. For example, this works: https://githubbox.com/jotaijs/jotai-scope/tree/main/examples/02_scope