%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
const t = require('tap') const { load: loadMockNpm } = require('../../fixtures/mock-npm.js') const dym = require('../../../lib/utils/did-you-mean.js') t.test('did-you-mean', async t => { const { npm } = await loadMockNpm(t) t.test('with package.json', async t => { const testdir = t.testdir({ 'package.json': JSON.stringify({ bin: { npx: 'exists', }, scripts: { install: 'exists', posttest: 'exists', }, }), }) t.test('nistall', async t => { const result = await dym(npm, testdir, 'nistall') t.match(result, 'npm install') }) t.test('sttest', async t => { const result = await dym(npm, testdir, 'sttest') t.match(result, 'npm test') t.match(result, 'npm run posttest') }) t.test('npz', async t => { const result = await dym(npm, testdir, 'npxx') t.match(result, 'npm exec npx') }) t.test('qwuijbo', async t => { const result = await dym(npm, testdir, 'qwuijbo') t.match(result, '') }) }) t.test('with no package.json', t => { const testdir = t.testdir({}) t.test('nistall', async t => { const result = await dym(npm, testdir, 'nistall') t.match(result, 'npm install') }) t.end() }) t.test('missing bin and script properties', async t => { const testdir = t.testdir({ 'package.json': JSON.stringify({ name: 'missing-bin', }), }) const result = await dym(npm, testdir, 'nistall') t.match(result, 'npm install') }) })