@wordpress/e2e-test-utils
Version:
End-To-End (E2E) test utils for WordPress.
31 lines (28 loc) • 760 B
JavaScript
/* wp:polyfill */
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createURL = createURL;
var _path = require("path");
var _config = require("./shared/config");
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Creates new URL by parsing base URL, WPPath and query string.
*
* @param {string} WPPath String to be serialized as pathname.
* @param {?string} query String to be serialized as query portion of URL.
* @return {string} String which represents full URL.
*/
function createURL(WPPath, query = '') {
const url = new URL(_config.WP_BASE_URL);
url.pathname = (0, _path.join)(url.pathname, WPPath);
url.search = query;
return url.href;
}
//# sourceMappingURL=create-url.js.map