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

Fixes try catch tests and remove unecessary asseritons #1434

Merged

Conversation

konstantinabl
Copy link
Collaborator

@konstantinabl konstantinabl commented Jul 3, 2023

Description:
Currently in the acceptance tests try catch logic is used, however we do not check whether an error is actually thrown and we enter the catch. Therefore, this PR changes the logic so we take the maximum of the chai library in order to make the tests effective and intuitive

What is included

  1. Added chai as promised library for testing on promises
  2. Replaced try catch with suitable chai methods, which detect if an error is not thrown
  3. Added missing semicolons
  4. Replaced some uses of let with const
  5. Removed the unnecessary use of Assertions

@konstantinabl konstantinabl self-assigned this Jul 3, 2023
@konstantinabl konstantinabl linked an issue Jul 3, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Jul 3, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (1f441ce) 78.14% compared to head (2224b40) 78.14%.

❗ Current head 2224b40 differs from pull request most recent head 1e3602e. Consider uploading reports for the commit 1e3602e to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1434   +/-   ##
=======================================
  Coverage   78.14%   78.14%           
=======================================
  Files          32       32           
  Lines        2599     2599           
  Branches      529      529           
=======================================
  Hits         2031     2031           
  Misses        402      402           
  Partials      166      166           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@konstantinabl konstantinabl force-pushed the 1371-update-trycatch-test-logic-to-verify-errors-are-thrown branch 3 times, most recently from a99932a to c9c08a7 Compare July 3, 2023 18:27
@Ivo-Yankov Ivo-Yankov linked an issue Jul 4, 2023 that may be closed by this pull request
@konstantinabl
Copy link
Collaborator Author

Added temporary fix in dapp-example/tests/e2e/specs/index.spec.js due to issue in synpress library:
Synthetixio/synpress#795

@konstantinabl konstantinabl marked this pull request as ready for review July 4, 2023 13:40
Copy link
Collaborator

@Ivo-Yankov Ivo-Yankov left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LG

@Nana-EC Nana-EC added enhancement New feature or request good first issue Good for newcomers P2 labels Jul 4, 2023
@Nana-EC Nana-EC added this to the 0.27.0 milestone Jul 4, 2023
@konstantinabl konstantinabl force-pushed the 1371-update-trycatch-test-logic-to-verify-errors-are-thrown branch 3 times, most recently from 4783703 to 411488a Compare July 5, 2023 08:33
Konstantina Blazhukova added 4 commits July 5, 2023 11:42
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Konstantina Blazhukova added 4 commits July 5, 2023 11:42
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
@konstantinabl konstantinabl force-pushed the 1371-update-trycatch-test-logic-to-verify-errors-are-thrown branch from 411488a to 1e3602e Compare July 5, 2023 08:44
@sonarcloud
Copy link

sonarcloud bot commented Jul 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
1.6% 1.6% Duplication

@Ivo-Yankov Ivo-Yankov merged commit 459a4da into main Jul 5, 2023
24 checks passed
@Ivo-Yankov Ivo-Yankov deleted the 1371-update-trycatch-test-logic-to-verify-errors-are-thrown branch July 5, 2023 10:59
mshakeg pushed a commit to mshakeg/hedera-json-rpc-relay that referenced this pull request Oct 18, 2023
* Fixes try catch tests and remove unecessary asseritons

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>

* Adds missing dependency

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>

* Fixes accidental deletion

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>

* Moves chai import to index; remove uneccessary imports

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>

* Removes duplication

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>

* Fixes accidental commit of comments in index

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>

* Removes unexpected parameter passed to function

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>

* Adds temporary fix in dapp due to synpress issue

Signed-off-by: Konstantina Blazhukova <[email protected]>

---------

Signed-off-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Konstantina Blazhukova <[email protected]>
Co-authored-by: Konstantina Blazhukova <[email protected]>
Signed-off-by: Mo Shaikjee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers P2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update try/catch test logic in acceptance tests batches 1, 2 and 3
5 participants