Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Recorder] More karma.conf enhancements to MIGRATION.md #20261

Merged
merged 3 commits into from
Feb 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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