<commit_before>var chai = require('chai'),
  should = chai.should(),
  express = require('express'),
  app = express(),
  chai = require('chai'),
  sinon = require('sinon'),
  sinonChai = require('sinon-chai'),
  _ = require('underscore'),
  request = require('supertest'),
  proxyquire = require('proxyquire'),
  hypermediaResponseStub = { 
    digestPOST: sinon.stub() 
  },
  digestAdded = {
    create: sinon.stub()
  },
  eventStoreClient = {
    streams: {
      post: sinon.stub()
    },
    projection: {
      getState: sinon.stub()
    }
  },
  controller = proxyquire('../../api/digestsController',
    { 
      './hypermediaResponse' : hypermediaResponseStub,
      './events/digestAdded' : digestAdded,
      './helpers/eventStoreClient': eventStoreClient
    }
  );

chai.use(sinonChai);<commit_msg>Provide dummy values for config module for tests to avoid validation error<commit_after>var chai = require('chai'),
  should = chai.should(),
  express = require('express'),
  app = express(),
  chai = require('chai'),
  sinon = require('sinon'),
  sinonChai = require('sinon-chai'),
  _ = require('underscore'),
  request = require('supertest'),
  proxyquire = require('proxyquire'),
  /* We must provide some dummy values here for the module: */
  config = require ('../../config');
  config.eventStorePassword = '<PASSWORD>';
  config.eventStoreUser = 'admin',
  config.eventStoreBaseUrl = 'http://nothing:7887';

var hypermediaResponseStub = { 
    digestPOST: sinon.stub() 
  },
  digestAdded = {
    create: sinon.stub()
  },
  eventStoreClient = {
    streams: {
      post: sinon.stub()
    },
    projection: {
      getState: sinon.stub()
    }
  },
  controller = proxyquire('../../api/digestsController',
    { 
      './hypermediaResponse' : hypermediaResponseStub,
      './events/digestAdded' : digestAdded,
      './helpers/eventStoreClient': eventStoreClient
    }
  );

chai.use(sinonChai);
{'fraction_non_alphanumeric': 0.1603331598125976, 'fraction_numerical': 0.002082248828735034, 'mean_word_length': 3.309417040358744, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '3215168', 'n_tokens_mistral': 609, 'n_tokens_neox': 619, 'n_words': 114}