fix(build): migrate project metadata and tooling config to smartconfig
This commit is contained in:
+4
-5
@@ -1,4 +1,4 @@
|
||||
import { expect, tap } from '@push.rocks/tapbundle';
|
||||
import { expect, tap } from '@git.zone/tstest/tapbundle';
|
||||
import * as smartjwt from '../ts/index.js';
|
||||
|
||||
let smartjwtInstance: smartjwt.SmartJwt;
|
||||
@@ -21,7 +21,6 @@ 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).not.toBeNull();
|
||||
console.log(data);
|
||||
console.log(smartjwtInstance.publicKey.toPemString());
|
||||
@@ -32,7 +31,7 @@ tap.test('should not verify a wrong jwt', async () => {
|
||||
const jwt2Array = jwt2.split('.');
|
||||
const testJwtArray = testJwt.split('.');
|
||||
const newJwt = `${testJwtArray[0]}.${jwt2Array[1]}.${testJwtArray[2]}`;
|
||||
let error: Error;
|
||||
let error: Error | undefined;
|
||||
try {
|
||||
await smartjwtInstance.verifyJWTAndGetData(newJwt);
|
||||
} catch (e: any) {
|
||||
@@ -44,8 +43,8 @@ tap.test('should not verify a wrong jwt', async () => {
|
||||
tap.test('should verify a jwt on another instance', async () => {
|
||||
const secondSmartJwtInstance = new smartjwt.SmartJwt();
|
||||
secondSmartJwtInstance.setPublicPemKeyForVerification(smartjwtInstance.publicKey.toPemString());
|
||||
const result = secondSmartJwtInstance.verifyJWTAndGetData(testJwt);
|
||||
const result = await secondSmartJwtInstance.verifyJWTAndGetData(testJwt);
|
||||
console.log(result);
|
||||
});
|
||||
|
||||
tap.start();
|
||||
export default tap.start();
|
||||
|
||||
Reference in New Issue
Block a user