Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
9
test/once/once.js
Normal file
9
test/once/once.js
Normal file
@ -0,0 +1,9 @@
|
||||
const once = fn => {
|
||||
let called = false;
|
||||
return function(...args) {
|
||||
if (called) return;
|
||||
called = true;
|
||||
return fn.apply(this, args);
|
||||
};
|
||||
};
|
||||
module.exports = once;
|
||||
10
test/once/once.test.js
Normal file
10
test/once/once.test.js
Normal file
@ -0,0 +1,10 @@
|
||||
const expect = require('expect');
|
||||
const once = require('./once.js');
|
||||
|
||||
|
||||
test('once is a Function', () => {
|
||||
expect(once).toBeInstanceOf(Function);
|
||||
});
|
||||
t.pass('Tested by @chalarangelo on 16/02/2018');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user