-
Notifications
You must be signed in to change notification settings - Fork 44
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: Skip change detection for tests that assert panic #883
test: Skip change detection for tests that assert panic #883
Conversation
assert.Panics(t, func() { | ||
executeTestCase(t, test) | ||
}) | ||
testUtils.AssertPanicAndSkipChangeDetection(t, func() { executeTestCase(t, 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.
thought: I was thinking more of adding a bool prop to the QueryTestCase
struct and handling the skip within testUtils.executeTestCase
- but this works too. Cheers for sorting it out
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 thought about that too, but IMO this gives us slightly more control (can assert a function other than executeTestCase
if one desires) also wanted to avoid crowding QueryTestCase
with another bool.
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.
Can revisit this in the future and is an easy change if we do prefer that route.
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.
LGTM, added a quick thought, but happy as-is
8713134
to
067ff04
Compare
…k#883) - Resolves sourcenetwork#882 - Skip change detector for tests that assert for panics. - Clean up the assertion of panic and skipping of the change detector into a utility function.
Relevant issue(s)
Resolves #882
Description
Tasks
How has this been tested?
CI & Locally
Specify the platform(s) on which this was tested: