text: /*******************************************************************************
   * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 
   *
   * Licensed under the Amazon Software License (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   *
   *   http://www.apache.org/licenses/LICENSE-2.0    
   *
   * or in the "license" file accompanying this file. This file is distributed
   * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
   * express or implied. See the License for the specific language governing
   * permissions and limitations under the License.
   *
   ********************************************************************************/
  
  const axios = require('axios');
  const expect = require('chai').expect;
  const MockAdapter = require('axios-mock-adapter');
  
  const lambda = require('./index.js');
  
  const _duration = 300.0;
  
  describe('#SEND METRICS', () => {
  
  	it('should return "200" on a send metrics sucess', async () => {
  
  		let mock = new MockAdapter(axios);
  		mock.onPost().reply(200, {});
  
  		let response = await lambda.send(_duration)
  		expect(response).to.equal(200);
  	});
  
  	it('should return "Network Error" on connection timedout', async () => {
  
  		let mock = new MockAdapter(axios);
  		mock.onPut().networkError();
  
  		await lambda.send(_duration).catch(err => {
  			expect(err.toString()).to.equal("Error: Request failed with status code 404");
  		});
  	});
  
  });
  