Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Dec 20, 2023
1 parent fb39c30 commit b06dc88
Show file tree
Hide file tree
Showing 47 changed files with 5,054 additions and 921 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## TODO
* css sourcemap
* sever side node.js coverage
* lines coverage js calculation

## Changelog

* 1.2.0
- added functions coverage for v8 (typescript)
- added lines coverage for v8 (blanks, comments)

* 1.1.0
- added onEnd hook
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/monocart-code-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/monocart-coverage-v8.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/monocart-formatter.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/assets/turbogrid.js

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ <h2>Usage</h2>
console.log(coverageResults.summary);
</code></pre>
<ul>
<li><a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/tests/test-v8.js">example v8</a></li>
<li><a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/tests/test-istanbul.js">example istanbul</a></li>
<li><a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-v8.js">example v8</a></li>
<li><a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-istanbul.js">example istanbul</a></li>
</ul>
<h2>Default Options</h2>
<ul>
Expand Down Expand Up @@ -166,15 +166,15 @@ <h2>Compare Workflows</h2>
<ul>
<li><p>Istanbul Workflows</p>
<ul>
<li>1, Only for source code: instrumenting code with <a target="_blank" href="https://github.com/istanbuljs/babel-plugin-istanbul">babel-plugin-istanbul</a>,see <a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/mock/webpack.config-istanbul.js">webpack.config-istanbul.js</a>, or using <a target="_blank" href="https://github.com/istanbuljs/nyc">nyc</a>.</li>
<li>2, Collecting coverage data from browser <code>window.__coverage__</code>, see <a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/tests/test-istanbul.js">example</a>.</li>
<li>1, Only for source code: instrumenting code with <a target="_blank" href="https://github.com/istanbuljs/babel-plugin-istanbul">babel-plugin-istanbul</a>,see <a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/test/webpack.config-istanbul.js">webpack.config-istanbul.js</a>, or using <a target="_blank" href="https://github.com/istanbuljs/nyc">nyc</a>.</li>
<li>2, Collecting coverage data from browser <code>window.__coverage__</code>, see <a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-istanbul.js">example</a>.</li>
<li>3, Generating coverage report.</li>
</ul>
</li>
<li><p>V8 Workflows</p>
<ul>
<li>1, For any runtime code: nothing to do. For source code: building code with <code>development</code> <a target="_blank" href="https://webpack.js.org/configuration/mode/">mode</a> and <a target="_blank" href="https://webpack.js.org/configuration/devtool/">sourcemap</a> support, see <a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/mock/webpack.config-v8.js">webpack.config-v8.js</a>.</li>
<li>2, Collecting coverage data with <a href="#chromium-coverage-api">Chromium Coverage API</a>, see <a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/tests/test-v8.js">example</a>.</li>
<li>1, For any runtime code: nothing to do. For source code: building code with <code>development</code> <a target="_blank" href="https://webpack.js.org/configuration/mode/">mode</a> and <a target="_blank" href="https://webpack.js.org/configuration/devtool/">sourcemap</a> support, see <a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/test/webpack.config-v8.js">webpack.config-v8.js</a>.</li>
<li>2, Collecting coverage data with <a href="#chromium-coverage-api">Chromium Coverage API</a>, see <a target="_blank" href="https://github.com/cenfun/monocart-coverage-reports/blob/main/test/test-v8.js">example</a>.</li>
<li>3, Generating coverage report.</li>
</ul>
</li>
Expand Down
4 changes: 2 additions & 2 deletions docs/istanbul/html-spa/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<body>
<div id="app" class="app"></div>
<script>
window.data = {"file":"","isEmpty":false,"metrics":{"statements":{"total":32,"covered":24,"skipped":0,"missed":8,"pct":75,"classForPercent":"medium"},"branches":{"total":12,"covered":7,"skipped":0,"missed":5,"pct":58.33,"classForPercent":"medium"},"functions":{"total":8,"covered":7,"skipped":0,"missed":1,"pct":87.5,"classForPercent":"high"},"lines":{"total":32,"covered":24,"skipped":0,"missed":8,"pct":75,"classForPercent":"medium"}},"children":[{"file":"index.js","isEmpty":false,"metrics":{"statements":{"total":32,"covered":24,"skipped":0,"missed":8,"pct":75,"classForPercent":"medium"},"branches":{"total":12,"covered":7,"skipped":0,"missed":5,"pct":58.33,"classForPercent":"medium"},"functions":{"total":8,"covered":7,"skipped":0,"missed":1,"pct":87.5,"classForPercent":"high"},"lines":{"total":32,"covered":24,"skipped":0,"missed":8,"pct":75,"classForPercent":"medium"}},"children":false}]};
window.generatedDatetime = "Tue Dec 12 2023 10:32:03 GMT+0800 (中国标准时间)";
window.data = {"file":"","isEmpty":false,"metrics":{"statements":{"total":86,"covered":64,"skipped":0,"missed":22,"pct":74.41,"classForPercent":"medium"},"branches":{"total":32,"covered":22,"skipped":0,"missed":10,"pct":68.75,"classForPercent":"medium"},"functions":{"total":20,"covered":12,"skipped":0,"missed":8,"pct":60,"classForPercent":"medium"},"lines":{"total":83,"covered":61,"skipped":0,"missed":22,"pct":73.49,"classForPercent":"medium"}},"children":[{"file":"minify","isEmpty":false,"metrics":{"statements":{"total":36,"covered":31,"skipped":0,"missed":5,"pct":86.11,"classForPercent":"high"},"branches":{"total":12,"covered":9,"skipped":0,"missed":3,"pct":75,"classForPercent":"medium"},"functions":{"total":6,"covered":4,"skipped":0,"missed":2,"pct":66.66,"classForPercent":"medium"},"lines":{"total":34,"covered":29,"skipped":0,"missed":5,"pct":85.29,"classForPercent":"high"}},"children":[{"file":"comments.js","isEmpty":false,"metrics":{"statements":{"total":11,"covered":11,"skipped":0,"missed":0,"pct":100,"classForPercent":"high"},"branches":{"total":0,"covered":0,"skipped":0,"missed":0,"pct":0,"classForPercent":"empty"},"functions":{"total":0,"covered":0,"skipped":0,"missed":0,"pct":0,"classForPercent":"empty"},"lines":{"total":10,"covered":10,"skipped":0,"missed":0,"pct":100,"classForPercent":"high"}},"children":false},{"file":"demo.js","isEmpty":false,"metrics":{"statements":{"total":25,"covered":20,"skipped":0,"missed":5,"pct":80,"classForPercent":"high"},"branches":{"total":12,"covered":9,"skipped":0,"missed":3,"pct":75,"classForPercent":"medium"},"functions":{"total":6,"covered":4,"skipped":0,"missed":2,"pct":66.66,"classForPercent":"medium"},"lines":{"total":24,"covered":19,"skipped":0,"missed":5,"pct":79.16,"classForPercent":"medium"}},"children":false}]},{"file":"src","isEmpty":false,"metrics":{"statements":{"total":50,"covered":33,"skipped":0,"missed":17,"pct":66,"classForPercent":"medium"},"branches":{"total":20,"covered":13,"skipped":0,"missed":7,"pct":65,"classForPercent":"medium"},"functions":{"total":14,"covered":8,"skipped":0,"missed":6,"pct":57.14,"classForPercent":"medium"},"lines":{"total":49,"covered":32,"skipped":0,"missed":17,"pct":65.3,"classForPercent":"medium"}},"children":[{"file":"branch.js","isEmpty":false,"metrics":{"statements":{"total":6,"covered":6,"skipped":0,"missed":0,"pct":100,"classForPercent":"high"},"branches":{"total":6,"covered":5,"skipped":0,"missed":1,"pct":83.33,"classForPercent":"high"},"functions":{"total":1,"covered":1,"skipped":0,"missed":0,"pct":100,"classForPercent":"high"},"lines":{"total":6,"covered":6,"skipped":0,"missed":0,"pct":100,"classForPercent":"high"}},"children":false},{"file":"index.js","isEmpty":false,"metrics":{"statements":{"total":44,"covered":27,"skipped":0,"missed":17,"pct":61.36,"classForPercent":"medium"},"branches":{"total":14,"covered":8,"skipped":0,"missed":6,"pct":57.14,"classForPercent":"medium"},"functions":{"total":13,"covered":7,"skipped":0,"missed":6,"pct":53.84,"classForPercent":"medium"},"lines":{"total":43,"covered":26,"skipped":0,"missed":17,"pct":60.46,"classForPercent":"medium"}},"children":false}]}]};
window.generatedDatetime = "Wed Dec 20 2023 08:27:33 GMT+0800 (中国标准时间)";
window.metricsToShow = ["lines","branches","functions"];
</script>
<script src="bundle.js"></script>
Expand Down
235 changes: 235 additions & 0 deletions docs/istanbul/html-spa/minify/comments.js.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@

