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

5
test/times/times.js Normal file
View File

@ -0,0 +1,5 @@
const times = (n, fn, context = undefined) => {
let i = 0;
while (fn.call(context, i) !== false && ++i < n) {}
};
module.exports = times;

14
test/times/times.test.js Normal file
View File

@ -0,0 +1,14 @@
const expect = require('expect');
const times = require('./times.js');
test('times is a Function', () => {
expect(times).toBeInstanceOf(Function);
});
var output = '';
times(5, i => (output += i));
test('Runs a function the specified amount of times', () => {
expect(output, '01234').toBe()
});