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

[REVIEW] Feat/rpc mock #236

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

[REVIEW] Feat/rpc mock #236

wants to merge 29 commits into from

Conversation

ducphamle2
Copy link
Collaborator

  • Add a way to mock RPC calls effectively for unit testing
  • Add testing common methods to simplify the mocking process

Copy link

github-actions bot commented Apr 8, 2024

badge

Code Coverage Summary

Filename                                                                           Stmts    Miss  Cover    Missing
-------------------------------------------------------------------------------  -------  ------  -------  --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
packages/oraidex-common-ui/src/components/TVChartContainer/helpers/constants.ts        6       0  100.00%
packages/oraidex-common-ui/src/components/TVChartContainer/helpers/utils.ts           33       2  93.93%   23-24
packages/oraidex-common/src/bigdecimal.ts                                             80      29  63.75%   23, 40, 45-53, 120-153, 173-177
packages/oraidex-common/src/constant.ts                                              121       0  100.00%
packages/oraidex-common/src/helper.ts                                                251      68  72.90%   142, 146-147, 163-168, 277-279, 287-299, 309-313, 336-340, 344-346, 364-383, 387-394, 398-399, 403-404, 409-417, 427-448, 534, 560
packages/oraidex-common/src/network.ts                                                17       0  100.00%
packages/oraidex-common/src/pairs.ts                                                  27       2  92.59%   151, 157
packages/oraidex-common/src/token.ts                                                  27       0  100.00%
packages/universal-swap/src/handler.ts                                               300      61  79.66%   77, 100-103, 114-115, 145-165, 245-274, 332, 352, 390, 399, 403, 415, 430, 436, 452, 462, 480, 486, 561, 581, 607, 644-649, 670-675, 695, 714, 724-730, 737, 777, 840, 886
packages/universal-swap/src/helper.ts                                                381      43  88.71%   213, 348, 355, 368-371, 443-455, 535, 568, 573, 577, 620, 654, 723, 740, 780-793, 798, 832, 836, 862-870, 886-889, 974-983, 995-1000, 1019, 1045
packages/universal-swap/src/swap-filter.ts                                            11       0  100.00%
packages/universal-swap/src/types.ts                                                   2       0  100.00%
packages/universal-swap/src/proto/proto-gen.ts                                        13       0  100.00%
TOTAL                                                                               1269     205  83.84%

Diff against main

Filename                                  Stmts    Miss  Cover
--------------------------------------  -------  ------  -------
packages/universal-swap/src/handler.ts       +4    -110  +37.44%
packages/universal-swap/src/helper.ts        +4     -33  +8.87%
TOTAL                                        +8    -143  +11.44%

Results for commit: 318c27c

Minimum allowed coverage is 0%

♻️ This comment has been updated with latest results

Copy link

sonarcloud bot commented Jul 15, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
4.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants