Skip to content

Commit

Permalink
fix: Add favicon to html report (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 authored and coreyfarrell committed Nov 24, 2019
1 parent a01a2b8 commit 5afe203
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion packages/istanbul-reports/lib/html/index.js
Expand Up @@ -16,7 +16,10 @@ function htmlHead(details) {
<meta charset="utf-8" />
<link rel="stylesheet" href="${html.escape(details.prettify.css)}" />
<link rel="stylesheet" href="${html.escape(details.base.css)}" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="${html.escape(
details.favicon
)}" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(${html.escape(details.sorter.image)});
Expand Down Expand Up @@ -303,6 +306,7 @@ class HtmlReport extends ReportBase {
js: linkMapper.assetPath(node, 'prettify.js'),
css: linkMapper.assetPath(node, 'prettify.css')
};
templateData.favicon = linkMapper.assetPath(node, 'favicon.png');
}

getTemplateData() {
Expand Down
9 changes: 9 additions & 0 deletions packages/istanbul-reports/test/html-spa/index.js
Expand Up @@ -83,6 +83,15 @@ describe('html-spa', () => {
dest: './block-navigation.js',
header: '/* eslint-disable */\n'
},
{
dest: './favicon.png',
header: undefined,
source: path.join(
__dirname,
'/../../lib/html/assets/favicon.png'
),
type: 'copy'
},
{
type: 'copy',
source: path.join(
Expand Down

0 comments on commit 5afe203

Please sign in to comment.