Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ class Diff {
const [a, b] = await this.retrieveSpecs(specs)
npmlog.info('diff', { src: a, dst: b })

const res = await libdiff(
[a, b],
{ ...this.npm.flatOptions, diffFiles: args }
)
const res = await libdiff([a, b], {
...this.npm.flatOptions,
diffFiles: args,
where: this.where,
})
return output(res)
}

Expand Down
3 changes: 2 additions & 1 deletion test/lib/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -951,12 +951,13 @@ t.test('first arg is a valid semver range', t => {

t.test('first arg is an unknown dependency name', t => {
t.test('second arg is a qualified spec', t => {
t.plan(3)
t.plan(4)

libnpmdiff = async ([a, b], opts) => {
t.equal(a, 'bar@latest', 'should set expected first spec')
t.equal(b, 'bar@2.0.0', 'should set expected second spec')
t.match(opts, npm.flatOptions, 'should forward flat options')
t.match(opts, { where: '.' }, 'should forward pacote options')
}

npm.flatOptions.diff = ['bar', 'bar@2.0.0']
Expand Down