jquery/test/runner/browserstack/buildBrowserFromString.js
Timmy Willison 95a4c94b81
Tests: reuse browser workers in BrowserStack tests (#5428)
- reuse BrowserStack workers.
- add support for "latest" and "latest-1" in browser version filters
- add support for specifying non-final browser versions, such as beta versions
- more accurate eslint for files in test/runner
- switched `--no-isolate` command flag to `--isolate`. Now that browser instances are shared, it made more sense to me to default to no isolation unless specified. This turned out to be cleaner because the only place we isolate is in browserstack.yml.
- fixed an issue with retries where it wasn't always waiting for the retried test run
- enable strict mode in test yargs command
2024-03-05 14:44:01 -05:00

21 lines
433 B
JavaScript

export function buildBrowserFromString( str ) {
const [ browser, versionOrDevice, os, osVersion ] = str.split( "_" );
// If the version starts with a colon, it's a device
if ( versionOrDevice && versionOrDevice.startsWith( ":" ) ) {
return {
browser,
device: versionOrDevice.slice( 1 ),
os,
os_version: osVersion
};
}
return {
browser,
browser_version: versionOrDevice,
os,
os_version: osVersion
};
}