From ed8c984ed685cc708c628937bd2c66e318b3745e Mon Sep 17 00:00:00 2001 From: Bliss Pisit Wetcha Date: Thu, 5 Oct 2023 12:14:37 +0700 Subject: [PATCH 1/3] [#482] Update Quick and Nimble with better support for async --- Tuist/Interfaces/SwiftUI/Project/Podfile | 4 ++-- Tuist/Interfaces/UIKit/Project/Podfile | 4 ++-- .../Sources/Specs/Application/ApplicationSpec.swift | 6 +++--- .../Sources/Utilities/KIFSpec.swift | 10 ++++++++++ .../Sources/Specs/Data/NetworkAPI/NetworkAPISpec.swift | 2 +- .../Extensions/Foundation/OptionalUnwrapSpec.swift | 2 +- 6 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 {PROJECT_NAME}KIFUITests/Sources/Utilities/KIFSpec.swift diff --git a/Tuist/Interfaces/SwiftUI/Project/Podfile b/Tuist/Interfaces/SwiftUI/Project/Podfile index 7a0d2eed..5c5a1e9a 100644 --- a/Tuist/Interfaces/SwiftUI/Project/Podfile +++ b/Tuist/Interfaces/SwiftUI/Project/Podfile @@ -3,8 +3,8 @@ use_frameworks! inhibit_all_warnings! def testing_pods - pod 'Quick', '~> 6.0' - pod 'Nimble', '~> 11.0' + pod 'Quick', '~> 7.0' + pod 'Nimble', '~> 12.0' pod 'Sourcery' pod 'SwiftFormat/CLI' pod 'OHHTTPStubs/Swift', :configurations => ['Debug Staging', 'Debug Production'] diff --git a/Tuist/Interfaces/UIKit/Project/Podfile b/Tuist/Interfaces/UIKit/Project/Podfile index ab75d34b..1d90e584 100644 --- a/Tuist/Interfaces/UIKit/Project/Podfile +++ b/Tuist/Interfaces/UIKit/Project/Podfile @@ -3,8 +3,8 @@ use_frameworks! inhibit_all_warnings! def testing_pods - pod 'Quick', '~> 6.0' - pod 'Nimble', '~> 11.0' + pod 'Quick', '~> 7.0' + pod 'Nimble', '~> 12.0' pod 'Sourcery' pod 'SwiftFormat/CLI' pod 'OHHTTPStubs/Swift', :configurations => ['Debug Staging', 'Debug Production'] diff --git a/{PROJECT_NAME}KIFUITests/Sources/Specs/Application/ApplicationSpec.swift b/{PROJECT_NAME}KIFUITests/Sources/Specs/Application/ApplicationSpec.swift index 9380ba9f..238a4b10 100644 --- a/{PROJECT_NAME}KIFUITests/Sources/Specs/Application/ApplicationSpec.swift +++ b/{PROJECT_NAME}KIFUITests/Sources/Specs/Application/ApplicationSpec.swift @@ -6,9 +6,9 @@ import Foundation import Nimble import Quick -final class ApplicationSpec: QuickSpec { +final class ApplicationSpec: KIFSpec { - override func spec() { + override class func spec() { describe("a {PROJECT_NAME} screen") { @@ -23,7 +23,7 @@ final class ApplicationSpec: QuickSpec { context("when opens") { it("shows its UI components") { - self.tester().waitForView(withAccessibilityLabel: "Hello, world!") + tester().waitForView(withAccessibilityLabel: "Hello, world!") } } } diff --git a/{PROJECT_NAME}KIFUITests/Sources/Utilities/KIFSpec.swift b/{PROJECT_NAME}KIFUITests/Sources/Utilities/KIFSpec.swift new file mode 100644 index 00000000..15b2e17a --- /dev/null +++ b/{PROJECT_NAME}KIFUITests/Sources/Utilities/KIFSpec.swift @@ -0,0 +1,10 @@ +// +// KIFSpec.swift +// + +import Quick + +class KIFSpec: QuickSpec { + + static let kifDelegate = XCTestCase() +} diff --git a/{PROJECT_NAME}Tests/Sources/Specs/Data/NetworkAPI/NetworkAPISpec.swift b/{PROJECT_NAME}Tests/Sources/Specs/Data/NetworkAPI/NetworkAPISpec.swift index c26bbdd0..1795c9d9 100644 --- a/{PROJECT_NAME}Tests/Sources/Specs/Data/NetworkAPI/NetworkAPISpec.swift +++ b/{PROJECT_NAME}Tests/Sources/Specs/Data/NetworkAPI/NetworkAPISpec.swift @@ -9,7 +9,7 @@ import Quick final class NetworkAPISpec: QuickSpec { - override func spec() { + override class func spec() { describe("a NetworkAPI") { diff --git a/{PROJECT_NAME}Tests/Sources/Specs/Supports/Extensions/Foundation/OptionalUnwrapSpec.swift b/{PROJECT_NAME}Tests/Sources/Specs/Supports/Extensions/Foundation/OptionalUnwrapSpec.swift index c6952037..71d436f7 100644 --- a/{PROJECT_NAME}Tests/Sources/Specs/Supports/Extensions/Foundation/OptionalUnwrapSpec.swift +++ b/{PROJECT_NAME}Tests/Sources/Specs/Supports/Extensions/Foundation/OptionalUnwrapSpec.swift @@ -9,7 +9,7 @@ import Quick final class OptionalUnwrapSpec: QuickSpec { - override func spec() { + override class func spec() { describe("an string optional") { var value: String? From d2905e6a2e96c244f98ff32f989b88916937339d Mon Sep 17 00:00:00 2001 From: Bliss Pisit Wetcha Date: Thu, 5 Oct 2023 12:22:01 +0700 Subject: [PATCH 2/3] [#482] Update KIF --- .../Sources/Utilities/KIF+Swift.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/{PROJECT_NAME}KIFUITests/Sources/Utilities/KIF+Swift.swift b/{PROJECT_NAME}KIFUITests/Sources/Utilities/KIF+Swift.swift index b7b69cd9..66696b28 100644 --- a/{PROJECT_NAME}KIFUITests/Sources/Utilities/KIF+Swift.swift +++ b/{PROJECT_NAME}KIFUITests/Sources/Utilities/KIF+Swift.swift @@ -5,13 +5,13 @@ import KIF -extension XCTestCase { +extension KIFSpec { - func tester(file: String = #file, _ line: Int = #line) -> KIFUITestActor { - return KIFUITestActor(inFile: file, atLine: line, delegate: self) + static func tester(file: String = #file, _ line: Int = #line) -> KIFUITestActor { + return KIFUITestActor(inFile: file, atLine: line, delegate: kifDelegate) } - func system(file: String = #file, _ line: Int = #line) -> KIFSystemTestActor { - return KIFSystemTestActor(inFile: file, atLine: line, delegate: self) + static func system(file: String = #file, _ line: Int = #line) -> KIFSystemTestActor { + return KIFSystemTestActor(inFile: file, atLine: line, delegate: kifDelegate) } } From 3b6e33a4a96dff1b71e39e2af62df48b780a9243 Mon Sep 17 00:00:00 2001 From: Bliss Pisit Wetcha Date: Thu, 5 Oct 2023 12:23:49 +0700 Subject: [PATCH 3/3] [#482] Update Async spec --- .../Sources/Specs/Data/NetworkAPI/NetworkAPISpec.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{PROJECT_NAME}Tests/Sources/Specs/Data/NetworkAPI/NetworkAPISpec.swift b/{PROJECT_NAME}Tests/Sources/Specs/Data/NetworkAPI/NetworkAPISpec.swift index 1795c9d9..23e388c7 100644 --- a/{PROJECT_NAME}Tests/Sources/Specs/Data/NetworkAPI/NetworkAPISpec.swift +++ b/{PROJECT_NAME}Tests/Sources/Specs/Data/NetworkAPI/NetworkAPISpec.swift @@ -7,7 +7,7 @@ import Quick @testable import {PROJECT_NAME} -final class NetworkAPISpec: QuickSpec { +final class NetworkAPISpec: AsyncSpec { override class func spec() {