webjwt/test/test.both.ts

19 lines
506 B
TypeScript
Raw Permalink Normal View History

2023-08-21 06:26:47 +00:00
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
2022-12-22 16:12:15 +00:00
import * as webjwt from '../ts/index.js';
tap.test('first test', async () => {
const originalString = JSON.stringify({
a: {
2022-12-22 16:23:23 +00:00
complex_2: {
object: 'yes',
},
},
2022-12-22 16:12:15 +00:00
});
const stringToDecode = `abc.${btoa(originalString)}.rthgf`;
const result = webjwt.getDataFromJwtString(stringToDecode);
expect(result.a['complex_2'].object).toEqual('yes');
console.log(JSON.stringify(result, null, 2));
});
tap.start();