Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
16
test/functions/functions.test.js
Normal file
16
test/functions/functions.test.js
Normal file
@ -0,0 +1,16 @@
|
||||
const expect = require('expect');
|
||||
const functions = require('./functions.js');
|
||||
|
||||
|
||||
test('functions is a Function', () => {
|
||||
expect(functions).toBeInstanceOf(Function);
|
||||
});
|
||||
function Foo() {
|
||||
this.a = () => 1;
|
||||
this.b = () => 2;
|
||||
}
|
||||
Foo.prototype.c = () => 3;
|
||||
t.deepEqual(functions(new Foo()), ['a', 'b'], 'Returns own methods');
|
||||
t.deepEqual(functions(new Foo(), true), ['a', 'b', 'c'], 'Returns own and inherited methods');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user