test(besu): refactor jest test negative test cases
jagpreetsinghsasan opened this issue · 4 comments
jagpreetsinghsasan commented
Description
Refactor all the negative test case exception assertions for cactus-plugin-ledger-connector-besu
so that they do not use try-catch blocks but instead declare the requirements through Jest's (and jest-extended's) own API.
The parent issue with a much more detailed explanation of what's needed and code examples on how to do it:
Parent Issue: https://github.com/hyperledger/cacti/issues/3455
Acceptance Criteria
Test passes the same as before
Negative test case assertions have been migrated the way it is explained in the parent issue.
jagpreetsinghsasan commented
@ashnashahgrover here's the issue
ashnashahgrover commented
Please assign me.
ashnashahgrover commented
- In the PR I have noted two tests in openapi-validation.test.ts where the status code returned should be 400 but is 200 - before refactoring those I wanted to confirm if this is correct. I print those status codes with comments on these lines:
- I left the original try-catch blocks as comments in the PR for your reference in case it is helpful while reviewing - I can take them out once you are done reviewing and/or if you don't need them.
jagpreetsinghsasan commented
- Please mention this point in the PR rather than here while referencing the lines within the PR commit. That way, it will be easier to navigate
- You dont have to add the previous code as
in code comment
. This is already enabled when we review the PR (you can also check theFiles Changed
tab under the PR), we can see the difference.
For example
You can also utilize the git graph plugin to view commits and their diff