<commit_before>var path = require('path');
var tape = require('tape');
var Provider = require('butter-provider');
var debug = require('debug')('butter-provider:tests')

var pkg = require(path.join(process.cwd(), 'package.json'));
var timeout = 10000;

var config = {
  args: {
    apiURL: "http://movies-v2.api-fetch.website/"
  }
};

if (pkg.butter && pkg.butter.testArgs) {
    config = Provider.prototype.parseArgs(pkg.butter.testArgs);
}

function load() {
    return require(process.cwd());
}

tape('loads', function (t) {
    var P = load();

    t.ok(P, 'we were able to load')

    var I = new P(config.args);

    t.ok(I, 'we were able to instanciate')

    t.ok(I.config.name, 'we have a name')
    t.ok(I.config.uniqueId, 'we have a uniqueId')
    t.ok(I.config.tabName, 'we have a tabName')
    t.ok(I.config.type, 'we have a type')

    t.end();
})

tape('fetch', function (t) {
    debug('fetch, timeout', timeout)
    t.timeoutAfter(timeout);

    var P = load();
    var I = new P(config.args);

    I.fetch({
      page: 1
    }).then(function (r) {
        debug ('fetch', r)
        t.ok(r, 'we were able to fetch')
        t.ok(r.hasMore===true || r.hasMore===false, 'we have a hasMore field that is a boolean: ')
        t.ok(r.results, 'we have a results field')
        t.ok(r.results.length > 0, 'we have at least 1 result')
        t.ok(I.extractIds(r), 'extractIds')
        t.end();
    }).catch(function (e) {
        t.notOk(e, 'failed fetch')
    })
})<commit_msg>indents and semicolons<commit_after>var path = require('path');
var tape = require('tape');
var Provider = require('butter-provider');
var debug = require('debug')('butter-provider:tests');

var pkg = require(path.join(process.cwd(), 'package.json'));
var timeout = 10000;

var config = {
  args: {
    apiURL: "http://movies-v2.api-fetch.website/"
  }
};

if (pkg.butter && pkg.butter.testArgs) {
    config = Provider.prototype.parseArgs(pkg.butter.testArgs);
}

function load() {
  return require(process.cwd());
}

tape('loads', function (t) {
  var P = load();

  t.ok(P, 'we were able to load');

  var I = new P(config.args);

  t.ok(I, 'we were able to instanciate');

  t.ok(I.config.name, 'we have a name');
  t.ok(I.config.uniqueId, 'we have a uniqueId');
  t.ok(I.config.tabName, 'we have a tabName');
  t.ok(I.config.type, 'we have a type');

  t.end();
});

tape('fetch', function (t) {
  debug('fetch, timeout', timeout);
  t.timeoutAfter(timeout);

  var P = load();
  var I = new P(config.args);

  I.fetch({
    page: 1
  }).then(function (r) {
    debug ('fetch', r);
    t.ok(r, 'we were able to fetch');
    t.ok(r.hasMore===true || r.hasMore===false, 'we have a hasMore field that is a boolean: ');
    t.ok(r.results, 'we have a results field');
    t.ok(r.results.length > 0, 'we have at least 1 result');
    t.ok(I.extractIds(r), 'extractIds');
    t.end();
  }).catch(function (e) {
    t.notOk(e, 'failed fetch');
  });
});
{'fraction_non_alphanumeric': 0.19015280135823429, 'fraction_numerical': 0.006112054329371817, 'mean_word_length': 3.155148095909732, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '568150', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1078, 'n_words': 276}