<commit_before>import { expect } from 'chai';
import MoodJS from '../src/mood';
import { version } from '../package.json';
import { createSVGElement } from './lib/helpers.js'
import Face from '../src/Face';

describe('MoodJS', () => {
  const happy = 'happy';
  const neutral = 'neutral';
  const sad = 'sad';
  let div;
  const selector = '#containerId';

  it('exists', () => {
    expect(MoodJS).to.exist;
  });

  beforeEach('create a face container', () => {
    div = document.createElement('div');
    div.setAttribute('id', selector.replace('#', ''));
    document.body.appendChild(div);
  });

  afterEach(() => {
    while(MoodJS._faces.length) {
      MoodJS._faces.pop(); // reset only for test
    }
    div.remove();
  });

  describe('#properties', () => {
    it('has a version properties', () => {
      expect(MoodJS.version).to.equal(version);
    });
  });

  describe('#add(type, selector[, options])', () => {
    it('adds an svg element as child of selected element by selector', () => {
      MoodJS.add('happy', selector);
      const actual = div.querySelector('svg');
      expect(actual).to.exist;
    });<commit_msg>style: Fix minor style and linter error<commit_after>import { expect } from 'chai';
import MoodJS from '../src/mood';
import { version } from '../package.json';
import { createSVGElement } from './lib/helpers';
import Face from '../src/Face';

describe('MoodJS', () => {
  const happy = 'happy';
  const neutral = 'neutral';
  const sad = 'sad';
  let div;
  const selector = '#containerId';

  it('exists', () => {
    expect(MoodJS).to.exist;
  });

  beforeEach('create a face container', () => {
    div = document.createElement('div');
    div.setAttribute('id', selector.replace('#', ''));
    document.body.appendChild(div);
  });

  afterEach(() => {
    while (MoodJS._faces.length) {
      MoodJS._faces.pop(); // reset only for test
    }
    div.remove();
  });

  describe('#properties', () => {
    it('has a version properties', () => {
      expect(MoodJS.version).to.equal(version);
    });
  });

  describe('#add(type, selector[, options])', () => {
    it('adds an svg element as child of selected element by selector', () => {
      MoodJS.add('happy', selector);
      const actual = div.querySelector('svg');
      expect(actual).to.exist;
    });
{'fraction_non_alphanumeric': 0.19827213822894169, 'fraction_numerical': 0.0, 'mean_word_length': 3.2495412844036697, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7012616', 'n_tokens_mistral': 733, 'n_tokens_neox': 716, 'n_words': 167}