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
I'm porting my tests from PHPUnit. Today I've been looking at dealing with incomplete (markTestIncomplete) and skipped (markTestSkipped) tests.
One can kinda mark a test incomplete at compile-time by using xdescribe and xit, but it would be good to have a runtime way of doing it as well, similar to PHPUnit. That said I think 95% of the time handling this at compile time is fine, so low impact.
I note there is a skipIf method, but was surprised to see its implementation was void function skipIf(boolean condition), where I might have expected void function skipIf(string message, callback condition) to match the implementations of it and describe, and using the same analogy. At the very least void function skipIf(boolean condition[, string message]).
I think a message is reasonably handy when skipping tests.
I checked to see if there was a precedent in other similar frameworks:
I agree markTestIncomplete can be handled with xdescribe().
In regards to Mocha & Rspec, for them skip as the same meaning as xit of xdescribe.
To actually "skip" a test you need to progamatically add a if() condition somewhere so skipIf() is just a shortcut to avoid nested if braces. But indeed void function skipIf(boolean condition[, string message]) could be a good idea, we just need to think where is the best place for displaying this message.
I'd display it in exactly the same place / time / way as you display test failures / errors. Just in a different colour, and prefix it with SKIPPED, eg:
skipIf(true, "only test this on Tuesdays");
When reporting:
SKIPPED: only test this on Tuesdays
Maybe it's orange or light blue or something... indicates it's not completely good (green), but it's not necessarily a problem (red).
I'm porting my tests from PHPUnit. Today I've been looking at dealing with incomplete (
markTestIncomplete
) and skipped (markTestSkipped
) tests.One can kinda mark a test incomplete at compile-time by using
xdescribe
andxit
, but it would be good to have a runtime way of doing it as well, similar to PHPUnit. That said I think 95% of the time handling this at compile time is fine, so low impact.I note there is a
skipIf
method, but was surprised to see its implementation wasvoid function skipIf(boolean condition)
, where I might have expectedvoid function skipIf(string message, callback condition)
to match the implementations ofit
anddescribe
, and using the same analogy. At the very leastvoid function skipIf(boolean condition[, string message])
.I think a message is reasonably handy when skipping tests.
I checked to see if there was a precedent in other similar frameworks:
skip
yet, based on Implement "skip()" in Jasmine jasmine/jasmine#1709;skip()
.The text was updated successfully, but these errors were encountered: