Skip to content

Commit

Permalink
fix(cts): fix requests tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fluf22 committed Jan 29, 2024
1 parent df6761f commit 985fb9e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
14 changes: 6 additions & 8 deletions templates/swift/tests/Package.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,28 @@ let package = Package(
.package(path: "../../../clients/algoliasearch-client-swift"),
],
targets: [
.target(name: "Utils", path: "Tests/Utils"),
.testTarget(
name: "client",
dependencies: [
.product(name: "AnyCodable", package: "AnyCodable"),
.product(name: "SwiftyJSON", package: "SwiftyJSON"),{{#packageList}}
.target(name: "Utils"),{{#packageList}}
.product(
name: "{{.}}",
package: "algoliasearch-client-swift"
),{{/packageList}}
],
path: "Tests",
sources: ["client", "Utils"]
]
),
.testTarget(
name: "requests",
dependencies: [
.product(name: "AnyCodable", package: "AnyCodable"),{{#packageList}}
.product(name: "AnyCodable", package: "AnyCodable"),
.target(name: "Utils"),{{#packageList}}
.product(
name: "{{.}}",
package: "algoliasearch-client-swift"
),{{/packageList}}
],
path: "Tests",
sources: ["requests", "Utils"]
]
)
]
)
5 changes: 3 additions & 2 deletions templates/swift/tests/client/suite.mustache
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import XCTest
import SwiftyJSON

#if canImport(AnyCodable)
import AnyCodable
import AnyCodable
#endif
import Utils

@testable import Core
@testable import {{import}}
Expand Down
2 changes: 2 additions & 0 deletions templates/swift/tests/requests/requests.mustache
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import XCTest

#if canImport(AnyCodable)
import AnyCodable
#endif
import Utils

@testable import Core
@testable import {{import}}
Expand Down
2 changes: 1 addition & 1 deletion tests/output/swift/Tests/Utils/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import Foundation

extension Data {
public extension Data {
var jsonString: String? {
return (try? JSONSerialization.jsonObject(with: self, options: .allowFragments))
.flatMap {
Expand Down

0 comments on commit 985fb9e

Please # to comment.