Skip to content

Commit 43e6160

Browse files
authored
tests/performance/utils: use commonUtils.params() (#8780)
1 parent 2f5a5f6 commit 43e6160

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tests/performance/utils.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ var nextTick = (typeof process === 'undefined' || process.browser) ?
88

99
var grep;
1010
var iterations;
11-
if (global.window && global.window.location && global.window.location.search) {
12-
grep = global.window.location.search.match(/[&?]grep=([^&]+)/);
13-
grep = grep && decodeURIComponent(grep[1]);
14-
iterations = global.window.location.search.match(/[&?]iterations=([^&]+)/);
15-
iterations = iterations && parseInt(iterations[1], 10);
16-
} else if (process && process.env) {
17-
grep = process.env.GREP;
18-
iterations = process.env.ITERATIONS && parseInt(process.env.ITERATIONS, 10);
11+
const params = commonUtils.params();
12+
if (commonUtils.isNode()) {
13+
grep = params.GREP;
14+
iterations = params.ITERATIONS && parseInt(params.ITERATIONS, 10);
15+
} else {
16+
grep = params.grep;
17+
iterations = params.iterations && parseInt(params.iterations, 10);
1918
}
2019

2120
var adapterUsed;

0 commit comments

Comments
 (0)