smartstring/test/test.type.both.ts

15 lines
485 B
TypeScript
Raw Normal View History

2019-10-10 15:28:23 +00:00
import { tap, expect } from '@pushrocks/tapbundle';
2022-03-18 21:50:24 +00:00
import * as smartstring from '../ts/index.js';
2019-10-10 15:28:23 +00:00
tap.test('should state valuid utf8', async () => {
2022-03-18 21:50:24 +00:00
expect(smartstring.type.isUtf8('hithere')).toBeTrue();
2019-10-10 15:28:23 +00:00
});
2019-10-10 16:03:04 +00:00
tap.test('should state wether base64 string is valid', async () => {
const base64String = smartstring.base64.encode('hi there');
2022-03-18 21:50:24 +00:00
expect(smartstring.type.isBase64(base64String)).toBeTrue();
expect(smartstring.type.isBase64('hi there')).toBeFalse();
2019-10-10 16:03:04 +00:00
});
2019-10-10 16:14:07 +00:00
tap.start();