<commit_before>var painless = require('../../assertion/painless')
var t        = painless.assert
var test     = painless.createGroup('Test object/stampit (refs)')

var stampit = require('../../../src/object/stamp')

// Basics refs

test('stampit({ refs })', () => {
  const obj = stampit({ refs: { foo: { bar: 'bar' } } }).create();

  t.is(obj.foo.bar, 'bar',
    'Should set default refs.');
});

test('stampit().refs()', () => {
  const obj = stampit().refs({
    foo: { bar: 'bar' },
    refsOverride: false,
    func1() {}
  }).refs({
    bar: 'bar',
    refsOverride: true,
    func2() {}
  }).create();

  t.is(obj.foo.bar, 'bar',
    'Should set default refs.');
  t.is(obj.bar, 'bar',
    'Should set let you add by chaining .refs().');
  t.ok(obj.refsOverride,
    'Should set let you override by chaining .refs().');
  t.ok(obj.func1,
    'Should mix functions.');
  t.ok(obj.func2,
    'Should mix functions.');
});

test('stampit({ refs }).refs()', () => {
  const obj = stampit({ refs: {
    foo: { bar: 'bar' },
    refsOverride: false,
    func1() {}
  }}).refs({
    bar: 'bar',
    refsOverride: true,
    func2() {}
  }).create();

  t.is(obj.foo.bar, 'bar',
    'Should set default refs.');
  t.is(obj.bar, 'bar',
    'Should set let you add by chaining .refs().');
  t.ok(obj.refsOverride,
    'Should set let you override by chaining .refs().');
  t.ok(obj.func1,
    'Should mix functions.');
  t.ok(obj.func2,
    'Should mix functions.');
});

test('stampit().refs(a, b)', () => {
  const obj = stampit().refs({
    a: 'a'
  }, {
    b: 'b'
  }).create();

  t.ok(obj.a && obj.b,
    'Should mixIn objects when multiple properties are passed.');
});<commit_msg>update test stamp/basic-refs — stampit v3, lint<commit_after>var painless = require('../../assertion/painless')
var t        = painless.assert
var test     = painless.createGroup('Test object/stampit (refs)')

var stampit = require('../../../src/object/stamp')

// Basics refs
// deprecated as of stampit v3 ... reference (refs) alias to properties

test('stampit({ refs }) -- syntax no longer in use -- adjustments made', () => {
  const obj = stampit().refs({foo: {bar: 'bar'}}).create()

  t.is(obj.foo.bar, 'bar',
    'Should set default refs.')
})

test('stampit().refs()', () => {
  const obj = stampit().refs({
    foo: {bar: 'bar'},
    refsOverride: false,
    func1 () {}
  }).refs({
    bar: 'bar',
    refsOverride: true,
    func2 () {}
  }).create()

  t.is(obj.foo.bar, 'bar',
    'Should set default refs.')
  t.is(obj.bar, 'bar',
    'Should set let you add by chaining .refs().')
  t.ok(obj.refsOverride,
    'Should set let you override by chaining .refs().')
  t.ok(obj.func1,
    'Should mix functions.')
  t.ok(obj.func2,
    'Should mix functions.')
})

test('stampit({ refs }).refs() -- syntax no longer in use -- adjustments made', () => {
  const obj = stampit()
    .refs({
      foo: {bar: 'bar'},
      refsOverride: false,
      func1 () {}
    })
    .refs({
      bar: 'bar',
      refsOverride: true,
      func2 () {}
    })
    .create()

  t.is(obj.foo.bar, 'bar',
    'Should set default refs.')
  t.is(obj.bar, 'bar',
    'Should set let you add by chaining .refs().')
  t.ok(obj.refsOverride,
    'Should set let you override by chaining .refs().')
  t.ok(obj.func1,
    'Should mix functions.')
  t.ok(obj.func2,
    'Should mix functions.')
})

test('stampit().refs(a, b)', () => {
  const obj = stampit().refs({
    a: 'a'
  }, {
    b: 'b'
  }).create()

  t.ok(obj.a && obj.b,
    'Should mixIn objects when multiple properties are passed.')
})
{'fraction_non_alphanumeric': 0.20900951315053162, 'fraction_numerical': 0.005036373810856184, 'mean_word_length': 2.7162162162162162, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4414643', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1294, 'n_words': 337}