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

var config = require('../lib/config.js');
var init = require('../lib/init.js');
var nxt = require('../lib/nxt.js');
var package = require('../lib/package.js');

describe('Config', function() {
  var confObj;
  it('should load the config object', function() {
    confObj = config.load();
    assert.equal(typeof confObj, 'object');
  });
});

describe('Init', function() {
  it('should write the package file', function(done) {
    var rand = Math.floor(Math.random() * 10000);
    var packageObj = {
      alias: 'test',
      name: rand,
    };
    var path = __dirname + '/tmp/package.json';
    init.writePackageFile(path, packageObj, function() {
      var result = require(path);
      assert.deepEqual(packageObj, result);
      done();
    });
  });
});

describe('Nxt', function() {<commit_msg>fix tests<commit_after>var fs = require('fs');
var assert = require('assert');
var crypto = require('crypto');

global.NXTPM = {
  appName: 'nxtpm',
  account: '<KEY>',
};

var config = require('../lib/config.js');
var init = require('../lib/init.js');
var nxt = require('../lib/nxt.js');
var package = require('../lib/package.js');

describe('Config', function() {
  var confObj;
  it('should load the config object', function() {
    confObj = config.load();
    assert.equal(typeof confObj, 'object');
  });
});

describe('Init', function() {
  it('should write the package file', function(done) {
    var rand = Math.floor(Math.random() * 10000);
    var packageObj = {
      alias: 'test',
      name: rand,
    };
    var path = __dirname + '/tmp/package.json';
    init.writePackageFile(path, packageObj, function() {
      var result = require(path);
      assert.deepEqual(packageObj, result);
      done();
    });
  });
});

describe('Nxt', function() {
{'fraction_non_alphanumeric': 0.19401389631213256, 'fraction_numerical': 0.005344735435595938, 'mean_word_length': 3.5, 'pattern_counts': {'":': 0, '<': 4, '<?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': '7005111', 'n_tokens_mistral': 603, 'n_tokens_neox': 586, 'n_words': 144}