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 {
66 func testEncodingJWT( ) {
77 let payload = [ " name " : " Kyle " ] as Payload
88 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) )
1119 }
1220
1321 func testEncodingWithBuilder( ) {
You can’t perform that action at this time.
0 commit comments