<commit_before>var Lab = require('lab');
var lab = exports.lab = Lab.script();

var describe = lab.describe;
var it = lab.it;
var expect = Lab.expect;

var equals = require('../equals');

describe('equals', function() {
  it('should work like ===', function (done) {
    var obj = {};
    var compares = [
      ['hey', 'hey'],
      [2, 2],
      [obj, obj],
      ['hey', 'hey'],
      [2, '3'],
      [obj, {}],
      [false, '']
    ];
    compares.forEach(function (items) {
      expect(equals(items[0], items[1])).to.equal(items[0] === items[1]);
    });
    done();
  });
  it('should works with array functions', function (done) {
    expect([1,2,3].map(equals(1))).to.be.eql([true, false, false]);
    done();
  });
});<commit_msg>expanding tests for equals<commit_after>var Lab = require('lab');
var lab = exports.lab = Lab.script();

var describe = lab.describe;
var it = lab.it;
var expect = Lab.expect;

var equals = require('../equals');

describe('equals', function() {
  it('should work like Object.is', function (done) {
    var obj = {};
    var compares = [
      ['hey', 'hey'],
      [2, 2],
      [obj, obj],
      ['hey', 'hey'],
      [2, '3'],
      [obj, {}],
      [false, ''],
      [+1, -1],
      [Number.NaN, NaN]
    ];
    compares.forEach(function (items) {
      expect(equals(items[0], items[1])).to.equal(Object.is(items[0], items[1]));
    });
    // Monkey patching Object.is, better way?
    var temp = Object.is;
    Object.is = false;
    compares.forEach(function (items) {
      expect(equals(items[0], items[1])).to.equal(temp(items[0], items[1]));
    });
    Object.is = temp;
    done();
  });
  it('should works with array functions', function (done) {
    expect([1,2,3].map(equals(1))).to.be.eql([true, false, false]);
    done();
  });
});

{'fraction_non_alphanumeric': 0.22141662018962632, 'fraction_numerical': 0.016731734523145567, 'mean_word_length': 2.883116883116883, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3264140', 'n_tokens_mistral': 641, 'n_tokens_neox': 621, 'n_words': 143}