Files
30-seconds-of-code/test/functions/functions.test.js
Angelos Chalaris 4f7da1be9b Test migration to jest by hand
Apparently using regular expressions is way easier.
2018-06-18 15:15:56 +03:00

17 lines
442 B
JavaScript

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');