Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add unit test for Explorer Service #378

Merged
merged 7 commits into from
Sep 1, 2021
Merged

test: add unit test for Explorer Service #378

merged 7 commits into from
Sep 1, 2021

Conversation

mortalYoung
Copy link
Collaborator

@mortalYoung mortalYoung commented Aug 30, 2021

简介

  • 新增测试用例
  • 优化了 service

主要变更

  • 修改了一下顺序,现在 interface 的顺序是按照 panel 的增删改查到 action 的 增删改查,然后是 reset 和 事件订阅
  • 添加了一些判断在 add 和 remove 接口
  • 优化 updatePanel 的接口的逻辑,本来需要传 panels 数组全部的值,显然不合理
  • src/services/workbench/__tests__/explorerService.test.ts -> src/services/__tests__/explorerService.test.ts

@mortalYoung mortalYoung added refactoring Refactor unit test The PR is for the unit test mainly labels Aug 30, 2021
@mortalYoung mortalYoung added this to the 0.9.0-alpha.5 milestone Aug 30, 2021
@mortalYoung mortalYoung self-assigned this Aug 30, 2021
@mortalYoung mortalYoung mentioned this pull request Aug 30, 2021
53 tasks
@codecov
Copy link

codecov bot commented Aug 30, 2021

Codecov Report

Merging #378 (fa54d0f) into main (0ca5622) will increase coverage by 2.63%.
The diff coverage is 96.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #378      +/-   ##
==========================================
+ Coverage   65.91%   68.55%   +2.63%     
==========================================
  Files         176      176              
  Lines        4774     4796      +22     
  Branches     1030     1033       +3     
==========================================
+ Hits         3147     3288     +141     
+ Misses       1608     1490     -118     
+ Partials       19       18       -1     
Impacted Files Coverage Δ
src/components/collapse/index.tsx 47.14% <ø> (ø)
src/model/workbench/explorer/explorer.tsx 92.30% <ø> (ø)
...c/services/workbench/explorer/folderTreeService.ts 16.03% <0.00%> (+0.58%) ⬆️
src/services/helper.ts 100.00% <100.00%> (+9.83%) ⬆️
src/services/workbench/explorer/explorerService.ts 100.00% <100.00%> (+68.29%) ⬆️
src/services/keybinding.ts 84.61% <0.00%> (+3.84%) ⬆️
src/common/dom.ts 74.57% <0.00%> (+8.47%) ⬆️
src/components/scrollable/index.tsx 100.00% <0.00%> (+13.33%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0ca5622...fa54d0f. Read the comment docs.

@mortalYoung
Copy link
Collaborator Author

mortalYoung commented Aug 30, 2021

  • 补充 helper 的测试用例

Copy link
Collaborator

@wewoor wewoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@mortalYoung mortalYoung merged commit 6bb6605 into main Sep 1, 2021
@mortalYoung mortalYoung deleted the test/explorer branch September 1, 2021 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactor unit test The PR is for the unit test mainly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants