<commit_before>describe('Mixin', function() {

  var IdMixin = {
    getId: function() {
      return this._riot_id
    }
  }

  /*eslint-disable */

  // generated from babeljs
  // src: http://babeljs.io/repl/#?experimental=false&evaluate=true&loose=false&spec=false&code=class%20FunctMixin%20{%0A%20%20init%28%29%20{%0A%20%20%20%20this.type%20%3D%20%27func%27%0A%20%20}%0A%20%20get%20message%28%29%20{%0A%20%20%20%20return%20%27Initialized%27%3B%0A%20%20}%0A}

  var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

  var FunctMixin = (function() {
    function FunctMixin() {
      _classCallCheck(this, FunctMixin);
    }

    _createClass(FunctMixin, [{
      key: 'init',
      value: function init() {
        this.type = 'func';
      }
    }, {
      key: 'message',
      get: function get() {
        return 'Initialized';
      }
    }]);

    return FunctMixin;
  })();

  /*eslint-enable */


  var OptsMixin = {
    getOpts: function() {
      return this.opts
    },

    setOpts: function(options, update) {
      this.opts = options

      if (!update) {
        this.update()
      }

      return this
    }
  }

  var MixinWithInit = {
    init: function() {
      this.message = 'initialized'
    },
    message: 'not yet'
  }

  var globalMixin = {
    globalAttr: 'not yet',
    init: function() {
      this.globalAttr = 'initialized'
    },
    getGlobal: function() {
      return 'global'
    }
  }

  it('Will register a global mixin and mount a tag with global mixed-in methods', function() {
    riot.mixin(globalMixin)

    injectHTML('<my-mixin></my-mixin>')

    riot.tag('my-mixin', '<span>some tag</span>')

    var tag = riot.mount('my-mixin')[0]

    expect('initialized').to.be(tag.globalAttr)
    expect('global').to.be(tag.getGlobal())
  })

  it('Will mount a tag and provide mixed-in methods', function() {

    injectHTML('<my-mixin></my-mixin>')

    riot.tag('my-mixin', '<span>some tag</span>', function(opts) {
      this.mixin(IdMixin)
    })

    var tag = riot.mount('my-mixin')[0]

    expect(tag._riot_id).to.be(tag.getId())
    tag.unmount()
  })

  it('Will mount a tag and provide mixed-in methods from an function constructor instance', function() {<commit_msg>Better description for global mixin test<commit_after>describe('Mixin', function() {

  var IdMixin = {
    getId: function() {
      return this._riot_id
    }
  }

  /*eslint-disable */

  // generated from babeljs
  // src: http://babeljs.io/repl/#?experimental=false&evaluate=true&loose=false&spec=false&code=class%20FunctMixin%20{%0A%20%20init%28%29%20{%0A%20%20%20%20this.type%20%3D%20%27func%27%0A%20%20}%0A%20%20get%20message%28%29%20{%0A%20%20%20%20return%20%27Initialized%27%3B%0A%20%20}%0A}

  var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }

  var FunctMixin = (function() {
    function FunctMixin() {
      _classCallCheck(this, FunctMixin);
    }

    _createClass(FunctMixin, [{
      key: 'init',
      value: function init() {
        this.type = 'func';
      }
    }, {
      key: 'message',
      get: function get() {
        return 'Initialized';
      }
    }]);

    return FunctMixin;
  })();

  /*eslint-enable */


  var OptsMixin = {
    getOpts: function() {
      return this.opts
    },

    setOpts: function(options, update) {
      this.opts = options

      if (!update) {
        this.update()
      }

      return this
    }
  }

  var MixinWithInit = {
    init: function() {
      this.message = 'initialized'
    },
    message: 'not yet'
  }

  var globalMixin = {
    globalAttr: 'not yet',
    init: function() {
      this.globalAttr = 'initialized'
    },
    getGlobal: function() {
      return 'global'
    }
  }

  it('Will register a global mixin and mount a tag with global mixed-in attributes and methods', function() {
    riot.mixin(globalMixin)

    injectHTML('<my-mixin></my-mixin>')

    riot.tag('my-mixin', '<span>some tag</span>')

    var tag = riot.mount('my-mixin')[0]

    expect('initialized').to.be(tag.globalAttr)
    expect('global').to.be(tag.getGlobal())
  })

  it('Will mount a tag and provide mixed-in methods', function() {

    injectHTML('<my-mixin></my-mixin>')

    riot.tag('my-mixin', '<span>some tag</span>', function(opts) {
      this.mixin(IdMixin)
    })

    var tag = riot.mount('my-mixin')[0]

    expect(tag._riot_id).to.be(tag.getId())
    tag.unmount()
  })

  it('Will mount a tag and provide mixed-in methods from an function constructor instance', function() {
{'fraction_non_alphanumeric': 0.15521978021978022, 'fraction_numerical': 0.0260989010989011, 'mean_word_length': 3.3929110105580693, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 19, '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': '6028989', 'n_tokens_mistral': 2036, 'n_tokens_neox': 1896, 'n_words': 399}