• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

npm / init-package-json / 125
95%
master: 95%

Build:
Build:
LAST BUILD BRANCH: v2.0.3
DEFAULT BRANCH: master
Ran 04 Feb 2021 11:01PM UTC
Jobs 1
Files 1
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
125

push

travis-ci

ruyadorno
fix: package.json saving optional deps

When saving over existing files that contains optionalDependencies it
should avoid also saving that dep to dependencies, respecting our docs
recommendation on it:

    Entries in optionalDependencies will override entries of the same
    name in dependencies, so it's usually best to only put in one place.

This patches this UX problem by adding an extra check that will avoid
adding a dependency to the package.json `dependencies` object in case
that package is already listed under `optionalDependencies`.

Relates to: https://github.com/npm/arborist/pull/221
Fixes: https://github.com/npm/cli/issues/724

PR-URL: https://github.com/npm/init-package-json/pull/109
Credit: @ruyadorno
Close: #109
Reviewed-by: @nlf, @wraithgar

53 of 65 branches covered (81.54%)

8 of 8 new or added lines in 1 file covered. (100.0%)

84 of 88 relevant lines covered (95.45%)

15.1 hits per line

Jobs
ID Job ID Ran Files Coverage
2 125.2 04 Feb 2021 11:01PM UTC 0
95.45
Travis Job 125.2
Source Files on build 125
  • Tree
  • List 1
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Travis Build #125
  • da71c050 on github
  • Prev Build on latest (#121)
  • Next Build on latest (#126)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc