Test migration to jest by hand

Apparently using regular expressions is way easier.
This commit is contained in:
Angelos Chalaris
2018-06-18 15:15:56 +03:00
parent 5df7098fac
commit a78f5db260
894 changed files with 5917 additions and 3607 deletions

View File

@ -1,4 +1,4 @@
import expect from 'expect';
const expect = require('expect');
const Blob = class{
constructor(s) {
return {
@ -6,14 +6,13 @@ const Blob = class{
};
}
};
// const byteSize = require('./byteSize.js');
// Override
const byteSize = str => new Blob([str]).size;
test('Testing byteSize', () => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
expect(typeof byteSize === 'function').toBeTruthy();
expect(byteSize('a')).toBe(1);
expect(byteSize('Hello World')).toBe(11);
expect(byteSize('😀')).toBe(4);
test('byteSize is a Function', () => {
expect(byteSize).toBeInstanceOf(Function);
});
t.equal(byteSize('a'), 1, 'Works for a single letter');
t.equal(byteSize('Hello World'), 11, 'Works for a common string');
t.equal(byteSize('😀'), 4, 'Works for emoji');