{"id":7978,"date":"2021-08-18T08:30:00","date_gmt":"2021-08-18T05:30:00","guid":{"rendered":"https:\/\/dashbird.io\/?p=7978"},"modified":"2023-08-03T16:43:33","modified_gmt":"2023-08-03T13:43:33","slug":"test-javascript-lambda-functions","status":"publish","type":"post","link":"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/","title":{"rendered":"How to Test JavaScript Lambda Functions?"},"content":{"rendered":"\n<p><em>This article will discuss the different options for testing your AWS Lambda functions; the focus will be on JavaScript.<\/em><\/p>\n\n\n\n<p id=\"h-function-as-a-service-faas-offerings-like-aws-lambda-are-a-blessing-for-software-development-they-remove-many-of-the-issues-that-come-with-the-setup-and-maintenance-of-backend-infrastructure-with-much-of-the-upfront-work-taken-out-of-the-process-they-also-lower-the-barrier-to-start-a-new-service-and-encourage-modularization-and-encapsulation-of-software-systems\"><a href=\"https:\/\/dashbird.io\/blog\/what-is-faas-function-as-a-service\/\" target=\"_blank\" rel=\"noreferrer noopener\">Function as a service<\/a> (FaaS) offerings like AWS Lambda are a blessing for software development. They <strong>remove many of the issues<\/strong> that come with the setup and maintenance of backend infrastructure. With much of the upfront work taken out of the process, they also <strong>lower the barrier to start a new service<\/strong> and encourage modularization and encapsulation of software systems.<\/p>\n\n\n\n<p><strong>Testing distributed systems<\/strong> and <strong>serverless cloud infrastructures<\/strong> specifically is always a source of long discussions. Some people prefer the <strong>local approach<\/strong> of emulating everything around your own code because it gives you fast iterations. Others say it gives you a false sense of safety because you\u2019re not really testing the actual services involved later when you deploy into your production environment.<\/p>\n\n\n\n<h2 id=\"h-what-needs-to-be-tested\">What Needs to be Tested?<\/h2>\n\n\n\n<p>First of all, <strong>your own code<\/strong>, obviously. <\/p>\n\n\n\n<p>But the main part in the architecture where FaaS really shines is <strong>integration code<\/strong>. Lambda can be seen as versatile glue between all the managed services AWS, and other vendors, have to offer. So, the <strong>main focus of tests isn\u2019t just your code<\/strong> but also how it <strong>integrates with different services<\/strong>. Having a Lambda that just reads an event and writes an output will be a rare occasion; usually, it will access one or multiple other services like S3, Step Functions, or RDS.<\/p>\n\n\n\n<h2 id=\"h-smoke-tests\">Smoke Tests<\/h2>\n\n\n\n<p>Smoke tests are a <strong>straightforward type of test<\/strong>. They only check that your <strong>code doesn\u2019t crash when you try to run it<\/strong>. This means smoke tests <strong>don\u2019t check if your code works correctly<\/strong>. It could be that you have a bug in some if-branch anywhere that isn\u2019t executed with the test. It doesn\u2019t test for logic issues either.<\/p>\n\n\n\n<p>In terms of a <strong>web server<\/strong>, a smoke test would mean starting the server. No request gets sent to the server; just starting the server and see if it crashes. This is easy to do, and if it fails, you can save time running any other test.<\/p>\n\n\n\n<p>For <strong>Lambda<\/strong>, the action of starting and handling an event is the same because Lambdas only run when they handle an event and get frozen or retired right after they did their work. This means a smoke test would mean <strong>sending an event to the Lambda function<\/strong> to see if it throws an error. The simplest even you think your Lambda function should be able to handle would do.&nbsp;<\/p>\n\n\n\n<p>A smoke test can be done via the AWS CLI with the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">$ aws lambda invoke \\\n--cli-binary-format raw-in-base64-out \\\n--function-name &lt;LAMBDA_FUNCTION_NAME> \\\n--payload --payload file:\/\/&lt;JSON_EVENT_FILE>\n<\/pre>\n\n\n\n<p>For automation purposes, you can add such CLI commands to a bash script and simply execute it before every other test runs.<\/p>\n\n\n\n<h2 id=\"h-unit-tests\">Unit Tests<\/h2>\n\n\n\n<p>Unit tests are a bit more <strong>complex<\/strong> than smoke tests because they actually <strong>test the logic of your function<\/strong>. Since most errors usually happen when integrating your code with other services, they don\u2019t bring that much value compared to integration tests.<\/p>\n\n\n\n<p>But sometimes, you have very complex logic inside a Lambda function that doesn\u2019t need to access other services. If it does access other services, the interaction with them is very basic.<\/p>\n\n\n\n<p>To get unit tests going, your first step is <strong>extracting the logic you want to test<\/strong> into a JavaScript module.&nbsp;<\/p>\n\n\n\n<p>Let\u2019s look at the following example of a Lambda function that adds or substracts two numbers depending on an operation argument.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">exports.handler = async (event) => {\n  if (event.queryStringParameters.operation === \"substract\")\n    return {\n      statusCode: 200,\n      headers: { \"Content-Type\": \"application\/json\" },\n      body:\n        event.queryStringParameters.x - \n        event.queryStringParameters.y\n    }\n\n  return {\n    statusCode: 200,\n    headers: { \"Content-Type\": \"application\/json\" },\n    body:\n      event.queryStringParameters.x + \n      event.queryStringParameters.y\n  }\n}\n<\/pre>\n\n\n\n<p>This is a contrived example, but still, the function is harder to test than it needs to be. We would have to create an event object containing the <code>queryStringParameters<\/code> field, which would require an <code>operation<\/code>, <code>x<\/code>, and <code>y<\/code> fields to be present.<\/p>\n\n\n\n<p>If we encapsulate this logic in a plain JavaScript function that only requires three arguments, things would be simpler.&nbsp;<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">const addOrSubtract = (operation, x, y) => \n  operation === \"substract\" ? x - y : x + y;\n\nexports.handler = async (event) => {\n  const { operation, x, y } = event.queryStringParameters;\n\n  return {\n    statusCode: 200,\n    headers: { \"Content-Type\": \"application\/json\" },\n    body: addOrSubtract(operation, x, y)\n  };\n};\n<\/pre>\n\n\n\n<p>In this refactored example, we can now test the logic independently from the Lambda handler function.<\/p>\n\n\n\n<h2 id=\"h-integration-tests\">Integration Tests<\/h2>\n\n\n\n<p>Integration tests are the <strong>most important part of testing FaaS<\/strong>. I said it before, and I will repeat it, <strong>AWS Lambda<\/strong> is mostly used to <strong>glue together managed cloud services<\/strong>, and the parts where your Lambda function interacts with other services are the <strong>most crucial test targets<\/strong>.<\/p>\n\n\n\n<p>Now, there are two main ways of integration testing:<\/p>\n\n\n\n<ul><li>Test with real infrastructure<\/li><li>Test by emulating that infrastructure<\/li><\/ul>\n\n\n\n<p>They both have their <strong>pros and cons<\/strong>. For example, if testing with <strong>mocked-up<\/strong> infrastructure is <strong>faster and cheaper<\/strong>, but if your mocks are wrong, you\u2019re tests are wrong too. Testing with <strong>real infrastructure<\/strong> gives you <strong>more confidence but costs more money<\/strong> and can be quite <strong>slow<\/strong> if you need to provide it for each test run.<\/p>\n\n\n\n<p>Also, there is \u201cno free lunch\u201d in writing integration tests. The time you might save when you don\u2019t have to meddle with real infrastructure will sink into keeping your mocked-up infrastructure up-to-date. <strong>Martin Fowler<\/strong> wrote <a href=\"https:\/\/martinfowler.com\/articles\/mocksArentStubs.html#TheDifferenceBetweenMocksAndStubs\">an awesome article<\/a> about everything that goes into mock tests.<\/p>\n\n\n\n<h2 id=\"h-testing-with-real-infrastructure\">Testing with Real Infrastructure<\/h2>\n\n\n\n<p>Testing with real infrastructure only makes sense when you are <strong>using infrastructure as code<\/strong> (IaC) tool. Otherwise, you <strong>waste too much time<\/strong> provisioning your resources manually. Especially serverless applications are prone to contain many small services.<\/p>\n\n\n\n<p>AWS offers multiple IaC tools: <a href=\"https:\/\/aws.amazon.com\/cloudformation\/\">CloudFormation<\/a>, <a href=\"https:\/\/aws.amazon.com\/serverless\/sam\/\">SAM<\/a>, and <a href=\"https:\/\/aws.amazon.com\/cdk\/\">the CDK<\/a> are a few of them that are very well integrated with the AWS ecosystem.&nbsp;<\/p>\n\n\n\n<p>When you have your tool of choice ready, you can then use it to deploy to test and production with one IaC definition. This way, you can be sure your testing environment matches production.<\/p>\n\n\n\n<p>Now, the tests would check the inputs and outputs of your Lambda functions.<\/p>\n\n\n\n<p>For a <strong>synchronous invocation of Lambda<\/strong>, which happens with API-Gateway, for example, this means the events that go into your Lambda function and the response that function returns. For <strong>asynchronous invocations<\/strong>, there are no values returned.<\/p>\n\n\n\n<p>The more interesting part of these tests is <strong>how your function accesses other services<\/strong>. If your function reads some data from DynamoDB for authentication, before it does its work, you need to check that that data is accessible and correct<strong> before running the test<\/strong>. If you write to S3, you must access S3 to check if everything went right<strong> after running the test<\/strong>.<\/p>\n\n\n\n<p>You can use the same <a href=\"https:\/\/docs.aws.amazon.com\/sdk-for-javascript\/v3\/developer-guide\/installing-jssdk.html\">AWS SDK for JavaScript<\/a> to check these services inside your tests. If you choose to run your tests on AWS Lambda, too, it will even be preinstalled.<\/p>\n\n\n\n<p>Let\u2019s look at how such an integration test could look like:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">const aws = require(\"aws-sdk\");\n\nconst dynamoDb = new aws.DynamoDB.DocumentClient();\nconst lambda = new aws.Lambda();\nconst s3 = new aws.S3();\n\nexports.handler = async (vent) => {\n  await firstTest();\n};\n\nasync function firstTest() {\n  await dynamoDb\n    .put({\n      TableName: \"Users\",\n      Item: {\n        HashKey: \"userId\",\n        isAdmin: true\n      }\n    })\n    .promise();\n\n  await lambda\n    .invoke({\n      FunctionName: \"createAdminFile\",\n      Payload: JSON.stringify({\n  userId: \"userId\",\n\t  filename: \"sample.txt\",\n  content: \"OK\" \n      })\n    })\n    .promise();\n\n  const s3Object = await s3\n    .getObject({\n      Bucket: \"admin-files\",\n      Key: \"sample.txt\"\n    })\n    .promise();\n\n  checkFile(s3Object).contains(\"OK\");\n\n  await dynamoDb\n    .delete({\n      TableName: \"Users\",\n      Key: { HashKey: \"userId\" }\n    })\n    .promise();\n\n  await s3\n    .deleteObject({\n      Bucket: \"admin-files\",\n      Key: \"sample.txt\"\n    })\n    .promise();\n}\n<\/pre>\n\n\n\n<p>This example is a <strong>Lambda function<\/strong> <strong>that tests another Lambda function<\/strong>. It creates a user document in a DynamoDB table with admin permissions. Then it invokes a Lambda function with event arguments. After the function was invoked, it checks that a file in S3 was created. And finally, it cleans up all the test-related data.<\/p>\n\n\n\n<p>This is only a basic implementation, including <a href=\"https:\/\/www.npmjs.com\/package\/tape\" class=\"broken_link\">a testing framework like tape<\/a> to make things more convenient. But it illustrates what even a simple integration test requires to work.<\/p>\n\n\n\n<p>You can test, retest applications all you want but once that baby goes Live, s*#@ will happen. It\u2019s just how it is. You\u2019ll be able to use&nbsp;<a href=\"https:\/\/dashbird.io\/\">Dashbird<\/a>\u2018s function view to see exactly how your application is behaving and when the app goes sideways, you\u2019ll be able to use the Incident management platform you can see exactly what broke and where.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"492\" src=\"https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/errorview-2019.02.13-1-1024x492.png\" alt=\"\" class=\"wp-image-7991\" srcset=\"https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/errorview-2019.02.13-1-1024x492.png 1024w, https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/errorview-2019.02.13-1-300x144.png 300w, https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/errorview-2019.02.13-1-768x369.png 768w, https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/errorview-2019.02.13-1-1536x738.png 1536w, https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/errorview-2019.02.13-1-500x240.png 500w, https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/errorview-2019.02.13-1.png 1870w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 id=\"h-conclusion\">Conclusion<\/h2>\n\n\n\n<p>This article only talked about <strong>three basic methods to test your functions<\/strong>: <\/p>\n\n\n\n<ul><li>smoke tests<\/li><li>unit tests<\/li><li>integration tests. <\/li><\/ul>\n\n\n\n<p>There are even more test types out there that have a much bigger scope, like E2E tests or test specific behavior of your functions like performance tests.<\/p>\n\n\n\n<p>To get started, you should be good to go with <strong>smoke and integration tests<\/strong>. Make sure your Lambda doesn\u2019t crash right at the start of an invocation and then test that it actually accurately uses other services.<\/p>\n\n\n\n<p>If you have very complex Lambda functions used for specific logic and not just to integrate multiple services, try to encapsulate that logic and run unit tests. This way, you can iterate faster and cheaper.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p><em>Further reading: <\/em><\/p>\n\n\n\n<p><a href=\"https:\/\/dashbird.io\/blog\/how-to-test-serverless-applications\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to test serverless applications?<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/dashbird.io\/blog\/log-based-monitoring-for-aws-lambda\/\" target=\"_blank\" rel=\"noreferrer noopener\">Log-based monitoring for AWS Lambda<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/dashbird.io\/blog\/sizing-cloud-resources-mistakes\/\" target=\"_blank\" rel=\"noreferrer noopener\">10 mistakes to avoid when sizing your cloud resources<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/dashbird.io\/blog\/why-serverless-apps-fail\/\" target=\"_blank\" rel=\"noreferrer noopener\">Why serverless apps fail and how to design resilient architectures?<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will discuss the different options for testing your AWS Lambda functions; the focus will be on JavaScript. Function as a service (FaaS) offerings like AWS Lambda are a blessing for software development. They remove many of the issues that come with the setup and maintenance of backend infrastructure. With much of the upfront [&hellip;]<\/p>\n","protected":false},"author":30,"featured_media":7985,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,6],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v18.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Test JavaScript Lambda Functions? - Dashbird<\/title>\n<meta name=\"description\" content=\"This article will discuss the different options for testing your AWS Lambda functions; the focus will be on JavaScript.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Test JavaScript Lambda Functions? - Dashbird\" \/>\n<meta property=\"og:description\" content=\"This article will discuss the different options for testing your AWS Lambda functions; the focus will be on JavaScript.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"Dashbird\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dashbirdapp\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-18T05:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-03T13:43:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/aws-lambda-metrics-23.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"500\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@thedashbird\" \/>\n<meta name=\"twitter:site\" content=\"@thedashbird\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kay Pl\u00f6\u00dfer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dashbird.io\/#website\",\"url\":\"https:\/\/dashbird.io\/\",\"name\":\"Dashbird\",\"description\":\"Serverless Observability and Troubleshooting\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dashbird.io\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/aws-lambda-metrics-23.png\",\"contentUrl\":\"https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/aws-lambda-metrics-23.png\",\"width\":1000,\"height\":500,\"caption\":\"test lambda functions\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/#webpage\",\"url\":\"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/\",\"name\":\"How to Test JavaScript Lambda Functions? - Dashbird\",\"isPartOf\":{\"@id\":\"https:\/\/dashbird.io\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/#primaryimage\"},\"datePublished\":\"2021-08-18T05:30:00+00:00\",\"dateModified\":\"2023-08-03T13:43:33+00:00\",\"author\":{\"@id\":\"https:\/\/dashbird.io\/#\/schema\/person\/259fb108e7de6e15c2c805f817e13caa\"},\"description\":\"This article will discuss the different options for testing your AWS Lambda functions; the focus will be on JavaScript.\",\"breadcrumb\":{\"@id\":\"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dashbird.io\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Test JavaScript Lambda Functions?\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/dashbird.io\/#\/schema\/person\/259fb108e7de6e15c2c805f817e13caa\",\"name\":\"Kay Pl\u00f6\u00dfer\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/dashbird.io\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0778d713fabfb82c20973683aee0d480?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0778d713fabfb82c20973683aee0d480?s=96&d=mm&r=g\",\"caption\":\"Kay Pl\u00f6\u00dfer\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Test JavaScript Lambda Functions? - Dashbird","description":"This article will discuss the different options for testing your AWS Lambda functions; the focus will be on JavaScript.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/","og_locale":"en_US","og_type":"article","og_title":"How to Test JavaScript Lambda Functions? - Dashbird","og_description":"This article will discuss the different options for testing your AWS Lambda functions; the focus will be on JavaScript.","og_url":"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/","og_site_name":"Dashbird","article_publisher":"https:\/\/www.facebook.com\/dashbirdapp","article_published_time":"2021-08-18T05:30:00+00:00","article_modified_time":"2023-08-03T13:43:33+00:00","og_image":[{"width":1000,"height":500,"url":"https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/aws-lambda-metrics-23.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_creator":"@thedashbird","twitter_site":"@thedashbird","twitter_misc":{"Written by":"Kay Pl\u00f6\u00dfer","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/dashbird.io\/#website","url":"https:\/\/dashbird.io\/","name":"Dashbird","description":"Serverless Observability and Troubleshooting","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dashbird.io\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/#primaryimage","inLanguage":"en-US","url":"https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/aws-lambda-metrics-23.png","contentUrl":"https:\/\/dashbird.io\/wp-content\/uploads\/2021\/08\/aws-lambda-metrics-23.png","width":1000,"height":500,"caption":"test lambda functions"},{"@type":"WebPage","@id":"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/#webpage","url":"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/","name":"How to Test JavaScript Lambda Functions? - Dashbird","isPartOf":{"@id":"https:\/\/dashbird.io\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/#primaryimage"},"datePublished":"2021-08-18T05:30:00+00:00","dateModified":"2023-08-03T13:43:33+00:00","author":{"@id":"https:\/\/dashbird.io\/#\/schema\/person\/259fb108e7de6e15c2c805f817e13caa"},"description":"This article will discuss the different options for testing your AWS Lambda functions; the focus will be on JavaScript.","breadcrumb":{"@id":"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dashbird.io\/blog\/test-javascript-lambda-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dashbird.io\/"},{"@type":"ListItem","position":2,"name":"How to Test JavaScript Lambda Functions?"}]},{"@type":"Person","@id":"https:\/\/dashbird.io\/#\/schema\/person\/259fb108e7de6e15c2c805f817e13caa","name":"Kay Pl\u00f6\u00dfer","image":{"@type":"ImageObject","@id":"https:\/\/dashbird.io\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/0778d713fabfb82c20973683aee0d480?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0778d713fabfb82c20973683aee0d480?s=96&d=mm&r=g","caption":"Kay Pl\u00f6\u00dfer"}}]}},"_links":{"self":[{"href":"https:\/\/dashbird.io\/wp-json\/wp\/v2\/posts\/7978"}],"collection":[{"href":"https:\/\/dashbird.io\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dashbird.io\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dashbird.io\/wp-json\/wp\/v2\/users\/30"}],"replies":[{"embeddable":true,"href":"https:\/\/dashbird.io\/wp-json\/wp\/v2\/comments?post=7978"}],"version-history":[{"count":6,"href":"https:\/\/dashbird.io\/wp-json\/wp\/v2\/posts\/7978\/revisions"}],"predecessor-version":[{"id":10435,"href":"https:\/\/dashbird.io\/wp-json\/wp\/v2\/posts\/7978\/revisions\/10435"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dashbird.io\/wp-json\/wp\/v2\/media\/7985"}],"wp:attachment":[{"href":"https:\/\/dashbird.io\/wp-json\/wp\/v2\/media?parent=7978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dashbird.io\/wp-json\/wp\/v2\/categories?post=7978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dashbird.io\/wp-json\/wp\/v2\/tags?post=7978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}