mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-01-31 04:52:05 +00:00
Share tests timeout and set to .infinity
This commit is contained in:
parent
9b8ebc10a8
commit
e49e8881b3
@ -58,7 +58,7 @@ extension ExtendedTunnelTests {
|
||||
.store(in: &subscriptions)
|
||||
|
||||
try await tunnel.disconnect()
|
||||
await fulfillment(of: [exp], timeout: 1.0)
|
||||
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
|
||||
XCTAssertEqual(sut.lastErrorCode, .crypto)
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ extension ExtendedTunnelTests {
|
||||
.store(in: &subscriptions)
|
||||
|
||||
try await tunnel.install(profile, connect: true, title: \.name)
|
||||
await fulfillment(of: [exp], timeout: 1.0)
|
||||
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
|
||||
XCTAssertEqual(sut.dataCount, dataCount)
|
||||
}
|
||||
|
||||
|
@ -381,7 +381,7 @@ extension IAPManagerTests {
|
||||
.store(in: &subscriptions)
|
||||
|
||||
await sut.reloadReceipt()
|
||||
await fulfillment(of: [exp], timeout: 1.0)
|
||||
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
|
||||
|
||||
XCTAssertEqual(sut.eligibleFeatures, [
|
||||
.appleTV,
|
||||
@ -433,7 +433,7 @@ extension IAPManagerTests {
|
||||
.store(in: &subscriptions)
|
||||
|
||||
sut.observeObjects()
|
||||
await fulfillment(of: [exp], timeout: 1.0)
|
||||
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
|
||||
|
||||
XCTAssertNotEqual(sut.userLevel, .undefined)
|
||||
XCTAssertFalse(sut.eligibleFeatures.isEmpty)
|
||||
|
@ -31,8 +31,6 @@ import XCTest
|
||||
|
||||
@MainActor
|
||||
final class ProfileManagerTests: XCTestCase {
|
||||
private let timeout = 3.0
|
||||
|
||||
private var subscriptions: Set<AnyCancellable> = []
|
||||
}
|
||||
|
||||
@ -247,7 +245,7 @@ extension ProfileManagerTests {
|
||||
.store(in: &subscriptions)
|
||||
|
||||
try await sut.save(profile)
|
||||
await fulfillment(of: [exp], timeout: timeout)
|
||||
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
|
||||
}
|
||||
|
||||
func test_givenRepository_whenRemove_thenIsRemoved() async throws {
|
||||
@ -294,7 +292,7 @@ extension ProfileManagerTests {
|
||||
.store(in: &subscriptions)
|
||||
|
||||
try await sut.save(profile, remotelyShared: true)
|
||||
await fulfillment(of: [exp], timeout: timeout)
|
||||
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
|
||||
|
||||
XCTAssertTrue(sut.isRemotelyShared(profileWithId: profile.id))
|
||||
}
|
||||
@ -321,7 +319,7 @@ extension ProfileManagerTests {
|
||||
.store(in: &subscriptions)
|
||||
|
||||
try await sut.save(profile, remotelyShared: false)
|
||||
await fulfillment(of: [exp], timeout: timeout)
|
||||
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
|
||||
|
||||
XCTAssertFalse(sut.isRemotelyShared(profileWithId: profile.id))
|
||||
}
|
||||
@ -731,6 +729,6 @@ private extension ProfileManagerTests {
|
||||
.store(in: &subscriptions)
|
||||
|
||||
try await action(sut)
|
||||
await fulfillment(of: [exp], timeout: timeout)
|
||||
await fulfillment(of: [exp], timeout: CommonLibraryTests.timeout)
|
||||
}
|
||||
}
|
||||
|
30
Passepartout/Library/Tests/CommonLibraryTests/Shared.swift
Normal file
30
Passepartout/Library/Tests/CommonLibraryTests/Shared.swift
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Shared.swift
|
||||
// Passepartout
|
||||
//
|
||||
// Created by Davide De Rosa on 11/26/24.
|
||||
// Copyright (c) 2024 Davide De Rosa. All rights reserved.
|
||||
//
|
||||
// https://github.com/passepartoutvpn
|
||||
//
|
||||
// This file is part of Passepartout.
|
||||
//
|
||||
// Passepartout is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Passepartout is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Passepartout. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
enum CommonLibraryTests {
|
||||
static let timeout: TimeInterval = .infinity
|
||||
}
|
Loading…
Reference in New Issue
Block a user