ra-core
Version:
Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React
12 lines (10 loc) • 379 B
text/typescript
import getValue from './getValue';
import expect from 'expect';
describe('getValue', () => {
it('returns directly the value if it is not an object', () => {
expect(getValue(10, 'foo.bar')).toEqual(10);
});
it('returns the value at specified path if it is an object', () => {
expect(getValue({ foo: { bar: 10 } }, 'foo.bar')).toEqual(10);
});
});