Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev committed Dec 3, 2024
1 parent ec2dbf6 commit 5f113dd
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import XCTest

@testable import Auth
@testable import Helpers

final class JWTTests: XCTestCase {
func testDecodeJWT() throws {
let token =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhdXRoZW50aWNhdGVkIiwiZXhwIjoxNjQ4NjQwMDIxLCJzdWIiOiJmMzNkM2VjOS1hMmVlLTQ3YzQtODBlMS01YmQ5MTlmM2Q4YjgiLCJlbWFpbCI6ImhpQGJpbmFyeXNjcmFwaW5nLmNvIiwicGhvbmUiOiIiLCJhcHBfbWV0YWRhdGEiOnsicHJvdmlkZXIiOiJlbWFpbCIsInByb3ZpZGVycyI6WyJlbWFpbCJdfSwidXNlcl9tZXRhZGF0YSI6e30sInJvbGUiOiJhdXRoZW50aWNhdGVkIn0.CGr5zNE5Yltlbn_3Ms2cjSLs_AW9RKM3lxh7cTQrg0w"
let jwt = try decode(jwt: token)
let jwt = JWT.decodePayload(token)
let exp = try XCTUnwrap(jwt?["exp"] as? TimeInterval)
XCTAssertEqual(exp, 1648640021)
XCTAssertEqual(exp, 1_648_640_021)
}
}

0 comments on commit 5f113dd

Please sign in to comment.