'use strict';

const chai = require('chai');
const chaiAsPromised = require('chai-as-promised');
const weather = require('../index.js');

chai.use(chaiAsPromised);
chai.should();

describe('Weather', () => {
  it('should get the weather', () => {
    return weather([]).should.be.fulfilled.then(res => {
      res.data.should.be.an.instanceOf(Object);
    });
  });
});

@@ -1,8 +1,60 @@
+/* eslint-env max-nested-callbacks: %5B%22error%22, 5%5D */%0A
 'use str
@@ -138,24 +138,81 @@
 promised');%0A
+const Conf = require('conf');%0Aconst config = new Conf();%0A
 const weathe
@@ -295,24 +295,28 @@
 ibe('Weather
+ CLI
 ', () =%3E %7B%0A 
@@ -314,16 +314,207 @@
 () =%3E %7B%0A
+  beforeEach(() =%3E %7B%0A    config.clear();%0A  %7D);%0A%0A  describe('Retrieve', () =%3E %7B%0A    beforeEach(() =%3E %7B%0A      config.set('city', 'Dhaka');%0A      config.set('country', 'Bangladesh');%0A    %7D);%0A%0A  
   it('sh
@@ -533,16 +533,37 @@
  weather
+ for default location
 ', () =%3E
@@ -561,24 +561,26 @@
 n', () =%3E %7B%0A
+  
     return w
@@ -589,11 +589,40 @@
 ther
-(%5B%5D
+.getWeather(%7Bscale: 'C', s: 'C'%7D
 ).sh
@@ -663,17 +663,14 @@
     
+  
 res.
-data.
 shou
@@ -696,16 +696,1510 @@
 (Object)
+;%0A        res.city.should.be.equal('Dhaka');%0A        res.country.should.be.equal('Bangladesh');%0A      %7D);%0A    %7D);%0A%0A    it('should get the weather for default location and Fahrenheit scale', () =%3E %7B%0A      return weather.getWeather(%7Bscale: 'F', s: 'F'%7D).should.be.fulfilled.then(res =%3E %7B%0A        res.should.be.an.instanceOf(Object);%0A        res.scale.should.be.equal('F');%0A        res.city.should.be.equal('Dhaka');%0A        res.country.should.be.equal('Bangladesh');%0A      %7D);%0A    %7D);%0A%0A    it('should get the weather for custom location', () =%3E %7B%0A      return weather.getWeather(%7Bscale: 'C', s: 'C', city: 'Kuala Lumpur', country: 'Malaysia'%7D).should.be.fulfilled.then(res =%3E %7B%0A        res.should.be.an.instanceOf(Object);%0A        res.city.should.be.equal('Kuala Lumpur');%0A        res.country.should.be.equal('Malaysia');%0A      %7D);%0A    %7D);%0A  %7D);%0A%0A  describe('Error handling', () =%3E %7B%0A    it('should return error if no defaults set or arguments passed in', () =%3E %7B%0A      return weather.getWeather(%7Bscale: 'C', s: 'C'%7D).should.be.rejected;%0A    %7D);%0A  %7D);%0A%0A  describe('Configure defaults', () =%3E %7B%0A    it('should print success message if config set successfully', () =%3E %7B%0A      return weather.setLocation(%7Bcity: 'Dhaka', country: 'Bangladesh'%7D).should.be.fulfilled.then(res =%3E %7B%0A        res.should.equal('Default location set to Dhaka, Bangladesh');%0A      %7D);%0A    %7D);%0A%0A    it('should return error if arguments are missing', () =%3E %7B%0A      return weather.setLocation(%7Bcity: 'Dhaka'%7D).should.be.rejected
 ;%0A    %7D)

Update test cases