<!doctype html>
<html lang="en">

<head>
<title>Code coverage report for minify/comments.js</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="../prettify.css" />
<link rel="stylesheet" href="../base.css" />
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type='text/css'>
.coverage-summary .sorter {
background-image: url(../sort-arrow-sprite.png);
}
</style>
</head>

<body>
<div class='wrapper'>
<div class='pad1'>
<h1><a href="javascript:history.back()">Back</a></h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>11/11</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/0</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>10/10</span>
</div>


</div>
<p class="quiet">
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
</p>
<template id="filterTemplate">
<div class="quiet">
Filter:
<input oninput="onInput()" type="search" id="fileSearch">
</div>
</template>
</div>
<div class='status-line high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a>
<a name='L16'></a><a href='#L16'>16</a>
<a name='L17'></a><a href='#L17'>17</a>
<a name='L18'></a><a href='#L18'>18</a>
<a name='L19'></a><a href='#L19'>19</a>
<a name='L20'></a><a href='#L20'>20</a>
<a name='L21'></a><a href='#L21'>21</a>
<a name='L22'></a><a href='#L22'>22</a>
<a name='L23'></a><a href='#L23'>23</a>
<a name='L24'></a><a href='#L24'>24</a>
<a name='L25'></a><a href='#L25'>25</a>
<a name='L26'></a><a href='#L26'>26</a>
<a name='L27'></a><a href='#L27'>27</a>
<a name='L28'></a><a href='#L28'>28</a>
<a name='L29'></a><a href='#L29'>29</a>
<a name='L30'></a><a href='#L30'>30</a>
<a name='L31'></a><a href='#L31'>31</a>
<a name='L32'></a><a href='#L32'>32</a>
<a name='L33'></a><a href='#L33'>33</a>
<a name='L34'></a><a href='#L34'>34</a>
<a name='L35'></a><a href='#L35'>35</a>
<a name='L36'></a><a href='#L36'>36</a>
<a name='L37'></a><a href='#L37'>37</a>
<a name='L38'></a><a href='#L38'>38</a>
<a name='L39'></a><a href='#L39'>39</a>
<a name='L40'></a><a href='#L40'>40</a>
<a name='L41'></a><a href='#L41'>41</a>
<a name='L42'></a><a href='#L42'>42</a>
<a name='L43'></a><a href='#L43'>43</a>
<a name='L44'></a><a href='#L44'>44</a>
<a name='L45'></a><a href='#L45'>45</a>
<a name='L46'></a><a href='#L46'>46</a>
<a name='L47'></a><a href='#L47'>47</a>
<a name='L48'></a><a href='#L48'>48</a>
<a name='L49'></a><a href='#L49'>49</a>
<a name='L50'></a><a href='#L50'>50</a>
<a name='L51'></a><a href='#L51'>51</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">2x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/* eslint-disable no-trailing-spaces,line-comment-position,no-inline-comments,indent,no-multi-spaces,no-multiple-empty-lines */
// LineComment
&nbsp;
console.log('some//thing'); // comment /*
&nbsp;
// comment /*
console.log('some//thing/*'); /*
ddd
*/
console.log('some/*/thing');
&nbsp;
console.log(`
/*
//
*/
`);
&nbsp;
/**
* BlockComment

*

*/ console.log('some/*/thing');
&nbsp;
console.log('some//thing'); // end of line

/*
connected
*/ console.log('some*//thing'); /*
cross line
*/
&nbsp;
console.log('some*//thing'); /*
cross line
&nbsp;
*/
&nbsp;
console.log('some*//thing'); /* inline */ console.log('some*//thing');
&nbsp;
/*
multiple line
//
&nbsp;
*/
&nbsp;
/**/ console.log('some*//thing'); /*
console.log('some//*thing')
*/
&nbsp;
&nbsp;
&nbsp;</pre></td></tr></table></pre>

<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage generated by
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
at 2023-12-20T00:27:33.854Z
</div>
<script src="../prettify.js"></script>
<script>
window.onload = function () {
prettyPrint();
};
</script>
<script src="../sorter.js"></script>
<script src="../block-navigation.js"></script>
</body>
</html>

Loading

0 comments on commit b06dc88

Please sign in to comment.