<commit_before>const assert = require('chai').assert;
const $      = require('jquery');
const Game   = require('../lib/game');

describe('game', function() {
  it('should exist', function() {
    assert(Game);
  });

  it('is an object', function() {
    assert(new Game());
  });

  it('should render itself', function() {
    var game = new Game();
    var targetDiv = $('#test-game');
    game.render(targetDiv);

    var renderedGame = document.querySelector('.board')
    assert.isNotNull(renderedGame);
  });
});

<commit_msg>create test that game is over<commit_after>const assert = require('chai').assert;
const $      = require('jquery');
const Game   = require('../lib/game');

describe('game', function() {
  it('should exist', function() {
    assert(Game);
  });

  it('is an object', function() {
    assert(new Game());
  });

  it('should render itself', function() {
    var game = new Game();
    var targetDiv = $('#test-game');
    game.render(targetDiv);

    var renderedGame = document.getElementsByClassName('.board')
    assert.isNotNull(renderedGame);
  });

  xit('should wipeout', function() {
    var game = new Game();
    var targetDiv = $('#test-game');
    game.render(targetDiv);

    game.wipeOut();
    var removedClassBoard = document.getElementsByClassName('.board');
    var removedClassColumn = document.getElementsByClassName('.column');
    var removedClassLight = document.getElementsByClassName('.light');

    //assert.include(removedClassBoard, false);
    assert.notInclude(document,'.board');
    assert.isNotNull(removedClassLight);
  });

  it("should toggle it's lights", function() {
    var game = new Game();
    var targetDiv = $('#test-game');
    game.render(targetDiv);

    game.toggleLights(0, 0);

    var lights = [];
    game.board.columns.forEach(function(column) {
      lights.push(column.lights)
    });

    var testedLight = _.flatten(lights)[0];
    var secondTestedLight = _.flatten(lights)[1];
    var sixthTestedLight = _.flatten(lights)[5];

    assert.equal(testedLight.turnedOn, true);
    assert.equal(secondTestedLight.turnedOn, true);
    assert.equal(sixthTestedLight.turnedOn, true);

    game.toggleLights(0, 0);

    assert.equal(testedLight.turnedOn, false);
    assert.equal(secondTestedLight.turnedOn, false);
    assert.equal(sixthTestedLight.turnedOn, false);
  });

  it('checks if game is over by having all lights off', function() {
    var game = new Game();
    var targetDiv = $('#test-game');
    game.render(targetDiv);

    assert.equal(game.allLightsOff(), true)
  });
});


{'fraction_non_alphanumeric': 0.1660186625194401, 'fraction_numerical': 0.0027216174183514776, 'mean_word_length': 3.773654916512059, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3052323', 'n_tokens_mistral': 797, 'n_tokens_neox': 762, 'n_words': 165}