ice-lab / icestore

🌲 Simple and friendly state for React
MIT License
397 stars 35 forks source link

Add @ice/store Unit Test #69

Closed luhc228 closed 4 years ago

luhc228 commented 4 years ago

增加 @ice/store单元测试

0. add some examples for test

1. createStore Module

2. createModel Module

3. createContainer

补充:

alvinhui commented 4 years ago

createContainer.tsx 里面的方法createContainer需要传参useValue.

这个 useValue 应该可以是任意的 hooks , 不一定需要 createModel 里的 useValue?

luhc228 commented 4 years ago

createContainer.tsx 里面的方法createContainer需要传参useValue.

这个 useValue 应该可以是任意的 hooks , 不一定需要 createModel 里的 useValue?

useValue是任意的hooks 我的理解是 如果是任意的hooks的话,没办法拿到他的值呢?后面就没法测试到Provider?比如下面的 const value = useValue(props); 应该要拿到value吧 image

alvinhui commented 4 years ago

@luhc228 这个 PR 非常的出色! 但我们在在 1.3.0 中重构了 icestore https://github.com/ice-lab/icestore/pull/82 ,如果可以的话,是不是可以基于这个 PR 为 1.3.0 版本补充单测?可以将 PR 的目标分支指向 master。