smartstring/test/test.type.ts

15 lines
476 B
TypeScript
Raw Normal View History

2019-10-10 15:28:23 +00:00
import { tap, expect } from '@pushrocks/tapbundle';
import * as smartstring from '../ts';
tap.test('should state valuid utf8', async () => {
expect(smartstring.type.isUtf8('hithere')).to.be.true;
});
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');
expect(smartstring.type.isBase64(base64String)).to.be.true;
expect(smartstring.type.isBase64('hi there')).to.be.false;
});
2019-10-10 16:14:07 +00:00
tap.start();