Skip to content

Commit

Permalink
tests(smoke): add smoke test code coverage (#4967)
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankenny authored and paulirish committed Apr 14, 2018
1 parent 67947e8 commit 9d10641
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ script:
- yarn type-check
- yarn closure
- yarn diff:sample-json
- yarn smoke
- yarn smoke:silentcoverage
- yarn test-extension
# _JAVA_OPTIONS is breaking parsing of compiler output. See #3338.
- unset _JAVA_OPTIONS
Expand All @@ -49,5 +49,6 @@ before_cache:
- rm -rf ./node_modules/temp-devtoolsprotocol/
after_success:
- yarn coveralls
- yarn codecov
addons:
chrome: stable
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ const libDetectorSource = fs.readFileSync(
* Obtains a list of detected JS libraries and their versions.
* @return {!Array<!{name: string, version: string, npmPkgName: string}>}
*/
/* istanbul ignore next */
/* eslint-disable camelcase */
/* istanbul ignore next */
function detectLibraries() {
const libraries = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const Gatherer = require('../gatherer');

/* global document,window,HTMLLinkElement */

/* istanbul ignore next */
function installMediaListener() {
window.___linkMediaChanges = [];
Object.defineProperty(HTMLLinkElement.prototype, 'media', {
Expand Down
1 change: 1 addition & 0 deletions lighthouse-core/gather/gatherers/seo/robots-txt.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const Gatherer = require('../gatherer');

/* global fetch, URL, location */

/* istanbul ignore next */
function getRobotsTxtContent() {
return fetch(new URL('/robots.txt', location.href))
.then(response => {
Expand Down
1 change: 1 addition & 0 deletions lighthouse-core/lib/dom-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Combinators are not supported.
* @param {!Array<!Element>}
*/
/* istanbul ignore next */
function getElementsInDocument(selector) {
const results = [];

Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@
"viewer-unit": "yarn unit-viewer",
"watch": "yarn unit-core --watch",

"unit:silentcoverage": "nyc --silent yarn unit",
"unit:silentcoverage": "nyc --silent yarn unit && nyc report --reporter text-lcov > unit-coverage.lcov",
"coverage": "nyc yarn unit && nyc report --reporter html",
"coveralls": "nyc report --reporter lcovonly && cat ./coverage/lcov.info | coveralls && codecov",
"smoke:silentcoverage": "nyc --silent yarn smoke && nyc report --reporter text-lcov > smoke-coverage.lcov",
"coverage:smoke": "nyc yarn smoke && nyc report --reporter html",
"coveralls": "cat unit-coverage.lcov | coveralls",
"codecov": "codecov -f unit-coverage.lcov -F unit && codecov -f smoke-coverage.lcov -F smoke",

"closure": "cd lighthouse-core && node closure/closure-type-checking.js",
"devtools": "bash lighthouse-core/scripts/roll-to-devtools.sh",
Expand Down

0 comments on commit 9d10641

Please sign in to comment.