File tree Expand file tree Collapse file tree 6 files changed +18
-7
lines changed
Tests/MeiliSearchIntegrationTests Expand file tree Collapse file tree 6 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -33,12 +33,14 @@ class DocumentsTests: XCTestCase {
3333
3434 private var client : MeiliSearch !
3535 private var index : Indexes !
36+ private var session : URLSessionProtocol !
3637 private let uid : String = " books_test "
3738
3839 override func setUp( ) {
3940 super. setUp ( )
4041
41- client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " )
42+ session = URLSession ( configuration: . ephemeral)
43+ client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " , session: session)
4244 index = self . client. index ( self . uid)
4345
4446 let expectation = XCTestExpectation ( description: " Create index if it does not exist " )
Original file line number Diff line number Diff line change @@ -6,14 +6,16 @@ import Foundation
66class DumpsTests : XCTestCase {
77
88 private var client : MeiliSearch !
9+ private var session : URLSessionProtocol !
910 private let uid : String = " books_test "
1011
1112 // MARK: Setup
1213
1314 override func setUp( ) {
1415 super. setUp ( )
1516 if client == nil {
16- client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " )
17+ session = URLSession ( configuration: . ephemeral)
18+ client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " , session: session)
1719 }
1820 }
1921
Original file line number Diff line number Diff line change @@ -5,13 +5,15 @@ import XCTest
55class IndexesTests : XCTestCase {
66
77 private var client : MeiliSearch !
8+ private var session : URLSessionProtocol !
89 private let uid : String = " books_test "
910
1011 override func setUp( ) {
1112 super. setUp ( )
1213
1314 if client == nil {
14- client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " )
15+ session = URLSession ( configuration: . ephemeral)
16+ client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " , session: session)
1517 }
1618 let getIndexesExp = XCTestExpectation ( description: " Try to get all indexes " )
1719 self . client. getIndexes { result in
Original file line number Diff line number Diff line change @@ -72,14 +72,16 @@ class SearchTests: XCTestCase {
7272
7373 private var client : MeiliSearch !
7474 private var index : Indexes !
75+ private var session : URLSessionProtocol !
7576 private let uid : String = " books_test "
7677
7778 // MARK: Setup
7879
7980 override func setUp( ) {
8081 super. setUp ( )
8182
82- client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " )
83+ session = URLSession ( configuration: . ephemeral)
84+ client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " , session: session)
8385 index = self . client. index ( self . uid)
8486
8587 let documents : Data = try ! JSONEncoder ( ) . encode ( books)
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ class SettingsTests: XCTestCase {
77
88 private var client : MeiliSearch !
99 private var index : Indexes !
10+ private var session : URLSessionProtocol !
1011 private let uid : String = " books_test "
1112
1213 private let defaultRankingRules : [ String ] = [
@@ -32,7 +33,8 @@ class SettingsTests: XCTestCase {
3233 override func setUp( ) {
3334 super. setUp ( )
3435
35- client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " )
36+ session = URLSession ( configuration: . ephemeral)
37+ client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " , session: session)
3638 index = self . client. index ( self . uid)
3739
3840 let expectation = XCTestExpectation ( description: " Create index if it does not exist " )
Original file line number Diff line number Diff line change @@ -32,14 +32,15 @@ class UpdatesTests: XCTestCase {
3232
3333 private var client : MeiliSearch !
3434 private var index : Indexes !
35+ private var session : URLSessionProtocol !
3536 private let uid : String = " books_test "
3637
3738 // MARK: Setup
3839
3940 override func setUp( ) {
4041 super. setUp ( )
41-
42- client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " )
42+ session = URLSession ( configuration : . ephemeral )
43+ client = try ! MeiliSearch ( host: " http://localhost:7700 " , apiKey: " masterKey " , session : session )
4344 index = self . client. index ( self . uid)
4445 let expectation = XCTestExpectation ( description: " Create index if it does not exist " )
4546
You can’t perform that action at this time.
0 commit comments