fix(diff): set option where for pacote · npm/cli@b3e7dd1 (original) (raw)

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -50,10 +50,11 @@ class Diff {
50 50 const [a, b] = await this.retrieveSpecs(specs)
51 51 npmlog.info('diff', { src: a, dst: b })
52 52
53 -const res = await libdiff(
54 -[a, b],
55 -{ ...this.npm.flatOptions, diffFiles: args }
56 -)
53 +const res = await libdiff([a, b], {
54 + ...this.npm.flatOptions,
55 +diffFiles: args,
56 +where: this.where,
57 +})
57 58 return output(res)
58 59 }
59 60
Original file line number Diff line number Diff line change
@@ -951,12 +951,13 @@ t.test('first arg is a valid semver range', t => {
951 951
952 952 t.test('first arg is an unknown dependency name', t => {
953 953 t.test('second arg is a qualified spec', t => {
954 -t.plan(3)
954 +t.plan(4)
955 955
956 956 libnpmdiff = async ([a, b], opts) => {
957 957 t.equal(a, 'bar@latest', 'should set expected first spec')
958 958 t.equal(b, 'bar@2.0.0', 'should set expected second spec')
959 959 t.match(opts, npm.flatOptions, 'should forward flat options')
960 +t.match(opts, { where: '.' }, 'should forward pacote options')
960 961 }
961 962
962 963 npm.flatOptions.diff = ['bar', 'bar@2.0.0']