<commit_before>var path = require('path');
require('chai').should();
var supertest = require('supertest');
var uut = require('../../lib/api');

var recipe = {
  name: 'file',
  input: {
    channel: 'gulp',
    glob: path.join(__dirname, '..', 'fixtures', 'file.json')
  },
  output: {
    channel: 'gulp',
    glob: path.join(__dirname, '..', 'fixtures', 'output')
  }
};
var connections = {};
var channels = require('../../lib/channels')(connections, [recipe]);

var api = uut([recipe], connections, channels);
var request = supertest(api());

describe('api', function() {
  it('return file using recipe', function(done) {
    request
    .get('/file')
    .expect(200, {hello: 'world'}, done)
    ;
  });
});<commit_msg>add test for parameter overrides in api<commit_after>var path = require('path');
require('chai').should();
var supertest = require('supertest');
var uut = require('../../lib/api');

var recipe = {
  name: 'file',
  input: {
    channel: 'gulp',
    glob: path.join(__dirname, '..', 'fixtures', 'file.json')
  },
  output: {
    channel: 'gulp',
    glob: path.join(__dirname, '..', 'fixtures', 'output')
  }
};
var connections = {};
var channels = require('../../lib/channels')(connections, [recipe]);

var api = uut([recipe], connections, channels);
var request = supertest(api());

describe('api', function() {
  it('return file using recipe', function(done) {
    request
    .get('/file')
    .expect(200, {hello: 'world'}, done)
    ;
  });

  it('return different file by overriding parameter', function(done) {
    request
    .get(`/file?override=input.glob=${path.join(__dirname, '..', 'fixtures', 'file2.json')}`)
    .expect(200, {hello: 'there'}, done)
    ;
  });
});
{'fraction_non_alphanumeric': 0.22019964768056371, 'fraction_numerical': 0.005871990604815032, 'mean_word_length': 3.8, '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': '5860660', 'n_tokens_mistral': 570, 'n_tokens_neox': 556, 'n_words': 131}