Skip to content

Commit 7836ac2

Browse files
committed
Merge remote-tracking branch 'upstream/master' into typed-array
2 parents b0ff949 + 04dc4ad commit 7836ac2

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

IntegrationTests/TestSuites/Sources/PrimaryTests/UnitTestUtils.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import JavaScriptKit
22

3-
let printTestNames = false
3+
var printTestNames = false
4+
// Uncomment the next line to print the name of each test suite before running it.
5+
// This will make it easier to debug any errors that occur on the JS side.
6+
//printTestNames = true
47

58
func test(_ name: String, testBlock: () throws -> Void) {
69
if printTestNames { print(name) }

IntegrationTests/TestSuites/Sources/PrimaryTests/main.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ test("Call Function With This") {
264264
}
265265

266266
test("Object Conversion") {
267-
let array1 = [1, 2, 3]
268-
let jsArray1 = array1.jsValue().object!
269-
try expectEqual(jsArray1.length, .number(3))
270-
try expectEqual(jsArray1[0], .number(1))
271-
try expectEqual(jsArray1[1], .number(2))
272-
try expectEqual(jsArray1[2], .number(3))
267+
let array1 = [1, 2, 3]
268+
let jsArray1 = array1.jsValue().object!
269+
try expectEqual(jsArray1.length, .number(3))
270+
try expectEqual(jsArray1[0], .number(1))
271+
try expectEqual(jsArray1[1], .number(2))
272+
try expectEqual(jsArray1[2], .number(3))
273273

274274
let array2: [JSValueConvertible] = [1, "str", false]
275275
let jsArray2 = array2.jsValue().object!
@@ -279,9 +279,9 @@ test("Object Conversion") {
279279
try expectEqual(jsArray2[2], .boolean(false))
280280
_ = jsArray2.push!(5)
281281
try expectEqual(jsArray2.length, .number(4))
282-
_ = jsArray2.push!(jsArray1)
282+
_ = jsArray2.push!(jsArray1)
283283

284-
try expectEqual(jsArray2[4], .object(jsArray1))
284+
try expectEqual(jsArray2[4], .object(jsArray1))
285285

286286
let dict1: [String: JSValueConvertible] = [
287287
"prop1": 1,
@@ -339,7 +339,7 @@ func jsStringify(_ array: [Any]) -> String {
339339
test("TypedArray") {
340340
let numbers = [UInt8](0 ... 255)
341341
let typedArray = JSTypedArray(numbers)
342-
try expectEqual(typedArray[12], .number(12))
342+
try expectEqual(typedArray[12], 12)
343343

344344
try checkArray([0, .max, 127, 1] as [UInt8])
345345
try checkArray([0, 1, .max, .min, -1] as [Int8])

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ let package = Package(
3838
.when(platforms: [.wasi])
3939
),
4040
]
41-
)
41+
),
4242
]
4343
)

0 commit comments

Comments
 (0)