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

optimizely / javascript-sdk / 336 / 4
78%
master: 78%

Build:
DEFAULT BRANCH: master
Ran 03 Jul 2018 06:59PM UTC
Files 44
Run time 8s
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

03 Jul 2018 06:58PM UTC coverage: 97.11%. Remained the same
336.4

push

travis-ci

web-flow
<a href="https://github.com/optimizely/javascript-sdk/commit/<a class=hub.com/optimizely/javascript-sdk/commit/958c0b6412e7a25ee670a695f05503ffd223b567">958c0b641<a href="https://github.com/optimizely/javascript-sdk/commit/958c0b6412e7a25ee670a695f05503ffd223b567">&quot;&gt;fix(publish): Change prepare to prepublishOnly

## Summary

- Convert `prepare` hook to a (not-equivalent) `prepublishOnly`, reducing the number of times unit tests are run in `prepare`-literate builds by 1.

https://github.com/optimizely/javascript-sdk/pull/129 introduced a regression where unit tests stopped being run for Node.js v4 and v6. Prior to that PR, unit tests were run
- v4 and v6: once
- v8, v9, v10, ... (versions whose npm understands the `prepare` hook): twice

After that PR was merged, the number of times unit tests were run in each build went down by 1, _for every build_. That means v4 and v6 stopped running unit tests altogether.

https://github.com/optimizely/javascript-sdk/commit/</a><a class="double-link" href="https://github.com/optimizely/javascript-sdk/commit/<a class="double-link" href="https://github.com/optimizely/javascript-sdk/commit/2faa9c433f79ab720fdd337b81f7003d999dfbdb">2faa9c433</a>">2faa9c433</a><a href="https://github.com/optimizely/javascript-sdk/commit/958c0b6412e7a25ee670a695f05503ffd223b567"> fixed the regression by unconditionally running unit tests on all matrix-based builds (and explicitly adding a build to run xbrowser tests). With this, Node.js 8+ builds resumed running unit tests twice ([example](https://travis-ci.org/optimizely/javascript-sdk/jobs/399704185)).

Regarding the `prepare` hook: npm@4 added the [`prepare`](https://docs.npmjs.com/misc/scripts#prepublish-and-prepare) hook with that fires on prepublish and postinstall. This is strange. Why run tests when someone installs the package? They see the mocha output in their shell, which is likely to surprise.

This PR stops the unconventional test runs on postinstall.

## Test plan
CI.

408 of 448 branches covered (91.07%)

Branch coverage included in aggregate %.

3961 of 4051 relevant lines covered (97.78%)

14.66 hits per line

Source Files on job 336.4
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 181
  • Travis Job 336.4
  • 958c0b64 on github
  • Prev Job for on master (#334.6)
  • Next Job for on master (#340.5)
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

© 2026 Coveralls, Inc