File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,16 @@ class EncodeTests: XCTestCase {
6
6
func testEncodingJWT( ) {
7
7
let payload = [ " name " : " Kyle " ] as Payload
8
8
let jwt = JWT . encode ( payload, algorithm: . hs256( " secret " . data ( using: . utf8) !) )
9
- let fixture = " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiS3lsZSJ9.zxm7xcp1eZtZhp4t-nlw09ATQnnFKIiSN83uG8u6cAg "
10
- XCTAssertEqual ( jwt, fixture)
9
+
10
+ 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) )
11
19
}
12
20
13
21
func testEncodingWithBuilder( ) {
You can’t perform that action at this time.
0 commit comments