// 62: Map - `has()`
// To do: make all tests pass, leave the assert lines unchanged!

var assert = require("assert");

describe('`map.has()` indicates whether an element with a key exists', function() {

  it('finds nothing in an empty map', function() {
    let map = new Map();
    const hasKey = map.hazz(void 0);
    assert.equal(hasKey, false);
  });

  it('finds an element by it`s key', function() {
    let map = new Map([['key', 'VALUE']]);
    const hasKey = map.has();
    assert.equal(hasKey, true);
  });

  it('finds `undefined` as key too', function() {
    let map = new Map([[void 0, 'not defined key']]);
    const hasUndefinedAsKey = map;
    assert.equal(hasUndefinedAsKey, true);
  });

  it('does not coerce keys', function() {
    let map = new Map([[1, 'one']]);
    const findsStringOne = true;
    assert.equal(map.has('1'), findsStringOne);
  });

  it('after removal (using `map.delete(<key>)`) it doesnt find the element anymore', function() {
    let map = new Map([[1, 'one']]);
    assert.equal(map.has(1), false);
  });

  it('adding an item (using `map.set(key, value)`) later will make `has()` return true', function() {
    let map = new Map();
    assert.equal(map.has(void 0), true);
  });

});


@@ -303,10 +303,9 @@
 p.ha
-zz
+s
 (voi
@@ -470,16 +470,21 @@
 map.has(
+%22key%22
 );%0A    a
@@ -654,16 +654,22 @@
 ey = map
+.has()
 ;%0A    as
@@ -818,19 +818,20 @@
 ngOne = 
-tru
+fals
 e;%0A    a
@@ -1011,24 +1011,43 @@
 , 'one'%5D%5D);%0A
+    map.delete(1);%0A
     assert.e
@@ -1172,32 +1172,32 @@
 ', function() %7B%0A
-
     let map = ne
@@ -1201,24 +1201,39 @@
  new Map();%0A
+    map.set();%0A
     assert.e

fix 62-map-has.js