<commit_before>jest.dontMock('../index');

var samplePropDefForA = {
  value: 'a',
  writable: true,
  enumerable: true,
  configurable: true
}

describe('util', function() {
  it('can provide default object property attributes', function() {
    var util = require('../index');

    var def = util.defaultObjectProp('a');
    expect(def).toEqual(samplePropDefForA);
  });

  it('can normalize values by sorting arrays and returning the first value', function() {
    var util = require('../index');

    var value = [3, 2, 1];
    var normalized = util.normalizeValue(value);
    expect(normalized).toEqual([1, 2, 3]);
    expect(normalized).toEqual(value.sort());
  });

  it('can search for object keys', function() {
    var util = require('../index');

    var o = { foo: 1, bar: 2, baz: 3 };

    var fooKey = util.objectKeysContain(o, 'foo');
    var bazKey = util.objectKeysContain(o, 'baz');
    var quxKey = util.objectKeysContain(o, 'qux');

    expect(fooKey).toBeTruthy()<commit_msg>Update util test for normalizeValue<commit_after>jest.dontMock('../index');

var samplePropDefForA = {
  value: 'a',
  writable: true,
  enumerable: true,
  configurable: true
}

describe('util', function() {
  it('can provide default object property attributes', function() {
    var util = require('../index');

    var def = util.defaultObjectProp('a');
    expect(def).toEqual(samplePropDefForA);
  });

  it('can normalize values by sorting arrays', function() {
    var util = require('../index');

    var arrOf3 = [3, 1, 4];
    var normalized = util.normalizeValue(arrOf3);

    expect(normalized).toEqual([1, 3, 4]);
    expect(normalized).toEqual(arrOf3.sort());
  });

  it('returns the first value if array length is 1 when normalizing array values', function() {
    var util = require('../index');

    var arrOf1 = [2];
    var normalized = util.normalizeValue(arrOf1);

    expect(normalized).toEqual(2);
    expect(normalized).toEqual(arrOf1[0]);
  })

  it('can search for object keys', function() {
    var util = require('../index');

    var o = { foo: 1, bar: 2, baz: 3 };

    var fooKey = util.objectKeysContain(o, 'foo');
    var bazKey = util.objectKeysContain(o, 'baz');
    var quxKey = util.objectKeysContain(o, 'qux');

    expect(fooKey).toBeTruthy()
{'fraction_non_alphanumeric': 0.16374012291483758, 'fraction_numerical': 0.012291483757682178, 'mean_word_length': 3.708677685950413, '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': '5876827', 'n_tokens_mistral': 767, 'n_tokens_neox': 730, 'n_words': 191}