-
Notifications
You must be signed in to change notification settings - Fork 4
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
SYS-332, SYS-375, SYS-376, SYS-377, SYS-378: Add validateJoinRequest.test.ts
#244
base: dev
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍
|
two of the new tests failed in the PR check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR LGTM
two tests are failing for me
https://github.com/shardeum/shardus-core/pull/244/files#diff-6691c51708538fc5b3d636534da4165888f4c5746c7fce110a0c467bc02733dfR329
instead of `undefined`
Can you point out the circular dependency that existed, and where it was removed? I noticed you didnt have any commits that add tests without refactoring. Which test was not possible without needing a refactor? |
These tests required mocking fields and functions that were all included in the root of the For example, all tests using logging functions like It also became impossible to change So...
This fixes any tests that depended on |
{ | ||
it: 'should fail if joining node is known by public key', | ||
before: () => { | ||
;(getByPubKeyMap as jest.Mock).mockReturnValueOnce(new Map([['known node', {}]])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
god help us all if we need this semi colon stuff.
Adds unit tests for testing
validateJoinRequest
and some of its components.Refactors were required in order to eliminate any circular dependencies that prevented mock functions from working as intended.
To see this work, just run
npx jest "validateJoinRequest"
.