[{"data":1,"prerenderedAt":83},["ShallowReactive",2],{"content-testing-guidance-6-mocks":3},{"markdown":4,"frontMatterAttributes":5,"bodyRaw":12,"contributorPaths":13,"menuType":15,"contentName":16,"slug":17,"readingTime":18,"menu":19,"nextDocItem":62,"previousDocItem":51},"\u003Cp>Mocks are replacement objects that may simulate the behavior of cloud services for unit tests. Some mock frameworks are generic and others are designed specifically to mock AWS SDK’s. For example, \u003Ca href=\"https:\u002F\u002Fdocs.getmoto.org\u002Fen\u002Flatest\u002F\">moto\u003C\u002Fa> is a framework for mocking the popular boto AWS SDK for Python. The \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fdwyl\u002Faws-sdk-mock\">aws-sdk-mock\u003C\u002Fa> library provides a framework for mocking the AWS SDK for Javascript. These mock frameworks contain functions and return values similar to those contained within their SDK counterparts. Developers using other runtime languages may need to rely on more generic mocking frameworks. For example, Java developers may use \u003Ca href=\"https:\u002F\u002Fsite.mockito.org\u002F\">Mockito\u003C\u002Fa> or \u003Ca href=\"https:\u002F\u002Feasymock.org\u002F\">EasyMock\u003C\u002Fa> and .NET developers may use \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmoq\u002Fmoq4\">Moq\u003C\u002Fa>.\u003C\u002Fp>\n\u003Cp>Local development can be fast with mock frameworks. Since mocks may provide substitute behavior for virtually any kind of object, mocking strategies may create broad coverage for a wide variety of services. However, mock frameworks may require a non-trivial amount of setup efforts. And mock frameworks cannot properly test IAM policies and quotas. \u003C\u002Fp>\n",{"title":6,"order":7,"callout":8},"Mocks",6,{"title":9,"description":10,"link":11},"View our code samples","Our open source repository is a great place to begin.  We have serverless test samples in Java, Python, TypeScript and .NET.  Pick a language and navigate to a starter project.","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-test-samples","Mocks are replacement objects that may simulate the behavior of cloud services for unit tests. Some mock frameworks are generic and others are designed specifically to mock AWS SDK’s. For example, [moto](https:\u002F\u002Fdocs.getmoto.org\u002Fen\u002Flatest\u002F) is a framework for mocking the popular boto AWS SDK for Python. The [aws-sdk-mock](https:\u002F\u002Fgithub.com\u002Fdwyl\u002Faws-sdk-mock) library provides a framework for mocking the AWS SDK for Javascript. These mock frameworks contain functions and return values similar to those contained within their SDK counterparts. Developers using other runtime languages may need to rely on more generic mocking frameworks. For example, Java developers may use [Mockito](https:\u002F\u002Fsite.mockito.org\u002F) or [EasyMock](https:\u002F\u002Feasymock.org\u002F) and .NET developers may use [Moq](https:\u002F\u002Fgithub.com\u002Fmoq\u002Fmoq4).\n\nLocal development can be fast with mock frameworks. Since mocks may provide substitute behavior for virtually any kind of object, mocking strategies may create broad coverage for a wide variety of services. However, mock frameworks may require a non-trivial amount of setup efforts. And mock frameworks cannot properly test IAM policies and quotas. \n\n\n",[14],"content\u002Fcontributors\u002Fdan-fox.json","LIST","Testing your serverless applications","\u002Fcontent\u002Ftesting\u002Fguidance\u002F6-mocks","1 min",[20],{"title":21,"content":22},"Testing Guide",[23,30,37,44,51,58,62,69,76],{"title":24,"order":25,"callout":26,"time":18,"path":27,"id":28,"link":29},"Introduction",1,{"title":9,"description":10,"link":11},"1-introduction","1-introduction.md","\u002Fcontent\u002Ftesting\u002Fguidance\u002F1-introduction",{"title":31,"order":32,"callout":33,"time":18,"path":34,"id":35,"link":36},"Should you test?",2,{"title":9,"description":10,"link":11},"2-should-you-test","2-should-you-test.md","\u002Fcontent\u002Ftesting\u002Fguidance\u002F2-should-you-test",{"title":38,"order":39,"callout":40,"time":18,"path":41,"id":42,"link":43},"Shared responsibility",3,{"title":9,"description":10,"link":11},"3-shared-responsibility","3-shared-responsibility.md","\u002Fcontent\u002Ftesting\u002Fguidance\u002F3-shared-responsibility",{"title":45,"order":46,"callout":47,"time":18,"path":48,"id":49,"link":50},"Three Strategies",4,{"title":9,"description":10,"link":11},"4-three-strategies","4-three-strategies.md","\u002Fcontent\u002Ftesting\u002Fguidance\u002F4-three-strategies",{"title":52,"order":53,"callout":54,"time":18,"path":55,"id":56,"link":57},"Testing in the Cloud",5,{"title":9,"description":10,"link":11},"5-testing-in-the-cloud","5-testing-in-the-cloud.md","\u002Fcontent\u002Ftesting\u002Fguidance\u002F5-testing-in-the-cloud",{"title":6,"order":7,"callout":59,"time":18,"path":60,"id":61,"link":17},{"title":9,"description":10,"link":11},"6-mocks","6-mocks.md",{"title":63,"order":64,"callout":65,"time":18,"path":66,"id":67,"link":68},"Emulators",7,{"title":9,"description":10,"link":11},"7-emulators","7-emulators.md","\u002Fcontent\u002Ftesting\u002Fguidance\u002F7-emulators",{"title":70,"order":71,"callout":72,"time":18,"path":73,"id":74,"link":75},"Our guidance",8,{"title":9,"description":10,"link":11},"8-our-guidance","8-our-guidance.md","\u002Fcontent\u002Ftesting\u002Fguidance\u002F8-our-guidance",{"title":77,"order":78,"callout":79,"time":18,"path":80,"id":81,"link":82},"Get started with code",9,{"title":9,"description":10,"link":11},"9-get-started","9-get-started.md","\u002Fcontent\u002Ftesting\u002Fguidance\u002F9-get-started",1792578874968]