TestHarness 0.1.0

TestHarness 0.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jan 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by Valentin Knabel.



 
Depends on:
RxSwift~> 3.0
RxBlocking~> 3.0
 

Taps

Taps is a lightweight Unit Test library optimized for asynchronous code. it has been implemented using RxSwift and therefore you can easily test your own Observables with ease.

As the generated output is TAP13 compatible, you can easily customize it yourself. You can either use Taps integrated TapsHarness or you can use the pod TestHarness to customize the output.

Currently it is under development.

Example

func describeReadmeExamples(t: Taps) {
  t.test("asynchronous test") { t in
    async {
      t.pass()
      t.end()
    }
  }

  t.test("synchronous test", plan: 1) { t in
    t.equal(someInt(), 1)
  }

  t.rx.test("reactive test") { (t: Test) -> Observable<Int> in
    let myService = MyService()
    return myService.someObservable()
      .test(
        onNext: t.equal(to: 3, "should only emit 3"),
        onError: t.fail(with: "should not throw")
      )
  }
}

Taps.runMain(tests: [
  describeReadmeExamples
])

License

Finite is available under the MIT license. See the LICENSE file for more info.