You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found when disabling validation in @discordjs/builders on EmbedBuilder#setDescription() it would still throw a CombinedError with ExpectedValidationError in it.
Steps To Reproduce
import {s} from "@sapphire/shapeshift";
s.string
.lengthGreaterThanOrEqual(10)
.nullish
.setValidationEnabled(false).parse("test");
Expected behavior
It should not throw any Error.
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Thing is, although the API is called setValidationEnabled, the getter method (getValidationEnabled()) is only called in tests, not a single time in the source code, and instead the library uses the getter below it (get shouldRunConstraints()):
In fact, if this.handle() wasn't called at all if it returned false, the effects would not only apply to the current validator, but also the children, since their parse() method wouldn't be called either.
We should change the name or the behaviour IMO. cc: @vladfrangu@favna
Is there an existing issue for this?
Description of the bug
Found when disabling validation in
@discordjs/builders
onEmbedBuilder#setDescription()
it would still throw aCombinedError
withExpectedValidationError
in it.Steps To Reproduce
Expected behavior
It should not throw any Error.
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: