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
Right now, if an assertion fails, the test terminates. There are cases where this is exactly what is wanted since assertions that follow may then be invalid. However, I often run into cases, where assertions are not sequentially dependent and I want to run the rest of the assertions so that I know all of the issues that need to be fixed. With the current logic, I have to run the tests, fix an error, rerun the tests, fix another error, and repeat until all errors are fixed. This wastes time. Having a nonterminating assertion option would help fix this.
The text was updated successfully, but these errors were encountered:
llarsen71
changed the title
Allow Assertions (So statements) that do not terminate completion of test
Allow Assertions (So statements) that do not terminate test case
Jan 9, 2025
After some digging into the code, I found that there is an option that causes tests to continue after a test fails. This is done by passing FailureContinues as an option tot he Convey function as shown below:
func TestExample(t *testing.T) {
Convey("Given ...", FailureContinues, func() {
...
// So statements will not cause the test to terminate in this convey block
// or any child convey blocks.
})
}
Right now, if an assertion fails, the test terminates. There are cases where this is exactly what is wanted since assertions that follow may then be invalid. However, I often run into cases, where assertions are not sequentially dependent and I want to run the rest of the assertions so that I know all of the issues that need to be fixed. With the current logic, I have to run the tests, fix an error, rerun the tests, fix another error, and repeat until all errors are fixed. This wastes time. Having a nonterminating assertion option would help fix this.
The text was updated successfully, but these errors were encountered: