/* eslint-env mocha */
// TODO : Do not reference the server from here or any related files
import { dropTestDb } from './utils'
import { SERVER_PORTS } from './constants'
import nconf from 'nconf'

// TODO : Remove the need for this
nconf.set('router', { httpPort: SERVER_PORTS.httpPort })

before(async () => {
  await dropTestDb()
})

/* eslint-env mocha */
require('../src/config/config')

import { SERVER_PORTS } from './constants'
import nconf from 'nconf'

// Set the router http port to the mocked constant value for the tests
nconf.set('router', { httpPort: SERVER_PORTS.httpPort })

Remove the clearing of the database from the script
Remove the clearing of the database from the script

This was causing race conditions with some of the files which were already connected to a mongo connection and then not having a reference to an existing collection. This was picked up in the LogsAPITests were the tests were failing intermittently.
Replaced the inclusion of the entire utils script with just the required config script to override the router httpPort

OHM-732
