diff --git a/lib/commands/xctest.js b/lib/commands/xctest.js index c040d536e..920c04fcb 100644 --- a/lib/commands/xctest.js +++ b/lib/commands/xctest.js @@ -96,7 +96,7 @@ export function parseXCTestStdout(stdout) { // Parse each property /** @type {XCTestResult} */ - const output = /** @type {any} */({}); + const output = /** @type {any} */ ({}); let entryIndex = 0; for (const prop of properties) { if (entryIndex === 0) { @@ -185,7 +185,15 @@ export default { * @returns {Promise} * @this {XCUITestDriver} */ - async mobileRunXCTest(testRunnerBundleId, appUnderTestBundleId, xcTestBundleId, args, testType = 'ui', env, timeout = XCTEST_TIMEOUT) { + async mobileRunXCTest( + testRunnerBundleId, + appUnderTestBundleId, + xcTestBundleId, + args = [], + testType = 'ui', + env, + timeout = XCTEST_TIMEOUT + ) { const subproc = await assertIDB(this.opts).runXCUITest( testRunnerBundleId, appUnderTestBundleId, @@ -233,7 +241,7 @@ export default { subproc.on('exit', (code, signal) => { clearTimeout(xctestTimeout); if (code !== 0) { - const err = /** @type {any} */(new Error(lastErrorMessage || mostRecentLogObject)); + const err = /** @type {any} */ (new Error(lastErrorMessage || mostRecentLogObject)); err.code = code; if (signal != null) { err.signal = signal; @@ -283,13 +291,13 @@ export default { }, /** - * List XCTests in a test bundle - * - * @param {string} bundle - Bundle ID of the XCTest - * - * @returns {Promise} The list of xctests in the test bundle (e.g., `['XCTesterAppUITests.XCTesterAppUITests/testExample', 'XCTesterAppUITests.XCTesterAppUITests/testLaunchPerformance']`) - * @this {XCUITestDriver} - */ + * List XCTests in a test bundle + * + * @param {string} bundle - Bundle ID of the XCTest + * + * @returns {Promise} The list of xctests in the test bundle (e.g., `['XCTesterAppUITests.XCTesterAppUITests/testExample', 'XCTesterAppUITests.XCTesterAppUITests/testLaunchPerformance']`) + * @this {XCUITestDriver} + */ async mobileListXCTestsInTestBundle(bundle) { if (!_.isString(bundle)) { throw new errors.InvalidArgumentError( diff --git a/lib/execute-method-map.ts b/lib/execute-method-map.ts index 53fa3304e..bea151598 100644 --- a/lib/execute-method-map.ts +++ b/lib/execute-method-map.ts @@ -342,8 +342,8 @@ export const executeMethodMap = { 'mobile: runXCTest': { command: 'mobileRunXCTest', params: { - required: ['testRunnerBundleId', 'appUnderTestBundleId', 'xcTestBundleId', 'args'], - optional: ['testType', 'env', 'timeout'], + required: ['testRunnerBundleId', 'appUnderTestBundleId', 'xctestBundleId'], + optional: ['args', 'testType', 'env', 'timeout'], }, }, 'mobile: installXCTestBundle': {