4
4
// https://github.com/karma-runner/karma-chrome-launcher
5
5
process . env . CHROME_BIN = require ( "puppeteer" ) . executablePath ( ) ;
6
6
require ( "dotenv" ) . config ( ) ;
7
- const {
8
- jsonRecordingFilterFunction,
9
- isPlaybackMode,
10
- isSoftRecordMode,
11
- isRecordMode,
12
- } = require ( "@azure-tools/test-recorder" ) ;
7
+ const { relativeRecordingsPath } = require ( "@azure-tools/test-recorder" ) ;
8
+
9
+ process . env . RECORDINGS_RELATIVE_PATH = relativeRecordingsPath ( ) ;
13
10
14
11
module . exports = function ( config ) {
15
12
config . set ( {
@@ -40,27 +37,30 @@ module.exports = function (config) {
40
37
files : [
41
38
"dist-test/index.browser.js" ,
42
39
{ pattern : "dist-test/index.browser.js.map" , type : "html" , included : false , served : true } ,
43
- ] . concat ( isPlaybackMode ( ) || isSoftRecordMode ( ) ? [ "recordings/browsers/**/*.json" ] : [ ] ) ,
44
-
40
+ ] ,
45
41
// list of files / patterns to exclude
46
42
exclude : [ ] ,
47
43
48
44
// preprocess matching files before serving them to the browser
49
45
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
50
46
preprocessors : {
51
47
"**/*.js" : [ "sourcemap" , "env" ] ,
52
- "recordings/browsers/**/*.json" : [ "json" ] ,
53
48
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
54
49
// Preprocess source file to calculate code coverage, however this will make source file unreadable
55
50
// "dist-test/index.js": ["coverage"]
56
51
} ,
57
52
58
- envPreprocessor : [ "TEST_MODE" , "ENDPOINT" , "DOCUMENT_TRANSLATOR_API_KEY" ] ,
53
+ envPreprocessor : [
54
+ "TEST_MODE" ,
55
+ "ENDPOINT" ,
56
+ "DOCUMENT_TRANSLATOR_API_KEY" ,
57
+ "RECORDINGS_RELATIVE_PATH" ,
58
+ ] ,
59
59
60
60
// test results reporter to use
61
61
// possible values: 'dots', 'progress'
62
62
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
63
- reporters : [ "mocha" , "coverage" , "junit" , "json-to-file" ] ,
63
+ reporters : [ "mocha" , "coverage" , "junit" ] ,
64
64
65
65
coverageReporter : {
66
66
// specify a common output directory
@@ -83,11 +83,6 @@ module.exports = function (config) {
83
83
properties : { } , // key value pair of properties to add to the <properties> section of the report
84
84
} ,
85
85
86
- jsonToFileReporter : {
87
- filter : jsonRecordingFilterFunction ,
88
- outputPath : "." ,
89
- } ,
90
-
91
86
// web server port
92
87
port : 9876 ,
93
88
@@ -122,9 +117,6 @@ module.exports = function (config) {
122
117
browserNoActivityTimeout : 60000000 ,
123
118
browserDisconnectTimeout : 10000 ,
124
119
browserDisconnectTolerance : 3 ,
125
- browserConsoleLogOptions : {
126
- terminal : ! isRecordMode ( ) ,
127
- } ,
128
120
129
121
client : {
130
122
mocha : {
0 commit comments