2023-08-18 13:12:25 +02:00
|
|
|
import { tap, expect } from '@push.rocks/tapbundle';
|
2022-03-18 22:50:24 +01:00
|
|
|
import * as smartstring from '../ts/index.js';
|
2019-10-10 17:28:23 +02:00
|
|
|
|
|
|
|
tap.test('should state valuid utf8', async () => {
|
2022-03-18 22:50:24 +01:00
|
|
|
expect(smartstring.type.isUtf8('hithere')).toBeTrue();
|
2019-10-10 17:28:23 +02:00
|
|
|
});
|
|
|
|
|
2019-10-10 18:03:04 +02:00
|
|
|
tap.test('should state wether base64 string is valid', async () => {
|
|
|
|
const base64String = smartstring.base64.encode('hi there');
|
2022-03-18 22:50:24 +01:00
|
|
|
expect(smartstring.type.isBase64(base64String)).toBeTrue();
|
|
|
|
expect(smartstring.type.isBase64('hi there')).toBeFalse();
|
2019-10-10 18:03:04 +02:00
|
|
|
});
|
|
|
|
|
2019-10-10 18:14:07 +02:00
|
|
|
tap.start();
|