import XCTest
import SwiftUI
@testable import ViewInspector

final class TreeViewTests: XCTestCase {
    
    #if !os(tvOS)
    func testEnclosedView() throws {
        let sut = Text("Test").contextMenu(ContextMenu(menuItems: { Text("Menu") }))
        let text = try sut.inspect().text().string()
        XCTAssertEqual(text, "Test")
    }
    #endif
}

import XCTest
import SwiftUI
@testable import ViewInspector

final class TreeViewTests: XCTestCase {
    
    func testEnclosedView() throws {
        let sut = Text("Test").contextMenu(ContextMenu(menuItems: { Text("Menu") }))
        let text = try sut.inspect().text().string()
        XCTAssertEqual(text, "Test")
    }
}

--- 
+++ 
@@ -4,9 +4,11 @@
 
 final class TreeViewTests: XCTestCase {
     
+    #if !os(tvOS)
     func testEnclosedView() throws {
         let sut = Text("Test").contextMenu(ContextMenu(menuItems: { Text("Menu") }))
         let text = try sut.inspect().text().string()
         XCTAssertEqual(text, "Test")
     }
+    #endif
 }
Exclude a test for tvOS
