File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -129,5 +129,21 @@ final class ConversionTests: XCTestCase {
129129 XCTAssertTrue ( ( nestedDict [ " anArray " ] as! [ JSConvertible ] ) . count == 4 )
130130 }
131131
132-
132+ func testMassConversionIn( ) throws {
133+ // expand this later ... just doing date for now.
134+ let engine = JSEngine ( )
135+ engine. exceptionHandler = { error in
136+ XCTFail ( )
137+ print ( error)
138+ }
139+
140+ // test date ...
141+ let isoFormatter = ISO8601DateFormatter ( )
142+ let date = isoFormatter. date ( from: " 2024-05-01T12:00:00Z " ) !
143+ engine. setValue ( date, for: " aDate " )
144+ let jsdate = engine. value ( for: " aDate " ) !. typed ( as: Date . self) !
145+ XCTAssertEqual (
146+ Int64 ( jsdate. timeIntervalSince1970 * 1000 ) , 1714564800000 // expected epoch ms for 2024-05-01T12:00:00Z
147+ )
148+ }
133149}
You can’t perform that action at this time.
0 commit comments