<commit_before>import Player from 'components/player'
import Events from 'base/events'

describe('integration', function() {
  this.timeout(15 * 1000)

  var player

  before(function(done){

    var containerPlayer = document.createElement('div')
    containerPlayer.id = "player"
    document.body.appendChild(containerPlayer)

    player = new Player({
      source: '/base/test/fixtures/SampleVideo_360x240_1mb.mp4',
      parentId: "#player",
      events: {onReady: done}
    })
  })

  it('plays a video', function(done) {
    player.on(Events.PLAYER_PLAY, () => {
      expect(player.isPlaying()).to.be.equal(true)
      done()
    })

    player.play()
  })

  it('pauses a video', function(done) {
    player.on(Events.PLAYER_TIMEUPDATE, () => {
      expect(player.isPlaying()).to.be.equal(false)
      done()
    })

    if (!player.isPlaying()) {player.play()}

    player.pause()
  })

})<commit_msg>integration: resets before each test<commit_after>import Player from 'components/player'
import Events from 'base/events'

describe('integration', function() {
  this.timeout(15 * 1000)

  var player

  before(function(done){
    var containerPlayer = document.createElement('div')
    containerPlayer.id = "player"
    document.body.appendChild(containerPlayer)

    player = new Player({
      source: '/base/test/fixtures/SampleVideo_360x240_1mb.mp4',
      parentId: "#player",
      events: {onReady: done}
    })
  })

  beforeEach(function(){
    player.stop()
  })

  it('plays a video', function(done) {
    player.on(Events.PLAYER_PLAY, () => {
      expect(player.isPlaying()).to.be.equal(true)
      done()
    })

    player.play()
  })

  it('pauses a video', function(done) {
    player.on(Events.PLAYER_PAUSE, () => {
      expect(player.isPlaying()).to.be.equal(false)
      done()
    })
    player.on(Events.PLAYER_PLAY, () => { player.pause() })

    player.play()
  })
})
{'fraction_non_alphanumeric': 0.16002098635886675, 'fraction_numerical': 0.014690451206715634, 'mean_word_length': 3.266219239373602, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '5491516', 'n_tokens_mistral': 652, 'n_tokens_neox': 605, 'n_words': 105}