tests(smoke): add smoke test code coverage (#4967)

This commit is contained in:
Brendan Kenny 2018-04-13 19:30:08 -07:00 коммит произвёл Paul Irish
Родитель 67947e8a0b
Коммит 9d10641059
6 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -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
@ -49,5 +49,6 @@ before_cache:
- rm -rf ./node_modules/temp-devtoolsprotocol/
after_success:
- yarn coveralls
- yarn codecov
addons:
chrome: stable

Просмотреть файл

@ -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 = [];

Просмотреть файл

@ -23,6 +23,7 @@ const Gatherer = require('../gatherer');
/* global document,window,HTMLLinkElement */
/* istanbul ignore next */
function installMediaListener() {
window.___linkMediaChanges = [];
Object.defineProperty(HTMLLinkElement.prototype, 'media', {

Просмотреть файл

@ -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 => {

Просмотреть файл

@ -19,6 +19,7 @@
* Combinators are not supported.
* @param {!Array<!Element>}
*/
/* istanbul ignore next */
function getElementsInDocument(selector) {
const results = [];

Просмотреть файл

@ -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",