If you are doing TDD but you also like to push your progress to remotes in Git, you will want your knowingly broken tests disabled to avoid false alarms in your CI
Lets say you have this test. It’s a blunt example but on Test Driven Development we know that we do “RED-GREEN-REFACTOR” so RED it’s normal.
func testIKnowItsBroken() {
XCTAssert(false)
}
Sometimes, you want to push our progress for whatever reason. If you push this to your CI integrated Git repo it will trigger all sorts of actions that depending on your pay tier could cost you money.
How to disable tests on Swift Packages? Easier than you think
Unlike Xcode that relies on xcodeproj files, Swift Package Manager relies on convention over configuration to run XCTests. So Xcode and swift test
won’t run this tests if we remove the test
prefix from it
func disabled_testIKnowItsBroken() {
XCTAssert(false)
}
That’s it!