smartstring/test/test.type.both.ts
2023-08-18 13:12:25 +02:00

15 lines
486 B
TypeScript

import { tap, expect } from '@push.rocks/tapbundle';
import * as smartstring from '../ts/index.js';
tap.test('should state valuid utf8', async () => {
expect(smartstring.type.isUtf8('hithere')).toBeTrue();
});
tap.test('should state wether base64 string is valid', async () => {
const base64String = smartstring.base64.encode('hi there');
expect(smartstring.type.isBase64(base64String)).toBeTrue();
expect(smartstring.type.isBase64('hi there')).toBeFalse();
});
tap.start();