"use strict";

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

var _MultiWeakMap = _interopRequireDefault(require("../MultiWeakMap"));

describe('MultiWeakMap', function () {
  it('retrieves a previously set value', function () {
    var obj1 = {
      x: 1
    };
    var obj2 = {
      x: 2
    };
    var map = new _MultiWeakMap.default(2);
    map.set([obj1, obj2], 4);
    expect(map.has([obj1, obj2])).to.be.true();
    expect(map.get([obj1, obj2])).to.eq(4);
  });
  it('is sensitive to key ordering', function () {
    var obj1 = {
      x: 1
    };
    var obj2 = {
      x: 2
    };
    var map = new _MultiWeakMap.default(2);
    map.set([obj1, obj2], 4);
    expect(map.has([obj2, obj1])).to.be.false();
    expect(map.get([obj2, obj1])).to.be.undefined();
  });
  it('expects the numKeys to be a positive integer', function () {
    expect(function () {
      return new _MultiWeakMap.default('hello');
    }).to.throw();
    expect(function () {
      return new _MultiWeakMap.default(0);
    }).to.throw();
  });
  it('returns undefined when empty', function () {
    var obj1 = {
      x: 1
    };
    var obj2 = {
      x: 2
    };
    var map = new _MultiWeakMap.default(2);
    expect(map.has([obj1, obj2])).to.be.false();
    expect(map.get([obj1, obj2])).to.be.undefined();
  });
});