Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
15
test/promisify/promisify.test.js
Normal file
15
test/promisify/promisify.test.js
Normal file
@ -0,0 +1,15 @@
|
||||
const expect = require('expect');
|
||||
const promisify = require('./promisify.js');
|
||||
|
||||
|
||||
test('promisify is a Function', () => {
|
||||
expect(promisify).toBeInstanceOf(Function);
|
||||
});
|
||||
const x = promisify(Math.max);
|
||||
test('Returns a promise', () => {
|
||||
expect(x() instanceof Promise).toBeTruthy();
|
||||
});
|
||||
const delay = promisify((d, cb) => setTimeout(cb, d));
|
||||
delay(200).then(() => t.pass('Runs the function provided'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user