<commit_before>var assert = require('assert');

describe('Question set', function () {
  let QuestionSet = require('../src/QuestionSet');
  let questions;

  beforeEach(function () {
    questions = new QuestionSet();
  });
  afterEach(function() {
    delete questions;
  });

  it('can be chained', function() {
    assert.equal(questions, questions.narrow());
    assert.equal(questions, questions.noanswers);
  });
  it('#array returns question objects', function() {
    let question = questions.array[0];

    assert.notEqual(question.text, undefined);
    assert.notEqual(question.answer, undefined);
  });
  it('#narrow(10).array returns a 10 element array', function() {
    assert.equal(questions.narrow(10).array.length, 10);
  });
  it('#narrow(0).array returns an empty array', function() {
    let result = questions.narrow(0).array;

    assert.equal(result.constructor, Array);
    assert.equal(result.length, 0);
  });
  it('#narrow(1000).array returns all questions', function() {
    let length = questions.array.length;

    assert.equal(questions.narrow(1000).array.length, length);
  });
  it('#noanswers leaves no answer properties', function() {
    let result = questions.noanswers.array;

    for (var i in result) {
      assert.equal(result[i].answer, undefined);
    }
  });
});
<commit_msg>Change test for better coverage<commit_after>var assert = require('assert');

describe('Question set', function () {
  let QuestionSet = require('../src/QuestionSet');
  let questions;

  beforeEach(function () {
    questions = new QuestionSet();
  });
  afterEach(function() {
    delete questions;
  });

  it('can be chained', function() {
    assert.equal(questions, questions.narrow());
    assert.equal(questions, questions.noanswers);
  });
  it('#array returns valid question objects', function() {
    questions.forEach((question) => {
      assert.notEqual(question.text, undefined);
      assert.notEqual(question.answer, undefined);
      assert.notEqual(question.choice_a, undefined);
    });
  });
  it('#narrow(10).array returns a 10 element array', function() {
    assert.equal(questions.narrow(10).array.length, 10);
  });
  it('#narrow(0).array returns an empty array', function() {
    let result = questions.narrow(0).array;

    assert.equal(result.constructor, Array);
    assert.equal(result.length, 0);
  });
  it('#narrow(1000).array returns all questions', function() {
    let length = questions.array.length;

    assert.equal(questions.narrow(1000).array.length, length);
  });
  it('#noanswers leaves no answer properties', function() {
    let result = questions.noanswers.array;

    for (var i in result) {
      assert.equal(result[i].answer, undefined);
    }
  });
});

{'fraction_non_alphanumeric': 0.15951595159515952, 'fraction_numerical': 0.014301430143014302, 'mean_word_length': 3.9509981851179674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '71367', 'n_tokens_mistral': 844, 'n_tokens_neox': 790, 'n_words': 177}