When I call t.fail() within a subtest, it seems to try to continue to execute the rest of the subtest.
When I call t.exit() from within a subtest, it halts execution of the entire test.
In one particular case I'd like to be able to call a failure that exits the current subtest and moves on to the next subtest. Is there any method for that?
Thanks as always.
-Joe
Support Forum
Made a quick experiment, it seems to continue to the next "it" after "exit()":
Can you change the code above to demo the problem?
StartTest(function(t) {
t.it("Quix", function (t) {
t.chain(
{ click : [ 1, 1 ] },
function (next) {
t.exit()
next()
},
function (next) {
t.diag("SHOULD NOT BE VISIBLE")
next()
}
)
})
t.it("Foo", function (t) {
t.diag("Bar")
})
})
Read the API documentation
Thanks as usual Nikolay! I can confirm that your code behaves as I was hoping. I had assumed that exit() was actually supposed to get out of subtests but I'm glad to see it isn't.
Oddly enough, in this very specific instance the test runner behaves differently for me in my windows 7 64 bit vm (only on Google Chrome - Firefox works fine) than it does on my windows 10 machine. However, the dumbed down test doesn't display the discrepancy ... so there's really nothing for me to share at the moment. Now that I know the expected behavior I'll use that, and if I'm able to find a concrete issue I'll let you know.
Thanks!
-Joe
Oddly enough, in this very specific instance the test runner behaves differently for me in my windows 7 64 bit vm (only on Google Chrome - Firefox works fine) than it does on my windows 10 machine. However, the dumbed down test doesn't display the discrepancy ... so there's really nothing for me to share at the moment. Now that I know the expected behavior I'll use that, and if I'm able to find a concrete issue I'll let you know.
Thanks!
-Joe
Read the API documentation