diff --git a/lib/diff.js b/lib/diff.js index 9ef5a78a20ce9..bead06e85dbf8 100644 --- a/lib/diff.js +++ b/lib/diff.js @@ -42,7 +42,11 @@ const diff = async (args) => { const [a, b] = await retrieveSpecs(specs) npmlog.info('diff', { src: a, dst: b }) - const res = await libdiff([a, b], { ...npm.flatOptions, diffFiles: args }) + const res = await libdiff([a, b], { + ...npm.flatOptions, + diffFiles: args, + where: where(), + }) return output(res) } diff --git a/test/lib/diff.js b/test/lib/diff.js index 926c54fdf1848..23d1198c83a2b 100644 --- a/test/lib/diff.js +++ b/test/lib/diff.js @@ -946,12 +946,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']