add url pathName in toQueryString function - fixes (https://github.com/jasmine/jasmine/issues/1906 ) + comment + test

This commit is contained in:
Joris Stolwijk
2021-06-03 10:30:36 +02:00
parent f2de1be96a
commit 1e4f0d1545
2 changed files with 19 additions and 1 deletions

View File

@@ -26,7 +26,10 @@ jasmineRequire.QueryString = function() {
encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop])
);
}
return '?' + qStrPairs.join('&');
// include getWindowLocation() to fix issue with karma-jasmine-html-reporter in angular: see https://github.com/jasmine/jasmine/issues/1906
return (
(options.getWindowLocation().pathname || '') + '?' + qStrPairs.join('&')
);
}
function queryStringToParamMap() {