ice-lab / icestore

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

Test: Add Plugins Test #113

Closed luhc228 closed 4 years ago

luhc228 commented 4 years ago

增加 icestore 插件测试

调整 index.spec.tsx 的测试用例,只测试是否有相应的 API 导出,具体的单元测试在各 plugin 中单独进行。

增加 plugin 测试内容如下

codecov-io commented 4 years ago

Codecov Report

Merging #113 into master will decrease coverage by 0.71%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #113      +/-   ##
==========================================
- Coverage   83.98%   83.27%   -0.72%     
==========================================
  Files          19       19              
  Lines         562      562              
  Branches      121      121              
==========================================
- Hits          472      468       -4     
- Misses         80       84       +4     
  Partials       10       10              
Impacted Files Coverage Δ
src/plugins/modelApis.tsx 46.00% <0.00%> (-14.00%) :arrow_down:
src/plugins/error.tsx 96.82% <0.00%> (+7.93%) :arrow_up:
src/plugins/loading.tsx 96.66% <0.00%> (+8.33%) :arrow_up:
luhc228 commented 4 years ago

Current test coverage statement

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 94.38 81.16 87.84 94.31
src 93.19 67.57 86.67 92.45
actionTypes.ts 100 100 100 100
icestore.ts 92.45 58.33 91.67 90.24 88-93
index.tsx 100 70 100 100 24,43-44,61-69
pluginFactory.ts 95 92.86 100 92.31 41
redux.ts 85.45 57.14 66.67 84.78 40,66,82-87
src/plugins 94.88 87.58 87.76 94.59
dispatch.ts 88.46 83.33 75 86.36 12-16,60
effects.ts 100 85.71 100 100 23
error.tsx 95.65 88.46 90 95.24 135,193,198
immer.ts 100 80 100 100 9,30
loading.tsx 95.59 88.64 88.89 96.67 151,156
modelApis.tsx 92.52 88.89 85.19 91.92 199-206
provider.tsx 100 83.33 100 100 20
reduxHooks.ts 100 100 100 100
src/utils 95 80.7 90 96.67
appendReducers.ts 100 100 100 100
converter.ts 87.8 63.64 80 92.31 62-69
isListener.ts 100 100 100 100
mergeConfig.ts 100 84.38 100 100 5,31-59
validate.ts 100 75 100 100 10
warning.ts 100 75 100 100 9
codecov-commenter commented 4 years ago

Codecov Report

Merging #113 into master will increase coverage by 9.01%. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #113      +/-   ##
==========================================
+ Coverage   84.09%   93.10%   +9.01%     
==========================================
  Files          19       19              
  Lines         566      566              
  Branches      124      124              
==========================================
+ Hits          476      527      +51     
+ Misses         80       29      -51     
  Partials       10       10              
Impacted Files Coverage Δ
src/plugins/error.tsx 96.82% <0.00%> (+7.93%) :arrow_up:
src/plugins/loading.tsx 96.66% <0.00%> (+8.33%) :arrow_up:
src/index.tsx 100.00% <0.00%> (+16.36%) :arrow_up:
src/plugins/modelApis.tsx 92.00% <0.00%> (+32.00%) :arrow_up: