{"size": 1468, "ext": "js", "max_stars_repo_path": "katas/es6/language/map/has.js", "max_stars_repo_name": "Ceheiss/katas", "max_stars_repo_stars_event_min_datetime": "2015-04-08T17:06:11.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-18T13:33:59.000Z", "max_issues_repo_path": "katas/es6/language/map/has.js", "max_issues_repo_name": "Ceheiss/katas", "max_issues_repo_issues_event_min_datetime": "2015-04-20T14:22:14.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-05T19:00:24.000Z", "max_forks_repo_path": "katas/es6/language/map/has.js", "max_forks_repo_name": "Ceheiss/katas", "max_forks_repo_forks_event_min_datetime": "2015-04-20T10:15:10.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-15T15:53:55.000Z"}
{"max_stars_count": 141, "max_issues_count": 60, "max_forks_count": 73, "avg_line_length": 34.1395348837, "max_line_length": 101, "alphanum_fraction": 0.5967302452}
// 62: Map - `has()` 
// To do: make all tests pass, leave the assert lines unchanged!
// Follow the hints of the failure messages!

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);
    const hasKey = map.has(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();
    const hasKey = map.has('key');
    assert.equal(hasKey, true);
  });
  it('finds `undefined` as key too', function() {
    let map = new Map([[void 0, 'not defined key']]);
    //// const hasUndefinedAsKey = map;
    const hasUndefinedAsKey = map.has();
    assert.equal(hasUndefinedAsKey, true);
  });
  it('does not coerce keys', function() {
    let map = new Map([[1, 'one']]);
    //// const findsStringOne = true;
    const findsStringOne = false;
    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']]);
    ////
    map.delete(1);
    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();
    ////
    map.set(void 0, '');
    assert.equal(map.has(void 0), true);
  });
});
