Skip to content

Commit 8606c4a

Browse files
committed
[update] doc and istanbul coverage
1 parent ee1a18b commit 8606c4a

17 files changed

+887
-5
lines changed

.babelrc

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"presets": ["es2015", "stage-2"],
33
"plugins": ["transform-runtime"],
4-
"comments": false
4+
"comments": false,
5+
"env": {
6+
"test": {
7+
"plugins": [
8+
"istanbul"
9+
]
10+
}
11+
}
512
}

.istanbul.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dir: ./coverage

.npmignore

+2
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ npm-debug.log
1111
.editorconfig
1212
.eslintrc.js
1313
img
14+
coverage
15+
.nyc_output
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"/Users/chuck7/repository/dva-subscribe/src/index.js":{"path":"/Users/chuck7/repository/dva-subscribe/src/index.js","statementMap":{"0":{"start":{"line":34,"column":25},"end":{"line":70,"column":6}},"1":{"start":{"line":35,"column":8},"end":{"line":35,"column":38}},"2":{"start":{"line":36,"column":8},"end":{"line":36,"column":37}},"3":{"start":{"line":37,"column":8},"end":{"line":69,"column":9}},"4":{"start":{"line":38,"column":76},"end":{"line":38,"column":81}},"5":{"start":{"line":39,"column":26},"end":{"line":39,"column":74}},"6":{"start":{"line":40,"column":12},"end":{"line":42,"column":13}},"7":{"start":{"line":41,"column":16},"end":{"line":41,"column":24}},"8":{"start":{"line":43,"column":29},"end":{"line":43,"column":34}},"9":{"start":{"line":45,"column":12},"end":{"line":54,"column":13}},"10":{"start":{"line":46,"column":16},"end":{"line":46,"column":33}},"11":{"start":{"line":48,"column":32},"end":{"line":48,"column":77}},"12":{"start":{"line":49,"column":16},"end":{"line":53,"column":17}},"13":{"start":{"line":50,"column":20},"end":{"line":50,"column":37}},"14":{"start":{"line":52,"column":20},"end":{"line":52,"column":126}},"15":{"start":{"line":55,"column":12},"end":{"line":68,"column":13}},"16":{"start":{"line":56,"column":36},"end":{"line":56,"column":38}},"17":{"start":{"line":57,"column":16},"end":{"line":59,"column":17}},"18":{"start":{"line":58,"column":20},"end":{"line":58,"column":66}},"19":{"start":{"line":60,"column":31},"end":{"line":60,"column":96}},"20":{"start":{"line":61,"column":16},"end":{"line":67,"column":17}},"21":{"start":{"line":62,"column":20},"end":{"line":64,"column":21}},"22":{"start":{"line":63,"column":24},"end":{"line":63,"column":35}},"23":{"start":{"line":66,"column":20},"end":{"line":66,"column":36}},"24":{"start":{"line":71,"column":19},"end":{"line":74,"column":5}},"25":{"start":{"line":72,"column":8},"end":{"line":72,"column":27}},"26":{"start":{"line":73,"column":8},"end":{"line":73,"column":18}},"27":{"start":{"line":75,"column":16},"end":{"line":78,"column":5}},"28":{"start":{"line":79,"column":4},"end":{"line":79,"column":14}},"29":{"start":{"line":83,"column":4},"end":{"line":87,"column":5}},"30":{"start":{"line":84,"column":8},"end":{"line":86,"column":9}},"31":{"start":{"line":85,"column":12},"end":{"line":85,"column":23}},"32":{"start":{"line":88,"column":4},"end":{"line":92,"column":5}},"33":{"start":{"line":89,"column":8},"end":{"line":91,"column":9}},"34":{"start":{"line":90,"column":12},"end":{"line":90,"column":23}},"35":{"start":{"line":93,"column":4},"end":{"line":93,"column":16}}},"fnMap":{"0":{"name":"subscribe","decl":{"start":{"line":31,"column":9},"end":{"line":31,"column":18}},"loc":{"start":{"line":31,"column":49},"end":{"line":80,"column":1}},"line":31},"1":{"name":"(anonymous_1)","decl":{"start":{"line":34,"column":40},"end":{"line":34,"column":41}},"loc":{"start":{"line":34,"column":57},"end":{"line":70,"column":5}},"line":34},"2":{"name":"(anonymous_2)","decl":{"start":{"line":71,"column":19},"end":{"line":71,"column":20}},"loc":{"start":{"line":71,"column":32},"end":{"line":74,"column":5}},"line":71},"3":{"name":"_diff","decl":{"start":{"line":82,"column":9},"end":{"line":82,"column":14}},"loc":{"start":{"line":82,"column":69},"end":{"line":94,"column":1}},"line":82}},"branchMap":{"0":{"loc":{"start":{"line":38,"column":25},"end":{"line":38,"column":37}},"type":"default-arg","locations":[{"start":{"line":38,"column":35},"end":{"line":38,"column":37}}],"line":38},"1":{"loc":{"start":{"line":38,"column":54},"end":{"line":38,"column":71}},"type":"default-arg","locations":[{"start":{"line":38,"column":66},"end":{"line":38,"column":71}}],"line":38},"2":{"loc":{"start":{"line":40,"column":12},"end":{"line":42,"column":13}},"type":"if","locations":[{"start":{"line":40,"column":12},"end":{"line":42,"column":13}},{"start":{"line":40,"column":12},"end":{"line":42,"column":13}}],"line":40},"3":{"loc":{"start":{"line":45,"column":12},"end":{"line":54,"column":13}},"type":"if","locations":[{"start":{"line":45,"column":12},"end":{"line":54,"column":13}},{"start":{"line":45,"column":12},"end":{"line":54,"column":13}}],"line":45},"4":{"loc":{"start":{"line":45,"column":16},"end":{"line":45,"column":55}},"type":"binary-expr","locations":[{"start":{"line":45,"column":16},"end":{"line":45,"column":25}},{"start":{"line":45,"column":29},"end":{"line":45,"column":55}}],"line":45},"5":{"loc":{"start":{"line":49,"column":16},"end":{"line":53,"column":17}},"type":"if","locations":[{"start":{"line":49,"column":16},"end":{"line":53,"column":17}},{"start":{"line":49,"column":16},"end":{"line":53,"column":17}}],"line":49},"6":{"loc":{"start":{"line":55,"column":12},"end":{"line":68,"column":13}},"type":"if","locations":[{"start":{"line":55,"column":12},"end":{"line":68,"column":13}},{"start":{"line":55,"column":12},"end":{"line":68,"column":13}}],"line":55},"7":{"loc":{"start":{"line":60,"column":31},"end":{"line":60,"column":96}},"type":"binary-expr","locations":[{"start":{"line":60,"column":31},"end":{"line":60,"column":44}},{"start":{"line":60,"column":48},"end":{"line":60,"column":96}}],"line":60},"8":{"loc":{"start":{"line":61,"column":16},"end":{"line":67,"column":17}},"type":"if","locations":[{"start":{"line":61,"column":16},"end":{"line":67,"column":17}},{"start":{"line":61,"column":16},"end":{"line":67,"column":17}}],"line":61},"9":{"loc":{"start":{"line":84,"column":8},"end":{"line":86,"column":9}},"type":"if","locations":[{"start":{"line":84,"column":8},"end":{"line":86,"column":9}},{"start":{"line":84,"column":8},"end":{"line":86,"column":9}}],"line":84},"10":{"loc":{"start":{"line":84,"column":12},"end":{"line":84,"column":62}},"type":"binary-expr","locations":[{"start":{"line":84,"column":12},"end":{"line":84,"column":17}},{"start":{"line":84,"column":21},"end":{"line":84,"column":62}}],"line":84},"11":{"loc":{"start":{"line":89,"column":8},"end":{"line":91,"column":9}},"type":"if","locations":[{"start":{"line":89,"column":8},"end":{"line":91,"column":9}},{"start":{"line":89,"column":8},"end":{"line":91,"column":9}}],"line":89}},"s":{"0":8,"1":19,"2":19,"3":19,"4":25,"5":25,"6":25,"7":8,"8":17,"9":17,"10":8,"11":9,"12":9,"13":3,"14":6,"15":17,"16":13,"17":13,"18":6,"19":13,"20":13,"21":1,"22":2,"23":12,"24":8,"25":7,"26":7,"27":8,"28":8,"29":6,"30":5,"31":1,"32":5,"33":8,"34":1,"35":4},"f":{"0":8,"1":19,"2":7,"3":6},"b":{"0":[16],"1":[23],"2":[8,17],"3":[8,9],"4":[17,15],"5":[3,6],"6":[13,4],"7":[13,13],"8":[1,12],"9":[1,4],"10":[5,5],"11":[1,7]},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"e5a6150d455e97d3ff23d5b57e0f902bb866253a","contentHash":"6eccb44ddc851a101c31d513edda74b8_11.0.3"}}

