fix(core): update
This commit is contained in:
parent
d34feacdf1
commit
eaef5d3d78
13
test/test.ts
13
test/test.ts
@ -24,5 +24,18 @@ tap.test('should verify a jwt', async () => {
|
||||
console.log(data);
|
||||
});
|
||||
|
||||
tap.test('should not verify a wrong jwt', async () => {
|
||||
const jwt2 = await smartjwtInstance.createJWT({ wow: 'soclear' });
|
||||
const jwt2Array = jwt2.split('.');
|
||||
const testJwtArray = testJwt.split('.');
|
||||
const newJwt = `${testJwtArray[0]}.${jwt2Array[1]}.${testJwtArray[2]}`;
|
||||
let error: Error;
|
||||
try {
|
||||
await smartjwtInstance.verifyJWTAndGetData(newJwt);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
expect(error).to.be.instanceOf(Error);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
|
Loading…
Reference in New Issue
Block a user