Rocket.Chat.Apps-engine icon indicating copy to clipboard operation
Rocket.Chat.Apps-engine copied to clipboard

Migrate testing framework to jest and add more tests

Open shiqimei opened this issue 5 years ago • 3 comments

I was thinking to migrate our testing framework from alsation to jest for the following considerations:

Reliability. Compared to alsation, jest is an actively developed and maintained open-source project led by facebook, which has already gained a lot of attention from the community. The former is a personal open-source project mainly maintained by @ jamesadarich, which is at risk of no longer maintaining.

Ecosystem Jest has a stronger community, which means we will benefit from abundant tools contributed by the community. For instance, vscode-jest would bring us seamless VSCode integration; babel-jest can give jest the ability to support TypeScript (now it has been merged into jest's main repository). Because of the stronger community, It's much easier for us to find solutions from the community's discussions when meeting the bugs.

Easy Migration We can do this migration without too much pain.

shiqimei avatar Nov 07 '19 16:11 shiqimei

Codecov Report

Merging #180 (303ca67) into beta-external-component (a34d69c) will decrease coverage by 12.54%. The diff coverage is n/a.

Impacted file tree graph

@@                     Coverage Diff                      @@
##           beta-external-component     #180       +/-   ##
============================================================
- Coverage                    55.49%   42.94%   -12.55%     
============================================================
  Files                           68       66        -2     
  Lines                         2402     2191      -211     
  Branches                       360      356        -4     
============================================================
- Hits                          1333      941      -392     
- Misses                        1069     1250      +181     
Impacted Files Coverage Δ
src/server/ProxiedApp.ts 2.89% <ø> (-11.21%) :arrow_down:
src/server/compiler/AppCompiler.ts 19.87% <ø> (-6.17%) :arrow_down:
src/server/compiler/AppPackageParser.ts 14.08% <ø> (-7.72%) :arrow_down:
src/server/errors/RequiredApiVersionError.ts 0.00% <ø> (-100.00%) :arrow_down:
src/server/logging/AppConsole.ts 100.00% <ø> (+1.96%) :arrow_up:
src/server/misc/Utilities.ts 35.29% <ø> (-13.55%) :arrow_down:
src/server/misc/DisabledApp.ts 0.00% <0.00%> (-100.00%) :arrow_down:
src/server/managers/AppSlashCommandManager.ts 4.48% <0.00%> (-94.90%) :arrow_down:
src/server/managers/AppSlashCommand.ts 32.25% <0.00%> (-64.72%) :arrow_down:
... and 64 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 a34d69c...303ca67. Read the comment docs.

codecov[bot] avatar Nov 08 '19 21:11 codecov[bot]

Hey @lolimay ! Could you edit the description to add some of the reasons for the migration (e.g. benefits of Jest vs Alsatian)? Thanks :D

d-gubert avatar Nov 18 '19 16:11 d-gubert

Hey @lolimay ! Could you edit the description to add some of the reasons for the migration (e.g. benefits of Jest vs Alsatian)? Thanks :D

Added :)

shiqimei avatar Nov 18 '19 17:11 shiqimei