mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
4af5caed7a
Close gh-2234
25 lines
632 B
JavaScript
25 lines
632 B
JavaScript
export function buildTestUrl( suite, { browserstack, jquery, migrate, port, reportId } ) {
|
|
if ( !port ) {
|
|
throw new Error( "No port specified." );
|
|
}
|
|
|
|
const query = new URLSearchParams();
|
|
|
|
if ( jquery ) {
|
|
query.append( "jquery", jquery );
|
|
}
|
|
|
|
if ( migrate ) {
|
|
query.append( "migrate", "true" );
|
|
}
|
|
|
|
if ( reportId ) {
|
|
query.append( "reportId", reportId );
|
|
}
|
|
|
|
// BrowserStack supplies a custom domain for local testing,
|
|
// which is especially necessary for iOS testing.
|
|
const host = browserstack ? "bs-local.com" : "localhost";
|
|
return `http://${ host }:${ port }/tests/unit/${ suite }/${ suite }.html?${ query }`;
|
|
}
|