"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

var _maxContent = _interopRequireDefault(require("../maxContent"));

describe('maxContent', function () {
  var obj = {
    x: 1
  };
  var str = JSON.stringify(obj);
  it('passes when the content is under the max', function () {
    var result = (0, _maxContent.default)(obj, {
      limit: str.length
    });
    expect(result).to.be.undefined();
  });
  it('fails when the content is over the max', function () {
    var result = (0, _maxContent.default)(obj, {
      limit: str.length - 1
    });
    expect(result).to.eq('Maximum content exceeded');
  });
});