DEV Community

Discussion on: Running a single test suite/spec in Jasmine

Collapse
 
dansilcox profile image
Dan Silcox

Definitely beats messing with the test runner bootstrap! Don’t commit your fdescribes though as this might give you false confidence running just one test instead of the whole suite and just seeing ‘tests passed’ in CI. Not sure if you know about xdescribes too - skip a certain test! Although again don’t commit them or your future team mates/self will not be happy having to fix potentially broken disabled tests!

Collapse
 
bradtaniguchi profile image
Brad

I believe in future versions (3+?) of jasmine using fdescribe and fit will make the overall process "fail" as the tests will be incomplete. I personally usually put a check to verify a certain coverage of tests are ran, so if I do accidentally commit these, the coverage check will fail.

Collapse
 
dzhavat profile image
Dzhavat Ushev

A coverage check sounds like a good strategy to guard against accidental fdescribe/fit. I haven't seen yet the first part where Jasmine will fail overall, but this too makes sense.

Collapse
 
dzhavat profile image
Dzhavat Ushev

I've already had cases where I committed an fdescribe/fit. If catched on time, quickly amending the commit fixes the issue. But I agree that it's easy to oversee. Can this be a good lint opportunity? Not sure.

Yes, I've seen xdescribe. Haven't used it though. I think xdescribe is less "destructive" compared to fdescribe. The former just disables a suite/spec (even though this might be bad as well), where the latter disables everything else but the suite/spec in focus.