title: Test Lambda Locally (Lambda function calling another lambda function)
body: <p>I am learning node and serverless architecture. 
  To test my lambda function locally I am currently using <a href="https://www.npmjs.com/package/lambda-local" rel="nofollow noreferrer" title="lambda-local">lambda-local</a> which has been working fine so far.</p>
  
  <p>Now I have a function that <a href="http://docs.aws.amazon.com/lambda/latest/dg/API_Invoke.html" rel="nofollow noreferrer">invoke</a> another lambda function, something like this:</p>
  
  <pre><code>    let lambda = new integration.myLambda.AWS.Lambda();
      let params = {
          FunctionName: 'my-other-function',
          InvocationType: 'RequestResponse',
          LogType: 'None',
          Payload: JSON.stringify(myEvent)
      };
  
      return new Promise((resolve, reject) =&gt; {
  
          lambda.invoke(params, function (error, data) {
              if (error) {
                  console.log('error on invoke', error);
                  reject({
                      statusCode: HttpStatus.INTERNAL_SERVER_ERROR,
                      message: error
                  });
  
              } else {
                  console.log('invoke success', data);
                  resolve(JSON.parse(data.Payload));
              }
          });
  
      });
  </code></pre>
  
  <p>This bit of code does not work locally, but once deployed on aws it's working fine. However deploying to aws it takes about 2 mins. So I was wondering if there is a way to have this code run locally.</p>
  
  <p>Any suggestions?</p>
  
  <p>Thank you!</p>