Top AI Repos โ open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
AWS JavaScript SDK v3 mocks for easy unit testing. ๐๏ธ Typed ๐ฌ Tested ๐ Documented ๐ ๏ธ Maintained
| Date | Stars |
|---|---|
| 2026-07-24 | 906 |
| 2026-07-25 | 906 |
| 2026-07-28 | 906 |
| 2026-07-30 | 906 |
| 2026-08-06 | 906 |
Today
โ stars today
This week
โ stars this week
This month
โ stars this month
Momentum
0.0
growth rate 0.00%/day
<div align="center">
# AWS SDK v3 Client mock
Easy and powerful mocking of AWS SDK v3 Clients.
[](https://www.npmjs.com/package/aws-sdk-client-mock)
[](https://www.npmjs.com/package/aws-sdk-client-mock-jest)
</div>
Library recommended by the AWS SDK for JavaScript team - see the [introductory post on the AWS blog](https://aws.amazon.com/blogs/developer/mocking-modular-aws-sdk-for-javascript-v3-in-unit-tests/).
Features:
- ๐ **fluent interface** - declaring behavior is short and readable
- ๐ **matching options** - defining mock behavior by Command type and/or its input payload
- ๐ต๏ธ **spying** - checking if Commands were actually sent
- ๐ **Jest matchers** - easily verifying sent Commands
- ๐๏ธ **fully typed** - same type control for declaring mock's behavior as when writing regular code
- โ
**fully tested** - reliable mocks help instead of impeding
In action:

### Table of Contents
- [About AWS SDK v3](#about-aws-sdk-v3)
- [Usage](#usage)
- [Install](#install)
- [Versions compatibility](#versions-compatibility)
- [Import](#import)
- [Mock](#mock)
- [DynamoDB DocumentClient](#dynamodb-documentclient)
- [Lib Storage Upload](#lib-storage-upload)
- [S3 GetObjectCommand](#s3-getobjectcommand)
- [Paginated operations](#paginated-operations)
- [SDK v2-style mocks](#sdk-v2-style-mocks)
- [Inspect](#inspect)
- [Reset and restore](#reset-and-restore)
- [Custom matchers](#custom-matchers)
- [Jest](#jest)
- [Vitest](#vitest)
- [API Reference](#api-reference)
- [AWS Lambda example](#aws-lambda-example)
- [Caveats](#caveats)
- [Mixed @smithy/types versions](#mixed-smithytypes-versions)
- [AwsClientStub and strictFunctionTypes](#awsclientstub-and-strictfunctiontypes)
- [Order of mock behaviors](#order-of-mock-behaviors)
- [Order of type and instance mocks](#order-of-type-and-instance-mocks)
- [Using with Mocha](#using-with-mocha)
## About AWS SDK v3
The [AWS SDK for JavaScript version 3](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html),
is the new version of SDK to use in Node.js and browser.
It comes with modular architecture and improved typing,
thanks to being written in TypeScript.
The recommended way of using it is to create a `Client`
and use it to send `Commands`.
For example, using SNS Client to publish a message to a topic looks like that:
```typescript
import {PublishCommand, SNSClient} from '@aws-sdk/client-sns';
const sns = new SNSClient({});
const result = await sns.send(new PublishCommand({
TopicArn: 'arn:aws:sns:us-east-1:111111111111:MyTopic',
Message: 'My message',
}));
console.log(`Message published, id: ${result.MessageId}`);
```
This library provides an easy way to mock sending `Commands`
and define returned results depending on the `Command` type and payload.
## Usage
### Install
```bash
npm install -D aws-sdk-client-mock
```
> **Warning**
> If you are getting type errors `Argument of type 'typeof SomeClient' is not assignable to parameter of type...`
> see instructions [here](#mixed-smithytypes-versions).
#### Versions compatibility
| `@aws-sdk/*` | `aws-sdk-client-mock` |
|--------------|-----------------------|
| โฅ 3.363.0 | โฅ 3.x |
| < 3.363.0 | 2.x |
### Import
CommonJS:
```javascript
const {mockClient} = require('aws-sdk-client-mock');
```
TypeScript / ES6:
```typescript
import {mockClient} from 'aws-sdk-client-mock';
```
### Mock
Create mock for all instances or for given instance of the AWS SDK Client:
```typescript
const snsMock = mockClient(SNSClient);
const dynaExcerpt of 23,168 characters
Read on GitHub128
62
25
Ilia Choly ยท Canada
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Would you bet a product on this? Bounded 0โ100 and slow moving.
matched fp:f6cf1207d09fa736, topic:testing