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 977949ca61
commit 4f7da1be9b
894 changed files with 5917 additions and 3607 deletions

6
test/on/on.js Normal file
View File

@ -0,0 +1,6 @@
const on = (el, evt, fn, opts = {}) => {
const delegatorFn = e => e.target.matches(opts.target) && fn.call(e.target, e);
el.addEventListener(evt, opts.target ? delegatorFn : fn, opts.options || false);
if (opts.target) return delegatorFn;
};
module.exports = on;

10
test/on/on.test.js Normal file
View File

@ -0,0 +1,10 @@
const expect = require('expect');
const on = require('./on.js');
test('on is a Function', () => {
expect(on).toBeInstanceOf(Function);
});
t.pass('Tested by @chalarangelo on 16/02/2018');