-
Notifications
You must be signed in to change notification settings - Fork 81
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
test(utils): remove duplicates #1239
Conversation
// 'getAddressFromPrivateKey() error' | ||
expect(identity).toBe(rawId.address); |
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.
Those comments were messages displayed in case of a failure back when we were still using mocha instead of jest, they were placed as the second argument in the expect
, see #283. They can be removed, at least for happy-path tests, they can be confusing.
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.
I removed them for failure tests too, see #1239 (comment)
it('can encrypt()', async () => { | ||
const encryptedData = await ecEncrypt(rawId.publicKey, anyData); | ||
// 'encrypt() error' | ||
expect(encryptedData.length).toBe(226); | ||
// 'decrypt() error' | ||
expect(await ecDecrypt(rawId.privateKey, encryptedData)).toBe(anyData); | ||
}); | ||
|
||
it('can decrypt()', async () => { | ||
const data = await ecDecrypt( | ||
rawId.privateKey, | ||
'307bac038efaa5bf8a0ac8db53fd4de8024a0c0baf37283a9e6671589eba18edc12b3915ff0df66e6ffad862440228a65ead99e3320e50aa90008961e3d68acc35b314e98020e3280bf4ce4258419dbb775185e60b43e7b88038a776a9322ff7cb3e886b2d92060cff2951ef3beedcc70a', | ||
); | ||
// 'decrypt() error' | ||
expect(data).toBe(anyData); | ||
}); |
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.
Those two tests are duplicates see above lines 95 and 118 (from the new line numbers)
// 'getAddressFromPrivateKey() error' | ||
// getAddressFromPrivateKey() error |
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.
In case of failure tests, I kept the comments but removed the quotes
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.
these comments were generated when migrating from mocha to jest, they can totally be removed
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.
OK then, I'm removing them altogether
// 'getAddressFromPrivateKey() error' | ||
// getAddressFromPrivateKey() error |
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.
these comments were generated when migrating from mocha to jest, they can totally be removed
Nice work. |
Description of the changes