Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions test/lib/commands/ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -5462,6 +5462,37 @@ t.test('ls --install-strategy=linked', async t => {
t.match(output, /nopt/, 'should list the dependency')
})

t.test('should not report devDeps of linked transitive packages as UNMET DEPENDENCY', async t => {
const { result, ls } = await mockLs(t, {
config: {
'install-strategy': 'linked',
all: true,
},
prefixDir: {
'package.json': JSON.stringify({
name: 'test-linked-transitive',
version: '1.0.0',
dependencies: { 'pkg-a': 'file:./pkg-a' },
}),
'pkg-a': {
'package.json': JSON.stringify({
name: 'pkg-a',
version: '1.0.0',
devDependencies: { tap: '^16.0.0' },
}),
},
node_modules: {
'pkg-a': t.fixture('symlink', '../pkg-a'),
},
},
})
await ls.exec([])
const output = cleanCwd(result())
t.notMatch(output, /UNMET DEPENDENCY/, 'should not report devDeps of linked transitive packages')
t.notMatch(output, /tap/, 'should not traverse devDeps of linked transitive packages')
t.match(output, /pkg-a/, 'should list the dependency')
})

t.test('should still report declared workspace as UNMET DEPENDENCY when missing', async t => {
const { ls } = await mockLs(t, {
config: {
Expand Down
Loading