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

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

// Basics statics

test('stampit().statics()', () => {
  const stamp1 = stampit()
    .statics({
      foo() {
        return 42;
      },
      bar: 'space'
    });

  t.ok(stamp1.foo, 'Should add statics props to factory.');
  t.is(stamp1.foo(), 42, 'Should set proper reference.');
  t.is(stamp1.bar, 'space', 'Should set proper reference.');
});

test('stampit({statics})', () => {
  const stamp1 = stampit({
    statics: {
      foo: 42
    }
  });

  t.is(stamp1.foo, 42, 'Should accept statics in options.');
});

test('stampit().statics() last override', () => {
  const stamp1 = stampit()
    .statics({
      foo() {
        return 'override';
      }
    });

  const stamp2 = stampit()
    .statics({
      foo() {}
    }).compose(stamp1);

  t.is(stamp2.foo(), 'override', 'Should override props during composition.');
});

test('stampit().statics(arg1, arg2)', () => {
  const stamp1 = stampit().statics(
    {
      foo1() {}
    },
    {
      foo2() {}
    }
  );

  t.ok(stamp1.foo1, 'Should accept multiple args.');
  t.ok(stamp1.foo2, 'Should accept multiple args.');
});

test('stampit.statics(arg1, arg2)', () => {
  const stamp1 = stampit.statics(
    {
      foo1() {}
    },
    {
      foo2() {}
    }
  );

  t.ok(stamp1.foo1, 'Should accept multiple args.');
  t.ok(stamp1.foo2, 'Should accept multiple args.');
});

test('stampit({statics}).statics()', () => {
  const stamp1 = stampit({
    statics: {
      foo1: 'foo1 value'
    }
  })
    .statics({
      foo2() {
        return 'foo2 value';
      }
    });

  t.is(stamp1.foo1, 'foo1 value', 'Should have statics from options.');
  t.is(stamp1.foo2(), 'foo2 value', 'Should have statics form chain method.');
});
<commit_msg>update test stamp/basic-statics — stampit v3, lint<commit_after>var painless = require('../../assertion/painless')
var t        = painless.assert
var test     = painless.createGroup('Test object/stampit (statics)')

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

// Basics statics

test('stampit().statics()', () => {
  const stamp1 = stampit()
    .statics({
      foo () {
        return 42
      },
      bar: 'space'
    })

  t.ok(stamp1.foo, 'Should add statics props to factory.')
  t.is(stamp1.foo(), 42, 'Should set proper reference.')
  t.is(stamp1.bar, 'space', 'Should set proper reference.')
})

test('stampit({statics}) -- syntax no longer in use -- adjustments made', () => {
  const stamp1 = stampit()
    .statics({
      foo: 42
    })

  t.is(stamp1.foo, 42, 'Should accept statics in options.')
})

test('stampit().statics() last override', () => {
  const stamp1 = stampit()
    .statics({
      foo () {
        return 'override'
      }
    })

  const stamp2 = stampit()
    .statics({
      foo () {}
    }).compose(stamp1)

  t.is(stamp2.foo(), 'override', 'Should override props during composition.')
})

test('stampit().statics(arg1, arg2)', () => {
  const stamp1 = stampit().statics(
    {
      foo1 () {}
    },
    {
      foo2 () {}
    }
  )

  t.ok(stamp1.foo1, 'Should accept multiple args.')
  t.ok(stamp1.foo2, 'Should accept multiple args.')
})

test('stampit.statics(arg1, arg2)', () => {
  const stamp1 = stampit.statics(
    {
      foo1 () {}
    },
    {
      foo2 () {}
    }
  )

  t.ok(stamp1.foo1, 'Should accept multiple args.')
  t.ok(stamp1.foo2, 'Should accept multiple args.')
})

test('stampit({statics}).statics() -- syntax no longer in use -- adjustments made', () => {
  const stamp1 = stampit()
    .statics({
      foo1: 'foo1 value'
    })
    .statics({
      foo2 () {
        return 'foo2 value'
      }
    })

  t.is(stamp1.foo1, 'foo1 value', 'Should have statics from options.')
  t.is(stamp1.foo2(), 'foo2 value', 'Should have statics form chain method.')
})

{'fraction_non_alphanumeric': 0.19197780020181635, 'fraction_numerical': 0.0239656912209889, 'mean_word_length': 2.562443845462713, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2741917', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1428, 'n_words': 312}