Closed
Description
It's quite common - in large test suites - the usage of focused test (fdescribe
, fcontext
, and fit
), especially when doing TDD.
Focused test is a pretty handy feature, but not rarely do developers push code with focused test without realizing it :-(
This rule would trigger a warning for focused tests, to remind developers they have focused tests.
Non Triggering Examples
class TotoTests: QuickSpec {
override func spec() {
describe("foo") {
describe("bar") { }
context("bar") {
it("bar") { }
}
it("bar") { }
itBehavesLike("bar")
}
}
}
Triggering Examples
class TotoTests: QuickSpec {
override func spec() {
↓fdescribe("foo") {
}
}
}
class TotoTests: QuickSpec {
override func spec() {
↓fcontext("foo") {
}
}
}
class TotoTests: QuickSpec {
override func spec() {
↓fit("foo") {
}
}
}
class TotoTests: QuickSpec {
override func spec() {
describe("foo") {
↓fit("bar") { }
}
}
}
class TotoTests: QuickSpec {
override func spec() {
context("foo") {
↓fit("bar") { }
}
}
}
class TotoTests: QuickSpec {
override func spec() {
describe("foo") {
context("bar") {
↓fit("toto") { }
}
}
}
}
class TotoTests: QuickSpec {
override func spec() {
↓fitBehavesLike("foo")
}
}
Metadata
Assignees
Labels
No labels