😑 using search-a-licious API now...
This commit is contained in:
@@ -35,15 +35,15 @@ final class OpenFoodFactsTests: XCTestCase {
|
||||
func testSearch() async throws {
|
||||
let response = try await client.search(
|
||||
.query("chocolate"),
|
||||
.tag(tag: .brands, value: "milka"),
|
||||
// .tag(tag: .brands, value: "milka"),
|
||||
.pageSize(5),
|
||||
.sort(.popularity),
|
||||
// .sort(.popularity),
|
||||
)
|
||||
|
||||
let results = response.products
|
||||
let results = response.hits
|
||||
|
||||
let jsonResults = try JSONEncoder().encode(results)
|
||||
_ = jsonResults
|
||||
try jsonResults.write(to: .init(filePath: "./jsonResults.json"))
|
||||
|
||||
XCTAssertFalse(results.isEmpty)
|
||||
XCTAssertEqual(results.count, 5)
|
||||
|
||||
Reference in New Issue
Block a user