mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 14:13:34 +01:00
test runner: Simplify getURLParameter()
This commit is contained in:
parent
958f7d8966
commit
5a8f7cf54e
1 changed files with 2 additions and 7 deletions
|
@ -154,12 +154,7 @@ $(() => {
|
|||
});
|
||||
};
|
||||
|
||||
// http://stackoverflow.com/questions/1403888/get-url-parameter-with-jquery
|
||||
const getURLParameter = function (name) {
|
||||
return decodeURI(
|
||||
(RegExp(`${name}=(.+?)(&|$)`).exec(location.search) || [null, null])[1]
|
||||
);
|
||||
};
|
||||
const getURLParameter = (name) => (new URLSearchParams(location.search)).get(name);
|
||||
|
||||
// get the list of specs and filter it if requested
|
||||
const specs = specs_list.slice();
|
||||
|
@ -179,7 +174,7 @@ $(() => {
|
|||
helper.init(() => {
|
||||
// configure and start the test framework
|
||||
const grep = getURLParameter('grep');
|
||||
if (grep !== 'null') {
|
||||
if (grep != null) {
|
||||
mocha.grep(grep);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue