Comments (1)
Yeah. This is unsurprising, but still disappointing. It's also a bug with Quick, not Nimble - you'd get similar behavior if you tried the following code:
class AsyncConfiguration: QuickConfiguration {
override class func configuration(_ configuration: QCKConfiguration) {
configuration.beforeEach {
let start = Date()
RunLoop.main.run(until: Date(timeIntervalSinceNow: 2))
expect(date.timeIntervalSince(start)).to(beCloseTo(2, within: 0.01)) // this assertion will fail when run with an async spec.
}
}
}
AsyncExample will run the stuff in your QuickConfiguration
, as a matter of fact. This is desired because using any kind of waiting behavior in that kind of global configuration is an edge case (QuickConfiguration
is meant more for doing stuff like configuring your test suite, not waiting for stuff to be available).
This is an issue when you try to run the sync versions of waitUntil
, toEventually
, etc. because those use APIs which no-op when run in an async context.
Possibly we might be able to get around this by detecting these cases and run them on the main actor using MainActor.run
, similar to what we do for the suite hooks (i.e. the beforeSuite
and afterSuite
things) (see https://github.com/Quick/Quick/blob/main/Sources/Quick/Examples/AsyncExample.swift#L38-L40).
from nimble.
Related Issues (20)
- toEventually in Xcode 15 somtimes results in "main run loop was unresponsive" HOT 1
- Question: Advice on using toEventually with UIViewController/UIView in XCTestCase
- Discussion about the project setup and Carthage usage HOT 2
- Quick 7.3.0 and Nimble 13.0.0 ERROR : "Instance member 'testVariablesNotNil' cannot be used on type 'ConditionSelectionTests'" HOT 1
- Attempted to report a test failure to XCTest while no test case was running HOT 5
- Add a `require` function, similar to `expect`, which either returns the expression if it passes, or throws if it fails.
- Privacy Manifest
- Move matcher documentation out of README.md
- Support localization in matchers.
- `throwAssertion` does not work on macOS HOT 2
- Release 13.2.0 is not available through cocoapods source repo/CDN HOT 6
- Trying to write my own matcher but predicate is not working as I expected HOT 1
- Memoize errors
- `expect(nil).toAlways(equal(0))` incorrectly succeeds HOT 5
- Test with toNever(equal(<non nil value>)) fails on encountering nil HOT 2
- Reexamine how Nimble treats nils in Swift code.
- `require(nil).to(beNil())` will incorrectly fail & throw an error.
- Using Nimble types with @MainActor gives a warning when SWIFT_STRICT_CONCURRENCY=targeted due to lack of Sendable conformance HOT 4
- When the current main branch will be in a release? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nimble.