Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with unit tests / what unit tests revealed #7

Open
almostintuitive opened this issue Feb 17, 2016 · 3 comments
Open

Problems with unit tests / what unit tests revealed #7

almostintuitive opened this issue Feb 17, 2016 · 3 comments

Comments

@almostintuitive
Copy link
Owner

originally by @fabb :

#4 (comment)

these are the open problems with the reactive versions:

  • If one gesture recognizer starts and ends, and then the other starts, the timer is started, but it should not (testBeganPanEndedPanBeganRotateGesture)
  • The last Tick and Completed happen immediately after each other, in the imperative version there is a second time between
  • The timer counts up, not down like the imperative version
  • It leaks (Reactive Code Leaks #5), maybe we can unit test this via RxSwift.resourceCount

Currently 2 problems exist with the unit tests:

  • Cannot use Variable for MockReactiveTimer, as Variable sends the first value immediately, but we need it to wait until the first call to mockExecuteOnTick (I asked at the RxSwift project for some advice on this Mock Timer for Unit Tests ReactiveX/RxSwift#490)
  • Cannot use XCTAssertNil(mockTimer) at the moment, as we need to retain the mockTimer, as it is not directly provided as Observable to the sut
@almostintuitive
Copy link
Owner Author

I'm thinking if we could fix the problem with Variable by using the skip operator?

@fabb
Copy link
Collaborator

fabb commented Feb 17, 2016

Cool, I can edit other's posts ;-)
skip could work for fixing the unit tests. But it would not fix the XCTAssertNil(mockTimer) issue. Let's see, maybe someone in the linked RxSwift issue has an idea. Meanwhile we could try skip.

@almostintuitive
Copy link
Owner Author

this may also come handy: https://github.com/ReactiveX/RxSwift/tree/master/RxTests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants