All files GetApi.js

100% Statements 10/10
100% Branches 4/4
100% Functions 3/3
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 181x       2x 2x 2x     2x 2x 1x 1x       1x  
var Api = require('./Api')
 
class GetApi {
  constructor(opts, config, logger) {
    this.opts = opts
    this.logger = logger
    this.api = new Api(config)
  }
  run(cb) {
    this.api.makeRequest('GET', this.opts.route, JSON.parse(this.opts.params || '{}'), (err, response) => {
      if (err) return cb(err)
      this.logger.info(JSON.stringify(response, null, 2))
      return cb(null, response)
    })
  }
}
module.exports = GetApi