After merging #24, we do not invoke `npm install` if the requested package is
already installed. Thus, `cordova-fetch` will not add the requested package to
`dependencies` of `package.json`.
However, some tests in `cordova-lib` expect that calling `cordova-fetch` with
`{save: true}` will add the requested package to `dependencies` of
`package.json`. This does *not* cause the tests to fail with the current
version of `cordova-fetch` since there are no "dependency cache-hits" right
now. But when I experimented with #44 to speed up `cordova-lib` E2E tests, some
of the tests started to fail.
So how should we handle `save: true` when the requested package is already
installed?
I think the current behavior is fine. When we find a package already installed,
either a user manually installed it, or it had been previously installed by
Cordova. In any case, it would have been added to `dependencies` unless that
behavior was explicitly suppressed. So I don't really expect this behavor to
break anything.
Frankly, it would be better if `cordova-fetch` would only fetch dependencies
and was not expected to manage `package.json` in the first place, but that is a
different story I guess.
[ Full content available at: https://github.com/apache/cordova-fetch/issues/47 ]
This message was relayed via gitbox.apache.org for [email protected]