Skip to content

Default initialized test cases will use Swift Testing rather than XCTest#214

Merged
marcprux merged 2 commits intomainfrom
init-testing
Mar 13, 2026
Merged

Default initialized test cases will use Swift Testing rather than XCTest#214
marcprux merged 2 commits intomainfrom
init-testing

Conversation

@marcprux
Copy link
Member

@marcprux marcprux commented Mar 13, 2026

Previously a new Skip project would have a sample test created using XCTest. With the advent of support for Swift Testing inhttps://github.com//pull/212, the test case will now be created with Testing, like so:

import Testing
import OSLog
import Foundation
@testable import SomeModule

let logger: Logger = Logger(subsystem: "SomeModule", category: "Tests")

@Suite struct SomeModuleTests {
    init() {
        #if SKIP
        // needed to load the compiled bridge from the transpiled tests
        loadPeerLibrary(packageName: "some-model", moduleName: "SomeModule")
        #endif
    }

    @Test func someModule() throws {
        logger.log("running testSomeModule")
        #expect(1 + 2 == 3, "basic test")
    }

    @Test func asyncThrowsFunction() async throws {
        let id = UUID()
        let type: SomeModuleModule.SomeModuleType = try await SomeModuleModule.createSomeModuleType(id: id, delay: 0.001)
        #expect(type.id == id)
    }

}

@cla-bot cla-bot bot added the cla-signed label Mar 13, 2026
@marcprux marcprux merged commit 2ce8882 into main Mar 13, 2026
5 checks passed
@marcprux marcprux deleted the init-testing branch March 13, 2026 18:01
@marcprux marcprux added the testing Issues related to Skip's testing capabilities label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed testing Issues related to Skip's testing capabilities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant