<commit_before>sinon = require 'sinon'
rewire = require 'rewire'
express = require 'express'
path = require 'path'

describe 'setup', ->

  before ->
    @setup = rewire '../../lib/setup'

  describe 'setup production environment', ->

    before ->
      @setup.__set__
        NODE_ENV: 'production'
        MAX_SOCKETS: 10
        ipfilter: @ipfilter = sinon.stub().returns((req, res, next) -> next())
        artsyPassport: @artsyPassport = sinon.stub().returns((req, res, next) -> next())
        session: @session = sinon.stub().returns((req, res, next) -> next())
        bodyParser:
          json: @json = sinon.stub().returns((req, res, next) -> next())
          urlencoded: @urlencoded = sinon.stub().returns((req, res, next) -> next())
        bucketAssets: @bucketAssets = sinon.stub().returns((req, res, next) -> next())
        cors: @cors = sinon.stub().returns((req, res, next) -> next())
        artsyPassport: @artsyPassport = sinon.stub().returns((req, res, next) -> next())
        flash: @flash = sinon.stub().returns((req, res, next) -> next())
        logger: @logger = sinon.stub().returns((req, res, next) -> next())
        http: @http = globalAgent: {}
      @app = express()
      sinon.stub @app, 'use'
      sinon.stub @app, 'get'
      sinon.stub @app, 'set'
      @setup @app<commit_msg>Remove dupe artsyPassport stub<commit_after>sinon = require 'sinon'
rewire = require 'rewire'
express = require 'express'
path = require 'path'

describe 'setup', ->

  before ->
    @setup = rewire '../../lib/setup'

  describe 'setup production environment', ->

    before ->
      @setup.__set__
        NODE_ENV: 'production'
        MAX_SOCKETS: 10
        ipfilter: @ipfilter = sinon.stub().returns((req, res, next) -> next())
        artsyPassport: @artsyPassport = sinon.stub().returns((req, res, next) -> next())
        session: @session = sinon.stub().returns((req, res, next) -> next())
        bodyParser:
          json: @json = sinon.stub().returns((req, res, next) -> next())
          urlencoded: @urlencoded = sinon.stub().returns((req, res, next) -> next())
        bucketAssets: @bucketAssets = sinon.stub().returns((req, res, next) -> next())
        cors: @cors = sinon.stub().returns((req, res, next) -> next())
        flash: @flash = sinon.stub().returns((req, res, next) -> next())
        logger: @logger = sinon.stub().returns((req, res, next) -> next())
        http: @http = globalAgent: {}
      @app = express()
      sinon.stub @app, 'use'
      sinon.stub @app, 'get'
      sinon.stub @app, 'set'
      @setup @app
{'fraction_non_alphanumeric': 0.18326848249027236, 'fraction_numerical': 0.0015564202334630351, 'mean_word_length': 2.7642752562225477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 30, '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': '2735472', 'n_tokens_mistral': 827, 'n_tokens_neox': 837, 'n_words': 206}