From 02ef556b3400e4b3f16373b72d9e679c26c8da08 Mon Sep 17 00:00:00 2001 From: Harsha Nalluru Date: Tue, 8 Feb 2022 14:39:21 -0700 Subject: [PATCH] [Recorder] More karma.conf enhancements to MIGRATION.md (#20261) * Update MIGRATION.md * Update sdk/test-utils/recorder/MIGRATION.md * Update sdk/test-utils/recorder/MIGRATION.md Co-authored-by: Timo van Veenendaal Co-authored-by: Timo van Veenendaal --- sdk/test-utils/recorder/MIGRATION.md | 32 ++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/sdk/test-utils/recorder/MIGRATION.md b/sdk/test-utils/recorder/MIGRATION.md index 754f9d2983a5..5f3bb1fe03cf 100644 --- a/sdk/test-utils/recorder/MIGRATION.md +++ b/sdk/test-utils/recorder/MIGRATION.md @@ -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(); ``` @@ -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: ".", }