<commit_before>const chai = require('chai');
const assert = chai.assert;

const Yeti = require('../app/lib/yeti');
const Skier = require('../app/lib/skier');
var yetiEnding = require('../app/lib/yeti-ending');

describe('yetiEnding', function() {
  beforeEach(function () {
    this.canvas = document.createElement('canvas');
    this.canvas.width = 600;
    this.canvas.height = 500;
    this.context = this.canvas.getContext('2d');
  });

  it('should set the yeti to aggressive under the right circumstances', function() {
    var yeti = new Yeti({ canvas: this.canvas, context: this.context });
    var skier = new Skier({ canvas: this.canvas, context: this.context });
    var image = new Image();
    image.src = 'images/sprites.png';
    skier.distance = 30500;
    (function doLotsOfTimes(count) {
      if (count < 10000) {
        yetiEnding(skier, yeti, image);
        count += 1;
        doLotsOfTimes(count);
      }
    })(0);
    assert.strictEqual(yeti.aggressive, true);
  });
});<commit_msg>Fix test that was reaching over its call stack size.<commit_after>const chai = require('chai');
const assert = chai.assert;

const Yeti = require('../app/lib/yeti');
const Skier = require('../app/lib/skier');
var yetiEnding = require('../app/lib/yeti-ending');

describe('yetiEnding', function() {
  beforeEach(function () {
    this.canvas = document.createElement('canvas');
    this.canvas.width = 600;
    this.canvas.height = 500;
    this.context = this.canvas.getContext('2d');
  });

  it('should set the yeti to aggressive under the right circumstances', function() {
    var yeti = new Yeti({ canvas: this.canvas, context: this.context });
    var skier = new Skier({ canvas: this.canvas, context: this.context });
    var image = new Image();
    image.src = 'images/sprites.png';
    skier.distance = 30500;
    (function doLotsOfTimes(count) {
      if (count < 1000) {
        yetiEnding(skier, yeti, image);
        count += 1;
        doLotsOfTimes(count);
      }
    })(0);
    assert.strictEqual(yeti.aggressive, true);
  });
});
{'fraction_non_alphanumeric': 0.1608357628765792, 'fraction_numerical': 0.017978620019436346, 'mean_word_length': 3.3165618448637315, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1747227', 'n_tokens_mistral': 693, 'n_tokens_neox': 655, 'n_words': 159}