Skip to content

Commit

Permalink
Updated tests for windows compat
Browse files Browse the repository at this point in the history
  • Loading branch information
bsneed committed May 15, 2024
1 parent f11b809 commit a9e490e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 31 deletions.
30 changes: 0 additions & 30 deletions Tests/Segment-Tests/Analytics_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,6 @@ final class Analytics_Tests: XCTestCase {
let outputReader = OutputReaderPlugin()
analytics.add(plugin: outputReader)

#if !os(watchOS) && !os(Linux)
/* Disabling this for now; Newer SDKs, it's getting even more delay-ful.
// prime the pump for userAgent, since it's retrieved async.
let vendorSystem = VendorSystem.current
while vendorSystem.userAgent == nil {
RunLoop.main.run(until: Date.distantPast)
}
*/
#endif

waitUntilStarted(analytics: analytics)

// add a referrer
Expand All @@ -207,12 +197,6 @@ final class Analytics_Tests: XCTestCase {
let referrer = context?["referrer"] as! [String: Any]
XCTAssertEqual(referrer["url"] as! String, "https://google.com")

// this key not present on watchOS (doesn't have webkit)
#if !os(watchOS)
/* Disabling this for now; Newer SDKs, it's getting even more delay-ful. */
//XCTAssertNotNil(context?["userAgent"], "userAgent missing!")
#endif

// these keys not present on linux or Windows
#if !os(Linux) && !os(Windows)
XCTAssertNotNil(context?["app"], "app missing!")
Expand All @@ -228,16 +212,6 @@ final class Analytics_Tests: XCTestCase {
let outputReader = OutputReaderPlugin()
analytics.add(plugin: outputReader)

#if !os(watchOS) && !os(Linux)
/* Disabling this for now; Newer SDKs, it's getting even more delay-ful.
// prime the pump for userAgent, since it's retrieved async.
let vendorSystem = VendorSystem.current
while vendorSystem.userAgent == nil {
RunLoop.main.run(until: Date.distantPast)
}
*/
#endif

waitUntilStarted(analytics: analytics)

// add a referrer
Expand All @@ -259,10 +233,6 @@ final class Analytics_Tests: XCTestCase {

let referrer = context?["referrer"] as! [String: Any]
XCTAssertEqual(referrer["url"] as! String, "https://google.com")

/* Disabling this for now; Newer SDKs, it's getting even more delay-ful.
XCTAssertEqual(context?["userAgent"] as! String, "testing user agent")
*/

// these keys not present on linux
#if !os(Linux) && !os(Windows)
Expand Down
2 changes: 1 addition & 1 deletion Tests/Segment-Tests/HTTPClient_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by Brandon Sneed on 1/21/21.
//

#if !os(Linux)
#if !os(Linux) && !os(Windows)

import XCTest
@testable import Segment
Expand Down

0 comments on commit a9e490e

Please sign in to comment.