message: while writing the test, I discovered a bug; also refactor a little.
diff: @@ -216,11 +216,13 @@ async function createDeployTask(deployData: Object) {
  `projectName: ${projectName}, branchName: ${branchName}, production environment, no environment limits considered`,
  )
  } else {
  - // strip out production environment
  - dev_environment = environments.project.environments.filter (e => e.environment_type=='development');
  - if (environments.project.environment_limit !== null && dev_environment.length >= environments.project.environment_limit ) {
  + // get a list of non-production environments
  + dev_environments = environments.project.environments.filter (e => e.environment_type=='development').map(e => e.name)
  + logger.debug( `projectName: ${projectName}, branchName: ${branchName}, existing environments are `, dev_environments)
  - if ( branchName in dev_environment.map(e => e.environment_type)) {
  + if (environments.project.environment_limit !== null && dev_environments.length >= environments.project.environment_limit ) {
  +
  + if ( dev_environments.find( function(i){ return i == branchName })) {
  logger.debug(
  `projectName: ${projectName}, branchName: ${branchName}, environment already exists, no environment limits considered`,
  )
  