mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-11 02:29:48 -04:00
Instead of rendering the full peer dependency issues tree during installation, suggest users run "pnpm peers check" to view the issues. Remove the now-unused @pnpm/installing.render-peer-issues package.
88 lines
1.9 KiB
TypeScript
88 lines
1.9 KiB
TypeScript
import { toOutput$ } from '@pnpm/cli.default-reporter'
|
|
import { peerDependencyIssuesLogger } from '@pnpm/core-loggers'
|
|
import {
|
|
createStreamParser,
|
|
logger,
|
|
} from '@pnpm/logger'
|
|
import { firstValueFrom } from 'rxjs'
|
|
|
|
test('print peer dependency issues warning', async () => {
|
|
const output$ = toOutput$({
|
|
context: {
|
|
argv: ['install'],
|
|
},
|
|
streamParser: createStreamParser(),
|
|
})
|
|
|
|
peerDependencyIssuesLogger.debug({
|
|
issuesByProjects: {
|
|
'.': {
|
|
missing: {},
|
|
bad: {
|
|
a: [
|
|
{
|
|
parents: [
|
|
{
|
|
name: 'b',
|
|
version: '1.0.0',
|
|
},
|
|
],
|
|
foundVersion: '2',
|
|
resolvedFrom: [],
|
|
optional: false,
|
|
wantedRange: '3',
|
|
},
|
|
],
|
|
},
|
|
conflicts: [],
|
|
intersections: {},
|
|
},
|
|
},
|
|
})
|
|
|
|
expect.assertions(1)
|
|
|
|
const output = await firstValueFrom(output$)
|
|
expect(output).toContain('pnpm peers check')
|
|
})
|
|
|
|
test('print peer dependency issues error', async () => {
|
|
const output$ = toOutput$({
|
|
context: { argv: ['install'] },
|
|
streamParser: createStreamParser(),
|
|
})
|
|
|
|
const err = Object.assign(new Error('some error'), {
|
|
code: 'ERR_PNPM_PEER_DEP_ISSUES',
|
|
issuesByProjects: {
|
|
'.': {
|
|
missing: {},
|
|
bad: {
|
|
a: [
|
|
{
|
|
foundVersion: '2',
|
|
parents: [
|
|
{
|
|
name: 'b',
|
|
version: '1.0.0',
|
|
},
|
|
],
|
|
optional: false,
|
|
resolvedFrom: [],
|
|
wantedRange: '3',
|
|
},
|
|
],
|
|
},
|
|
conflicts: [],
|
|
intersections: {},
|
|
},
|
|
},
|
|
})
|
|
logger.error(err, err)
|
|
|
|
expect.assertions(1)
|
|
|
|
const output = await firstValueFrom(output$)
|
|
expect(output).toContain('pnpm peers check')
|
|
})
|