Skip to content

Commit

Permalink
[Recorder] More karma.conf enhancements to MIGRATION.md (#20261)
Browse files Browse the repository at this point in the history
* Update MIGRATION.md

* Update sdk/test-utils/recorder/MIGRATION.md

* Update sdk/test-utils/recorder/MIGRATION.md

Co-authored-by: Timo van Veenendaal <timov@microsoft.com>

Co-authored-by: Timo van Veenendaal <timov@microsoft.com>
  • Loading branch information
HarshaNalluru and timovv committed Feb 8, 2022
1 parent 3b01392 commit 02ef556
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions sdk/test-utils/recorder/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ Since AAD traffic is not recorded by the new recorder, there is no longer a need
When running browser tests, the recorder relies on an environment variable to determine where to save the recordings. Add this snippet to your `karma.conf.js`:

```ts
const { relativeRecordingsPath } = require("@azure-tools/test-recorder-new");
const { relativeRecordingsPath } = require("@azure-tools/test-recorder");

process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();
```
Expand All @@ -259,20 +259,38 @@ module.exports = function (config) {
};
```

The following configuration options in `karma.config.js` should be **removed**:
The following configuration options in `karma.config.js` are unnecessary and should be **removed**:

```ts
// files section
.concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : [])

// imports - to be deleted
const {
jsonRecordingFilterFunction,
isPlaybackMode,
isSoftRecordMode,
isRecordMode,
} = require("@azure-tools/test-recorder");

// plugins - to be removed
"karma-json-to-file-reporter",
"karma-json-preprocessor",

// files section - snippet to remove
.concat(isPlaybackMode() || isSoftRecordMode() ? ["recordings/browsers/**/*.json"] : [])

// preprocessors - to be removed
"recordings/browsers/**/*.json": ["json"],

// reporters - to be removed
"json-to-file"

/* ... */

// log options - to be removed
browserConsoleLogOptions: {
terminal: !isRecordMode(),
}

/* ... */

// jsonToFileReporter - to be removed
jsonToFileReporter: {
filter: jsonRecordingFilterFunction, outputPath: ".",
}
Expand Down

0 comments on commit 02ef556

Please sign in to comment.