BREAKING CHANGE(core): switch to esm

This commit is contained in:
2022-10-24 07:14:17 +02:00
parent 85d958e424
commit 60da639d69
13 changed files with 4489 additions and 26248 deletions

View File

@ -1,5 +1,5 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as smartjwt from '../ts/index';
import * as smartjwt from '../ts/index.js';
let smartjwtInstance: smartjwt.SmartJwt;
let testJwt: string;
@ -22,7 +22,7 @@ tap.test('should create a new jwt', async () => {
tap.test('should verify a jwt', async () => {
const data = await smartjwtInstance.verifyJWTAndGetData(testJwt);
// tslint:disable-next-line: no-unused-expression
expect(data).to.not.be.null;
expect(data).not.toBeNull();
console.log(data);
console.log(smartjwtInstance.publicKey.toPemString());
});
@ -38,7 +38,7 @@ tap.test('should not verify a wrong jwt', async () => {
} catch (e: any) {
error = e;
}
expect(error).to.be.instanceOf(Error);
expect(error).toBeInstanceOf(Error);
});
tap.test('should verify a jwt on another instance', async () => {