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

optimizely / javascript-sdk / 336
78%

Build:
DEFAULT BRANCH: master
Ran 03 Jul 2018 06:59PM UTC
Jobs 6
Files 44
Run time 2min
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
336

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%)

87.94 hits per line

Jobs
ID Job ID Ran Files Coverage
1 336.1 03 Jul 2018 07:00PM UTC 0
97.11
Travis Job 336.1
2 336.2 03 Jul 2018 07:00PM UTC 0
97.11
Travis Job 336.2
3 336.3 03 Jul 2018 07:00PM UTC 0
97.11
Travis Job 336.3
4 336.4 03 Jul 2018 06:59PM UTC 0
97.11
Travis Job 336.4
5 336.5 03 Jul 2018 06:59PM UTC 0
97.11
Travis Job 336.5
6 336.6 03 Jul 2018 07:01PM UTC 0
97.11
Travis Job 336.6
Source Files on build 336
  • Tree
  • List 0
  • Changed 11
  • Source Changed 11
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Travis Build #336
  • 958c0b64 on github
  • Prev Build on master (#334)
  • Next Build on master (#340)
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