Code coverage report for ecs/doesServiceExist.js

Statements: 100% (5 / 5)      Branches: 100% (0 / 0)      Functions: 100% (2 / 2)      Lines: 100% (5 / 5)      Ignored: none     

All files » ecs/ » doesServiceExist.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17    1   1 2           2       1  
'use strict'
 
var _ = require('lodash')
 
function doesServiceExist (ecs, serviceName, cluster) {
  return ecs
    .describeServicesPromised({
      services: [serviceName],
      cluster: cluster
    })
    .then(function checkResponse (data) {
      return !_.isEmpty(data.services)
    })
}
 
module.exports = doesServiceExist