<commit_before>const async = require('async');

function apiSteps () {
  this.Then(/^I should receive a ?(.*?) notification with field ?(.*?) equal to "([^"]*)"$/, function (type, field, value, callback) {
    const main = callbackAsync => {
      setTimeout(() => {
        if (this.api.responses) {
          if (this.api.responses.error) {
            callbackAsync('An error occurred ' + this.api.response.error.toString());
            return false;
          }

          if (this.api.responses.type !== type) {
            callbackAsync(`Wrong notification type received: ${this.api.responses.type}. Expected: ${type}`);
            return false;
          }

          if (this.api.responses[field] !== value) {
            callbackAsync(`Expected notification field "${field}" to be equal to "${value}", but got "${this.api.responses[field]}" instead.`);
          }

          callbackAsync();
        } else {
          callbackAsync('No notification received');
        }
      }, 20);
    };

    async.retry(20, main, err => {
      if (err) {
        if (err.message) {
          err = err.message;
        }

        return callback(new Error(err));
      }

      callback();
    });
  });

  this.Then(/^The notification should ?(not)* have a "([^"]*)" member/, function (not, member, callback) {
    if ((this.api.responses.result[member] || not) && !(this.api.responses.result[member] && not)) {
      callback();
    }
    else {
      console.log('Notification received:');
      console.dir(this.api.responses.result[member], {colors: true, depth: null});
      callback('The document was ' + (not ? 'not ' : '') + 'supposed to contain the member "' + member + '"');<commit_msg>remove functional tests logs for travis<commit_after>const async = require('async');

function apiSteps () {
  this.Then(/^I should receive a ?(.*?) notification with field ?(.*?) equal to "([^"]*)"$/, function (type, field, value, callback) {
    const main = callbackAsync => {
      setTimeout(() => {
        if (this.api.responses) {
          if (this.api.responses.error) {
            callbackAsync('An error occurred ' + this.api.response.error.toString());
            return false;
          }

          if (this.api.responses.type !== type) {
            callbackAsync(`Wrong notification type received: ${this.api.responses.type}. Expected: ${type}`);
            return false;
          }

          if (this.api.responses[field] !== value) {
            callbackAsync(`Expected notification field "${field}" to be equal to "${value}", but got "${this.api.responses[field]}" instead.`);
          }

          callbackAsync();
        } else {
          callbackAsync('No notification received');
        }
      }, 20);
    };

    async.retry(20, main, err => {
      if (err) {
        if (err.message) {
          err = err.message;
        }

        return callback(new Error(err));
      }

      callback();
    });
  });

  this.Then(/^The notification should ?(not)* have a "([^"]*)" member/, function (not, member, callback) {
    if ((this.api.responses.result[member] || not) && !(this.api.responses.result[member] && not)) {
      callback();
    }
    else {
      callback('The document was ' + (not ? 'not ' : '') + 'supposed to contain the member "' + member + '"');
{'fraction_non_alphanumeric': 0.1715151515151515, 'fraction_numerical': 0.0024242424242424242, 'mean_word_length': 2.3076152304609217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2546543', 'n_tokens_mistral': 951, 'n_tokens_neox': 936, 'n_words': 230}