Nimble lets you write readable expectations for Swift or Objective-C code in tests. It provides matchers, async polling, and require-style assertions alongside XCTest or Swift Testing.
Overview
Nimble is a testing framework for verifying outcomes of Swift or Objective-C expressions. It was inspired by Cedar and focuses on natural-language expectations built from matchers rather than only XCTest assertion macros.
You express tests with expect syntax pointing at matchers for equality, identity, collections, strings, errors, notifications, and many other behaviors. Polling expectations wait for asynchronous values to settle, and async-await support covers modern Swift concurrency. A require DSL fails fast when a matcher does not pass and can return the evaluated value on success.
Objective-C is fully supported with bridging for callback-style waiting. Guides cover writing custom matchers and integrating with XCTest or Swift Testing handlers. Nimble is intended only for test targets and must not ship in App Store binaries; it does not collect analytics.
Installation paths include Swift Package Manager, CocoaPods, Carthage, and git submodules, targeting Apple platforms such as macOS, iOS, tvOS, and watchOS.
Key features
- expect and require expectation DSL
- Large built-in matcher library
- Polling and async-await expectations
- Objective-C and Swift support
- Custom matcher authoring
- XCTest and Swift Testing handlers
- Error and exception matchers
- Collection and string matchers
Use cases
- Readable unit test assertions in Swift
- Async behavior verification
- Objective-C test suites with matchers
- BDD-style specs with Quick
- Custom domain-specific matchers