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,13 +1,14 @@
const expect = require('expect');
const collectInto = require('./collectInto.js');
test('Testing collectInto', () => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
expect(typeof collectInto === 'function').toBeTruthy();
test('collectInto is a Function', () => {
expect(collectInto).toBeInstanceOf(Function);
});
const Pall = collectInto(Promise.all.bind(Promise));
let p1 = Promise.resolve(1);
let p2 = Promise.resolve(2);
let p3 = new Promise(resolve => setTimeout(resolve, 2000, 3));
Pall(p1, p2, p3).then(function(val){ expect(val).toEqual([1,2,3]);}, function(reason){});
});
Pall(p1, p2, p3).then(function(val){ t.deepEqual(val, [1,2,3], 'Works with multiple promises');}, function(reason){