-
Notifications
You must be signed in to change notification settings - Fork 77
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
Revert index range check on SelectRegexReveal #218
Conversation
@@ -77,10 +79,12 @@ describe("Select Regex Reveal", () => { | |||
} catch (error) { | |||
expect((error as Error).message).toMatch("Assert Failed"); | |||
} | |||
|
|||
expect.assertions(1); |
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.
@SoraSuegami Just FYI, we need to add this in negative testing to let jest know we expect an assertion - this ensures the catch block was executed (as our assertion is in catch). Otherwise the test would pass even if the code didn't fail as expected.
|
||
it("should fail when startIndex is larger than max length", async function () { |
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.
Wait why did we remove this test
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.
By our pattern we are constraining indices where it originates (main circuits). Adding them to each utils might be redundant as main circuits would be using multiple utils. We are not doing these checks on other circuits as well. This was added recently by another PR but we already have comments saying "assumes valid index"
0b8517f
to
fbdf5bc
Compare
This reverts commit fbdf5bc.
7c55f92
to
93b2a34
Compare
I have reverted prettier file changes from this PR. We can do |
Description
Revert index range check on SelectRegexReveal as we go with the principle of no constraining inputs in our utils and leave this to consuming functions.
Type of Change
Please delete options that are not relevant.
Checklist: