<commit_before>import { expect } from 'chai';
import uAPI from '../../src';
import UtilsValidator from '../../src/Services/Utils/UtilsValidator';

describe('#UtilsValidator', () => {
  describe('.CURRENCY_CONVERSION', () => {
    it('should throw error for undefined', () => {
      const fn = () => UtilsValidator.CURRENCY_CONVERSION({});
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should throw error for null', () => {
      const fn = () => UtilsValidator.CURRENCY_CONVERSION({ currencies: null });
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should check if currencies is array', () => {
      const fn = () => UtilsValidator.CURRENCY_CONVERSION({ currencies: '123' });
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should check if currencies array is not empty', () => {
      const fn = () => UtilsValidator.CURRENCY_CONVERSION({ currencies: [] });
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should check if all fields exists', () => {
      const fn = () =>
        UtilsValidator.CURRENCY_CONVERSION({ currencies: [{ to: 'RUB' }] });
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should check if all fields exists2', () => {
      const fn = () =>
        UtilsValidator.CURRENCY_CONVERSION({ currencies: [{}] });
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should correct validate and return object', () => {
      const params = UtilsValidator.CURRENCY_CONVERSION(
        { currencies: [{ from: 'UAR', to: 'EUR'}] }
      );
      expect(params).not.equal(null);
    });
  });
});<commit_msg>Chnaged  checking for null in validator tests to undefined. No reason to check for null.<commit_after>import { expect } from 'chai';
import uAPI from '../../src';
import UtilsValidator from '../../src/Services/Utils/UtilsValidator';

describe('#UtilsValidator', () => {
  describe('.CURRENCY_CONVERSION', () => {
    it('should throw error for undefined', () => {
      const fn = () => UtilsValidator.CURRENCY_CONVERSION({});
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should throw error for null', () => {
      const fn = () => UtilsValidator.CURRENCY_CONVERSION({ currencies: null });
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should check if currencies is array', () => {
      const fn = () => UtilsValidator.CURRENCY_CONVERSION({ currencies: '123' });
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should check if currencies array is not empty', () => {
      const fn = () => UtilsValidator.CURRENCY_CONVERSION({ currencies: [] });
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should check if all fields exists', () => {
      const fn = () =>
        UtilsValidator.CURRENCY_CONVERSION({ currencies: [{ to: 'RUB' }] });
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should check if all fields exists2', () => {
      const fn = () =>
        UtilsValidator.CURRENCY_CONVERSION({ currencies: [{}] });
      expect(fn).to.throw(uAPI.errors.Utils.UtilsValidationError.CurrenciesMissing);
    });

    it('should correct validate and return object', () => {
      const params = UtilsValidator.CURRENCY_CONVERSION(
        { currencies: [{ from: 'UAR', to: 'EUR'}] }
      );
      expect(params).not.equal(undefined);
    });
  });
});
{'fraction_non_alphanumeric': 0.16834303864478561, 'fraction_numerical': 0.0021175224986765486, 'mean_word_length': 3.520334928229665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 33, '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': '3202845', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1105, 'n_words': 210}