Jasmine uses fdescribe
and fit
("focused specs") to run a suite/spec
exclusively.
Whilst handy during development, these can cause unexpected behaviour if accidentally committed to source control.
Note: fdescribe
and fit
are known as ddescribe
and iit
in previous
Jasmine versions (<2.1). This rule checks for both syntaxes.
This rule triggers an error (is set to 2 by default) whenever it
encounters fdescribe
, fit
, ddescribe
and iit
.
The following patterns are considered warnings:
ddescribe('My focused suite', function() {});
describe('My suite', function() {
iit('My focused spec', function() {});
});
The following patterns are not warnings:
describe('My suite', function() {});
describe('My suite', function() {
it('My spec', function() {});
});
- You have alternatives steps in place to prevent focused tests (e.g. a Git pre-commit hook)