Amazon Web Services Inc. (AWS), Amplify Serverless Framework Adds CLI Mocking & Testing. After a recent addition of machine learning functionality, Amazon Web Services Inc. has enhanced the capabilities of its Amplify framework, a cloud-powered serverless backend for mobile apps and Web apps. This includes mock-based testing. AWS recently added a Predictions category in its list of pre-trained machine intelligence models that developers can use in their apps. AWS announced last week new mocking and testing capabilities for AmplifyCLI, the command line interface that is used with the framework. Amplify CLI offers a unified toolchain that includes UI components, libraries, and a command line interface. This allows developers to add cloud services and backend resource to Web and mobile apps via CloudFormation. It provides a common language to describe and provision cloud infrastructure resources. The new mocking capability allows for faster iterative development by locally emulating the simplified cloud service API. This allows for faster testing without the need to resort to full-blown usage that requires overhead and management details. Although it does not simulate a full service API, the mocking capability provides basic functionality for testing purposes. AWS stated that the new mocking capability allows you to quickly test your changes without having to provision or update the cloud resources. This allows you to set up unit and integrated tests that can be run quickly, without having to impact your cloud backend. Depending on your app’s architecture, you can automate testing in your CI/CD pipeline. Initial mocking can be done by the Amplify service via CLI.

  • AppSync GraphQL APIs include resolver mapping templates, storage backed up by Amazon DynamoDB, and storage
  • AWS Lambda functions can be invoked directly or as resolvers for a GraphQL API.
  • Amazon Simple Storage Service (S3) buckets are used for storage.
  • Amazon Cognito User Pool authentication to GraphQL APIs. However, developers must first obtain a JSON Web Token from the actual service. After that, the JWT can be honored locally.

AWS published guidance last week to help developers get started using the new functionality. The article was titled “Developing, testing and storage graphQL APIs, Functions and Functions with Amplify Framework Local mocking features”. The GitHub site is where Amplify CLI developers can be found.

Author: Kody