Skip to content

Commit 1816cd3

Browse files
committed
add test case for issue #70
1 parent 7863a84 commit 1816cd3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/issue_70.tests.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
var jwt = require('../');
2+
3+
describe('issue 70', function () {
4+
5+
it('should work', function () {
6+
var fs = require('fs');
7+
var cert_pub = fs.readFileSync(__dirname + '/pub.pem');
8+
var cert_priv = fs.readFileSync(__dirname + '/priv.pem');
9+
10+
var token = jwt.sign({ foo: 'bar' }, cert_priv, { algorithm: 'RS256'});
11+
12+
jwt.verify(token, cert_pub, function(err, decoded) {
13+
console.log("Decoded: " + JSON.stringify(decoded));
14+
console.log("Error: " + err);
15+
});
16+
17+
});
18+
});

0 commit comments

Comments
 (0)