Skip to content

Commit 42b660f

Browse files
committed
Fixing tests.
1 parent ee55968 commit 42b660f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/test.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
describe('jwt library wrapper (jwt.js)', function () {
2+
// TODO Add RS256 tests
23
it('should fail on invalid data', function () {
34
var result = window.verify('hello', 'bye', false);
45
expect(result.error).not.to.be(null);
56
expect(result.result).to.be('');
67
});
78
it('should verify using ascii secret', function () {
8-
var result = window.verify('eyJhbGciOiJIUzI1NiIsImN0eSI6IkpXVCJ9.eyJhZ2UiOjIxfQ.8nqb61Mdqdama9pZQz07HiIySY6FZC9UjHMKHg6zhjw', 'secret', false);
9+
var result = window.verify('HS256', 'eyJhbGciOiJIUzI1NiIsImN0eSI6IkpXVCJ9.eyJhZ2UiOjIxfQ.8nqb61Mdqdama9pZQz07HiIySY6FZC9UjHMKHg6zhjw', 'secret', false);
910
expect(result.error).to.be.equal(null);
1011
expect(result.result).to.be(true);
1112
});
1213
it('should verify using bas64 encoded secret', function () {
1314
var jwt = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2F1dGgwLmF1dGgwLmNvbS8iLCJzdWIiOiJhdXRoMHw1MjdhYzIxOWQ1ZWFjYzE4ZDQwMDAwMDUiLCJhdWQiOiJhRkd2RFRvNTVHT3RkRVlyb1Fsa3RBMkFHNU1rVDY2SCIsImV4cCI6MTM5NDY5OTg5MiwiaWF0IjoxMzk0NjYzODkyfQ.kEdt5CChBWdPytkGv10mb3tqe6CEcpCQ_DLnEgq69p8';
1415
var secret = '3GdpH_8Ty1Sx_laCRwyUaSl7ddb6xfpR-352SZPFdPKdZ1S8KGtDYbiNMG3Wt61X';
15-
var result = window.verify(jwt, secret, true);
16+
var result = window.verify('HS256', jwt, secret, true);
1617
expect(result.error).to.be.equal(null);
1718
expect(result.result).to.be(true);
1819
});

0 commit comments

Comments
 (0)