forked from Ents24/testcafe-browser-provider-fbsimctl
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de71a55
commit be8c712
Showing
14 changed files
with
413 additions
and
403 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,4 +32,3 @@ jobs: | |
|
||
- name: Test | ||
run: npm test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
lib/ | ||
node_modules | ||
screenshots/ | ||
screenshots/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"hooks": { | ||
"before:init": ["npm test"], | ||
"after:bump": "npm run build" | ||
} | ||
"hooks": { | ||
"before:init": ["npm test"], | ||
"after:bump": "npm run build" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,40 @@ | ||
export default { | ||
find(list, { platform, name }) { | ||
// Do a lowercase match on the device they have asked for so we can be nice about iphone vs iPhone | ||
platform = platform.toLowerCase(); | ||
name = name.toLowerCase(); | ||
find(list, { platform, name }) { | ||
// Do a lowercase match on the device they have asked for so we can be nice about iphone vs iPhone | ||
platform = platform.toLowerCase(); | ||
name = name.toLowerCase(); | ||
|
||
const device = list.find((d) => { | ||
return ( | ||
(platform === "any" || | ||
platform === `${d.os} ${d.version}`.toLowerCase()) && | ||
name === d.name.toLowerCase() | ||
); | ||
}); | ||
const device = list.find((d) => { | ||
return ( | ||
(platform === "any" || | ||
platform === `${d.os} ${d.version}`.toLowerCase()) && | ||
name === d.name.toLowerCase() | ||
); | ||
}); | ||
|
||
if (typeof device === "undefined") return null; | ||
return device; | ||
}, | ||
if (typeof device === "undefined") return null; | ||
return device; | ||
}, | ||
|
||
parse(rawList) { | ||
const parsedList = []; | ||
parse(rawList) { | ||
const parsedList = []; | ||
|
||
for (const entry of rawList) { | ||
try { | ||
var { | ||
udid, | ||
os_version: osVersion, | ||
state, | ||
name, | ||
} = JSON.parse(entry); | ||
// eslint-disable-next-line no-unused-vars | ||
} catch (e) { | ||
continue; | ||
} | ||
const [os, version] = osVersion.split(" "); | ||
const device = { name, os, version, udid, state }; | ||
for (const entry of rawList) { | ||
try { | ||
var { udid, os_version: osVersion, state, name } = JSON.parse(entry); | ||
// eslint-disable-next-line no-unused-vars | ||
} catch (e) { | ||
continue; | ||
} | ||
const [os, version] = osVersion.split(" "); | ||
const device = { name, os, version, udid, state }; | ||
|
||
// We can't run tests on tvOS or watchOS, so only include iOS devices | ||
if (device.os && device.os.startsWith("iOS")) | ||
parsedList.push(device); | ||
} | ||
// We can't run tests on tvOS or watchOS, so only include iOS devices | ||
if (device.os && device.os.startsWith("iOS")) parsedList.push(device); | ||
} | ||
|
||
return parsedList.sort((a, b) => { | ||
return parseFloat(b.version) - parseFloat(a.version); | ||
}); | ||
}, | ||
return parsedList.sort((a, b) => { | ||
return parseFloat(b.version) - parseFloat(a.version); | ||
}); | ||
}, | ||
}; |
Oops, something went wrong.