Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
18
test/when/when.test.js
Normal file
18
test/when/when.test.js
Normal file
@ -0,0 +1,18 @@
|
||||
const expect = require('expect');
|
||||
const when = require('./when.js');
|
||||
|
||||
|
||||
test('when is a Function', () => {
|
||||
expect(when).toBeInstanceOf(Function);
|
||||
});
|
||||
|
||||
const doubleEvenNumbers = when(
|
||||
(x) => x % 2 === 0,
|
||||
(x) => x * 2
|
||||
);
|
||||
|
||||
t.true(doubleEvenNumbers(2) === 4);
|
||||
t.true(doubleEvenNumbers(1) === 1);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user