mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-15 03:56:15 -04:00
* chore: update typescript to v5.5 * fix: some errors * chore(deps): update @pnpm/logger * chore(deps): use catalogs * refactor: remove a type no longer necessary * chore(deps): revert the catalog changes This reverts commit5a3d4394f1. * refactor: move types to their own files * refactor: change logger error type * feat: add pkgsStack to LogBase * feat: add type param to StreamParser * refactor: move error fields out for clarity * style: fix eslint * feat: nullify non existence fields * feat: add hint * feat: remove the nullifications This reverts commit955e196032. * feat: add `package` field * feat: extend `RequestRetryMessage.error` * fix: missing `id` field * fix: statsLogger * fix: correct types * fix: pkgsDiff * refactor: use interfaces * fix: reportSummary * fix: revert erroneous change This reverts commit81042a0783. * fix: audit * fix: silentReporter * fix: reporter * fix: eslint * fix: main.ts * fix: errorHandler * refactor: share code * fix: test/reportingPeerDependencyIssues * fix: default-reporter/test/index.ts * fix: test/reportingErrors.ts * fix: test/execPnpm --------- Co-authored-by: khai96_ <hvksmr1996@gmail.com>
100 lines
2.0 KiB
TypeScript
100 lines
2.0 KiB
TypeScript
import { peerDependencyIssuesLogger } from '@pnpm/core-loggers'
|
|
import { toOutput$ } from '@pnpm/default-reporter'
|
|
import {
|
|
createStreamParser,
|
|
logger,
|
|
} from '@pnpm/logger'
|
|
import { take } from 'rxjs/operators'
|
|
|
|
test('print peer dependency issues warning', (done) => {
|
|
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)
|
|
|
|
output$.pipe(take(1)).subscribe({
|
|
complete: () => done(),
|
|
error: done,
|
|
next: output => {
|
|
expect(output).toContain('.')
|
|
},
|
|
})
|
|
})
|
|
|
|
test('print peer dependency issues error', (done) => {
|
|
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)
|
|
|
|
expect.assertions(1)
|
|
|
|
output$.pipe(take(1)).subscribe({
|
|
complete: () => done(),
|
|
error: done,
|
|
next: output => {
|
|
expect(output).toContain('.')
|
|
},
|
|
})
|
|
})
|