Skip to content

Commit c6ba030

Browse files
committed
BridgeJS: Unified prelude.mjs tests with de-duplication logic
1 parent 3d4daac commit c6ba030

File tree

10 files changed

+1117
-12876
lines changed

10 files changed

+1117
-12876
lines changed

Package.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ let package = Package(
186186
exclude: [
187187
"bridge-js.config.json",
188188
"bridge-js.d.ts",
189+
"ExportAPITests.swift",
190+
"Generated/BridgeJS.ExportSwift.swift",
191+
"Generated/BridgeJS.ImportTS.swift",
189192
],
190193
swiftSettings: [
191194
.enableExperimentalFeature("Extern")

Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift

Lines changed: 241 additions & 181 deletions
Large diffs are not rendered by default.

Plugins/BridgeJS/Tests/BridgeJSToolTests/BridgeJSLinkTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,21 @@ import Testing
9191
let bridgeJSLink: BridgeJSLink = BridgeJSLink(exportedSkeletons: [outputSkeleton], sharedMemory: false)
9292
try snapshot(bridgeJSLink: bridgeJSLink, name: name + ".Global.Export")
9393
}
94-
94+
9595
@Test
9696
func snapshotMixedModuleExposure() throws {
9797
let globalURL = Self.inputsDirectory.appendingPathComponent("MixedGlobal.swift")
9898
let globalSourceFile = Parser.parse(source: try String(contentsOf: globalURL, encoding: .utf8))
9999
let globalAPI = ExportSwift(progress: .silent, moduleName: "GlobalModule", exposeToGlobal: true)
100100
try globalAPI.addSourceFile(globalSourceFile, "MixedGlobal.swift")
101101
let (_, globalSkeleton) = try #require(try globalAPI.finalize())
102-
102+
103103
let privateURL = Self.inputsDirectory.appendingPathComponent("MixedPrivate.swift")
104104
let privateSourceFile = Parser.parse(source: try String(contentsOf: privateURL, encoding: .utf8))
105105
let privateAPI = ExportSwift(progress: .silent, moduleName: "PrivateModule", exposeToGlobal: false)
106106
try privateAPI.addSourceFile(privateSourceFile, "MixedPrivate.swift")
107107
let (_, privateSkeleton) = try #require(try privateAPI.finalize())
108-
108+
109109
let bridgeJSLink = BridgeJSLink(
110110
exportedSkeletons: [globalSkeleton, privateSkeleton],
111111
sharedMemory: false

Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MixedGlobal.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ func globalFunction() -> String
55
class GlobalClass {
66
@JS public init()
77
@JS public func greet() -> String
8-
}
8+
}

Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MixedPrivate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ func privateFunction() -> String
55
class PrivateClass {
66
@JS public init()
77
@JS public func greet() -> String
8-
}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import XCTest
2+
3+
// Minimal test to ensure BridgeJSGlobalTests compiles and links
4+
class DummyTest: XCTestCase {
5+
func testDummy() {
6+
XCTAssertTrue(true)
7+
}
8+
}

0 commit comments

Comments
 (0)