In src/Bid.test.ts when bidParams is defined it was given a value (a new BidParams object). But that value was immediately being overwritten in the beforeEach function.
How Has This Been Tested?
I tested this with npm run jest
Output:
PASS src/Bid.test.ts (12.583s)Bid classrequestCommitment method✓ should return confirmation for already confirmed bid (349ms)✓ should return confirmation after bidder had confirmed the bid (280ms)✓ should return confirmation after bidder had confirmed the bid, and another bid confirmation was filtered (507ms)✓ should throw due to kafka error in sendParams (420ms)○ skipped 1 testaccept method✓ should not throw any errors when get valid input and no errors (81ms)✓ should throw due to topic creation failure (74ms)✓ should throw to due to unconfirmed bid (72ms)○ skipped 1 testmissions method○ skipped 3 testsmessages method✓ should get one message when get valid input and no errors (75ms)○ skipped 1 testsendMessage method✓ should success and call relevant function (73ms)✓ should throw because topic id == selfId (74ms)commitmentRequests method✓ should return valid commitment requests when there are no kafka errors (73ms)✓ should throw error due to kafka error (76ms)
Test Suites: 17 passed, 17 totalTests: 21 skipped, 100 passed, 121 totalSnapshots: 0 totalTime: 18.412sRan all test suites.[13:27:21] Finished 'jest' after 19 s
Screenshots (if appropriate):
Types of changes
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project.
[ ] My change requires a change to the documentation.
Description
Removing the assignment of BidParams so that it is just defined but not assigned.
Related Issue
https://github.com/DAVFoundation/dav-js/issues/50
Motivation and Context
In src/Bid.test.ts when bidParams is defined it was given a value (a new BidParams object). But that value was immediately being overwritten in the beforeEach function.
How Has This Been Tested?
I tested this with
npm run jest
Output:
PASS src/Bid.test.ts (12.583s)
Bid class
requestCommitment method
✓ should return confirmation for already confirmed bid (349ms)
✓ should return confirmation after bidder had confirmed the bid (280ms)
✓ should return confirmation after bidder had confirmed the bid, and another bid confirmation was filtered (507ms)
✓ should throw due to kafka error in sendParams (420ms)
○ skipped 1 test
accept method
✓ should not throw any errors when get valid input and no errors (81ms)
✓ should throw due to topic creation failure (74ms)
✓ should throw to due to unconfirmed bid (72ms)
○ skipped 1 test
missions method
○ skipped 3 tests
messages method
✓ should get one message when get valid input and no errors (75ms)
○ skipped 1 test
sendMessage method
✓ should success and call relevant function (73ms)
✓ should throw because topic id == selfId (74ms)
commitmentRequests method
✓ should return valid commitment requests when there are no kafka errors (73ms)
✓ should throw error due to kafka error (76ms)
Test Suites: 17 passed, 17 total
Tests: 21 skipped, 100 passed, 121 total
Snapshots: 0 total
Time: 18.412s
Ran all test suites.
[13:27:21] Finished 'jest' after 19 s
Screenshots (if appropriate):
Types of changes
Checklist: