<commit_before>'use strict';

process.env.NODE_ENV = 'test';

var path = require('path');

var chai = require('chai'),
sinon = require('sinon'),
sinonChai = require('sinon-chai'),
chaiAsPromised = require('chai-as-promised')

chai.use(sinonChai);
chai.use(chaiAsPromised);

global.chai = chai;
global.sinon = sinon;

global.should = chai.should();
global.expect = chai.expect;
global.assert = chai.assert;
global.AssertionError = chai.AssertionError;

global.spy = sinon.spy;
global.stub = sinon.stub;
global.shared = require('./shared');

// convenience function to require modules in lib directory
global.source = function(module) {
  return require(path.normalize('./../../lib/' + module));
};

global.Spark = source('spark-api');<commit_msg>Silence unhandled rejections in tests<commit_after>'use strict';

process.env.NODE_ENV = 'test';

var path = require('path');

var chai = require('chai'),
sinon = require('sinon'),
sinonChai = require('sinon-chai'),
chaiAsPromised = require('chai-as-promised'),
when = require('when');

when.Promise.onPotentiallyUnhandledRejection = function() {};
chai.use(sinonChai);
chai.use(chaiAsPromised);

global.chai = chai;
global.sinon = sinon;

global.should = chai.should();
global.expect = chai.expect;
global.assert = chai.assert;
global.AssertionError = chai.AssertionError;

global.spy = sinon.spy;
global.stub = sinon.stub;
global.shared = require('./shared');

// convenience function to require modules in lib directory
global.source = function(module) {
  return require(path.normalize('./../../lib/' + module));
};

global.Spark = source('spark-api');
{'fraction_non_alphanumeric': 0.16926920674578388, 'fraction_numerical': 0.0, 'mean_word_length': 5.2578125, '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': '5069101', 'n_tokens_mistral': 548, 'n_tokens_neox': 548, 'n_words': 109}