From 56c54e8d4e5f80c44f5bfe6a20a118aa9809df1e Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Sat, 28 Dec 2019 13:15:00 +0100 Subject: [PATCH] =?UTF-8?q?refactor(typings):=20Use=C2=A0`@types/tape?= =?UTF-8?q?=E2=80=91promise`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/headless/package.json | 1 + packages/pnpm/package.json | 1 + packages/pnpm/test/cli.ts | 1 - packages/pnpm/test/install/global.ts | 1 - packages/pnpm/test/install/hoist.ts | 1 - packages/pnpm/test/install/hooks.ts | 1 - packages/pnpm/test/install/lifecycleScripts.ts | 1 - packages/pnpm/test/install/misc.ts | 1 - packages/pnpm/test/install/only.ts | 2 +- packages/pnpm/test/install/optional.ts | 1 - packages/pnpm/test/install/selfUpdate.ts | 2 +- packages/pnpm/test/install/sideEffects.ts | 1 - packages/pnpm/test/install/store.ts | 1 - packages/pnpm/test/link.ts | 1 - packages/pnpm/test/monorepo/index.ts | 1 - packages/pnpm/test/recursive/misc.ts | 1 - packages/pnpm/test/recursive/run.ts | 1 - packages/pnpm/test/recursive/update.ts | 1 - packages/pnpm/test/root.ts | 1 - packages/pnpm/test/run.ts | 1 - packages/pnpm/test/server.ts | 5 ++--- packages/pnpm/test/uninstall.ts | 1 - packages/pnpm/test/update.ts | 1 - packages/supi/package.json | 1 + packages/supi/test/api.ts | 2 +- packages/supi/test/breakingChanges.ts | 1 - packages/supi/test/install/aliases.ts | 1 - packages/supi/test/install/auth.ts | 1 - packages/supi/test/install/dedupe.ts | 1 - packages/supi/test/install/fromRepo.ts | 3 +-- packages/supi/test/install/frozenLockfile.ts | 1 - packages/supi/test/install/hoist.ts | 1 - packages/supi/test/install/hooks.ts | 1 - packages/supi/test/install/independentLeaves.ts | 1 - packages/supi/test/install/installationChecks.ts | 1 - packages/supi/test/install/lifecycleScripts.ts | 3 +-- packages/supi/test/install/local.ts | 1 - packages/supi/test/install/lockfileDir.ts | 1 - packages/supi/test/install/lockfileOnly.ts | 1 - packages/supi/test/install/misc.ts | 3 +-- packages/supi/test/install/multipleImporters.ts | 1 - packages/supi/test/install/optionalDependencies.ts | 1 - packages/supi/test/install/peerDependencies.ts | 3 +-- packages/supi/test/install/sideEffects.ts | 1 - packages/supi/test/install/update.ts | 1 - packages/supi/test/install/updatingPkgJson.ts | 1 - packages/supi/test/link.ts | 3 +-- packages/supi/test/lockfile.ts | 4 +--- packages/supi/test/prune.ts | 1 - packages/supi/test/uninstall.ts | 1 - packages/supi/test/unlink.ts | 1 - pnpm-lock.yaml | 12 ++++++++++++ typings/typed.d.ts | 10 ---------- 53 files changed, 26 insertions(+), 67 deletions(-) diff --git a/packages/headless/package.json b/packages/headless/package.json index 1768a619b2..08ae274975 100644 --- a/packages/headless/package.json +++ b/packages/headless/package.json @@ -32,6 +32,7 @@ "@types/ramda": "^0.26.38", "@types/rimraf": "^2.0.3", "@types/sinon": "^7.5.1", + "@types/tape-promise": "4.0.0", "@zkochan/rimraf": "1.0.0", "fs-extra": "8.1.0", "is-windows": "1.0.2", diff --git a/packages/pnpm/package.json b/packages/pnpm/package.json index ab0a9c5079..194512b759 100644 --- a/packages/pnpm/package.json +++ b/packages/pnpm/package.json @@ -77,6 +77,7 @@ "@types/retry": "0.12.0", "@types/semver": "^6.2.0", "@types/table": "^4.0.7", + "@types/tape-promise": "4.0.0", "@types/update-notifier": "2.5.0", "@zkochan/rimraf": "1.0.0", "anonymous-npm-registry-client": "0.1.2", diff --git a/packages/pnpm/test/cli.ts b/packages/pnpm/test/cli.ts index 5da771272f..74385f4f5f 100644 --- a/packages/pnpm/test/cli.ts +++ b/packages/pnpm/test/cli.ts @@ -11,7 +11,6 @@ import { } from './utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('some commands pass through to npm', t => { const result = execPnpmSync('dist-tag', 'ls', 'is-positive') diff --git a/packages/pnpm/test/install/global.ts b/packages/pnpm/test/install/global.ts index 43b995179d..3fde5a12d2 100644 --- a/packages/pnpm/test/install/global.ts +++ b/packages/pnpm/test/install/global.ts @@ -11,7 +11,6 @@ import { } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('global installation', async (t: tape.Test) => { prepare(t) diff --git a/packages/pnpm/test/install/hoist.ts b/packages/pnpm/test/install/hoist.ts index 4e266011ca..34fba0e47f 100644 --- a/packages/pnpm/test/install/hoist.ts +++ b/packages/pnpm/test/install/hoist.ts @@ -6,7 +6,6 @@ import writeYamlFile = require('write-yaml-file') import { execPnpm } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('hoist the dependency graph', async function (t) { const project = prepare(t) diff --git a/packages/pnpm/test/install/hooks.ts b/packages/pnpm/test/install/hooks.ts index 2b24673af7..c41133b9ea 100644 --- a/packages/pnpm/test/install/hooks.ts +++ b/packages/pnpm/test/install/hooks.ts @@ -13,7 +13,6 @@ import { } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('readPackage hook', async (t: tape.Test) => { const project = prepare(t) diff --git a/packages/pnpm/test/install/lifecycleScripts.ts b/packages/pnpm/test/install/lifecycleScripts.ts index 3348677600..1d8e9435ae 100644 --- a/packages/pnpm/test/install/lifecycleScripts.ts +++ b/packages/pnpm/test/install/lifecycleScripts.ts @@ -10,7 +10,6 @@ const pkgRoot = path.join(__dirname, '..', '..') const pnpmPkg = loadJsonFile.sync(path.join(pkgRoot, 'package.json')) const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('installation fails if lifecycle script fails', t => { const project = prepare(t, { diff --git a/packages/pnpm/test/install/misc.ts b/packages/pnpm/test/install/misc.ts index 96ae1219ba..c459d6d36a 100644 --- a/packages/pnpm/test/install/misc.ts +++ b/packages/pnpm/test/install/misc.ts @@ -23,7 +23,6 @@ import { } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('bin files are found by lifecycle scripts', t => { const project = prepare(t, { diff --git a/packages/pnpm/test/install/only.ts b/packages/pnpm/test/install/only.ts index e977fec9b9..5f00e1c0d7 100644 --- a/packages/pnpm/test/install/only.ts +++ b/packages/pnpm/test/install/only.ts @@ -8,7 +8,7 @@ import { execPnpm } from '../utils' const basicPackageManifest = loadJsonFile.sync(path.join(__dirname, '../utils/simple-package.json')) const test = promisifyTape(tape) -test['only'] = promisifyTape(tape.only) + test('production install (with --production flag)', async (t: tape.Test) => { const project = prepare(t, basicPackageManifest) diff --git a/packages/pnpm/test/install/optional.ts b/packages/pnpm/test/install/optional.ts index c980c510fd..7569edb263 100644 --- a/packages/pnpm/test/install/optional.ts +++ b/packages/pnpm/test/install/optional.ts @@ -5,7 +5,6 @@ import promisifyTape from 'tape-promise' import { execPnpm } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('installing optional dependencies when --no-optional is not used', async (t: tape.Test) => { const project = prepare(t, { diff --git a/packages/pnpm/test/install/selfUpdate.ts b/packages/pnpm/test/install/selfUpdate.ts index ed8139292a..e874162a7a 100644 --- a/packages/pnpm/test/install/selfUpdate.ts +++ b/packages/pnpm/test/install/selfUpdate.ts @@ -10,7 +10,7 @@ import { } from '../utils' const test = promisifyTape(tape) -test['only'] = promisifyTape(tape.only) + test('self-update stops the store server', async (t: tape.Test) => { const project = prepare(t) diff --git a/packages/pnpm/test/install/sideEffects.ts b/packages/pnpm/test/install/sideEffects.ts index f24ff6df6c..343bd40049 100644 --- a/packages/pnpm/test/install/sideEffects.ts +++ b/packages/pnpm/test/install/sideEffects.ts @@ -8,7 +8,6 @@ import promisifyTape from 'tape-promise' import { execPnpm } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) const ENGINE_DIR = `${process.platform}-${process.arch}-node-${process.version.split('.')[0]}` diff --git a/packages/pnpm/test/install/store.ts b/packages/pnpm/test/install/store.ts index ea3d8470f8..8e8ef4fa8e 100644 --- a/packages/pnpm/test/install/store.ts +++ b/packages/pnpm/test/install/store.ts @@ -10,7 +10,6 @@ import { promisify } from 'util' import { execPnpm } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) const ncp = promisify(ncpCB) test('corrupted tarball should be redownloaded to the store', async (t: tape.Test) => { diff --git a/packages/pnpm/test/link.ts b/packages/pnpm/test/link.ts index e5fa345fbe..49027b78bd 100644 --- a/packages/pnpm/test/link.ts +++ b/packages/pnpm/test/link.ts @@ -17,7 +17,6 @@ import { const ncp = promisify(ncpCB.ncp) const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('linking multiple packages', async (t: tape.Test) => { const project = prepare(t) diff --git a/packages/pnpm/test/monorepo/index.ts b/packages/pnpm/test/monorepo/index.ts index 749500816c..b9d042561e 100644 --- a/packages/pnpm/test/monorepo/index.ts +++ b/packages/pnpm/test/monorepo/index.ts @@ -18,7 +18,6 @@ import writeYamlFile = require('write-yaml-file') import { execPnpm, execPnpxSync } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('linking a package inside a monorepo', async (t: tape.Test) => { const projects = preparePackages(t, [ diff --git a/packages/pnpm/test/recursive/misc.ts b/packages/pnpm/test/recursive/misc.ts index de7322366a..ded5b79ef8 100644 --- a/packages/pnpm/test/recursive/misc.ts +++ b/packages/pnpm/test/recursive/misc.ts @@ -16,7 +16,6 @@ import { } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('recursive installation with package-specific .npmrc', async t => { const projects = preparePackages(t, [ diff --git a/packages/pnpm/test/recursive/run.ts b/packages/pnpm/test/recursive/run.ts index 4e3297c39e..9d0c216394 100644 --- a/packages/pnpm/test/recursive/run.ts +++ b/packages/pnpm/test/recursive/run.ts @@ -7,7 +7,6 @@ import writeYamlFile = require('write-yaml-file') import { execPnpm } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('pnpm recursive run finds bins from the root of the workspace', async (t: tape.Test) => { preparePackages(t, [ diff --git a/packages/pnpm/test/recursive/update.ts b/packages/pnpm/test/recursive/update.ts index 9e7aafcf21..8d1ae24a61 100644 --- a/packages/pnpm/test/recursive/update.ts +++ b/packages/pnpm/test/recursive/update.ts @@ -7,7 +7,6 @@ import promisifyTape from 'tape-promise' import { execPnpm } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('recursive update --latest should update deps with correct specs', async (t: tape.Test) => { await addDistTag({ package: 'foo', version: '100.1.0', distTag: 'latest' }) diff --git a/packages/pnpm/test/root.ts b/packages/pnpm/test/root.ts index 8256de886c..966929262c 100644 --- a/packages/pnpm/test/root.ts +++ b/packages/pnpm/test/root.ts @@ -6,7 +6,6 @@ import promisifyTape from 'tape-promise' import { execPnpmSync } from './utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('pnpm root', async (t: tape.Test) => { tempDir(t) diff --git a/packages/pnpm/test/run.ts b/packages/pnpm/test/run.ts index 7ead031480..3fd5828a14 100644 --- a/packages/pnpm/test/run.ts +++ b/packages/pnpm/test/run.ts @@ -6,7 +6,6 @@ import promisifyTape from 'tape-promise' import { execPnpm, execPnpmSync } from './utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) const RECORD_ARGS_FILE = `require('fs').writeFileSync('args.json', JSON.stringify(require('./args.json').concat([process.argv.slice(2)])), 'utf8')` diff --git a/packages/pnpm/test/server.ts b/packages/pnpm/test/server.ts index 87720d374f..0331f7f25a 100644 --- a/packages/pnpm/test/server.ts +++ b/packages/pnpm/test/server.ts @@ -30,8 +30,7 @@ interface ServerProcess { } const IS_WINDOWS = isWindows() const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) -test['only'] = promisifyTape(tape.only) + const kill = promisify(killcb) as (pid: number, signal: string) => Promise test('installation using pnpm server', async (t: tape.Test) => { @@ -328,7 +327,7 @@ test('installation without store server running in the background', async (t: ta // per @etamponi: // > I update it on the host, which triggers a restart of the pnpm server, // and then I update it on the container images, but that doesn't restart the running containers -test['skip']('fail if the store server is run by a different version of pnpm', async (t: tape.Test) => { +test.skip('fail if the store server is run by a different version of pnpm', async (t: tape.Test) => { const project = prepare(t) const serverJsonPath = path.resolve('..', 'store', '2', 'server', 'server.json') diff --git a/packages/pnpm/test/uninstall.ts b/packages/pnpm/test/uninstall.ts index 143ee301f2..46ce7e2673 100644 --- a/packages/pnpm/test/uninstall.ts +++ b/packages/pnpm/test/uninstall.ts @@ -8,7 +8,6 @@ import promisifyTape from 'tape-promise' import { execPnpm } from './utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('uninstall package and remove from appropriate property', async function (t: tape.Test) { const project = prepare(t) diff --git a/packages/pnpm/test/update.ts b/packages/pnpm/test/update.ts index 87d559778d..e8cfc67034 100644 --- a/packages/pnpm/test/update.ts +++ b/packages/pnpm/test/update.ts @@ -11,7 +11,6 @@ import { } from './utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('update ', async function (t: tape.Test) { const project = prepare(t) diff --git a/packages/supi/package.json b/packages/supi/package.json index 0f1a8e3331..3555093f61 100644 --- a/packages/supi/package.json +++ b/packages/supi/package.json @@ -96,6 +96,7 @@ "@types/ramda": "^0.26.38", "@types/semver": "^6.2.0", "@types/sinon": "^7.5.1", + "@types/tape-promise": "4.0.0", "anonymous-npm-registry-client": "0.1.2", "cross-spawn": "7.0.1", "deep-require-cwd": "1.0.0", diff --git a/packages/supi/test/api.ts b/packages/supi/test/api.ts index ab505a3f77..4e4e8c3f55 100644 --- a/packages/supi/test/api.ts +++ b/packages/supi/test/api.ts @@ -15,7 +15,7 @@ test('API', (t) => { // this seems illogical as even though all save types are false, // the dependency will be saved // tslint:disable-next-line:no-string-literal -test['skip']('install fails when all saving types are false', async (t: test.Test) => { +test.skip('install fails when all saving types are false', async (t: test.Test) => { try { await pnpm.install({}, await testDefaults({ save: false, saveDev: false, saveOptional: false })) t.fail('installation should have failed') diff --git a/packages/supi/test/breakingChanges.ts b/packages/supi/test/breakingChanges.ts index af880df42b..ac3cdb5504 100644 --- a/packages/supi/test/breakingChanges.ts +++ b/packages/supi/test/breakingChanges.ts @@ -11,7 +11,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from './utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('fail on non-compatible node_modules', async (t: tape.Test) => { prepareEmpty(t) diff --git a/packages/supi/test/install/aliases.ts b/packages/supi/test/install/aliases.ts index 5e863da6f8..b14fe20d62 100644 --- a/packages/supi/test/install/aliases.ts +++ b/packages/supi/test/install/aliases.ts @@ -10,7 +10,6 @@ import { } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('installing aliased dependency', async (t: tape.Test) => { const project = prepareEmpty(t) diff --git a/packages/supi/test/install/auth.ts b/packages/supi/test/install/auth.ts index de28ca76e7..388c2544a0 100644 --- a/packages/supi/test/install/auth.ts +++ b/packages/supi/test/install/auth.ts @@ -9,7 +9,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('a package that need authentication', async (t: tape.Test) => { const project = prepareEmpty(t) diff --git a/packages/supi/test/install/dedupe.ts b/packages/supi/test/install/dedupe.ts index d3b03a0513..ca68fe85b5 100644 --- a/packages/supi/test/install/dedupe.ts +++ b/packages/supi/test/install/dedupe.ts @@ -6,7 +6,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) const addDistTag = pnpmRegistryMock.addDistTag test('prefer version ranges specified for top dependencies', async (t: tape.Test) => { diff --git a/packages/supi/test/install/fromRepo.ts b/packages/supi/test/install/fromRepo.ts index 2414f56d1a..d4d3af08e4 100644 --- a/packages/supi/test/install/fromRepo.ts +++ b/packages/supi/test/install/fromRepo.ts @@ -15,7 +15,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('from a github repo', async (t: tape.Test) => { const project = prepareEmpty(t) @@ -137,7 +136,7 @@ test('from a git repo', async (t: tape.Test) => { // This test is unstable due to dependency on third party registry // tslint:disable-next-line:no-string-literal -test['skip']('from a non-github git repo', async (t: tape.Test) => { +test.skip('from a non-github git repo', async (t: tape.Test) => { const project = prepareEmpty(t) await addDependenciesToPackage({}, ['git+http://ikt.pm2.io/ikt.git#3325a3e39a502418dc2e2e4bf21529cbbde96228'], await testDefaults()) diff --git a/packages/supi/test/install/frozenLockfile.ts b/packages/supi/test/install/frozenLockfile.ts index 9cbf64b423..cd319389c9 100644 --- a/packages/supi/test/install/frozenLockfile.ts +++ b/packages/supi/test/install/frozenLockfile.ts @@ -12,7 +12,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test(`frozen-lockfile: installation fails if specs in package.json don't match the ones in ${WANTED_LOCKFILE}`, async (t) => { prepareEmpty(t) diff --git a/packages/supi/test/install/hoist.ts b/packages/supi/test/install/hoist.ts index af4b8487c9..1eb162fe5d 100644 --- a/packages/supi/test/install/hoist.ts +++ b/packages/supi/test/install/hoist.ts @@ -15,7 +15,6 @@ import promisifyTape from 'tape-promise' import { addDistTag, testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('should hoist dependencies', async (t) => { const project = prepareEmpty(t) diff --git a/packages/supi/test/install/hooks.ts b/packages/supi/test/install/hooks.ts index 2fe593a71c..8b12246ea5 100644 --- a/packages/supi/test/install/hooks.ts +++ b/packages/supi/test/install/hooks.ts @@ -13,7 +13,6 @@ import { } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('readPackage, afterAllResolved hooks', async (t: tape.Test) => { const project = prepareEmpty(t) diff --git a/packages/supi/test/install/independentLeaves.ts b/packages/supi/test/install/independentLeaves.ts index 028f0b2f1c..ebd1b45f50 100644 --- a/packages/supi/test/install/independentLeaves.ts +++ b/packages/supi/test/install/independentLeaves.ts @@ -9,7 +9,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('install with --independent-leaves', async (t: tape.Test) => { const project = prepareEmpty(t) diff --git a/packages/supi/test/install/installationChecks.ts b/packages/supi/test/install/installationChecks.ts index 54147a6dd0..6784a740e5 100644 --- a/packages/supi/test/install/installationChecks.ts +++ b/packages/supi/test/install/installationChecks.ts @@ -6,7 +6,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('fail if installed package does not support the current engine and engine-strict = true', async (t) => { const project = prepareEmpty(t) diff --git a/packages/supi/test/install/lifecycleScripts.ts b/packages/supi/test/install/lifecycleScripts.ts index c9ba85cf5d..320a0498b3 100644 --- a/packages/supi/test/install/lifecycleScripts.ts +++ b/packages/supi/test/install/lifecycleScripts.ts @@ -18,7 +18,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('run pre/postinstall scripts', async (t: tape.Test) => { const project = prepareEmpty(t) @@ -147,7 +146,7 @@ test('installation fails if lifecycle script fails', async (t: tape.Test) => { // TODO: unskip // For some reason this fails on CI environments // tslint:disable-next-line:no-string-literal -test['skip']('creates env for scripts', async (t: tape.Test) => { +test.skip('creates env for scripts', async (t: tape.Test) => { prepareEmpty(t) const manifest = await addDependenciesToPackage({ scripts: { diff --git a/packages/supi/test/install/local.ts b/packages/supi/test/install/local.ts index eefbab7215..eaca78f12e 100644 --- a/packages/supi/test/install/local.ts +++ b/packages/supi/test/install/local.ts @@ -18,7 +18,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('scoped modules from a directory', async (t: tape.Test) => { const project = prepareEmpty(t) diff --git a/packages/supi/test/install/lockfileDir.ts b/packages/supi/test/install/lockfileDir.ts index 670a5f588b..33f7d9e86a 100644 --- a/packages/supi/test/install/lockfileDir.ts +++ b/packages/supi/test/install/lockfileDir.ts @@ -11,7 +11,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) const testSkip = promisifyTape(tape.skip) testSkip('subsequent installation uses same lockfile directory by default', async (t: tape.Test) => { diff --git a/packages/supi/test/install/lockfileOnly.ts b/packages/supi/test/install/lockfileOnly.ts index f3d0f6c909..fe2439bbdf 100644 --- a/packages/supi/test/install/lockfileOnly.ts +++ b/packages/supi/test/install/lockfileOnly.ts @@ -13,7 +13,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('install with lockfileOnly = true', async (t: tape.Test) => { const project = prepareEmpty(t) diff --git a/packages/supi/test/install/misc.ts b/packages/supi/test/install/misc.ts index f84ba13a39..462c7afa72 100644 --- a/packages/supi/test/install/misc.ts +++ b/packages/supi/test/install/misc.ts @@ -36,7 +36,6 @@ import { } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) const IS_WINDOWS = isWindows() @@ -423,7 +422,7 @@ test("don't refetch package to store if it has been modified and verify-store-in // TODO: decide what to do with this case // tslint:disable-next-line:no-string-literal -test['skip']('relink package to project if the dependency is not linked from store', async (t: tape.Test) => { +test.skip('relink package to project if the dependency is not linked from store', async (t: tape.Test) => { prepareEmpty(t) const manifest = await addDependenciesToPackage({}, ['magic-hook@2.0.0'], await testDefaults({ save: true, pinnedVersion: 'patch' })) diff --git a/packages/supi/test/install/multipleImporters.ts b/packages/supi/test/install/multipleImporters.ts index 56f86c3b63..8c3bfc9fea 100644 --- a/packages/supi/test/install/multipleImporters.ts +++ b/packages/supi/test/install/multipleImporters.ts @@ -17,7 +17,6 @@ import writeYamlFile = require('write-yaml-file') import { addDistTag, testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('install only the dependencies of the specified importer', async (t) => { const projects = preparePackages(t, [ diff --git a/packages/supi/test/install/optionalDependencies.ts b/packages/supi/test/install/optionalDependencies.ts index f681f5caab..aa2db1000e 100644 --- a/packages/supi/test/install/optionalDependencies.ts +++ b/packages/supi/test/install/optionalDependencies.ts @@ -14,7 +14,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('successfully install optional dependency with subdependencies', async (t) => { prepareEmpty(t) diff --git a/packages/supi/test/install/peerDependencies.ts b/packages/supi/test/install/peerDependencies.ts index 569be2586b..99b333a6d4 100644 --- a/packages/supi/test/install/peerDependencies.ts +++ b/packages/supi/test/install/peerDependencies.ts @@ -21,7 +21,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test("don't fail when peer dependency is fetched from GitHub", async (t) => { prepareEmpty(t) @@ -330,7 +329,7 @@ test('peer dependencies are linked when running two separate named installations }) // tslint:disable-next-line:no-string-literal -test['skip']('peer dependencies are linked', async (t: tape.Test) => { +test.skip('peer dependencies are linked', async (t: tape.Test) => { const project = prepareEmpty(t) await install({ dependencies: { diff --git a/packages/supi/test/install/sideEffects.ts b/packages/supi/test/install/sideEffects.ts index 9b8a02a098..3f983e1a5c 100644 --- a/packages/supi/test/install/sideEffects.ts +++ b/packages/supi/test/install/sideEffects.ts @@ -10,7 +10,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) const ENGINE_DIR = `${process.platform}-${process.arch}-node-${process.version.split('.')[0]}` diff --git a/packages/supi/test/install/update.ts b/packages/supi/test/install/update.ts index 764ec31bef..2530e47ae1 100644 --- a/packages/supi/test/install/update.ts +++ b/packages/supi/test/install/update.ts @@ -12,7 +12,6 @@ import { } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('preserve subdeps on update', async (t: tape.Test) => { const project = prepareEmpty(t) diff --git a/packages/supi/test/install/updatingPkgJson.ts b/packages/supi/test/install/updatingPkgJson.ts index 37952a73de..f6ec3b74b4 100644 --- a/packages/supi/test/install/updatingPkgJson.ts +++ b/packages/supi/test/install/updatingPkgJson.ts @@ -13,7 +13,6 @@ import { } from '../utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('save to package.json (is-positive@^1.0.0)', async (t) => { const project = prepareEmpty(t) diff --git a/packages/supi/test/link.ts b/packages/supi/test/link.ts index 5b9f08d65a..efac25a156 100644 --- a/packages/supi/test/link.ts +++ b/packages/supi/test/link.ts @@ -24,7 +24,6 @@ import writeJsonFile = require('write-json-file') import { testDefaults } from './utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) const ncp = promisify(ncpCB.ncp) test('relative link', async (t: tape.Test) => { @@ -260,7 +259,7 @@ test('relative link uses realpath when contained in a symlinked dir', async (t: } }) -// test['skip']('relative link when an external lockfile is used', async (t: tape.Test) => { +// test.skip('relative link when an external lockfile is used', async (t: tape.Test) => { // const projects = prepare(t, [ // { // name: 'project', diff --git a/packages/supi/test/lockfile.ts b/packages/supi/test/lockfile.ts index 962f4db100..0dc2affebc 100644 --- a/packages/supi/test/lockfile.ts +++ b/packages/supi/test/lockfile.ts @@ -26,8 +26,6 @@ import { } from './utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) -test['skip'] = promisifyTape(tape.skip) // tslint:disable-line:no-string-literal const LOCKFILE_WARN_LOG = { level: 'warn', @@ -559,7 +557,7 @@ test('repeat install with no inner lockfile should not rewrite packages in node_ // Skipped because the npm-registry.compass.com server was down // might be a good idea to mock it // tslint:disable-next-line:no-string-literal -test['skip']('installing from lockfile when using npm enterprise', async (t: tape.Test) => { +test.skip('installing from lockfile when using npm enterprise', async (t: tape.Test) => { const project = prepareEmpty(t) const opts = await testDefaults({ registry: 'https://npm-registry.compass.com/' }) diff --git a/packages/supi/test/prune.ts b/packages/supi/test/prune.ts index 1a4967baab..4c2b64bba7 100644 --- a/packages/supi/test/prune.ts +++ b/packages/supi/test/prune.ts @@ -14,7 +14,6 @@ import promisifyTape from 'tape-promise' import { testDefaults } from './utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('prune removes extraneous packages', async (t: tape.Test) => { const project = prepareEmpty(t) diff --git a/packages/supi/test/uninstall.ts b/packages/supi/test/uninstall.ts index 2134f3f6ab..4bd7a5eac8 100644 --- a/packages/supi/test/uninstall.ts +++ b/packages/supi/test/uninstall.ts @@ -27,7 +27,6 @@ import writeJsonFile = require('write-json-file') import { testDefaults } from './utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) const ncp = promisify(ncpCB.ncp) test('uninstall package with no dependencies', async (t: tape.Test) => { diff --git a/packages/supi/test/unlink.ts b/packages/supi/test/unlink.ts index 81fc5aa7ab..0d8dc570ba 100644 --- a/packages/supi/test/unlink.ts +++ b/packages/supi/test/unlink.ts @@ -19,7 +19,6 @@ import { } from './utils' const test = promisifyTape(tape) -const testOnly = promisifyTape(tape.only) test('unlink 1 package that exists in package.json', async (t: tape.Test) => { const project = prepareEmpty(t) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 105e2210e3..16955d9463 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -603,6 +603,7 @@ importers: '@types/ramda': 0.26.38 '@types/rimraf': 2.0.3 '@types/sinon': 7.5.1 + '@types/tape-promise': 4.0.0 '@zkochan/rimraf': 1.0.0 fs-extra: 8.1.0 is-windows: 1.0.2 @@ -649,6 +650,7 @@ importers: '@types/ramda': ^0.26.38 '@types/rimraf': ^2.0.3 '@types/sinon': ^7.5.1 + '@types/tape-promise': 4.0.0 '@zkochan/rimraf': 1.0.0 dependency-path: 'workspace:4.0.2' fs-extra: 8.1.0 @@ -1962,6 +1964,7 @@ importers: '@types/retry': 0.12.0 '@types/semver': 6.2.0 '@types/table': 4.0.7 + '@types/tape-promise': 4.0.0 '@types/update-notifier': 2.5.0 '@zkochan/rimraf': 1.0.0 anonymous-npm-registry-client: 0.1.2 @@ -2037,6 +2040,7 @@ importers: '@types/retry': 0.12.0 '@types/semver': ^6.2.0 '@types/table': ^4.0.7 + '@types/tape-promise': 4.0.0 '@types/update-notifier': 2.5.0 '@zkochan/libnpx': 11.0.3 '@zkochan/rimraf': 1.0.0 @@ -2441,6 +2445,7 @@ importers: '@types/ramda': 0.26.38 '@types/semver': 6.2.0 '@types/sinon': 7.5.1 + '@types/tape-promise': 4.0.0 anonymous-npm-registry-client: 0.1.2 cross-spawn: 7.0.1 deep-require-cwd: 1.0.0 @@ -2515,6 +2520,7 @@ importers: '@types/ramda': ^0.26.38 '@types/semver': ^6.2.0 '@types/sinon': ^7.5.1 + '@types/tape-promise': 4.0.0 '@zkochan/npm-package-arg': 1.0.2 '@zkochan/rimraf': 1.0.0 anonymous-npm-registry-client: 0.1.2 @@ -3430,6 +3436,12 @@ packages: dev: true resolution: integrity: sha512-HKtXvBxU8U8evZCSlUi9HbfT/SFW7nSGCoiBEheB06jAhXeW6JbGh8biEAqIFG5rZo9f8xeJVdIn455sddmIcw== + /@types/tape-promise/4.0.0: + dependencies: + '@types/tape': 4.2.33 + dev: true + resolution: + integrity: sha512-Ek6EryyaAvP3Lm1aol660YfmhpDkf04TJHK6Vc+R68EQrecK8Qkbv7Ct5jvY2Yf0fkhmkeim4DOz3yDiEYEnNQ== /@types/tape/4.2.33: dependencies: '@types/node': 12.12.21 diff --git a/typings/typed.d.ts b/typings/typed.d.ts index c4cc3b4342..2d9c1aa79f 100644 --- a/typings/typed.d.ts +++ b/typings/typed.d.ts @@ -21,16 +21,6 @@ declare module 'read-ini-file' { export = readIniFile; } -declare module 'tape-promise' { - import tape = require('tape') - export = tapePromise; - - function tapePromise(tape: any): (name: string, cb: tape.TestCase) => void; - function tapePromise(tape: any): (name: string, opts: tape.TestOptions, cb: tape.TestCase) => void; - function tapePromise(tape: any): (cb: tape.TestCase) => void; - function tapePromise(tape: any): (opts: tape.TestOptions, cb: tape.TestCase) => void; -} - declare module 'semver-utils' { export function parseRange (range: string): Array<{ semver?: string,