Skip to content

Commit 1e9e84e

Browse files
[Recorder] Update MIGRATION.md (Azure#20269)
* Update MIGRATION.md * Update sdk/test-utils/recorder/MIGRATION.md * Update MIGRATION.md * Update MIGRATION.md * Update MIGRATION.md
1 parent 1dd3202 commit 1e9e84e

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

sdk/test-utils/recorder/MIGRATION.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The new recorder is version 2.0.0 of the `@azure-tools/test-recorder` package. U
1515
// ...
1616
"devDependencies": {
1717
// ...
18+
"@azure-tools/test-credential" : "^1.0.0", // If you're using `@azure/identity` in your tests
1819
"@azure-tools/test-recorder": "^2.0.0"
1920
}
2021
}
@@ -40,6 +41,8 @@ Note the difference between the dev-tool `node-ts-input` and `node-js-input` com
4041
- `node-ts-input` runs the tests using `ts-node`, without code coverage.
4142
- `node-js-input` runs the tests using the built JavaScript output, and generates coverage reporting using `nyc`.
4243

44+
Compare with the older test runs to make sure you're running all the tests/files as before.
45+
4346
## Initializing the recorder
4447

4548
The approach taken to initialize the recorder depends on whether the SDK being tested uses Core v1 ([`core-http`]) or Core v2 ([`core-rest-pipeline`]). If your SDK is on Core v2, read on. If you're still on Core v1, [jump to the section on Core v1 below](#for-core-v1-sdks).
@@ -49,6 +52,8 @@ The approach taken to initialize the recorder depends on whether the SDK being t
4952
The recorder is implemented as a custom policy which should be attached to your client's pipeline. Firstly, initialize the recorder:
5053

5154
```ts
55+
import { Recorder } from "@azure-tools/test-recorder";
56+
5257
let recorder: Recorder;
5358

5459
/*
@@ -213,13 +218,9 @@ Other sanitizers for more complex use cases are also available.
213218

214219
## AAD and the new `NoOpCredential`
215220

216-
The new recorder does not record AAD traffic at present. As such, tests with clients using AAD should make use of the new `@azure-tools/test-credential` package, installed as follows:
217-
218-
```bash
219-
$ rush add --dev --caret -p @azure-tools/test-credential
220-
```
221+
The new recorder does not record AAD traffic at present. As such, tests with clients using AAD should make use of the new `@azure-tools/test-credential` package.
221222

222-
This package provides a `NoOpCredential` implementation of `TokenCredential` which makes no network requests, and should be used in playback mode. The provided `createTestCredential` helper will handle switching between NoOpCredential in playback and ClientSecretCredential when recording for you:
223+
This package provides a `NoOpCredential` implementation of `TokenCredential` which makes no network requests, and should be used in playback mode. The provided `createTestCredential` helper will handle switching between `NoOpCredential` in playback and `ClientSecretCredential` when recording for you:
223224

224225
```ts
225226
import { createTestCredential } from "@azure-tools/test-credential";
@@ -283,17 +284,17 @@ const {
283284
// reporters - to be removed
284285
"json-to-file"
285286

286-
/* ... */
287-
// log options - to be removed
288-
browserConsoleLogOptions: {
289-
terminal: !isRecordMode(),
290-
}
291-
292287
/* ... */
293288
// jsonToFileReporter - to be removed
294289
jsonToFileReporter: {
295290
filter: jsonRecordingFilterFunction, outputPath: ".",
296291
}
292+
293+
/* ... */
294+
// log options - to be removed
295+
browserConsoleLogOptions: {
296+
terminal: !isRecordMode(),
297+
}
297298
```
298299

299300
Remove the following "devDependencies" from `package.json`

0 commit comments

Comments
 (0)