Skip to content

Commit 7bce3c7

Browse files
BridgeJS: Fix macro test suites silently ignoring failures
1 parent b0bf4a3 commit 7bce3c7

File tree

6 files changed

+228
-167
lines changed

6 files changed

+228
-167
lines changed

Plugins/BridgeJS/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ let package = Package(
7272
name: "BridgeJSMacrosTests",
7373
dependencies: [
7474
"BridgeJSMacros",
75-
.product(name: "SwiftSyntaxMacrosTestSupport", package: "swift-syntax"),
75+
.product(name: "SwiftSyntaxMacrosGenericTestSupport", package: "swift-syntax"),
7676
]
7777
),
7878

Plugins/BridgeJS/Tests/BridgeJSMacrosTests/JSClassMacroTests.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import SwiftDiagnostics
22
import SwiftSyntax
33
import SwiftSyntaxMacroExpansion
4-
import SwiftSyntaxMacros
5-
import SwiftSyntaxMacrosTestSupport
4+
import SwiftSyntaxMacrosGenericTestSupport
65
import Testing
76
import BridgeJSMacros
87

@@ -13,14 +12,15 @@ import BridgeJSMacros
1312
]
1413

1514
@Test func emptyStruct() {
16-
assertMacroExpansion(
15+
TestSupport.assertMacroExpansion(
1716
"""
1817
@JSClass
1918
struct MyClass {
2019
}
2120
""",
2221
expandedSource: """
2322
struct MyClass {
23+
2424
let jsObject: JSObject
2525
2626
init(unsafelyWrapping jsObject: JSObject) {
@@ -32,12 +32,12 @@ import BridgeJSMacros
3232
}
3333
""",
3434
macroSpecs: macroSpecs,
35-
indentationWidth: indentationWidth
35+
indentationWidth: indentationWidth,
3636
)
3737
}
3838

3939
@Test func structWithExistingJSObject() {
40-
assertMacroExpansion(
40+
TestSupport.assertMacroExpansion(
4141
"""
4242
@JSClass
4343
struct MyClass {
@@ -62,7 +62,7 @@ import BridgeJSMacros
6262
}
6363

6464
@Test func structWithExistingInit() {
65-
assertMacroExpansion(
65+
TestSupport.assertMacroExpansion(
6666
"""
6767
@JSClass
6868
struct MyClass {
@@ -89,7 +89,7 @@ import BridgeJSMacros
8989
}
9090

9191
@Test func structWithBothExisting() {
92-
assertMacroExpansion(
92+
TestSupport.assertMacroExpansion(
9393
"""
9494
@JSClass
9595
struct MyClass {
@@ -118,7 +118,7 @@ import BridgeJSMacros
118118
}
119119

120120
@Test func structWithMembers() {
121-
assertMacroExpansion(
121+
TestSupport.assertMacroExpansion(
122122
"""
123123
@JSClass
124124
struct MyClass {
@@ -145,7 +145,7 @@ import BridgeJSMacros
145145
}
146146

147147
@Test func _class() {
148-
assertMacroExpansion(
148+
TestSupport.assertMacroExpansion(
149149
"""
150150
@JSClass
151151
class MyClass {
@@ -168,7 +168,7 @@ import BridgeJSMacros
168168
}
169169

170170
@Test func _enum() {
171-
assertMacroExpansion(
171+
TestSupport.assertMacroExpansion(
172172
"""
173173
@JSClass
174174
enum MyEnum {
@@ -191,7 +191,7 @@ import BridgeJSMacros
191191
}
192192

193193
@Test func _actor() {
194-
assertMacroExpansion(
194+
TestSupport.assertMacroExpansion(
195195
"""
196196
@JSClass
197197
actor MyActor {
@@ -214,7 +214,7 @@ import BridgeJSMacros
214214
}
215215

216216
@Test func structWithDifferentJSObjectName() {
217-
assertMacroExpansion(
217+
TestSupport.assertMacroExpansion(
218218
"""
219219
@JSClass
220220
struct MyClass {
@@ -241,7 +241,7 @@ import BridgeJSMacros
241241
}
242242

243243
@Test func structWithDifferentInit() {
244-
assertMacroExpansion(
244+
TestSupport.assertMacroExpansion(
245245
"""
246246
@JSClass
247247
struct MyClass {
@@ -270,7 +270,7 @@ import BridgeJSMacros
270270
}
271271

272272
@Test func structWithMultipleMembers() {
273-
assertMacroExpansion(
273+
TestSupport.assertMacroExpansion(
274274
"""
275275
@JSClass
276276
struct MyClass {
@@ -299,7 +299,7 @@ import BridgeJSMacros
299299
}
300300

301301
@Test func structWithComment() {
302-
assertMacroExpansion(
302+
TestSupport.assertMacroExpansion(
303303
"""
304304
/// Documentation comment
305305
@JSClass
@@ -325,7 +325,7 @@ import BridgeJSMacros
325325
}
326326

327327
@Test func structAlreadyConforms() {
328-
assertMacroExpansion(
328+
TestSupport.assertMacroExpansion(
329329
"""
330330
@JSClass
331331
struct MyClass: _JSBridgedClass {

0 commit comments

Comments
 (0)