diff --git a/.eslintignore b/.eslintignore index 43b31467a3430624d12bb65f9b0d21735537c799..a1e7e8a775f9913b17948afedaf2c70f50fa9698 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,2 @@ test/**/**/_fixtures +lib/types/**/*.d.ts diff --git a/.eslintrc.js b/.eslintrc.js index b45ff30f175af1fd3422c227a8881a0f01e1eccc..acc7d6ec4e491b6099d900cfd12c3719d0d1b409 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -16,6 +16,7 @@ module.exports = { }, rules: { 'import/no-unresolved': 0, // done by typescript + 'import/prefer-default-export': 0, // no benefit 'require-await': 'error', 'no-use-before-define': 0, 'no-restricted-syntax': 0, @@ -25,7 +26,6 @@ module.exports = { 'no-underscore-dangle': 0, // TODO: fix lint - 'import/prefer-default-export': 1, '@typescript-eslint/camelcase': 'off', // disabled until ?? '@typescript-eslint/no-var-requires': 'off', // disable until all files converted to typescript '@typescript-eslint/no-use-before-define': 'off', // disable until all files converted to typescript diff --git a/lib/manager/bundler/artifacts.js b/lib/manager/bundler/artifacts.js index 8a8574ffe009fecbd3c4261d7be1226829639555..66bdb078d4a2b05f06d3836c0c5e90ee6f50fe52 100644 --- a/lib/manager/bundler/artifacts.js +++ b/lib/manager/bundler/artifacts.js @@ -1,6 +1,6 @@ -const { exec } = require('child-process-promise'); const fs = require('fs-extra'); const upath = require('upath'); +const { exec } = require('../../util/exec'); const { getChildProcessEnv } = require('../../util/env'); const { logger } = require('../../logger'); @@ -118,7 +118,6 @@ async function updateArtifacts( logger.debug({ cmd }, 'bundler command'); ({ stdout, stderr } = await exec(cmd, { cwd, - shell: true, env, })); const duration = process.hrtime(startTime); diff --git a/lib/manager/cargo/artifacts.js b/lib/manager/cargo/artifacts.js index 6112fce7814949c072c9cafd571d0988e1128545..1ede6e8db7f7282ab1591e1fd8855677012aaf9a 100644 --- a/lib/manager/cargo/artifacts.js +++ b/lib/manager/cargo/artifacts.js @@ -1,7 +1,7 @@ const upath = require('upath'); const process = require('process'); const fs = require('fs-extra'); -const { exec } = require('child-process-promise'); +const { exec } = require('../../util/exec'); const { getChildProcessEnv } = require('../../util/env'); const { logger } = require('../../logger'); @@ -59,7 +59,6 @@ async function updateArtifacts( try { ({ stdout, stderr } = await exec(cmd, { cwd, - shell: true, env, })); } catch (err) /* istanbul ignore next */ { @@ -79,7 +78,6 @@ async function updateArtifacts( cmd = cmd.replace(/ --package.*/, ''); ({ stdout, stderr } = await exec(cmd, { cwd, - shell: true, env, })); } else { diff --git a/lib/manager/composer/artifacts.js b/lib/manager/composer/artifacts.js index 2e971d44b2b881d418933b013e07366340738813..d7d439e9f4f9b6e63306bd1740953b6730f5809a 100644 --- a/lib/manager/composer/artifacts.js +++ b/lib/manager/composer/artifacts.js @@ -1,7 +1,7 @@ import is from '@sindresorhus/is'; +import { exec } from '../../util/exec'; const URL = require('url'); -const { exec } = require('child-process-promise'); const fs = require('fs-extra'); const upath = require('upath'); const { logger } = require('../../logger'); @@ -124,7 +124,6 @@ async function updateArtifacts( logger.debug({ cmd, args }, 'composer command'); ({ stdout, stderr } = await exec(`${cmd} ${args}`, { cwd, - shell: true, env, })); const duration = process.hrtime(startTime); diff --git a/lib/manager/gomod/artifacts.js b/lib/manager/gomod/artifacts.js index cdae934c3eff99c6516aa1d52d1fdf6c051943b8..5f3e8c25a8da9de1da2b9e1496292518fabc9be9 100644 --- a/lib/manager/gomod/artifacts.js +++ b/lib/manager/gomod/artifacts.js @@ -1,6 +1,6 @@ -const { exec } = require('child-process-promise'); const fs = require('fs-extra'); const upath = require('upath'); +const { exec } = require('../../util/exec'); const hostRules = require('../../util/host-rules'); const { getChildProcessEnv } = require('../../util/env'); const { logger } = require('../../logger'); @@ -79,7 +79,6 @@ async function updateArtifacts( logger.debug({ cmd, args }, 'go get command'); ({ stdout, stderr } = await exec(`${cmd} ${args}`, { cwd, - shell: true, env, })); let duration = process.hrtime(startTime); @@ -99,7 +98,6 @@ async function updateArtifacts( logger.debug({ cmd, args }, 'go mod tidy command'); ({ stdout, stderr } = await exec(`${cmd} ${args}`, { cwd, - shell: true, env, })); duration = process.hrtime(startTime); @@ -132,7 +130,6 @@ async function updateArtifacts( logger.debug({ cmd, args }, 'go mod vendor command'); ({ stdout, stderr } = await exec(`${cmd} ${args}`, { cwd, - shell: true, env, })); duration = process.hrtime(startTime); @@ -149,7 +146,6 @@ async function updateArtifacts( logger.debug({ cmd, args }, 'go mod tidy command'); ({ stdout, stderr } = await exec(`${cmd} ${args}`, { cwd, - shell: true, env, })); duration = process.hrtime(startTime); diff --git a/lib/manager/gradle/index.js b/lib/manager/gradle/index.js index bfc1f8c43e94a27bd3b74b5774dc9cec1ca0ac87..35eebc9e1bb8e2d0160c5fa4c63d573658e79711 100644 --- a/lib/manager/gradle/index.js +++ b/lib/manager/gradle/index.js @@ -1,5 +1,5 @@ -const { exec } = require('child-process-promise'); const fs = require('fs-extra'); +const { exec } = require('../../util/exec'); const { logger } = require('../../logger'); const gradle = require('./build-gradle'); @@ -77,7 +77,6 @@ async function executeGradle(config) { ({ stdout, stderr } = await exec(cmd, { cwd: config.localDir, timeout: gradleTimeout, - shell: true, })); } catch (err) { const errorStr = `Gradle command ${cmd} failed. Exit code: ${err.code}.`; diff --git a/lib/manager/npm/post-update/lerna.js b/lib/manager/npm/post-update/lerna.js index 6794a2a70329865a2a1faa4afc267cf5016b91b8..ceee6b228f8356af1b037ce0a73e099204977ab1 100644 --- a/lib/manager/npm/post-update/lerna.js +++ b/lib/manager/npm/post-update/lerna.js @@ -1,4 +1,4 @@ -const { exec } = require('child-process-promise'); +const { exec } = require('../../../util/exec'); const { logger } = require('../../../logger'); module.exports = { @@ -52,7 +52,6 @@ async function generateLockFiles( // TODO: Switch to native util.promisify once using only node 8 ({ stdout, stderr } = await exec(cmd, { cwd, - shell: true, env, })); logger.debug(`npm stdout:\n${stdout}`); diff --git a/lib/manager/npm/post-update/npm.js b/lib/manager/npm/post-update/npm.js index 6a8765cf0a5aefdead6fd0c2762baecbd3e5b470..a9cb6fd77814e4ef827ce494f4e3fc6c082f0a30 100644 --- a/lib/manager/npm/post-update/npm.js +++ b/lib/manager/npm/post-update/npm.js @@ -1,7 +1,7 @@ const fs = require('fs-extra'); const upath = require('upath'); const { getInstalledPath } = require('get-installed-path'); -const { exec } = require('child-process-promise'); +const { exec } = require('../../../util/exec'); const { logger } = require('../../../logger'); module.exports = { @@ -94,7 +94,6 @@ async function generateLockFile( // TODO: Switch to native util.promisify once using only node 8 ({ stdout, stderr } = await exec(`${cmd} ${args}`, { cwd, - shell: true, env, })); } @@ -108,7 +107,6 @@ async function generateLockFile( .join(''); const updateRes = await exec(updateCmd, { cwd, - shell: true, env, }); stdout += updateRes.stdout ? updateRes.stdout : ''; @@ -118,7 +116,6 @@ async function generateLockFile( logger.info('Performing npm dedupe'); const dedupeRes = await exec(`${cmd} dedupe`, { cwd, - shell: true, env, }); stdout += dedupeRes.stdout ? dedupeRes.stdout : ''; diff --git a/lib/manager/npm/post-update/pnpm.js b/lib/manager/npm/post-update/pnpm.js index ba999d95c6d55d3436ff23453ab8dbf1109f8014..6972e588f1a4c605bf2a8211cefb24cd22f1a94f 100644 --- a/lib/manager/npm/post-update/pnpm.js +++ b/lib/manager/npm/post-update/pnpm.js @@ -1,7 +1,7 @@ const fs = require('fs-extra'); const upath = require('upath'); const { getInstalledPath } = require('get-installed-path'); -const { exec } = require('child-process-promise'); +const { exec } = require('../../../util/exec'); const { logger } = require('../../../logger'); module.exports = { @@ -77,7 +77,6 @@ async function generateLockFile(cwd, env, config) { // TODO: Switch to native util.promisify once using only node 8 ({ stdout, stderr } = await exec(cmd, { cwd, - shell: true, env, })); logger.debug(`pnpm stdout:\n${stdout}`); diff --git a/lib/manager/npm/post-update/yarn.js b/lib/manager/npm/post-update/yarn.js index 2c58a1711c71cc45e933ffa8444bb09d83586079..78e87982c18dfefe1941670a8ce07fa99d7d1e82 100644 --- a/lib/manager/npm/post-update/yarn.js +++ b/lib/manager/npm/post-update/yarn.js @@ -1,7 +1,7 @@ const fs = require('fs-extra'); const upath = require('upath'); const { getInstalledPath } = require('get-installed-path'); -const { exec } = require('child-process-promise'); +const { exec } = require('../../../util/exec'); const { logger } = require('../../../logger'); module.exports = { @@ -87,7 +87,6 @@ async function generateLockFile(cwd, env, config = {}, upgrades = []) { // TODO: Switch to native util.promisify once using only node 8 ({ stdout, stderr } = await exec(installCmd, { cwd, - shell: true, env, })); logger.debug(`yarn stdout:\n${stdout}`); @@ -104,7 +103,6 @@ async function generateLockFile(cwd, env, config = {}, upgrades = []) { cmdExtras; const updateRes = await exec(updateCmd, { cwd, - shell: true, env, }); stdout += updateRes.stdout @@ -123,7 +121,6 @@ async function generateLockFile(cwd, env, config = {}, upgrades = []) { 'npx yarn-deduplicate@1.1.1 --strategy fewer && yarn'; const dedupeRes = await exec(dedupeCommand, { cwd, - shell: true, env, }); stdout += dedupeRes.stdout @@ -142,7 +139,6 @@ async function generateLockFile(cwd, env, config = {}, upgrades = []) { 'npx yarn-deduplicate@1.1.1 --strategy highest && yarn'; const dedupeRes = await exec(dedupeCommand, { cwd, - shell: true, env, }); stdout += dedupeRes.stdout diff --git a/lib/manager/pip_setup/extract.js b/lib/manager/pip_setup/extract.js index c7e5eaa70abe3c6a879b095eedb1f2f888778c21..f419e58ac74f9439193b4b7ecbfd6c691dc1a56f 100644 --- a/lib/manager/pip_setup/extract.js +++ b/lib/manager/pip_setup/extract.js @@ -1,5 +1,5 @@ -const { exec } = require('child-process-promise'); const { join } = require('upath'); +const { exec } = require('../../util/exec'); const { logger } = require('../../logger'); const { isSkipComment } = require('../../util/ignore'); const { dependencyPattern } = require('../pip_requirements/extract'); @@ -69,7 +69,6 @@ async function extractSetupFile(content, packageFile, config) { logger.debug({ cmd, args }, 'python command'); const res = await exec(`${cmd} ${args.join(' ')}`, { cwd, - shell: true, timeout: 5000, }); // istanbul ignore if diff --git a/lib/manager/pipenv/artifacts.js b/lib/manager/pipenv/artifacts.js index e4dd140f21a7f003969c158081e0f5d52df3fd94..df1b7d66761860ebdd4902be3c251f3ba09614b7 100644 --- a/lib/manager/pipenv/artifacts.js +++ b/lib/manager/pipenv/artifacts.js @@ -1,6 +1,6 @@ -const { exec } = require('child-process-promise'); const fs = require('fs-extra'); const upath = require('upath'); +const { exec } = require('../../util/exec'); const { getChildProcessEnv } = require('../../util/env'); const { logger } = require('../../logger'); @@ -53,7 +53,6 @@ async function updateArtifacts( logger.debug({ cmd, args }, 'pipenv lock command'); ({ stdout, stderr } = await exec(`${cmd} ${args}`, { cwd, - shell: true, env, })); const duration = process.hrtime(startTime); diff --git a/lib/manager/poetry/artifacts.js b/lib/manager/poetry/artifacts.js index 0373154ddc8fc9dcb8019c8de53a17d369cde2b4..4bee358887790425d5e3e586a3ddc7663aa137b9 100644 --- a/lib/manager/poetry/artifacts.js +++ b/lib/manager/poetry/artifacts.js @@ -1,7 +1,7 @@ const upath = require('upath'); const process = require('process'); const fs = require('fs-extra'); -const { exec } = require('child-process-promise'); +const { exec } = require('../../util/exec'); const { getChildProcessEnv } = require('../../util/env'); const { logger } = require('../../logger'); @@ -66,7 +66,6 @@ async function updateArtifacts( cmd += ` update --lock --no-interaction ${dep}`; ({ stdout, stderr } = await exec(cmd, { cwd, - shell: true, env, })); } diff --git a/lib/types/.eslintrc.js b/lib/types/.eslintrc.js deleted file mode 100644 index e60f63cce989a27cbb13058f8484234af1499db8..0000000000000000000000000000000000000000 --- a/lib/types/.eslintrc.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - rules: { - 'import/prefer-default-export': 0, - }, -}; diff --git a/lib/util/env.js b/lib/util/env.js index 070942ee6c141454eadfd164b112218f62310a09..8cc63f42d446bd91fcb9e683193aea10db524f35 100644 --- a/lib/util/env.js +++ b/lib/util/env.js @@ -1,4 +1,10 @@ -function getChildProcessEnv(customEnvVars = []) { +/** + * + * @param {string[]} customEnvVars + * @returns {NodeJS.ProcessEnv} + */ +export function getChildProcessEnv(customEnvVars = []) { + /** @type NodeJS.ProcessEnv */ const env = {}; if (global.trustLevel === 'high') { return Object.assign(env, process.env); @@ -18,7 +24,3 @@ function getChildProcessEnv(customEnvVars = []) { }); return env; } - -module.exports = { - getChildProcessEnv, -}; diff --git a/lib/util/exec.ts b/lib/util/exec.ts new file mode 100644 index 0000000000000000000000000000000000000000..d9220217f3be5c9d78760d681a504d99dcdfa609 --- /dev/null +++ b/lib/util/exec.ts @@ -0,0 +1,14 @@ +// istanbul ignore file +import { promisify } from 'util'; +import { exec as cpExec, ExecOptions } from 'child_process'; + +const pExec = promisify(cpExec); + +export interface ExecResult { + stdout: string; + stderr: string; +} + +export function exec(cmd: string, options?: ExecOptions): Promise<ExecResult> { + return pExec(cmd, { ...options, encoding: 'utf-8' }); +} diff --git a/package.json b/package.json index 8462a2061c92027d3c09faeb2a8353628a5339a4..83f3b7b43e22ccfcde91f5e4a744e19e9aec6a2a 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,6 @@ "cacache": "11.3.3", "chalk": "2.4.2", "changelog-filename-regex": "2.0.1", - "child-process-promise": "2.2.1", "clean-git-ref": "2.0.1", "commander": "2.20.0", "conventional-commits-detector": "1.0.2", @@ -213,6 +212,7 @@ "collectCoverage": true, "collectCoverageFrom": [ "lib/**/*.{js,ts}", + "!lib/**/*.d.ts", "!lib/versioning/maven/index.js", "!lib/proxy.js" ], diff --git a/test/manager/cargo/artifacts.spec.js b/test/manager/cargo/artifacts.spec.js index c6e7ce44727d261f76fe3a8f5d950602a489a4b6..baa4021e74875f4f4586be12e8342fb6080c7ae1 100644 --- a/test/manager/cargo/artifacts.spec.js +++ b/test/manager/cargo/artifacts.spec.js @@ -1,9 +1,10 @@ jest.mock('fs-extra'); -jest.mock('child-process-promise'); +jest.mock('../../../lib/util/exec'); /** @type any */ const fs = require('fs-extra'); -const { exec } = require('child-process-promise'); +/** @type any */ +const { exec } = require('../../../lib/util/exec'); const cargo = require('../../../lib/manager/cargo/artifacts'); /** @type any */ diff --git a/test/manager/composer/artifacts.spec.js b/test/manager/composer/artifacts.spec.js index a3e8a419366dab05af61aaadbd0bde3dee12e4ea..01980647dbd0551d7040d329353bb94cc22250d0 100644 --- a/test/manager/composer/artifacts.spec.js +++ b/test/manager/composer/artifacts.spec.js @@ -1,10 +1,11 @@ jest.mock('fs-extra'); -jest.mock('child-process-promise'); +jest.mock('../../../lib/util/exec'); jest.mock('../../../lib/util/host-rules'); /** @type any */ const fs = require('fs-extra'); -const { exec } = require('child-process-promise'); +/** @type any */ +const { exec } = require('../../../lib/util/exec'); const composer = require('../../../lib/manager/composer/artifacts'); /** @type any */ const hostRules = require('../../../lib/util/host-rules'); diff --git a/test/manager/gomod/artifacts.spec.js b/test/manager/gomod/artifacts.spec.js index 5123aa5593aa81858fa1345b3f8bd29939f076ae..acecb96d2e5afe2f1aefeb910e5bcd0fb0311fb2 100644 --- a/test/manager/gomod/artifacts.spec.js +++ b/test/manager/gomod/artifacts.spec.js @@ -1,10 +1,11 @@ jest.mock('fs-extra'); -jest.mock('child-process-promise'); +jest.mock('../../../lib/util/exec'); jest.mock('../../../lib/util/host-rules'); /** @type any */ const fs = require('fs-extra'); -const { exec } = require('child-process-promise'); +/** @type any */ +const { exec } = require('../../../lib/util/exec'); const gomod = require('../../../lib/manager/gomod/artifacts'); /** @type any */ const hostRules = require('../../../lib/util/host-rules'); diff --git a/test/manager/gradle/index.spec.js b/test/manager/gradle/index.spec.js index bde2e7ad590c087ee1e6078ebe2a72c1ffa3316e..0cf393329945e9e52e6bfae4fc53711ed67acd07 100644 --- a/test/manager/gradle/index.spec.js +++ b/test/manager/gradle/index.spec.js @@ -1,11 +1,12 @@ jest.mock('fs-extra'); -jest.mock('child-process-promise'); +jest.mock('../../../lib/util/exec'); const { toUnix } = require('upath'); /** @type any */ const fs = require('fs-extra'); const fsReal = require('fs'); -const { exec } = require('child-process-promise'); +/** @type any */ +const { exec } = require('../../../lib/util/exec'); const manager = require('../../../lib/manager/gradle/index'); diff --git a/test/manager/pip_setup/extract.spec.js b/test/manager/pip_setup/extract.spec.js index 720f896b6eeb541a988efcd09c27e757b3ee8d41..ab62c6f6fab521b6c6d3ef2716d83b3eb591f9e6 100644 --- a/test/manager/pip_setup/extract.spec.js +++ b/test/manager/pip_setup/extract.spec.js @@ -1,7 +1,7 @@ const fs = require('fs'); -const { exec } = require('child-process-promise'); const tmp = require('tmp-promise'); const { relative } = require('path'); +const { exec } = require('../../../lib/util/exec'); const { extractPackageFile, parsePythonVersion, @@ -49,7 +49,7 @@ describe('lib/manager/pip_setup/extract', () => { const fExec = jest.fn(() => { throw new Error('No such file or directory'); }); - jest.doMock('child-process-promise', () => { + jest.doMock('../../../lib/util/exec', () => { return { exec: fExec, }; @@ -73,7 +73,7 @@ describe('lib/manager/pip_setup/extract', () => { const fExec = jest.fn(() => Promise.resolve({ stderr: 'Python 3.7.15rc1' }) ); - jest.doMock('child-process-promise', () => { + jest.doMock('../../../lib/util/exec', () => { return { exec: fExec, }; @@ -85,7 +85,7 @@ describe('lib/manager/pip_setup/extract', () => { }); describe('Test for presence of mock lib', () => { it('should test if python mock lib is installed', async () => { - const cp = jest.requireActual('child-process-promise'); + const cp = jest.requireActual('../../../lib/util/exec'); let isMockInstalled = true; // when binarysource === docker try { diff --git a/test/manager/pipenv/artifacts.spec.js b/test/manager/pipenv/artifacts.spec.js index 5b5756d015889a5353a80f2eef49c362ec027958..0351652543621200bfd892368b9c97c5dedd1140 100644 --- a/test/manager/pipenv/artifacts.spec.js +++ b/test/manager/pipenv/artifacts.spec.js @@ -1,10 +1,11 @@ jest.mock('fs-extra'); -jest.mock('child-process-promise'); +jest.mock('../../../lib/util/exec'); jest.mock('../../../lib/util/host-rules'); /** @type any */ const fs = require('fs-extra'); -const { exec } = require('child-process-promise'); +/** @type any */ +const { exec } = require('../../../lib/util/exec'); const pipenv = require('../../../lib/manager/pipenv/artifacts'); /** @type any */ diff --git a/test/manager/poetry/artifacts.spec.js b/test/manager/poetry/artifacts.spec.js index f8871ad2a9f33f89bc2e47988f6a402b2967299d..fe40806d7f9dfa715f6800f3dd087c92c85b5246 100644 --- a/test/manager/poetry/artifacts.spec.js +++ b/test/manager/poetry/artifacts.spec.js @@ -1,9 +1,10 @@ jest.mock('fs-extra'); -jest.mock('child-process-promise'); +jest.mock('../../../lib/util/exec'); /** @type any */ const fs = require('fs-extra'); -const { exec } = require('child-process-promise'); +/** @type any */ +const { exec } = require('../../../lib/util/exec'); const poetry = require('../../../lib/manager/poetry/artifacts'); /** @type any */ diff --git a/test/workers/branch/lock-files/lerna.spec.js b/test/workers/branch/lock-files/lerna.spec.js index a54bb660b9b7adcf23c098964a1dce5cc2b41695..3a215fa19fd57a2c63fdb52d53356d66f72aa226 100644 --- a/test/workers/branch/lock-files/lerna.spec.js +++ b/test/workers/branch/lock-files/lerna.spec.js @@ -1,7 +1,8 @@ -const { exec } = require('child-process-promise'); +/** @type any */ +const { exec } = require('../../../../lib/util/exec'); const lernaHelper = require('../../../../lib/manager/npm/post-update/lerna'); -jest.mock('child-process-promise'); +jest.mock('../../../../lib/util/exec'); /** @type any */ const platform = global.platform; diff --git a/test/workers/branch/lock-files/npm.spec.js b/test/workers/branch/lock-files/npm.spec.js index 41914eb689aa24ec7ef756c6de7b56d07da265cf..8fa283a2429085f4567c32b70db7a24a67e2ea0e 100644 --- a/test/workers/branch/lock-files/npm.spec.js +++ b/test/workers/branch/lock-files/npm.spec.js @@ -1,14 +1,15 @@ const { getInstalledPath } = require('get-installed-path'); jest.mock('fs-extra'); -jest.mock('child-process-promise'); +jest.mock('../../../../lib/util/exec'); jest.mock('get-installed-path'); getInstalledPath.mockImplementation(() => null); /** @type any */ const fs = require('fs-extra'); -const { exec } = require('child-process-promise'); +/** @type any */ +const { exec } = require('../../../../lib/util/exec'); const npmHelper = require('../../../../lib/manager/npm/post-update/npm'); describe('generateLockFile', () => { diff --git a/test/workers/branch/lock-files/pnpm.spec.js b/test/workers/branch/lock-files/pnpm.spec.js index 79b02dbdf825bfb62c4d1551dfb955e8e2cc8a01..25dec87c6afa918fe3b26753664923c7df7e75a8 100644 --- a/test/workers/branch/lock-files/pnpm.spec.js +++ b/test/workers/branch/lock-files/pnpm.spec.js @@ -1,14 +1,15 @@ const { getInstalledPath } = require('get-installed-path'); jest.mock('fs-extra'); -jest.mock('child-process-promise'); +jest.mock('../../../../lib/util/exec'); jest.mock('get-installed-path'); getInstalledPath.mockImplementation(() => null); /** @type any */ const fs = require('fs-extra'); -const { exec } = require('child-process-promise'); +/** @type any */ +const { exec } = require('../../../../lib/util/exec'); const pnpmHelper = require('../../../../lib/manager/npm/post-update/pnpm'); describe('generateLockFile', () => { diff --git a/test/workers/branch/lock-files/yarn.spec.js b/test/workers/branch/lock-files/yarn.spec.js index f43c879021972389357e063efc17fa6603718ef8..97dad7f1c21663e14fe76d8b3e632ec9948ec86d 100644 --- a/test/workers/branch/lock-files/yarn.spec.js +++ b/test/workers/branch/lock-files/yarn.spec.js @@ -1,14 +1,15 @@ const { getInstalledPath } = require('get-installed-path'); jest.mock('fs-extra'); -jest.mock('child-process-promise'); +jest.mock('../../../../lib/util/exec'); jest.mock('get-installed-path'); getInstalledPath.mockImplementation(() => null); /** @type any */ const fs = require('fs-extra'); -const { exec } = require('child-process-promise'); +/** @type any */ +const { exec } = require('../../../../lib/util/exec'); const yarnHelper = require('../../../../lib/manager/npm/post-update/yarn'); describe('generateLockFile', () => { diff --git a/yarn.lock b/yarn.lock index c79c856df5d1b53aa2721e2d53f08cf5df608048..c70dd10c93977dd92b4ed4cdd96abf7ce8e0b8ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2029,15 +2029,6 @@ check-error@^1.0.2: resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= -child-process-promise@2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/child-process-promise/-/child-process-promise-2.2.1.tgz#4730a11ef610fad450b8f223c79d31d7bdad8074" - integrity sha1-RzChHvYQ+tRQuPIjx50x172tgHQ= - dependencies: - cross-spawn "^4.0.2" - node-version "^1.0.0" - promise-polyfill "^6.0.1" - chokidar@^2.0.4: version "2.1.6" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.6.tgz#b6cad653a929e244ce8a834244164d241fa954c5" @@ -2462,14 +2453,6 @@ cross-env@5.2.0: cross-spawn "^6.0.5" is-windows "^1.0.0" -cross-spawn@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" - integrity sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE= - dependencies: - lru-cache "^4.0.1" - which "^1.2.9" - cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -6091,11 +6074,6 @@ node-releases@^1.1.25: dependencies: semver "^5.3.0" -node-version@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/node-version/-/node-version-1.2.0.tgz#34fde3ffa8e1149bd323983479dda620e1b5060d" - integrity sha512-ma6oU4Sk0qOoKEAymVoTvk8EdXEobdS7m/mAGhDJ8Rouugho48crHBORAmy5BoOcv8wraPM6xumapQp5hl4iIQ== - noms@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/noms/-/noms-0.0.0.tgz#da8ebd9f3af9d6760919b27d9cdc8092a7332859" @@ -7025,11 +7003,6 @@ promise-inflight@^1.0.1, promise-inflight@~1.0.1: resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" integrity sha1-mEcocL8igTL8vdhoEputEsPAKeM= -promise-polyfill@^6.0.1: - version "6.1.0" - resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-6.1.0.tgz#dfa96943ea9c121fca4de9b5868cb39d3472e057" - integrity sha1-36lpQ+qcEh/KTem1hoyznTRy4Fc= - promise-retry@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/promise-retry/-/promise-retry-1.1.1.tgz#6739e968e3051da20ce6497fb2b50f6911df3d6d"