We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d945892 commit 7e0c9a4Copy full SHA for 7e0c9a4
Tests/JWTTests/JWTTests.swift
@@ -6,8 +6,16 @@ class EncodeTests: XCTestCase {
6
func testEncodingJWT() {
7
let payload = ["name": "Kyle"] as Payload
8
let jwt = JWT.encode(payload, algorithm: .hs256("secret".data(using: .utf8)!))
9
- let fixture = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiS3lsZSJ9.zxm7xcp1eZtZhp4t-nlw09ATQnnFKIiSN83uG8u6cAg"
10
- XCTAssertEqual(jwt, fixture)
+
+ let expected = [
11
+ // { "alg": "HS256", "typ": "JWT" }
12
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiS3lsZSJ9.zxm7xcp1eZtZhp4t-nlw09ATQnnFKIiSN83uG8u6cAg",
13
14
+ // { "typ": "JWT", "alg": "HS256" }
15
+ "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJuYW1lIjoiS3lsZSJ9.4tCpoxfyfjbUyLjm9_zu-r52Vxn6bFq9kp6Rt9xMs4A",
16
+ ]
17
18
+ XCTAssertTrue(expected.contains(jwt))
19
}
20
21
func testEncodingWithBuilder() {
0 commit comments