.travis.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: node_js
2+
node_js:
3+
- 6
4+
script: true
5+
deploy:
6+
provider: npm
7+
8+
on:
9+
tags: true

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ subscriptions: {
6161

6262
## Parameters
6363

64-
```javascript
64+
```
6565
@param {Object} history, react-router history
6666
@param {Function} dispatch, dva's dispatch
67-
@param {Object} rules, spread arguments, optional,
67+
@param {Object} rules, rest arguments, optional,
6868
rule {Object}, { url: '...', queries: [...], actionCreator: (...) => {...}, everyTime: true/false }
6969
property {String} url
7070
the url pattern, etc '/a/:b/:c/x'

coverage/base.css

+212
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
body, html {
2+
margin:0; padding: 0;
3+
height: 100%;
4+
}
5+
body {
6+
font-family: Helvetica Neue, Helvetica, Arial;
7+
font-size: 14px;
8+
color:#333;
9+
}
10+
.small { font-size: 12px; }
11+
*, *:after, *:before {
12+
-webkit-box-sizing:border-box;
13+
-moz-box-sizing:border-box;
14+
box-sizing:border-box;
15+
}
16+
h1 { font-size: 20px; margin: 0;}
17+
h2 { font-size: 14px; }
18+
pre {
19+
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
20+
margin: 0;
21+
padding: 0;
22+
-moz-tab-size: 2;
23+
-o-tab-size: 2;
24+
tab-size: 2;
25+
}
26+
a { color:#0074D9; text-decoration:none; }
27+
a:hover { text-decoration:underline; }
28+
.strong { font-weight: bold; }
29+
.space-top1 { padding: 10px 0 0 0; }
30+
.pad2y { padding: 20px 0; }
31+
.pad1y { padding: 10px 0; }
32+
.pad2x { padding: 0 20px; }
33+
.pad2 { padding: 20px; }
34+
.pad1 { padding: 10px; }
35+
.space-left2 { padding-left:55px; }
36+
.space-right2 { padding-right:20px; }
37+
.center { text-align:center; }
38+
.clearfix { display:block; }
39+
.clearfix:after {
40+
content:'';
41+
display:block;
42+
height:0;
43+
clear:both;
44+
visibility:hidden;
45+
}
46+
.fl { float: left; }
47+
@media only screen and (max-width:640px) {
48+
.col3 { width:100%; max-width:100%; }
49+
.hide-mobile { display:none!important; }
50+
}
51+
52+
.quiet {
53+
color: #7f7f7f;
54+
color: rgba(0,0,0,0.5);
55+
}
56+
.quiet a { opacity: 0.7; }
57+
58+
.fraction {
59+
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
60+
font-size: 10px;
61+
color: #555;
62+
background: #E8E8E8;
63+
padding: 4px 5px;
64+
border-radius: 3px;
65+
vertical-align: middle;
66+
}
67+
68+
div.path a:link, div.path a:visited { color: #333; }
69+
table.coverage {
70+
border-collapse: collapse;
71+
margin: 10px 0 0 0;
72+
padding: 0;
73+
}
74+
75+
table.coverage td {
76+
margin: 0;
77+
padding: 0;
78+
vertical-align: top;
79+
}
80+
table.coverage td.line-count {
81+
text-align: right;
82+
padding: 0 5px 0 20px;
83+
}
84+
table.coverage td.line-coverage {
85+
text-align: right;
86+
padding-right: 10px;
87+
min-width:20px;
88+
}
89+
90+
table.coverage td span.cline-any {
91+
display: inline-block;
92+
padding: 0 5px;
93+
width: 100%;
94+
}
95+
.missing-if-branch {
96+
display: inline-block;
97+
margin-right: 5px;
98+
border-radius: 3px;
99+
position: relative;
100+
padding: 0 4px;
101+
background: #333;
102+
color: yellow;
103+
}
104+
105+
.skip-if-branch {
106+
display: none;
107+
margin-right: 10px;
108+
position: relative;
109+
padding: 0 4px;
110+
background: #ccc;
111+
color: white;
112+
}
113+
.missing-if-branch .typ, .skip-if-branch .typ {
114+
color: inherit !important;
115+
}
116+
.coverage-summary {
117+
border-collapse: collapse;
118+
width: 100%;
119+
}
120+
.coverage-summary tr { border-bottom: 1px solid #bbb; }
121+
.keyline-all { border: 1px solid #ddd; }
122+
.coverage-summary td, .coverage-summary th { padding: 10px; }
123+
.coverage-summary tbody { border: 1px solid #bbb; }
124+
.coverage-summary td { border-right: 1px solid #bbb; }
125+
.coverage-summary td:last-child { border-right: none; }
126+
.coverage-summary th {
127+
text-align: left;
128+
font-weight: normal;
129+
white-space: nowrap;
130+
}
131+
.coverage-summary th.file { border-right: none !important; }
132+
.coverage-summary th.pct { }
133+
.coverage-summary th.pic,
134+
.coverage-summary th.abs,
135+
.coverage-summary td.pct,
136+
.coverage-summary td.abs { text-align: right; }
137+
.coverage-summary td.file { white-space: nowrap; }
138+
.coverage-summary td.pic { min-width: 120px !important; }
139+
.coverage-summary tfoot td { }
140+
141+
.coverage-summary .sorter {
142+
height: 10px;
143+
width: 7px;
144+
display: inline-block;
145+
margin-left: 0.5em;
146+
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
147+
}
148+
.coverage-summary .sorted .sorter {
149+
background-position: 0 -20px;
150+
}
151+
.coverage-summary .sorted-desc .sorter {
152+
background-position: 0 -10px;
153+
}
154+
.status-line { height: 10px; }
155+
/* dark red */
156+
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
157+
.low .chart { border:1px solid #C21F39 }
158+
/* medium red */
159+
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
160+
/* light red */
161+
.low, .cline-no { background:#FCE1E5 }
162+
/* light green */
163+
.high, .cline-yes { background:rgb(230,245,208) }
164+
/* medium green */
165+
.cstat-yes { background:rgb(161,215,106) }
166+
/* dark green */
167+
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
168+
.high .chart { border:1px solid rgb(77,146,33) }
169+
170+
171+
.medium .chart { border:1px solid #666; }
172+
.medium .cover-fill { background: #666; }
173+
174+
.cbranch-no { background: yellow !important; color: #111; }
175+
176+
.cstat-skip { background: #ddd; color: #111; }
177+
.fstat-skip { background: #ddd; color: #111 !important; }
178+
.cbranch-skip { background: #ddd !important; color: #111; }
179+
180+
span.cline-neutral { background: #eaeaea; }
181+
.medium { background: #eaeaea; }
182+
183+
.cover-fill, .cover-empty {
184+
display:inline-block;
185+
height: 12px;
186+
}
187+
.chart {
188+
line-height: 0;
189+
}
190+
.cover-empty {
191+
background: white;
192+
}
193+
.cover-full {
194+
border-right: none !important;
195+
}
196+
pre.prettyprint {
197+
border: none !important;
198+
padding: 0 !important;
199+
margin: 0 !important;
200+
}
201+
.com { color: #999 !important; }
202+
.ignore-none { color: #999; font-weight: normal; }
203+
204+
.wrapper {
205+
min-height: 100%;
206+
height: auto !important;
207+
height: 100%;
208+
margin: 0 auto -48px;
209+
}
210+
.footer, .push {
211+
height: 48px;
212+
}

coverage/index.html

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<title>Code coverage report for All files</title>
5+
<meta charset="utf-8" />
6+
<link rel="stylesheet" href="prettify.css" />
7+
<link rel="stylesheet" href="base.css" />
8+
<meta name="viewport" content="width=device-width, initial-scale=1">
9+
<style type='text/css'>
10+
.coverage-summary .sorter {
11+
background-image: url(sort-arrow-sprite.png);
12+
}
13+
</style>
14+
</head>
15+
<body>
16+
<div class='wrapper'>
17+
<div class='pad1'>
18+
<h1>
19+
All files
20+
</h1>
21+
<div class='clearfix'>
22+
<div class='fl pad1y space-right2'>
23+
<span class="strong">100% </span>
24+
<span class="quiet">Statements</span>
25+
<span class='fraction'>36/36</span>
26+
</div>
27+
<div class='fl pad1y space-right2'>
28+
<span class="strong">100% </span>
29+
<span class="quiet">Branches</span>
30+
<span class='fraction'>22/22</span>
31+
</div>
32+
<div class='fl pad1y space-right2'>
33+
<span class="strong">100% </span>
34+
<span class="quiet">Functions</span>
35+
<span class='fraction'>4/4</span>
36+
</div>
37+
<div class='fl pad1y space-right2'>
38+
<span class="strong">100% </span>
39+
<span class="quiet">Lines</span>
40+
<span class='fraction'>36/36</span>
41+
</div>
42+
</div>
43+
</div>
44+
<div class='status-line high'></div>
45+
<div class="pad1">
46+
<table class="coverage-summary">
47+
<thead>
48+
<tr>
49+
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
50+
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
51+
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
52+
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
53+
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
54+
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
55+
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
56+
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
57+
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
58+
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
59+
</tr>
60+
</thead>
61+
<tbody><tr>
62+
<td class="file high" data-value="index.js"><a href="index.js.html">index.js</a></td>
63+
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
64+
<td data-value="100" class="pct high">100%</td>
65+
<td data-value="36" class="abs high">36/36</td>
66+
<td data-value="100" class="pct high">100%</td>
67+
<td data-value="22" class="abs high">22/22</td>
68+
<td data-value="100" class="pct high">100%</td>
69+
<td data-value="4" class="abs high">4/4</td>
70+
<td data-value="100" class="pct high">100%</td>
71+
<td data-value="36" class="abs high">36/36</td>
72+
</tr>
73+
74+
</tbody>
75+
</table>
76+
</div><div class='push'></div><!-- for sticky footer -->
77+
</div><!-- /wrapper -->
78+
<div class='footer quiet pad2 space-top1 center small'>
79+
Code coverage
80+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Tue Jul 18 2017 11:08:21 GMT+0800 (CST)
81+
</div>
82+
</div>
83+
<script src="prettify.js"></script>
84+
<script>
85+
window.onload = function () {
86+
if (typeof prettyPrint === 'function') {
87+
prettyPrint();
88+
}
89+
};
90+
</script>
91+
<script src="sorter.js"></script>
92+
</body>
93+
</html>

0 commit comments

Comments
 (0)