Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
@ -1,18 +1,19 @@
|
||||
const expect = require('expect');
|
||||
const converge = require('./converge.js');
|
||||
|
||||
test('Testing converge', () => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
expect(typeof converge === 'function').toBeTruthy();
|
||||
|
||||
test('converge is a Function', () => {
|
||||
expect(converge).toBeInstanceOf(Function);
|
||||
});
|
||||
const average = converge((a, b) => a / b, [
|
||||
arr => arr.reduce((a, v) => a + v, 0),
|
||||
arr => arr.length,
|
||||
]);
|
||||
expect(average([1, 2, 3, 4, 5, 6, 7])).toBe(4);
|
||||
t.equal(average([1, 2, 3, 4, 5, 6, 7]), 4, 'Produces the average of the array');
|
||||
const strangeConcat = converge((a, b) => a + b, [
|
||||
x => x.toUpperCase(),
|
||||
x => x.toLowerCase()]
|
||||
);
|
||||
expect(strangeConcat('Yodel')).toBe("YODELyodel");
|
||||
});
|
||||
t.equal(strangeConcat('Yodel'), "YODELyodel", 'Produces the strange concatenation');
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user