Ran
|
Jobs
6
|
Files
44
|
Run time
2min
|
Badge
Embed ▾
README BADGES
|
push
travis-ci
<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">">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
ID | Job ID | Ran | Files | Coverage | |
---|---|---|---|---|---|
1 | 336.1 | 44 |
97.11 |
Travis Job 336.1 | |
2 | 336.2 | 44 |
97.11 |
Travis Job 336.2 | |
3 | 336.3 | 44 |
97.11 |
Travis Job 336.3 | |
4 | 336.4 | 44 |
97.11 |
Travis Job 336.4 | |
5 | 336.5 | 44 |
97.11 |
Travis Job 336.5 | |
6 | 336.6 | 44 |
97.11 |
Travis Job 336.6 |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
---|