You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "erisu (via GitHub)" <gi...@apache.org> on 2025/11/08 03:11:04 UTC
[PR] feat!: drop ios-sim & use simctl directly [cordova-ios]
erisu opened a new pull request, #1583:
URL: https://github.com/apache/cordova-ios/pull/1583
<!--
Please make sure the checklist boxes are all checked before submitting the PR. The checklist is intended as a quick reference, for complete details please see our Contributor Guidelines:
http://cordova.apache.org/contribute/contribute_guidelines.html
Thanks!
-->
This PR is currently set as draft while waiting for `simctl@3.0.0` release.
### Motivation and Context
<!-- Why is this change required? What problem does it solve? -->
<!-- If it fixes an open issue, please link to the issue here. -->
Drop `ios-sim` and use `simctl` directly
### Description
<!-- Describe your changes in detail -->
Removed usage of `ios-sim`. Fetching of iOS simulators and running on simulator logic to call `simctl` directly.
### Testing
<!-- Please describe in detail how you tested your changes. -->
- `npm t`
- built Cordova sample app.
- Ran `cordova run ios --list`
- Ran `cordova run ios`
### Checklist
- [x] I've run the tests to see all new and existing tests pass
- [ ] I added automated test coverage as appropriate for this change
- [ ] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`)
- [ ] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
- [ ] I've updated the documentation if necessary
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] feat!: drop ios-sim & use simctl directly [cordova-ios]
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #1583:
URL: https://github.com/apache/cordova-ios/pull/1583#discussion_r2506089653
##########
lib/simctlHelper.js:
##########
@@ -0,0 +1,290 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+const simctl = require('simctl');
+const { events } = require('cordova-common');
+
+const fetchSimCtlList = () => simctl.list().json;
+
+/**
+ * Replaces:
+ * - Hyphens in iPad Pro name which differ in "Device Types" and "Devices"
+ * - "ʀ" in "iPhone Xʀ" with "R"
+ *
+ * @param {string} deviceName
+ * @returns {string}
+ */
+function filterDeviceName (deviceName) {
+ if (/^iPad Pro/i.test(deviceName)) {
+ return deviceName.replace(/-/g, ' ').trim();
+ }
+
+ if (deviceName.includes('ʀ')) {
+ return deviceName.replace('ʀ', 'R');
+ }
+
+ return deviceName;
+}
+
+function fixRuntimeName (runtimeName) {
+ // looking for format 'com.apple.CoreSimulator.SimRuntime.iOS-12-0'
+ const pattern = /^com\.apple\.CoreSimulator\.SimRuntime\.(([a-zA-Z0-9]+)-(\S+))$/i;
+ const match = pattern.exec(runtimeName);
+
+ if (match) {
+ const [, , os, version] = match;
+ // all or nothing -- os, version will always have a value for match
+ return `${os} ${version.replace('-', '.')}`;
+ }
+
+ return runtimeName;
+}
+
+function findAvailableRuntimes (runtimes) {
+ const availableRuntimes = {};
+
+ // The key "availability" was renamed to "isAvailable" in newer Xcode versions
+ runtimes.forEach(({ name, availability, isAvailable }) => {
+ availableRuntimes[name] = availability
+ ? availability === '(available)'
+ : isAvailable;
+ });
+
+ return availableRuntimes;
+}
+
+/**
+ * Finds and groups runtimes by device property.
+ *
+ * Example Output:
+ * {
+ * "iPhone 6" : [ "iOS 8.2", "iOS 8.3"],
+ * "iPhone 6 Plus" : [ "iOS 8.2", "iOS 8.3"]
+ * }
+ *
+ * @param {object} list
+ * @param {string} deviceProperty
+ * @param {boolean} availableOnly
+ * @param {object} options
+ * @returns {object}
+ */
+function findRuntimesGroupByDeviceProperty (list, deviceProperty, availableOnly, options = {}) {
+ const runtimes = {};
+ const availableRuntimes = findAvailableRuntimes(list.runtimes);
+
+ for (const [deviceGroup, devices] of Object.entries(list.devices)) {
+ // Normalizies the runtime name since deviceGroup can be either namespaced or human-readable.
+ const normalizedRuntimeName = fixRuntimeName(deviceGroup);
+
+ for (const device of devices) {
+ let devicePropertyValue = device[deviceProperty];
+
+ if (options.lowerCase) {
+ devicePropertyValue = devicePropertyValue.toLowerCase();
+ }
+
+ if (!runtimes[devicePropertyValue]) {
+ runtimes[devicePropertyValue] = [];
+ }
+
+ if (!availableOnly || availableRuntimes[normalizedRuntimeName]) {
+ runtimes[devicePropertyValue].push(normalizedRuntimeName);
+ }
+ }
+ }
+
+ return runtimes;
+}
+
+/**
+ * Starts, installs and launches the app onto targeted simulator.
+ *
+ * @param {object} device
+ * @param {object} options
+ */
+function startSimulator (device, options = {}) {
+ if (!device?.id) {
+ throw new Error('Missing device ID.');
+ }
+
+ if (!options?.appPath) {
+ throw new Error('Missing app installation path.');
+ }
+
+ if (!options?.appIdentifier) {
+ throw new Error('Missing app identifier for launch.');
+ }
+
+ if (!options?.logPath) {
+ throw new Error('Missing log path for simulator output.');
+ }
+
+ const waitForDebugger = options?.waitForDebugger ?? false;
+
+ events.emit('verbose', `device.name: ${device.name}`);
+ events.emit('verbose', `device.runtime: ${device.runtime}`);
+ events.emit('verbose', `device.id: ${device.id}`);
+
+ simctl.extensions.start(device.id);
+ simctl.install(device.id, options.appPath);
+ simctl.launch(waitForDebugger, device.id, options.appIdentifier, []);
+ simctl.extensions.log(device.id, options.logPath);
+}
+
+/**
+ * Finds the first available device name, udid, and normalized runtime.
+ *
+ * Example result:
+ * {
+ * name : 'iPhone 6',
+ * id : 'A1193D97-F5EE-468D-9DBA-786F403766E6',
+ * runtime : 'iOS 8.3'
+ * }
+ *
+ * @param {object} list
+ * @returns {object}
+ */
+function findFirstAvailableDevice (list) {
+ const availableRuntimes = findAvailableRuntimes(list.runtimes);
+
+ for (const [deviceGroup, devices] of Object.entries(list.devices)) {
+ // Normalizies the runtime name since deviceGroup can be either namespaced or human-readable.
+ const normalizedRuntimeName = fixRuntimeName(deviceGroup);
+
+ // Skip when the runtime is not available.
+ if (!availableRuntimes[normalizedRuntimeName]) {
+ continue;
+ }
+
+ const [firstDevice] = devices;
+ if (firstDevice) {
+ return {
+ name: firstDevice.name,
+ id: firstDevice.udid,
+ runtime: normalizedRuntimeName
+ };
+ }
+ }
+
+ // Nothing was found so returning null values
+ return { name: null, id: null, runtime: null };
+}
+
+/**
+ * Find and return available runtime by device name.
+ *
+ * @param {object} list
+ * @param {string} deviceName
+ * @returns
+ */
+function findAvailableRuntime (list, deviceName) {
+ deviceName = deviceName.toLowerCase();
+
+ const allDeviceRuntimes = findRuntimesGroupByDeviceProperty(list, 'name', true, { lowerCase: true });
+ const deviceRuntime = allDeviceRuntimes[filterDeviceName(deviceName)] || allDeviceRuntimes[deviceName];
+ const foundRuntime = deviceRuntime && deviceRuntime.length > 0;
+
+ if (!foundRuntime) {
+ throw new Error(`No available runtimes could be found for "${deviceName}".`);
+ }
+
+ // return most modern runtime
+ return deviceRuntime.sort().pop();
+}
+
+/**
+ * Example result:
+ * {
+ * name : 'iPhone 6',
+ * id : 'A1193D97-F5EE-468D-9DBA-786F403766E6',
+ * runtime : 'iOS 8.3'
+ * }
+ *
+ * @param {string} deviceTypeId
+ * @returns {object}
+ */
+function getDeviceFromDeviceTypeId (deviceTypeId = null) {
+ const list = fetchSimCtlList();
+
+ if (!deviceTypeId) {
+ const device = findFirstAvailableDevice(list);
+ events.emmit('warn', `--devicetypeid was not specified, using first available device: ${device.name}.`);
+ return device;
+ }
+
+ const [
+ deviceTypeRaw = null,
+ runtimeRaw = null
+ ] = deviceTypeId ? deviceTypeId.split(',') : [];
Review Comment:
## Useless conditional
This use of variable 'deviceTypeId' always evaluates to true.
[Show more details](https://github.com/apache/cordova-ios/security/code-scanning/26)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] feat!: drop ios-sim & use simctl directly [cordova-ios]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1583:
URL: https://github.com/apache/cordova-ios/pull/1583#issuecomment-3505708113
## [Codecov](https://app.codecov.io/gh/apache/cordova-ios/pull/1583?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `40.83885%` with `268 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 71.31%. Comparing base ([`6b39d0e`](https://app.codecov.io/gh/apache/cordova-ios/commit/6b39d0eabe112d160e9b757da0b1ec9a0f5e21ad?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`d7cb633`](https://app.codecov.io/gh/apache/cordova-ios/commit/d7cb633db41953d6e25e70345a98dbe5004a7c0c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
| [Files with missing lines](https://app.codecov.io/gh/apache/cordova-ios/pull/1583?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [lib/runSimulator.js](https://app.codecov.io/gh/apache/cordova-ios/pull/1583?src=pr&el=tree&filepath=lib%2FrunSimulator.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bGliL3J1blNpbXVsYXRvci5qcw==) | 33.65% | [138 Missing :warning: ](https://app.codecov.io/gh/apache/cordova-ios/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [lib/simctlHelper.js](https://app.codecov.io/gh/apache/cordova-ios/pull/1583?src=pr&el=tree&filepath=lib%2FsimctlHelper.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bGliL3NpbWN0bEhlbHBlci5qcw==) | 42.03% | [91 Missing :warning: ](https://app.codecov.io/gh/apache/cordova-ios/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [lib/listEmulatorImages.js](https://app.codecov.io/gh/apache/cordova-ios/pull/1583?src=pr&el=tree&filepath=lib%2FlistEmulatorImages.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bGliL2xpc3RFbXVsYXRvckltYWdlcy5qcw==) | 46.66% | [32 Missing :warning: ](https://app.codecov.io/gh/apache/cordova-ios/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [lib/run.js](https://app.codecov.io/gh/apache/cordova-ios/pull/1583?src=pr&el=tree&filepath=lib%2Frun.js&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-bGliL3J1bi5qcw==) | 73.07% | [7 Missing :warning: ](https://app.codecov.io/gh/apache/cordova-ios/pull/1583?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
> :exclamation: There is a different number of reports uploaded between BASE (6b39d0e) and HEAD (d7cb633). Click for more details.
>
> <details><summary>HEAD has 3 uploads less than BASE</summary>
>
>| Flag | BASE (6b39d0e) | HEAD (d7cb633) |
>|------|------|------|
>||4|1|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #1583 +/- ##
==========================================
- Coverage 78.74% 71.31% -7.43%
==========================================
Files 17 19 +2
Lines 4911 5289 +378
==========================================
- Hits 3867 3772 -95
- Misses 1044 1517 +473
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cordova-ios/pull/1583?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] feat!: drop ios-sim & use simctl directly [cordova-ios]
Posted by "erisu (via GitHub)" <gi...@apache.org>.
erisu merged PR #1583:
URL: https://github.com/apache/cordova-ios/pull/1583
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] feat!: drop ios-sim & use simctl directly [cordova-ios]
Posted by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org>.
github-advanced-security[bot] commented on code in PR #1583:
URL: https://github.com/apache/cordova-ios/pull/1583#discussion_r2506074157
##########
lib/runSimulator.js:
##########
@@ -0,0 +1,208 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+const path = require('node:path');
+const fs = require('node:fs');
+const { events } = require('cordova-common');
+const bplist = require('bplist-parser');
+const plist = require('plist');
+
+const {
+ fetchSimCtlList,
+ findAvailableRuntimes,
+ filterDeviceName,
+ fixRuntimeName,
+ findRuntimesGroupByDeviceProperty,
+ startSimulator
+} = require('./simctlHelper');
+
+/**
+ * Finds the first available device name, udid, and normalized runtime.
+ *
+ * Example result:
+ * {
+ * name : 'iPhone 6',
+ * id : 'A1193D97-F5EE-468D-9DBA-786F403766E6',
+ * runtime : 'iOS 8.3'
+ * }
+ *
+ * @param {object} list
+ * @returns {object}
+ */
+function findFirstAvailableDevice (list) {
+ const availableRuntimes = findAvailableRuntimes(list.runtimes);
+
+ for (const [deviceGroup, devices] of Object.entries(list.devices)) {
+ // Normalizies the runtime name since deviceGroup can be either namespaced or human-readable.
+ const normalizedRuntimeName = fixRuntimeName(deviceGroup);
+
+ // Skip when the runtime is not available.
+ if (!availableRuntimes[normalizedRuntimeName]) {
+ continue;
+ }
+
+ const [firstDevice] = devices;
+ if (firstDevice) {
+ return {
+ name: firstDevice.name,
+ id: firstDevice.udid,
+ runtime: normalizedRuntimeName
+ };
+ }
+ }
+
+ // Nothing was found so returning null values
+ return { name: null, id: null, runtime: null };
+}
+
+/**
+ * Find and return available runtime by device name.
+ *
+ * @param {object} list
+ * @param {string} deviceName
+ * @returns
+ */
+function findAvailableRuntime (list, deviceName) {
+ deviceName = deviceName.toLowerCase();
+
+ const allDeviceRuntimes = findRuntimesGroupByDeviceProperty(list, 'name', true, { lowerCase: true });
+ const deviceRuntime = allDeviceRuntimes[filterDeviceName(deviceName)] || allDeviceRuntimes[deviceName];
+ const foundRuntime = deviceRuntime && deviceRuntime.length > 0;
+
+ if (!foundRuntime) {
+ throw new Error(`No available runtimes could be found for "${deviceName}".`);
+ }
+
+ // return most modern runtime
+ return deviceRuntime.sort().pop();
+}
+
+/**
+ * Example result:
+ * {
+ * name : 'iPhone 6',
+ * id : 'A1193D97-F5EE-468D-9DBA-786F403766E6',
+ * runtime : 'iOS 8.3'
+ * }
+ *
+ * @param {string} deviceTypeId
+ * @returns {object}
+ */
+function getDeviceFromDeviceTypeId (deviceTypeId = null) {
+ const list = fetchSimCtlList();
+
+ if (!deviceTypeId) {
+ const device = findFirstAvailableDevice(list);
+ events.emmit('warn', `--devicetypeid was not specified, using first available device: ${device.name}.`);
+ return device;
+ }
+
+ const [
+ deviceTypeRaw = null,
+ runtimeRaw = null
+ ] = deviceTypeId ? deviceTypeId.split(',') : [];
Review Comment:
## Useless conditional
This use of variable 'deviceTypeId' always evaluates to true.
[Show more details](https://github.com/apache/cordova-ios/security/code-scanning/25)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] feat!: drop ios-sim & use simctl directly [cordova-ios]
Posted by "dpogue (via GitHub)" <gi...@apache.org>.
dpogue commented on code in PR #1583:
URL: https://github.com/apache/cordova-ios/pull/1583#discussion_r2544575305
##########
tests/spec/unit/lib/list-emulator-images.spec.js:
##########
@@ -1,38 +1,38 @@
-/*
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
*/
-// Requiring ios-sim below has some side effects, mainly,
+// Requiring simctl below has some side effects, mainly,
// it ends up requiring the specific macOS environment bits that
// allow for interacting with iOS Simulators. On Windows+Linux we are
// bound to not-have-that.
if (process.platform === 'darwin') {
const list_emus = require('../../../../lib/listEmulatorImages');
- const iossim = require('ios-sim');
+ const simctl = require('simctl');
- describe('cordova/lib/listEmulatorImages', () => {
+ xdescribe('cordova/lib/listEmulatorImages', () => {
Review Comment:
For this test, I think we can remove the darwin check, require simctl unconditionally, and just mock the JSON response? Is there something else that causes this to fail?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
Re: [PR] feat!: drop ios-sim & use simctl directly [cordova-ios]
Posted by "dpogue (via GitHub)" <gi...@apache.org>.
dpogue commented on code in PR #1583:
URL: https://github.com/apache/cordova-ios/pull/1583#discussion_r2544659179
##########
tests/spec/unit/lib/simctlHelper.spec.js:
##########
@@ -0,0 +1,502 @@
+/**
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+*/
+
+const fs = require('node:fs');
+const path = require('node:path');
+const simctl = require('simctl');
+const { events } = require('cordova-common');
+
+let json;
+let simctlHelper;
+let emitSpy;
+
+function fixtureJson (output) {
+ const file = path.resolve(__dirname, `../fixtures/${output}`);
+ return JSON.parse(fs.readFileSync(file, { encoding: 'utf-8' }).toString());
+}
+
+if (process.platform === 'darwin') {
Review Comment:
No need for these to be wrapped in a darwin check, since we're mocking the actual calls
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org