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

9
test/size/size.js Normal file
View File

@ -0,0 +1,9 @@
const size = val =>
Array.isArray(val)
? val.length
: val && typeof val === 'object'
? val.size || val.length || Object.keys(val).length
: typeof val === 'string'
? new Blob([val]).size
: 0;
module.exports = size;

10
test/size/size.test.js Normal file
View File

@ -0,0 +1,10 @@
const expect = require('expect');
const size = require('./size.js');
test('size is a Function', () => {
expect(size).toBeInstanceOf(Function);
});
t.equal(size([1, 2, 3, 4, 5]), 5, "Get size of arrays, objects or strings.");
t.equal(size({ one: 1, two: 2, three: 3 }), 3, "Get size of arrays, objects or strings.");