var assert = require('assert');
var onlyValue = require('../');

var obj = {
  foo: 42
};
var theKey;

assert.doesNotThrow(function() {
  theKey = onlyValue(obj);
});

assert.equal(onlyValue, obj[Object.keys(obj)[0]]);

obj = {};
assert.doesThrow(function() {
  theKey = onlyValue(obj);
});

obj = {
  foo: 42,
  bar: 24
};
assert.doesThrow(function() {
  theValue = onlyValue(obj);
});

var assert = require('assert');
var onlyValue = require('../');

var obj = {
  foo: 42
};
var theValue;

assert.doesNotThrow(function() {
  theValue = onlyValue(obj);
});

assert.equal(theValue, obj[Object.keys(obj)[0]]);

obj = {};
assert.throws(function() {
  theValue = onlyValue(obj);
});

obj = {
  foo: 42,
  bar: 24
};
assert.throws(function() {
  theValue = onlyValue(obj);
});

Fix up the test