azure-mock 4.4.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![NPM downloads][badge-npm-downloads]][url-npm]
6
6
  [![NPM Unpacked Size (with version)][badge-npm-unpacked-size]][url-npm]
7
7
 
8
- Mock Azure service classes for local development and testing, providing in-memory implementations of Azure Table Storage, Blob Storage, Service Bus, and EventGrid clients that mirror the real Azure SDK interfaces.
8
+ It provides mock Azure service classes for local development and testing. They are in-memory implementations of the Azure Table Storage, Blob Storage, Service Bus and EventGrid clients, and they mirror the real Azure SDK interfaces.
9
9
 
10
10
  Design notes live in [the specs](https://github.com/Esposter/Esposter/tree/main/openspec/specs).
11
11
 
@@ -19,6 +19,8 @@ Design notes live in [the specs](https://github.com/Esposter/Esposter/tree/main/
19
19
 
20
20
  ## <a name="getting-started">🚀 Getting Started</a>
21
21
 
22
+ Install the package and its Azure peer packages as dev dependencies:
23
+
22
24
  ```bash
23
25
  pnpm i -D azure-mock @azure/core-http-compat @azure/core-rest-pipeline @azure/data-tables @azure/eventgrid @azure/search-documents @azure/service-bus @azure/storage-blob @azure/storage-queue
24
26
  ```
@@ -34,24 +36,24 @@ await mockTableClient.upsertEntity({ partitionKey: "pk", rowKey: "rk", value: 42
34
36
  const entity = await mockTableClient.getEntity("pk", "rk");
35
37
  ```
36
38
 
37
- Replace real Azure clients with their mock equivalents by swapping them in your test setup or local `.env` configuration.
39
+ Replace each real Azure client with its mock equivalent. Make the replacement in your test setup or in your local `.env` configuration.
38
40
 
39
41
  ## <a name="key-exports">🧩 Key Exports</a>
40
42
 
41
- | Class | Azure Equivalent | Description |
42
- | ------------------------------ | -------------------------- | -------------------------------------------- |
43
- | `MockBlobBatchClient` | `BlobBatchClient` | In-memory batched blob deletion |
44
- | `MockBlobClient` | `BlobClient` | In-memory blob read, copy and delete |
45
- | `MockBlockBlobClient` | `BlockBlobClient` | In-memory block blob upload and download |
46
- | `MockContainerClient` | `ContainerClient` | In-memory blob container, listing and paging |
47
- | `MockEventGridPublisherClient` | `EventGridPublisherClient` | In-memory EventGrid publisher |
48
- | `MockQueueClient` | `QueueClient` | In-memory Azure Storage Queue |
49
- | `MockSearchClient` | `SearchClient` | In-memory Azure AI Search index |
50
- | `MockServiceBusSender` | `ServiceBusSender` | In-memory Azure Service Bus |
51
- | `MockTableClient` | `TableClient` | In-memory Azure Table Storage |
52
- | `MockWebPubSubServiceClient` | `WebPubSubServiceClient` | Stub: `group().sendToAll` and nothing else |
53
-
54
- Each client's state lives in an exported `Mock*Database` map (`MockTableDatabase`, `MockContainerDatabase`, …), so a test resets by clearing the one it seeded.
43
+ | Class | Azure Equivalent | Description |
44
+ | ------------------------------ | -------------------------- | ------------------------------------------------------------------------------------------ |
45
+ | `MockBlobBatchClient` | `BlobBatchClient` | In-memory batched blob deletion |
46
+ | `MockBlobClient` | `BlobClient` | In-memory blob read, copy and delete |
47
+ | `MockBlockBlobClient` | `BlockBlobClient` | In-memory block blob upload and download |
48
+ | `MockContainerClient` | `ContainerClient` | In-memory blob container, listing and paging |
49
+ | `MockEventGridPublisherClient` | `EventGridPublisherClient` | In-memory EventGrid publisher |
50
+ | `MockQueueClient` | `QueueClient` | In-memory Azure Storage Queue |
51
+ | `MockSearchClient` | `SearchClient` | In-memory Azure AI Search index |
52
+ | `MockServiceBusSender` | `ServiceBusSender` | In-memory Azure Service Bus |
53
+ | `MockTableClient` | `TableClient` | In-memory Azure Table Storage |
54
+ | `MockWebPubSubServiceClient` | `WebPubSubServiceClient` | In-memory group membership: `group().addUser` and `removeUser`; `sendToAll` reaches nobody |
55
+
56
+ Each client stores its state in an exported `Mock*Database` map, such as `MockTableDatabase` or `MockContainerDatabase`. To reset a test, clear the map that the test seeded.
55
57
 
56
58
  ## <a name="license">⚖️ License</a>
57
59