Files
30-seconds-of-code/test/get/get.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

12 lines
337 B
JavaScript

const expect = require('expect');
const get = require('./get.js');
test('get is a Function', () => {
expect(get).toBeInstanceOf(Function);
});
const obj = { selector: { to: { val: 'val to get' } } };
t.deepEqual(get(obj, 'selector.to.val'), ['val to get'], "Retrieve a property indicated by the selector from an object.");