<commit_before>'use strict';

var assert = require('assert')
  , createHash = require('../lib/makehash')
  ;

describe('createHash - inputs', function(){

  it('requires an opts object', function(done){

    var opts = false
      ;

    createHash(opts, function(err, data){
      assert.throws(function(){
          if(err) throw err;
        }, function(err){
          if((err instanceof Error) && /Missing required input: options/.test(err)){
            return true
          }
        },
        "Unexpected error"
      );
      done();
    });

  });

  it('requires opts.email to exist', function(done){

    var opts = {
        email: false
      }
      ;

    createHash(opts, function(err, data){
      assert.throws(function(){
          if(err) throw err;
        }, function(err){
          if((err instanceof Error) && /Missing required param: options.email/.test(err)){
            return true
          }
        },
        "Unexpected error"
      );
      done();
    });

  });

  it('requires opts.password to exist', function(done){

    var opts = {
        email: true,
        password: false
      }
      ;

    createHash(opts, function(err, data){
      assert.throws(function(){
          if(err) throw err;
        }, function(err){
          if((err instanceof Error) && /Missing required param: options.password/.test(err)){
            return true
          }
        },
        "Unexpected error"
      );
      done();
    });

  });

  it('requires opts.challenge to exist', function(done){

    var opts = {
        email: true,
        password: true,
        challenge: false
      }
      ;

    createHash(opts, function(err, data){
      assert.throws(function(){
          if(err) throw err;
        }, function(err){
          if((err instanceof Error) && /Missing required param: options.challenge/.test(err)){
            return true
          }
        },
        "Unexpected error"
      );
      done();
    });

  });

});<commit_msg>Changes code style<commit_after>'use strict';

var assert = require('assert');
var createHash = require('../lib/makehash');

describe('createHash - inputs', function(){

  it('requires an opts object', function(done){

    var opts = false;

    createHash(opts, function(err, data){
      assert.throws(function(){
          if(err) {
            throw err;
          } else {
            console.log(data);
          }
        }, function(err){
          if((err instanceof Error) && /Missing required input: options/.test(err)){
            return true;
          }
        },
        'Unexpected error'
      );
      done();
    });

  });

  it('requires opts.email to exist', function(done){

    var opts = {
      email: false
    };

    createHash(opts, function(err, data){
      assert.throws(function(){
          if(err) {
            throw err;
          } else {
            console.log(data);
          }
        }, function(err){
          if((err instanceof Error) && /Missing required param: options.email/.test(err)){
            return true;
          }
        },
        'Unexpected error'
      );
      done();
    });

  });

  it('requires opts.password to exist', function(done){

    var opts = {
      email: true,
      password: false
    };

    createHash(opts, function(err, data){
      assert.throws(function(){
          if(err) {
            throw err;
          } else {
            console.log(data);
          }
        }, function(err){
          if((err instanceof Error) && /Missing required param: options.password/.test(err)){
            return true;
          }
        },
        'Unexpected error'
      );
      done();
    });

  });

  it('requires opts.challenge to exist', function(done){

    var opts = {
      email: true,
      password: true,
      challenge: false
    };

    createHash(opts, function(err, data){
      assert.throws(function(){
          if(err) {
            throw err;
          } else {
            console.log(data);
          }
        }, function(err){
          if((err instanceof Error) && /Missing required param: options.challenge/.test(err)){
            return true;
          }
        },
        'Unexpected error'
      );
      done();
    });

  });

});
{'fraction_non_alphanumeric': 0.14140938015555032, 'fraction_numerical': 0.0, 'mean_word_length': 1.6658291457286432, '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': '91335', 'n_tokens_mistral': 1192, 'n_tokens_neox': 1141, 'n_words': 273}