ios-simulator
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -50,3 +50,3 @@ 'use strict'; | ||
var args = Array.prototype.slice.call(arguments); | ||
var cmd = `open -a Simulator --args -CurrentDeviceUDID "${this.deviceId}"`; | ||
var cmd = 'open -a `xcode-select -p`/Applications/Simulator.app --args -CurrentDeviceUDID ' + this.deviceId; | ||
return _.execPromiseGenerator(cmd, args[0]); | ||
@@ -53,0 +53,0 @@ }; |
{ | ||
"name": "ios-simulator", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "iOS Simulator Node.js wrapper", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -26,7 +26,7 @@ # ios-simulator | ||
|[<img src="https://avatars1.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub>](https://github.com/xudafeng)<br/>|[<img src="https://avatars1.githubusercontent.com/u/1044425?v=4" width="100px;"/><br/><sub><b>ziczhu</b></sub>](https://github.com/ziczhu)<br/>|[<img src="https://avatars0.githubusercontent.com/u/4576123?v=4" width="100px;"/><br/><sub><b>CodeToSurvive1</b></sub>](https://github.com/CodeToSurvive1)<br/> | ||
| :---: | :---: | :---: | | ||
|[<img src="https://avatars1.githubusercontent.com/u/1011681?v=4" width="100px;"/><br/><sub><b>xudafeng</b></sub>](https://github.com/xudafeng)<br/>|[<img src="https://avatars1.githubusercontent.com/u/1044425?v=4" width="100px;"/><br/><sub><b>ziczhu</b></sub>](https://github.com/ziczhu)<br/>|[<img src="https://avatars1.githubusercontent.com/u/13992714?v=4" width="100px;"/><br/><sub><b>twink1e</b></sub>](https://github.com/twink1e)<br/>|[<img src="https://avatars3.githubusercontent.com/u/1209810?v=4" width="100px;"/><br/><sub><b>paradite</b></sub>](https://github.com/paradite)<br/>|[<img src="https://avatars0.githubusercontent.com/u/4576123?v=4" width="100px;"/><br/><sub><b>CodeToSurvive1</b></sub>](https://github.com/CodeToSurvive1)<br/>|[<img src="https://avatars0.githubusercontent.com/u/1210832?v=4" width="100px;"/><br/><sub><b>djhr</b></sub>](https://github.com/djhr)<br/> | ||
| :---: | :---: | :---: | :---: | :---: | :---: | | ||
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto upated at `Thu Nov 22 2018 22:30:54 GMT+0800`. | ||
This project follows the git-contributor [spec](https://github.com/xudafeng/git-contributor), auto upated at `Sun Apr 19 2020 23:35:24 GMT+0800`. | ||
@@ -33,0 +33,0 @@ <!-- GITCONTRIBUTOR_END --> |
@@ -7,16 +7,17 @@ 'use strict'; | ||
var resetEnv = function *() { | ||
async function resetEnv() { | ||
try { | ||
yield Simulator.killAll(); | ||
await Simulator.killAll(); | ||
console.log('killed all simulators'); | ||
} catch (e) { | ||
console.log(e.stack); | ||
console.log('failed to kill all simulators'); | ||
} | ||
}; | ||
} | ||
var getSim = function *() { | ||
var devices = yield Simulator.getDevices(); | ||
async function getSim() { | ||
var devices = await Simulator.getDevices(); | ||
var matchedDevice = null; | ||
devices.forEach(function(device) { | ||
if (device.name === 'iPhone 5s' && device.available) { | ||
if (device.name === 'iPhone 8' && device.available) { | ||
matchedDevice = device; | ||
@@ -30,5 +31,5 @@ } | ||
sim.setDeviceId(matchedDevice.udid); | ||
yield sim.shutdown(); | ||
sim.shutdown(); | ||
} catch (e) { | ||
console.log(e); | ||
console.log('cannot shutdown'); | ||
} | ||
@@ -43,12 +44,13 @@ } | ||
} | ||
}; | ||
} | ||
describe('lib/ios-simulator.js', function() { | ||
this.timeout(10 * 60 * 1000); | ||
beforeEach(function *() { | ||
yield getSim(); | ||
before(function () { | ||
getSim(); | ||
}); | ||
afterEach(function *() { | ||
yield resetEnv(); | ||
afterEach(function () { | ||
resetEnv(); | ||
}); | ||
@@ -60,3 +62,3 @@ | ||
it('getDevices callback', function *(done) { | ||
it('getDevices callback', function(done) { | ||
Simulator.getDevices(function(err, data) { | ||
@@ -68,3 +70,3 @@ if (err) { | ||
} | ||
console.log(data); | ||
console.log(`got ${data.length} devices`); | ||
done(); | ||
@@ -76,3 +78,3 @@ }); | ||
Simulator.getDevices().then(function(data) { | ||
console.log(data); | ||
console.log(`got ${data.length} devices`); | ||
done(); | ||
@@ -85,4 +87,3 @@ }).catch(function(err) { | ||
it('boot callback', function *(done) { | ||
it('boot callback', function(done) { | ||
sim.boot(function(err, data) { | ||
@@ -99,4 +100,3 @@ if (err) { | ||
it('boot promise', function *(done) { | ||
it('boot promise', function(done) { | ||
sim.boot().then(function(data) { | ||
@@ -112,4 +112,3 @@ console.log(data); | ||
it('shutdown callback', function *(done) { | ||
it('shutdown callback', function(done) { | ||
sim.shutdown(function(err, data) { | ||
@@ -127,4 +126,3 @@ if (err) { | ||
it('shutdown promise', function *(done) { | ||
it('shutdown promise', function(done) { | ||
sim.shutdown().then(function(data) { | ||
@@ -137,7 +135,5 @@ console.log(data); | ||
}); | ||
}); | ||
it('open callback', function *(done) { | ||
it('open callback', function(done) { | ||
sim.open(function(err, data) { | ||
@@ -154,4 +150,3 @@ if (err) { | ||
it('open promise', function *(done) { | ||
it('open promise', function(done) { | ||
sim.open().then(function(data) { | ||
@@ -165,2 +160,12 @@ console.log(data); | ||
}); | ||
it('open success', function(done) { | ||
sim.open().then(function() { | ||
done(); | ||
}).catch(function(err) { | ||
done(err); | ||
}); | ||
}); | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
20775
12
520
2