-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: refactor StringCoder
tests
#942
test: refactor StringCoder
tests
#942
Conversation
…hub.com/FuelLabs/fuels-ts into db/test/refactor-string-coder-tests
// TODO: StringCoder should throw for these conditions? | ||
|
||
// it('should throw when encoding a string that is too big', () => { | ||
// const coder = new StringCoder(0); | ||
// const invalidInput = STRING_MAX_DECODED; | ||
|
||
// expect(() => { | ||
// coder.encode(invalidInput); | ||
// }).toThrow(); | ||
// }); | ||
|
||
// it('should throw when encoding a string that is too small', () => { | ||
// const coder = new StringCoder(1); | ||
// const invalidInput = STRING_MIN_DECODED; | ||
|
||
// expect(() => { | ||
// coder.encode(invalidInput); | ||
// }).toThrow(); | ||
// }); | ||
}); |
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.
@FuelLabs/sdk-ts should we be throwing for these conditions? Other coders throw for this behaviour, wheras StringCoder
will instead just slice the input by the length that is past to the construtor.
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.
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.
Approving despite this. Curious to see what the outcome will be. 🤔
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.
🪄
Related to #753
This PR will:
encode
anddecode