Files
30-seconds-of-code/test/get.test.js
2018-10-19 20:18:00 +03:00

11 lines
351 B
JavaScript

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