<commit_before>if (!process.env.INTEGRATION_TEST_API_KEY || !process.env.INTEGRATION_TEST_APPID) {
  throw new Error('usage: INTEGRATION_TEST_APPID=$APPID INTEGRATION_TEST_API_KEY=$APIKEY npm run test-integration');
}

// simple integration tests, checking the whole communication
var _ = require('lodash');
var Chance = require('chance');
var test = require('tape');

// ensure that on the browser we use the global algoliasearch,
// so that we are absolutely sure the builded version exposes algoliasearch
// in browser integration tests
var algoliasearch;
if (process.browser) {
  algoliasearch = global.algoliasearch;
} else {
  // on nodejs, we require algoliasearch
  algoliasearch = require('../');
}
var getFakeObjects = require('./utils/get-fake-objects');

var chance = new Chance();

var ApiKey = process.env.INTEGRATION_TEST_API_KEY;
var AppID = process.env.INTEGRATION_TEST_APPID;
var indexName = process.env.TRAVIS_BUILD_NUMBER ||
  'JS-integration-tests-' + chance.word({length: 12});

var client = algoliasearch(AppID, ApiKey, {
  protocol: 'https:'
});<commit_msg>test: avoid race conditions in integration test when run in travis<commit_after>if (!process.env.INTEGRATION_TEST_API_KEY || !process.env.INTEGRATION_TEST_APPID) {
  throw new Error('usage: INTEGRATION_TEST_APPID=$APPID INTEGRATION_TEST_API_KEY=$APIKEY npm run test-integration');
}

// simple integration tests, checking the whole communication
var _ = require('lodash');
var Chance = require('chance');
var test = require('tape');

// ensure that on the browser we use the global algoliasearch,
// so that we are absolutely sure the builded version exposes algoliasearch
// in browser integration tests
var algoliasearch;
if (process.browser) {
  algoliasearch = global.algoliasearch;
} else {
  // on nodejs, we require algoliasearch
  algoliasearch = require('../');
}
var getFakeObjects = require('./utils/get-fake-objects');

var chance = new Chance();

var ApiKey = process.env.INTEGRATION_TEST_API_KEY;
var AppID = process.env.INTEGRATION_TEST_APPID;
var indexName = (process.env.TRAVIS_BUILD_NUMBER ||
  'JS-integration-tests-') + chance.word({length: 12});

var client = algoliasearch(AppID, ApiKey, {
  protocol: 'https:'
});
{'fraction_non_alphanumeric': 0.11862877762742445, 'fraction_numerical': 0.0018042399639152007, 'mean_word_length': 5.355300859598854, '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': '4405163', 'n_tokens_mistral': 714, 'n_tokens_neox': 706, 'n_words': 190}