<commit_before>/*
Name:           fibonacci - test.js
Source & docs:  https://github.com/fvdm/nodejs-fibonacci
Feedback:       https://github.com/fvdm/nodejs-fibonacci/issues
License:        Unlicense (public domain)
*/

var EventEmitter = require ('events').EventEmitter;
var dotest = require ('dotest');
var app = require ('./');


var eventResult = false;
var eventDone = false;

var iterations = 1000;
var expectNumber = '43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875';


// process events
app.on ('result', function (result) {
  eventResult = result;
});

app.on ('done', function (result) {
  eventDone = result;
});


// module basics
dotest.add ('Module', function (test) {
  test ()
    .isObject ('fail', 'exports', app)
    .isExactly ('fail', 'interface', app instanceof EventEmitter, true)
    .isFunction ('fail', '.iterate', app && app.iterate)
    .isFunction ('fail', '.kill', app && app.kill)
    .done ();<commit_msg>Test: mention EventEmitter in text<commit_after>/*
Name:           fibonacci - test.js
Source & docs:  https://github.com/fvdm/nodejs-fibonacci
Feedback:       https://github.com/fvdm/nodejs-fibonacci/issues
License:        Unlicense (public domain)
*/

var EventEmitter = require ('events').EventEmitter;
var dotest = require ('dotest');
var app = require ('./');


var eventResult = false;
var eventDone = false;

var iterations = 1000;
var expectNumber = '43466557686937456435688527675040625802564660517371780402481729089536555417949051890403879840079255169295922593080322634775209689623239873322471161642996440906533187938298969649928516003704476137795166849228875';


// process events
app.on ('result', function (result) {
  eventResult = result;
});

app.on ('done', function (result) {
  eventDone = result;
});


// module basics
dotest.add ('Module', function (test) {
  test ()
    .isObject ('fail', 'exports', app)
    .isExactly ('fail', 'interface is EventEmitter', app instanceof EventEmitter, true)
    .isFunction ('fail', '.iterate', app && app.iterate)
    .isFunction ('fail', '.kill', app && app.kill)
    .done ();
{'fraction_non_alphanumeric': 0.1354492624050067, 'fraction_numerical': 0.1904336164506035, 'mean_word_length': 4.581047381546135, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '839041', 'n_tokens_mistral': 1012, 'n_tokens_neox': 757, 'n_words': 164}