Quick Nimble ios test not running
Asked Answered
T

2

5

I'm trying to use Quick & Nimble to test a project but the test is never executed.

I've created a project from scratch using File->New->Project in Xcode. The project is called "MyApp". Then I created a UnitTest target testing "MyApp".

I've added the following Podfile:

use_frameworks!
inhibit_all_warnings!

target 'MyApp' do
  # Pods for Test
  target "MyAppTests" do
  
      pod 'Quick'
      pod 'Nimble'
    end
end

I ran "pod install" and everything went well.

Then, I've created a test file:

import Quick
import Nimble
@testable import MyApp

class TestSpec: QuickSpec {

    override func spec() {
        describe("Describe test") {
            context("Context test") {
                it("Assertion") {
                    expect("toto") == "tata"
                }
            }
        }
    }

}

Then I ran the test. I expected my test to fail but actually: nothing. It's never executed. Do you guys have any idea why?

Thanks a lot.

Title answered 5/4, 2022 at 23:4 Comment(2)
Same as me, not sure if this is M1 or Xcode 13.3, or too low version of Quick/Nimble?Lentiginous
same here, xcode13.3.1Apollonius
L
4

Quick/Nimble test has a related bug for Xcode 13.3. I tested both 13.3 and 13.2.1 and only 13.2.1 can run Nimble tests. Might have to wait for the fix to be merged.

Lentiginous answered 13/4, 2022 at 5:59 Comment(0)
A
2

The bug mentioned here is already fixed, but what I found out is that default version of Quick being installed is 4.0.0. That is unless you tell it a minimum version desired, like this:

pod 'Quick', '~> 5.0.1'

This version has the xcode13.3.1 + Nimble bug fixed.

Apollonius answered 22/4, 2022 at 13:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.