chore(appium,support): fix teen_process types
Version 2 of the types introduced breaking changes for ...some reason.
MODIFY
packages/appium/test/e2e/e2e-helpers.js
packages/appium/test/e2e/e2e-helpers.js
@@ -29,8 +29,8 @@ const log = new console.CliConsole();
* @template {import('appium/types').CliExtensionSubcommand} ExtSubcommand
* @param {string} appiumHome - Path to `APPIUM_HOME`
* @param {CliExtArgs<ExtSubcommand> | CliArgs} args - Args, including commands
- * @param {import('teen_process').ExecOptions} [opts] - Options for `teen_process`
- * @returns {Promise<import('teen_process').ExecResult<string>>}
+ * @param {TeenProcessExecOptions} [opts] - Options for `teen_process`
+ * @returns {Promise<TeenProcessExecOptions>}
*/
async function run(appiumHome, args, opts = {}) {
const cwd = PACKAGE_ROOT;
@@ -185,6 +185,7 @@ export function formatAppiumArgErrorOutput(stderr) {
* @typedef {import('@appium/types').ExtensionType} ExtensionType
* @typedef {import('appium/lib/cli/extension-command').ExtensionListData} ExtensionListData
* @typedef {import('teen_process').ExecError} ExecError
+ * @typedef {import('teen_process').TeenProcessExecOptions} TeenProcessExecOptions
*/
/**
@@ -225,6 +226,6 @@ export function formatAppiumArgErrorOutput(stderr) {
* @callback AppiumOptsRunner
* @param {string} appiumHome
* @param {CliExtArgs<ExtSubcommand>|CliArgs} args
- * @param {import('teen_process').ExecOptions} opts
+ * @param {TeenProcessExecOptions} opts
* @returns {Promise<Result>}
*/

MODIFY
packages/support/lib/npm.js
packages/support/lib/npm.js
@@ -41,13 +41,13 @@ export class NPM {
* @param {string} cmd
* @param {string[]} args
* @param {ExecOpts} opts
- * @param {Omit<import('teen_process').ExecOptions, 'cwd'>} [execOpts]
+ * @param {Omit<TeenProcessExecOptions, 'cwd'>} [execOpts]
*/
async exec(cmd, args, opts, execOpts = {}) {
let {cwd, json, lockFile} = opts;
// make sure we perform the current operation in cwd
- /** @type {import('teen_process').ExecOptions} */
+ /** @type {TeenProcessExecOptions} */
const teenProcessExecOpts = {...execOpts, cwd};
args.unshift(cmd);
@@ -62,7 +62,7 @@ export class NPM {
runner = async () => await acquireLock(_runner);
}
- /** @type {import('teen_process').ExecResult<string> & {json?: any}} */
+ /** @type {import('teen_process').TeenProcessExecResult<string> & {json?: any}} */
let ret;
try {
const {stdout, stderr, code} = await runner();
@@ -280,3 +280,7 @@ export const npm = new NPM();
* @property {boolean} [json] - If `true`, supply `--json` flag to npm and resolve w/ parsed JSON
* @property {string} [lockFile] - Path to lockfile to use
*/
+
+/**
+ * @typedef {import('teen_process').TeenProcessExecOptions} TeenProcessExecOptions
+ */

MODIFY
packages/support/test/mocks.js
packages/support/test/mocks.js
@@ -87,5 +87,5 @@ export function initMocks(sandbox = createSandbox()) {
*/
/**
- * @typedef { { exec: sinon.SinonStub<[string, string[], import('teen_process').ExecOptions], import('teen_process').ExecResult>, __stdout: string, __stderr: string, __code: number} } MockTeenProcess
+ * @typedef { { exec: sinon.SinonStub<[string, string[], import('teen_process').TeenProcessExecOptions], import('teen_process').TeenProcessExecResult>, __stdout: string, __stderr: string, __code: number} } MockTeenProcess
*/

chore(appium,support): fix teen_process types

Version 2 of the types introduced breaking changes for ...some reason.