Awesome
aws-sdk-js-tests
Code Samples for testing AWS SDK for JavaScript.
Steps to test:
- Fork this repo, and clone your fork.
- Create a local branch in your workspace.
- Update the code for testing AWS SDK for JavaScript.
- The SDK clients are created and API calls are made in
packages/utils/src/utils.js
.
- The SDK clients are created and API calls are made in
- Push code to remote branch on your fork, and share the code for reproducing the issue.
Pre-requisites
- Run
corepack enable
to let corepack manage version of yarn. - Update REGION in
packages/utils/src/config.js
. - For browser and react-native, IDENTITY_POOL_ID also needs to be updated.
- Create a Amazon Cognito Identity pool for testing
- Note down IDENTITY_POOL_ID
- Add a Policy to the test Unauthenticated IAM Role
- The policy should be specific to the operations you want to test
- Update the IDENTITY_POOL_ID in
packages/utils/src/config.js
.
- Create a Amazon Cognito Identity pool for testing
Example test for data returned by DynamoDB client:
- Checkout main branch:
git checkout main
- Run
yarn
to install dependencies.
Node.js:
-
Run
yarn start:node
to run both v2 and v3 clients in Node.js -
The responses returned by clients will be printed in console, and will re-run when code is updated.
-
The file being run is at
<details><summary>Click to view Node.js screenshot</summary> <p> </p> </details>packages/node/src/index.js
.
Browser:
-
Run
yarn start:web
to start vite server with HMR. -
The bundle will be opened in default browser, and get refreshed when code is updated.
-
The file being run is at
<details><summary>Click to view Browser screenshot</summary> <p> </p> </details>packages/web/src/index.js
.
React Native:
- Install dependencies for the Development OS and Target OS.
iOS
-
Run
<details><summary>Click to view iOS screenshot</summary> <p> </p> </details>yarn start:ios
to start local development server with iOS using React Native CLI.
Android
-
Run
<details><summary>Click to view Android screenshot</summary> <p> </p> </details>yarn start:android
to start local development server with Android using React Native CLI.
The react-native app in simulator/emulator will refresh when code is updated.
The file being run is at packages/react-native/App.js
.
License
This library is licensed under the MIT-0 License. See the LICENSE file.