import throwOnUndefinedProperty from './index';
test('throws an error when trying to access undefined property', function () {
  var obj = {
    foo: 'bar'
  };
  var protectedObj = throwOnUndefinedProperty(obj);
  expect(protectedObj.foo).toBe('bar');
  expect(function () {
    return protectedObj.baz;
  }).toThrow("Property 'baz' is not defined");
});