Skip to content

Commit 156905c

Browse files
committed
JS - testing with azure
1 parent 480cf3d commit 156905c

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

articles/javascript/TOC.yml

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
href: core/use-azure-sdk.md
2626
- name: Authenticate to Azure
2727
href: core/nodejs-sdk-azure-authenticate.md
28+
- name: Test strategies
29+
href: core/test-azure-sdk-integrated-code.md
2830
- name: "List subscriptions"
2931
href: core/nodejs-sdk-azure-authenticate.md?tabs=azure-sdk-for-javascript.md#3-list-azure-subscriptions-with-service-principal
3032
- name: "View subscription history"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Test strategies with Azure SDK
3+
description: When developing applications integrated with Azure SDKs, you should consider the following strategies to ensure the quality of your code.
4+
ms.topic: how-to
5+
ms.date: 10/26/2021
6+
ms.custom: devx-track-js
7+
---
8+
9+
# Test strategies with Azure SDK
10+
11+
When developing applications integrated with Azure SDKs, consider how much integration your code base has with the Azure SDKs.
12+
13+
## Small team with few integration calls to Azure SDKs
14+
15+
When you code base has a very few integration calls to the Azure SDKs, we recommend you capture example results from those calls. Once the results are captured, use mocks/spys to integrate the example results.
16+
17+
With this strategy, your local development and testing isn't dependent on the Azure cloud. Your tests can run predictably without timeouts, or other cloud issues.
18+
19+
## More integration calls to Azure SDK
20+
21+
When you have more integration calls, consider using a recorder/playback strategy to generate the sample results and verify your code paths. This strategy also allows you to verify your own business logic without a dependency on the Azure cloud.
22+
23+
## Tests integrated with Azure cloud
24+
25+
When you run your tests against the Azure cloud resources, consider creating separate resources. Your tests may be able to run and complete against resources in lower pricing tiers or different regions.
26+
27+
## Azure SDK tests
28+
29+
The Azure SDK tests for each SDK are available in the GitHub repo for the JavaScript SDKs. Some example tests are:
30+
31+
* [Azure Storage Blob](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob/test)
32+
* [Azure Event grid](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/eventgrid/eventgrid/test)
33+
* [Azure Key vault](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/keyvault/keyvault-secrets/test)
34+
35+
## Next steps
36+
37+
* [List account subscriptions](nodejs-sdk-azure-authenticate.md?tabs=azure-sdk-for-javascript#3-list-azure-subscriptions-with-service-principal) with the resource manager SDK for subscriptions

0 commit comments

Comments
 (0)