vibetunnel/ios/VibeTunnelTests
Peter Steinberger eab1e6c962 feat: Update bundle identifiers and add logging configuration profile
- Updated macOS test bundle IDs to use consistent naming pattern:
  - sh.vibetunnel.vibetunnelTests → sh.vibetunnel.vibetunnel.tests
  - sh.vibetunnel.vibetunnelTests.debug → sh.vibetunnel.vibetunnel.tests.debug
- Updated iOS test bundle ID:
  - sh.vibetunnel.VibeTunnelTests-Mobile → sh.vibetunnel.ios.tests
- Fixed iOS logging to use sh.vibetunnel.ios subsystem consistently
- Created logging configuration profile in apple/logging/ to enable full debug logging
- Configuration profile covers all VibeTunnel subsystems and bundle IDs
- Updated documentation to reflect new bundle identifiers and logging setup
2025-07-30 18:04:32 +02:00
..
Mocks feat: Add Bonjour/mDNS service discovery for iOS app (#226) 2025-07-05 11:34:36 +01:00
Models feat: add magic wand button to web frontend for AI sessions (#262) 2025-07-08 02:13:34 +01:00
Services feat: Add Bonjour/mDNS service discovery for iOS app (#226) 2025-07-05 11:34:36 +01:00
Utilities feat: Add Bonjour/mDNS service discovery for iOS app (#226) 2025-07-05 11:34:36 +01:00
Utils feat: Add Bonjour/mDNS service discovery for iOS app (#226) 2025-07-05 11:34:36 +01:00
ViewModels feat: Add Bonjour/mDNS service discovery for iOS app (#226) 2025-07-05 11:34:36 +01:00
APIErrorTests.swift Burn everything with fire that is not node or swift. 2025-06-21 14:39:44 +02:00
AuthenticationTests.swift feat: Update bundle identifiers and add logging configuration profile 2025-07-30 18:04:32 +02:00
EdgeCaseTests.swift Add comprehensive server tests and switch to Biome linter (#73) 2025-06-24 18:51:38 +02:00
FileSystemTests.swift feat: Update bundle identifiers and add logging configuration profile 2025-07-30 18:04:32 +02:00
PerformanceTests.swift feat: Add Bonjour/mDNS service discovery for iOS app (#226) 2025-07-05 11:34:36 +01:00
README.md Burn everything with fire that is not node or swift. 2025-06-21 14:39:44 +02:00
SessionListViewModelTests.swift feat: Add Bonjour/mDNS service discovery for iOS app (#226) 2025-07-05 11:34:36 +01:00
StandaloneTests.swift Unified control protocol and deferred screen recording permissions (#239) 2025-07-08 00:42:13 +01:00
TerminalParsingTests.swift Burn everything with fire that is not node or swift. 2025-06-21 14:39:44 +02:00
TestCoverage.md Burn everything with fire that is not node or swift. 2025-06-21 14:39:44 +02:00
TestingApproach.md Burn everything with fire that is not node or swift. 2025-06-21 14:39:44 +02:00
VibeTunnelTests.swift Burn everything with fire that is not node or swift. 2025-06-21 14:39:44 +02:00
WebSocketReconnectionTests.swift fix warning 2025-06-25 02:11:51 +02:00

VibeTunnel iOS Tests

This directory contains the test suite for the VibeTunnel iOS application using Swift Testing framework.

Test Structure

VibeTunnelTests/
├── Mocks/                   # Mock implementations for testing
│   ├── MockAPIClient.swift
│   ├── MockURLProtocol.swift
│   └── MockWebSocketTask.swift
├── Services/                # Service layer tests
│   ├── APIClientTests.swift
│   ├── BufferWebSocketClientTests.swift
│   └── ConnectionManagerTests.swift
├── Models/                  # Data model tests
│   ├── SessionTests.swift
│   └── ServerConfigTests.swift
├── Utilities/              # Test utilities
│   ├── TestFixtures.swift
│   └── TestTags.swift
└── Integration/            # Integration tests (future)

Running Tests

Command Line

cd ios
swift test

Xcode

  1. Open VibeTunnel.xcodeproj
  2. Select the VibeTunnel scheme
  3. Press Cmd+U or choose Product → Test

CI

Tests run automatically in GitHub Actions on every push and pull request.

Test Tags

Tests are organized with tags for selective execution:

  • @Tag.critical - Core functionality tests
  • @Tag.networking - Network-related tests
  • @Tag.websocket - WebSocket functionality
  • @Tag.models - Data model tests
  • @Tag.persistence - Data persistence tests
  • @Tag.integration - Integration tests

Run specific tags:

swift test --filter .critical
swift test --filter .networking

Writing Tests

This project uses Swift Testing (not XCTest). Key differences:

  • Use @Test attribute instead of test prefix
  • Use #expect() instead of XCTAssert
  • Use @Suite to group related tests
  • Tests run in parallel by default

Example:

@Suite("MyFeature Tests", .tags(.critical))
struct MyFeatureTests {
    @Test("Does something correctly")
    func testFeature() async throws {
        // Arrange
        let sut = MyFeature()
        
        // Act
        let result = try await sut.doSomething()
        
        // Assert
        #expect(result == expectedValue)
    }
}

Coverage Goals

  • APIClient: 90%+
  • BufferWebSocketClient: 85%+
  • Models: 95%+
  • Overall: 80%+