UNPKG

@wordpress/e2e-test-utils

Version:
25 lines (23 loc) 726 B
/* wp:polyfill */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isCurrentURL = isCurrentURL; var _createUrl = require("./create-url"); /** * Internal dependencies */ /** * Checks if current URL is a WordPress path. * * @param {string} WPPath String to be serialized as pathname. * @param {?string} query String to be serialized as query portion of URL. * @return {boolean} Boolean represents whether current URL is or not a WordPress path. */ function isCurrentURL(WPPath, query = '') { const currentURL = new URL(page.url()); currentURL.search = query; return (0, _createUrl.createURL)(WPPath, query) === currentURL.href; } //# sourceMappingURL=is-current-url.js.map