@ellipticltd/aml-utils 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/aml-utils.iml +12 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.nyc_output/62fbf615-4746-451c-aa0c-c12cb22b7a9d.json +1 -0
- package/.nyc_output/fd0c5a49-1dee-497a-bd75-dcf009fcab1e.json +1 -0
- package/.nyc_output/processinfo/1aa97f38-9e09-4229-9e02-5f7fa02f213b.json +1 -0
- package/.nyc_output/processinfo/62fbf615-4746-451c-aa0c-c12cb22b7a9d.json +1 -0
- package/.nyc_output/processinfo/b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7.json +1 -0
- package/.nyc_output/processinfo/fd0c5a49-1dee-497a-bd75-dcf009fcab1e.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/coverage/errors/errors.js.html +1 -1
- package/coverage/errors/errors.spec.js.html +15 -15
- package/coverage/errors/index.html +12 -12
- package/coverage/file-parser/__tests/file-parser.spec.js.html +96 -96
- package/coverage/file-parser/__tests/index.html +32 -32
- package/coverage/file-parser/__tests/parse-row.spec.js.html +36 -36
- package/coverage/file-parser/__tests/sanitize-rows.spec.js.html +49 -49
- package/coverage/formatting/formatting.js.html +21 -21
- package/coverage/formatting/formatting.spec.js.html +30 -30
- package/coverage/formatting/index.html +28 -28
- package/coverage/index.html +54 -54
- package/coverage/middleware/index.html +1 -1
- package/coverage/middleware/middleware.js.html +1 -1
- package/coverage/orm-helpers/index.html +26 -26
- package/coverage/orm-helpers/ormHelpers.js.html +24 -24
- package/coverage/orm-helpers/ormHelpers.spec.js.html +9 -9
- package/coverage/types/index.html +1 -1
- package/coverage/types/types.js.html +1 -1
- package/coverage/validations/index.html +30 -30
- package/coverage/validations/validations.js.html +236 -545
- package/coverage/validations/validations.spec.js.html +159 -525
- package/dist/validations/validations.d.ts +6 -0
- package/dist/validations/validations.js +8 -0
- package/dist/validations/validations.spec.js +12 -0
- package/lib/validations/validations.js +8 -0
- package/lib/validations/validations.spec.js +13 -0
- package/package.json +1 -1
- package/.nyc_output/cd455ec6-4d73-4c5e-871e-7f0609bd11b8.json +0 -1
- package/.nyc_output/d6cd0f05-9810-4f97-8faa-8753f10b9d2d.json +0 -1
- package/.nyc_output/processinfo/3974a52e-3acc-45e4-a312-2dae8e2da051.json +0 -1
- package/.nyc_output/processinfo/3bbc21ec-7576-45f9-bc87-b6a79588c265.json +0 -1
- package/.nyc_output/processinfo/cd455ec6-4d73-4c5e-871e-7f0609bd11b8.json +0 -1
- package/.nyc_output/processinfo/d6cd0f05-9810-4f97-8faa-8753f10b9d2d.json +0 -1
- /package/.nyc_output/{3974a52e-3acc-45e4-a312-2dae8e2da051.json → 1aa97f38-9e09-4229-9e02-5f7fa02f213b.json} +0 -0
- /package/.nyc_output/{3bbc21ec-7576-45f9-bc87-b6a79588c265.json → b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7.json} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"uuid":"b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7","parent":null,"pid":52119,"argv":["/Users/dominic.holm-kander/.nvm/versions/node/v10.1.0/bin/node","/Users/dominic.holm-kander/WebstormProjects/aml-utils/node_modules/.bin/npm","run","test:unit"],"execArgv":[],"cwd":"/Users/dominic.holm-kander/WebstormProjects/aml-utils","time":1620207611603,"ppid":52116,"root":"eeab0944-bfbc-4552-bd82-355da9f95d71","coverageFilename":"/Users/dominic.holm-kander/WebstormProjects/aml-utils/.nyc_output/b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7.json","files":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"uuid":"fd0c5a49-1dee-497a-bd75-dcf009fcab1e","parent":null,"pid":"52116","argv":["/Users/dominic.holm-kander/.nvm/versions/node/v10.1.0/bin/node","/Users/dominic.holm-kander/WebstormProjects/aml-utils/node_modules/.bin/nyc","npm","run","test:unit"],"execArgv":[],"cwd":"/Users/dominic.holm-kander/WebstormProjects/aml-utils","time":1620207610001,"ppid":null,"root":null,"coverageFilename":"/Users/dominic.holm-kander/WebstormProjects/aml-utils/.nyc_output/fd0c5a49-1dee-497a-bd75-dcf009fcab1e.json","files":["/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/errors/errors.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/errors/errors.spec.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/file-parser/__tests/file-parser.spec.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/file-parser/__tests/parse-row.spec.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/file-parser/__tests/sanitize-rows.spec.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/formatting/formatting.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/formatting/formatting.spec.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/middleware/middleware.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/orm-helpers/ormHelpers.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/orm-helpers/ormHelpers.spec.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/types/types.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/validations/validations.js","/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/validations/validations.spec.js"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"processes":{"
|
|
1
|
+
{"processes":{"1aa97f38-9e09-4229-9e02-5f7fa02f213b":{"parent":"b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7","children":["62fbf615-4746-451c-aa0c-c12cb22b7a9d"]},"62fbf615-4746-451c-aa0c-c12cb22b7a9d":{"parent":"1aa97f38-9e09-4229-9e02-5f7fa02f213b","children":[]},"b5dcfb1d-3f6e-47a0-89e4-e93e7bcc51d7":{"parent":null,"children":["1aa97f38-9e09-4229-9e02-5f7fa02f213b"]},"fd0c5a49-1dee-497a-bd75-dcf009fcab1e":{"parent":null,"children":[]}},"files":{"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/errors/errors.spec.js":["62fbf615-4746-451c-aa0c-c12cb22b7a9d","fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/errors/errors.js":["62fbf615-4746-451c-aa0c-c12cb22b7a9d","fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/file-parser/__tests/file-parser.spec.js":["62fbf615-4746-451c-aa0c-c12cb22b7a9d","fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/file-parser/__tests/parse-row.spec.js":["62fbf615-4746-451c-aa0c-c12cb22b7a9d","fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/file-parser/__tests/sanitize-rows.spec.js":["62fbf615-4746-451c-aa0c-c12cb22b7a9d","fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/formatting/formatting.spec.js":["62fbf615-4746-451c-aa0c-c12cb22b7a9d","fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/formatting/formatting.js":["62fbf615-4746-451c-aa0c-c12cb22b7a9d","fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/orm-helpers/ormHelpers.spec.js":["62fbf615-4746-451c-aa0c-c12cb22b7a9d","fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/orm-helpers/ormHelpers.js":["62fbf615-4746-451c-aa0c-c12cb22b7a9d","fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/validations/validations.spec.js":["62fbf615-4746-451c-aa0c-c12cb22b7a9d","fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/validations/validations.js":["62fbf615-4746-451c-aa0c-c12cb22b7a9d","fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/middleware/middleware.js":["fd0c5a49-1dee-497a-bd75-dcf009fcab1e"],"/Users/dominic.holm-kander/WebstormProjects/aml-utils/lib/types/types.js":["fd0c5a49-1dee-497a-bd75-dcf009fcab1e"]},"externalIds":{}}
|
|
@@ -211,7 +211,7 @@ module.exports = {
|
|
|
211
211
|
</div><!-- /wrapper -->
|
|
212
212
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
213
213
|
Code coverage
|
|
214
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
214
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Wed May 05 2021 10:40:15 GMT+0100 (BST)
|
|
215
215
|
</div>
|
|
216
216
|
</div>
|
|
217
217
|
<script src="../prettify.js"></script>
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
</h1>
|
|
21
21
|
<div class='clearfix'>
|
|
22
22
|
<div class='fl pad1y space-right2'>
|
|
23
|
-
<span class="strong">
|
|
23
|
+
<span class="strong">64% </span>
|
|
24
24
|
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>
|
|
25
|
+
<span class='fraction'>16/25</span>
|
|
26
26
|
</div>
|
|
27
27
|
<div class='fl pad1y space-right2'>
|
|
28
28
|
<span class="strong">100% </span>
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
<span class='fraction'>0/0</span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">40% </span>
|
|
34
34
|
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>6/15</span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class='fl pad1y space-right2'>
|
|
38
38
|
<span class="strong">100% </span>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
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.
|
|
45
45
|
</p>
|
|
46
46
|
</div>
|
|
47
|
-
<div class='status-line
|
|
47
|
+
<div class='status-line medium'></div>
|
|
48
48
|
<pre><table class="coverage">
|
|
49
49
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
50
50
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -130,30 +130,30 @@
|
|
|
130
130
|
|
|
131
131
|
describe('lib/error', () => {
|
|
132
132
|
describe('RequestError', () => {
|
|
133
|
-
it('should inherit from Error', ()
|
|
133
|
+
it('should inherit from Error', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >(new RequestError instanceof Error).should.be.true)</span>;
|
|
134
134
|
|
|
135
135
|
describe('Forbidden Error', () => {
|
|
136
|
-
it('should inherit from Error', ()
|
|
136
|
+
it('should inherit from Error', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >new Forbidden instanceof Error)</span>;
|
|
137
137
|
|
|
138
|
-
return it('should inherit from RequestError', ()
|
|
138
|
+
return it('should inherit from RequestError', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >new Forbidden instanceof RequestError)</span>;
|
|
139
139
|
});
|
|
140
140
|
|
|
141
141
|
describe('Unauthorized Error', () => {
|
|
142
|
-
it('should inherit from Error', ()
|
|
142
|
+
it('should inherit from Error', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >new Unauthorized instanceof Error)</span>;
|
|
143
143
|
|
|
144
|
-
return it('should inherit from RequestError', ()
|
|
144
|
+
return it('should inherit from RequestError', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >new Unauthorized instanceof RequestError)</span>;
|
|
145
145
|
});
|
|
146
146
|
|
|
147
147
|
describe('BadRequest Error', () => {
|
|
148
|
-
it('should inherit from Error', ()
|
|
148
|
+
it('should inherit from Error', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >new BadRequest instanceof Error)</span>;
|
|
149
149
|
|
|
150
|
-
return it('should inherit from RequestError', ()
|
|
150
|
+
return it('should inherit from RequestError', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >new BadRequest instanceof RequestError)</span>;
|
|
151
151
|
});
|
|
152
152
|
|
|
153
153
|
return describe('NotFound Error', () => {
|
|
154
|
-
it('should inherit from Error', ()
|
|
154
|
+
it('should inherit from Error', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >new NotFound instanceof Error)</span>;
|
|
155
155
|
|
|
156
|
-
return it('should inherit from RequestError', ()
|
|
156
|
+
return it('should inherit from RequestError', <span class="fstat-no" title="function not covered" >() =</span>> <span class="cstat-no" title="statement not covered" >new NotFound instanceof RequestError)</span>;
|
|
157
157
|
});
|
|
158
158
|
});
|
|
159
159
|
});
|
|
@@ -163,7 +163,7 @@ describe('lib/error', () => {
|
|
|
163
163
|
</div><!-- /wrapper -->
|
|
164
164
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
165
165
|
Code coverage
|
|
166
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
166
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Wed May 05 2021 10:40:15 GMT+0100 (BST)
|
|
167
167
|
</div>
|
|
168
168
|
</div>
|
|
169
169
|
<script src="../prettify.js"></script>
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
</h1>
|
|
21
21
|
<div class='clearfix'>
|
|
22
22
|
<div class='fl pad1y space-right2'>
|
|
23
|
-
<span class="strong">
|
|
23
|
+
<span class="strong">74.36% </span>
|
|
24
24
|
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>
|
|
25
|
+
<span class='fraction'>29/39</span>
|
|
26
26
|
</div>
|
|
27
27
|
<div class='fl pad1y space-right2'>
|
|
28
28
|
<span class="strong">100% </span>
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
<span class='fraction'>0/0</span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">37.5% </span>
|
|
34
34
|
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>6/16</span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class='fl pad1y space-right2'>
|
|
38
38
|
<span class="strong">100% </span>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
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.
|
|
45
45
|
</p>
|
|
46
46
|
</div>
|
|
47
|
-
<div class='status-line
|
|
47
|
+
<div class='status-line medium'></div>
|
|
48
48
|
<div class="pad1">
|
|
49
49
|
<table class="coverage-summary">
|
|
50
50
|
<thead>
|
|
@@ -75,14 +75,14 @@
|
|
|
75
75
|
</tr>
|
|
76
76
|
|
|
77
77
|
<tr>
|
|
78
|
-
<td class="file
|
|
79
|
-
<td data-value="
|
|
80
|
-
<td data-value="
|
|
81
|
-
<td data-value="25" class="abs
|
|
78
|
+
<td class="file medium" data-value="errors.spec.js"><a href="errors.spec.js.html">errors.spec.js</a></td>
|
|
79
|
+
<td data-value="64" class="pic medium"><div class="chart"><div class="cover-fill" style="width: 64%;"></div><div class="cover-empty" style="width:36%;"></div></div></td>
|
|
80
|
+
<td data-value="64" class="pct medium">64%</td>
|
|
81
|
+
<td data-value="25" class="abs medium">16/25</td>
|
|
82
82
|
<td data-value="100" class="pct high">100%</td>
|
|
83
83
|
<td data-value="0" class="abs high">0/0</td>
|
|
84
|
-
<td data-value="
|
|
85
|
-
<td data-value="15" class="abs
|
|
84
|
+
<td data-value="40" class="pct low">40%</td>
|
|
85
|
+
<td data-value="15" class="abs low">6/15</td>
|
|
86
86
|
<td data-value="100" class="pct high">100%</td>
|
|
87
87
|
<td data-value="16" class="abs high">16/16</td>
|
|
88
88
|
</tr>
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
</div><!-- /wrapper -->
|
|
94
94
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
95
95
|
Code coverage
|
|
96
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
96
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Wed May 05 2021 10:40:15 GMT+0100 (BST)
|
|
97
97
|
</div>
|
|
98
98
|
</div>
|
|
99
99
|
<script src="../prettify.js"></script>
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
</h1>
|
|
21
21
|
<div class='clearfix'>
|
|
22
22
|
<div class='fl pad1y space-right2'>
|
|
23
|
-
<span class="strong">
|
|
23
|
+
<span class="strong">26.47% </span>
|
|
24
24
|
<span class="quiet">Statements</span>
|
|
25
|
-
<span class='fraction'>
|
|
25
|
+
<span class='fraction'>18/68</span>
|
|
26
26
|
</div>
|
|
27
27
|
<div class='fl pad1y space-right2'>
|
|
28
28
|
<span class="strong">100% </span>
|
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
<span class='fraction'>0/0</span>
|
|
31
31
|
</div>
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">5.26% </span>
|
|
34
34
|
<span class="quiet">Functions</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>1/19</span>
|
|
36
36
|
</div>
|
|
37
37
|
<div class='fl pad1y space-right2'>
|
|
38
|
-
<span class="strong">
|
|
38
|
+
<span class="strong">30% </span>
|
|
39
39
|
<span class="quiet">Lines</span>
|
|
40
|
-
<span class='fraction'>
|
|
40
|
+
<span class='fraction'>18/60</span>
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
<p class="quiet">
|
|
44
44
|
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.
|
|
45
45
|
</p>
|
|
46
46
|
</div>
|
|
47
|
-
<div class='status-line
|
|
47
|
+
<div class='status-line low'></div>
|
|
48
48
|
<pre><table class="coverage">
|
|
49
49
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
50
50
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -170,94 +170,94 @@
|
|
|
170
170
|
<span class="cline-any cline-neutral"> </span>
|
|
171
171
|
<span class="cline-any cline-neutral"> </span>
|
|
172
172
|
<span class="cline-any cline-yes">1x</span>
|
|
173
|
-
<span class="cline-any cline-
|
|
174
|
-
<span class="cline-any cline-
|
|
175
|
-
<span class="cline-any cline-
|
|
173
|
+
<span class="cline-any cline-no"> </span>
|
|
174
|
+
<span class="cline-any cline-no"> </span>
|
|
175
|
+
<span class="cline-any cline-no"> </span>
|
|
176
176
|
<span class="cline-any cline-neutral"> </span>
|
|
177
177
|
<span class="cline-any cline-neutral"> </span>
|
|
178
178
|
<span class="cline-any cline-yes">1x</span>
|
|
179
|
-
<span class="cline-any cline-
|
|
179
|
+
<span class="cline-any cline-no"> </span>
|
|
180
180
|
<span class="cline-any cline-neutral"> </span>
|
|
181
181
|
<span class="cline-any cline-neutral"> </span>
|
|
182
182
|
<span class="cline-any cline-yes">1x</span>
|
|
183
|
-
<span class="cline-any cline-
|
|
183
|
+
<span class="cline-any cline-no"> </span>
|
|
184
184
|
<span class="cline-any cline-neutral"> </span>
|
|
185
185
|
<span class="cline-any cline-neutral"> </span>
|
|
186
186
|
<span class="cline-any cline-yes">1x</span>
|
|
187
|
-
<span class="cline-any cline-
|
|
187
|
+
<span class="cline-any cline-no"> </span>
|
|
188
188
|
<span class="cline-any cline-neutral"> </span>
|
|
189
|
-
<span class="cline-any cline-
|
|
189
|
+
<span class="cline-any cline-no"> </span>
|
|
190
190
|
<span class="cline-any cline-neutral"> </span>
|
|
191
|
-
<span class="cline-any cline-
|
|
191
|
+
<span class="cline-any cline-no"> </span>
|
|
192
192
|
<span class="cline-any cline-neutral"> </span>
|
|
193
193
|
<span class="cline-any cline-neutral"> </span>
|
|
194
194
|
<span class="cline-any cline-yes">1x</span>
|
|
195
|
-
<span class="cline-any cline-
|
|
195
|
+
<span class="cline-any cline-no"> </span>
|
|
196
196
|
<span class="cline-any cline-neutral"> </span>
|
|
197
|
-
<span class="cline-any cline-
|
|
197
|
+
<span class="cline-any cline-no"> </span>
|
|
198
198
|
<span class="cline-any cline-neutral"> </span>
|
|
199
|
-
<span class="cline-any cline-
|
|
200
|
-
<span class="cline-any cline-
|
|
199
|
+
<span class="cline-any cline-no"> </span>
|
|
200
|
+
<span class="cline-any cline-no"> </span>
|
|
201
201
|
<span class="cline-any cline-neutral"> </span>
|
|
202
202
|
<span class="cline-any cline-neutral"> </span>
|
|
203
203
|
<span class="cline-any cline-yes">1x</span>
|
|
204
|
-
<span class="cline-any cline-
|
|
204
|
+
<span class="cline-any cline-no"> </span>
|
|
205
205
|
<span class="cline-any cline-neutral"> </span>
|
|
206
|
-
<span class="cline-any cline-
|
|
207
|
-
<span class="cline-any cline-
|
|
208
|
-
<span class="cline-any cline-
|
|
206
|
+
<span class="cline-any cline-no"> </span>
|
|
207
|
+
<span class="cline-any cline-no"> </span>
|
|
208
|
+
<span class="cline-any cline-no"> </span>
|
|
209
209
|
<span class="cline-any cline-no"> </span>
|
|
210
210
|
<span class="cline-any cline-neutral"> </span>
|
|
211
|
-
<span class="cline-any cline-
|
|
211
|
+
<span class="cline-any cline-no"> </span>
|
|
212
212
|
<span class="cline-any cline-neutral"> </span>
|
|
213
213
|
<span class="cline-any cline-neutral"> </span>
|
|
214
214
|
<span class="cline-any cline-neutral"> </span>
|
|
215
215
|
<span class="cline-any cline-yes">1x</span>
|
|
216
|
-
<span class="cline-any cline-
|
|
216
|
+
<span class="cline-any cline-no"> </span>
|
|
217
217
|
<span class="cline-any cline-neutral"> </span>
|
|
218
|
-
<span class="cline-any cline-
|
|
219
|
-
<span class="cline-any cline-
|
|
220
|
-
<span class="cline-any cline-
|
|
218
|
+
<span class="cline-any cline-no"> </span>
|
|
219
|
+
<span class="cline-any cline-no"> </span>
|
|
220
|
+
<span class="cline-any cline-no"> </span>
|
|
221
221
|
<span class="cline-any cline-no"> </span>
|
|
222
222
|
<span class="cline-any cline-neutral"> </span>
|
|
223
|
-
<span class="cline-any cline-
|
|
223
|
+
<span class="cline-any cline-no"> </span>
|
|
224
224
|
<span class="cline-any cline-neutral"> </span>
|
|
225
225
|
<span class="cline-any cline-neutral"> </span>
|
|
226
226
|
<span class="cline-any cline-neutral"> </span>
|
|
227
227
|
<span class="cline-any cline-yes">1x</span>
|
|
228
|
-
<span class="cline-any cline-
|
|
228
|
+
<span class="cline-any cline-no"> </span>
|
|
229
229
|
<span class="cline-any cline-neutral"> </span>
|
|
230
|
-
<span class="cline-any cline-
|
|
231
|
-
<span class="cline-any cline-
|
|
232
|
-
<span class="cline-any cline-
|
|
230
|
+
<span class="cline-any cline-no"> </span>
|
|
231
|
+
<span class="cline-any cline-no"> </span>
|
|
232
|
+
<span class="cline-any cline-no"> </span>
|
|
233
233
|
<span class="cline-any cline-no"> </span>
|
|
234
234
|
<span class="cline-any cline-neutral"> </span>
|
|
235
|
-
<span class="cline-any cline-
|
|
235
|
+
<span class="cline-any cline-no"> </span>
|
|
236
236
|
<span class="cline-any cline-neutral"> </span>
|
|
237
237
|
<span class="cline-any cline-neutral"> </span>
|
|
238
238
|
<span class="cline-any cline-neutral"> </span>
|
|
239
239
|
<span class="cline-any cline-yes">1x</span>
|
|
240
|
-
<span class="cline-any cline-
|
|
240
|
+
<span class="cline-any cline-no"> </span>
|
|
241
241
|
<span class="cline-any cline-neutral"> </span>
|
|
242
|
-
<span class="cline-any cline-
|
|
243
|
-
<span class="cline-any cline-
|
|
242
|
+
<span class="cline-any cline-no"> </span>
|
|
243
|
+
<span class="cline-any cline-no"> </span>
|
|
244
244
|
<span class="cline-any cline-neutral"> </span>
|
|
245
|
-
<span class="cline-any cline-
|
|
245
|
+
<span class="cline-any cline-no"> </span>
|
|
246
246
|
<span class="cline-any cline-neutral"> </span>
|
|
247
|
-
<span class="cline-any cline-
|
|
248
|
-
<span class="cline-any cline-
|
|
247
|
+
<span class="cline-any cline-no"> </span>
|
|
248
|
+
<span class="cline-any cline-no"> </span>
|
|
249
249
|
<span class="cline-any cline-neutral"> </span>
|
|
250
250
|
<span class="cline-any cline-neutral"> </span>
|
|
251
251
|
<span class="cline-any cline-yes">1x</span>
|
|
252
|
-
<span class="cline-any cline-
|
|
252
|
+
<span class="cline-any cline-no"> </span>
|
|
253
253
|
<span class="cline-any cline-neutral"> </span>
|
|
254
|
-
<span class="cline-any cline-
|
|
255
|
-
<span class="cline-any cline-
|
|
254
|
+
<span class="cline-any cline-no"> </span>
|
|
255
|
+
<span class="cline-any cline-no"> </span>
|
|
256
256
|
<span class="cline-any cline-neutral"> </span>
|
|
257
|
-
<span class="cline-any cline-
|
|
257
|
+
<span class="cline-any cline-no"> </span>
|
|
258
258
|
<span class="cline-any cline-neutral"> </span>
|
|
259
|
-
<span class="cline-any cline-
|
|
260
|
-
<span class="cline-any cline-
|
|
259
|
+
<span class="cline-any cline-no"> </span>
|
|
260
|
+
<span class="cline-any cline-no"> </span>
|
|
261
261
|
<span class="cline-any cline-neutral"> </span>
|
|
262
262
|
<span class="cline-any cline-neutral"> </span>
|
|
263
263
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import sinon from 'sinon';
|
|
@@ -276,95 +276,95 @@ describe('file-parser', () => {
|
|
|
276
276
|
let mockSanitizeRows;
|
|
277
277
|
let mockSetTimeout;
|
|
278
278
|
|
|
279
|
-
before(()
|
|
280
|
-
mockParseRow = sinon.stub(parseRow, 'default').returns(parsedRows)
|
|
281
|
-
mockSanitizeRows = sinon.stub(sanitizeRows, 'default').returns([{}])
|
|
282
|
-
mockSetTimeout = sinon.stub(global, 'setTimeout').callsFake((
|
|
279
|
+
before(<span class="fstat-no" title="function not covered" >() =</span>> {
|
|
280
|
+
<span class="cstat-no" title="statement not covered" > mockParseRow = sinon.stub(parseRow, 'default').returns(parsedRows);</span>
|
|
281
|
+
<span class="cstat-no" title="statement not covered" > mockSanitizeRows = sinon.stub(sanitizeRows, 'default').returns([{}]);</span>
|
|
282
|
+
<span class="cstat-no" title="statement not covered" > mockSetTimeout = sinon.stub(global, 'setTimeout').callsFake(<span class="fstat-no" title="function not covered" >(c</span>allback) => <span class="cstat-no" title="statement not covered" >callback())</span>;</span>
|
|
283
283
|
});
|
|
284
284
|
|
|
285
|
-
beforeEach(()
|
|
286
|
-
sinon.resetHistory()
|
|
285
|
+
beforeEach(<span class="fstat-no" title="function not covered" >() =</span>> {
|
|
286
|
+
<span class="cstat-no" title="statement not covered" > sinon.resetHistory();</span>
|
|
287
287
|
});
|
|
288
288
|
|
|
289
|
-
after(()
|
|
290
|
-
sinon.restore()
|
|
289
|
+
after(<span class="fstat-no" title="function not covered" >() =</span>> {
|
|
290
|
+
<span class="cstat-no" title="statement not covered" > sinon.restore();</span>
|
|
291
291
|
});
|
|
292
292
|
|
|
293
|
-
it('should call parseRow once per input new line', async ()
|
|
294
|
-
const input = '\n'
|
|
293
|
+
it('should call parseRow once per input new line', <span class="fstat-no" title="function not covered" >async () =</span>><span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" > {</span></span>
|
|
294
|
+
const input = <span class="cstat-no" title="statement not covered" >'\n';</span>
|
|
295
295
|
|
|
296
|
-
await parseFile(input, 50, dependencies)
|
|
296
|
+
<span class="cstat-no" title="statement not covered" > await parseFile(input, 50, dependencies);</span>
|
|
297
297
|
|
|
298
|
-
expect(mockParseRow).to.be.calledTwice
|
|
298
|
+
<span class="cstat-no" title="statement not covered" > expect(mockParseRow).to.be.calledTwice;</span>
|
|
299
299
|
});
|
|
300
300
|
|
|
301
|
-
it('should call pass parseRow result into sanitizeRows', async ()
|
|
302
|
-
const input = '\n'
|
|
301
|
+
it('should call pass parseRow result into sanitizeRows', <span class="fstat-no" title="function not covered" >async () =</span>><span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" > {</span></span>
|
|
302
|
+
const input = <span class="cstat-no" title="statement not covered" >'\n';</span>
|
|
303
303
|
|
|
304
|
-
await parseFile(input, 50, dependencies)
|
|
304
|
+
<span class="cstat-no" title="statement not covered" > await parseFile(input, 50, dependencies);</span>
|
|
305
305
|
|
|
306
|
-
expect(mockSanitizeRows).to.be.calledOnce
|
|
307
|
-
expect(mockSanitizeRows).to.be.deep.calledWith([[], []], dependencies.processRow)
|
|
306
|
+
<span class="cstat-no" title="statement not covered" > expect(mockSanitizeRows).to.be.calledOnce;</span>
|
|
307
|
+
<span class="cstat-no" title="statement not covered" > expect(mockSanitizeRows).to.be.deep.calledWith([[], []], dependencies.processRow);</span>
|
|
308
308
|
});
|
|
309
309
|
|
|
310
|
-
it('should throw error when number of rows is more than max rows', async ()
|
|
311
|
-
const input = '\n'
|
|
310
|
+
it('should throw error when number of rows is more than max rows', <span class="fstat-no" title="function not covered" >async () =</span>><span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" > {</span></span>
|
|
311
|
+
const input = <span class="cstat-no" title="statement not covered" >'\n';</span>
|
|
312
312
|
|
|
313
|
-
mockSanitizeRows.returns(new Array(20))
|
|
314
|
-
try {
|
|
315
|
-
await parseFile(input, 10, dependencies)
|
|
313
|
+
<span class="cstat-no" title="statement not covered" > mockSanitizeRows.returns(new Array(20));</span>
|
|
314
|
+
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
315
|
+
<span class="cstat-no" title="statement not covered" > await parseFile(input, 10, dependencies);</span>
|
|
316
316
|
<span class="cstat-no" title="statement not covered" > expect(1).to.equal(2);</span>
|
|
317
317
|
} catch (ex) {
|
|
318
|
-
expect(ex.name).to.equal('TooManyRowsError')
|
|
318
|
+
<span class="cstat-no" title="statement not covered" > expect(ex.name).to.equal('TooManyRowsError');</span>
|
|
319
319
|
}
|
|
320
320
|
});
|
|
321
321
|
|
|
322
|
-
it('should throw error when no rows returned from sanitizeRows', async ()
|
|
323
|
-
const input = '\n'
|
|
322
|
+
it('should throw error when no rows returned from sanitizeRows', <span class="fstat-no" title="function not covered" >async () =</span>><span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" > {</span></span>
|
|
323
|
+
const input = <span class="cstat-no" title="statement not covered" >'\n';</span>
|
|
324
324
|
|
|
325
|
-
mockSanitizeRows.returns([])
|
|
326
|
-
try {
|
|
327
|
-
await parseFile(input, 10, dependencies)
|
|
325
|
+
<span class="cstat-no" title="statement not covered" > mockSanitizeRows.returns([]);</span>
|
|
326
|
+
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
327
|
+
<span class="cstat-no" title="statement not covered" > await parseFile(input, 10, dependencies);</span>
|
|
328
328
|
<span class="cstat-no" title="statement not covered" > expect(1).to.equal(2);</span>
|
|
329
329
|
} catch (ex) {
|
|
330
|
-
expect(ex.name).to.equal('Error')
|
|
330
|
+
<span class="cstat-no" title="statement not covered" > expect(ex.name).to.equal('Error');</span>
|
|
331
331
|
}
|
|
332
332
|
});
|
|
333
333
|
|
|
334
|
-
it('should throw error an error when content is "invalidFileType"', async ()
|
|
335
|
-
const input = 'invalidFileType'
|
|
334
|
+
it('should throw error an error when content is "invalidFileType"', <span class="fstat-no" title="function not covered" >async () =</span>><span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" > {</span></span>
|
|
335
|
+
const input = <span class="cstat-no" title="statement not covered" >'invalidFileType';</span>
|
|
336
336
|
|
|
337
|
-
mockSanitizeRows.returns([])
|
|
338
|
-
try {
|
|
339
|
-
await parseFile(input, 10, dependencies)
|
|
337
|
+
<span class="cstat-no" title="statement not covered" > mockSanitizeRows.returns([]);</span>
|
|
338
|
+
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
339
|
+
<span class="cstat-no" title="statement not covered" > await parseFile(input, 10, dependencies);</span>
|
|
340
340
|
<span class="cstat-no" title="statement not covered" > expect(1).to.equal(2);</span>
|
|
341
341
|
} catch (ex) {
|
|
342
|
-
expect(ex.message).to.equal('Invalid file type')
|
|
342
|
+
<span class="cstat-no" title="statement not covered" > expect(ex.message).to.equal('Invalid file type');</span>
|
|
343
343
|
}
|
|
344
344
|
});
|
|
345
345
|
|
|
346
|
-
it('should call process row once per row in single timeout', async ()
|
|
347
|
-
const input = '\n'
|
|
346
|
+
it('should call process row once per row in single timeout', <span class="fstat-no" title="function not covered" >async () =</span>><span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" > {</span></span>
|
|
347
|
+
const input = <span class="cstat-no" title="statement not covered" >'\n';</span>
|
|
348
348
|
|
|
349
|
-
const fakeRows = (new Array(30)).fill({})
|
|
350
|
-
mockSanitizeRows.returns(fakeRows)
|
|
349
|
+
const fakeRows = <span class="cstat-no" title="statement not covered" >(new Array(30)).fill({});</span>
|
|
350
|
+
<span class="cstat-no" title="statement not covered" > mockSanitizeRows.returns(fakeRows);</span>
|
|
351
351
|
|
|
352
|
-
await parseFile(input, 70, dependencies)
|
|
352
|
+
<span class="cstat-no" title="statement not covered" > await parseFile(input, 70, dependencies);</span>
|
|
353
353
|
|
|
354
|
-
expect(dependencies.processRow).to.be.callCount(30)
|
|
355
|
-
expect(mockSetTimeout).to.be.calledOnce
|
|
354
|
+
<span class="cstat-no" title="statement not covered" > expect(dependencies.processRow).to.be.callCount(30);</span>
|
|
355
|
+
<span class="cstat-no" title="statement not covered" > expect(mockSetTimeout).to.be.calledOnce;</span>
|
|
356
356
|
});
|
|
357
357
|
|
|
358
|
-
it('should call process row once per row in two timeouts when more than 30 rows', async ()
|
|
359
|
-
const input = '\n'
|
|
358
|
+
it('should call process row once per row in two timeouts when more than 30 rows', <span class="fstat-no" title="function not covered" >async () =</span>><span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" > {</span></span>
|
|
359
|
+
const input = <span class="cstat-no" title="statement not covered" >'\n';</span>
|
|
360
360
|
|
|
361
|
-
const fakeRows = (new Array(50)).fill({})
|
|
362
|
-
mockSanitizeRows.returns(fakeRows)
|
|
361
|
+
const fakeRows = <span class="cstat-no" title="statement not covered" >(new Array(50)).fill({});</span>
|
|
362
|
+
<span class="cstat-no" title="statement not covered" > mockSanitizeRows.returns(fakeRows);</span>
|
|
363
363
|
|
|
364
|
-
await parseFile(input, 70, dependencies)
|
|
364
|
+
<span class="cstat-no" title="statement not covered" > await parseFile(input, 70, dependencies);</span>
|
|
365
365
|
|
|
366
|
-
expect(dependencies.processRow).to.be.callCount(50)
|
|
367
|
-
expect(mockSetTimeout).to.be.calledTwice
|
|
366
|
+
<span class="cstat-no" title="statement not covered" > expect(dependencies.processRow).to.be.callCount(50);</span>
|
|
367
|
+
<span class="cstat-no" title="statement not covered" > expect(mockSetTimeout).to.be.calledTwice;</span>
|
|
368
368
|
});
|
|
369
369
|
});
|
|
370
370
|
</pre></td></tr>
|
|
@@ -373,7 +373,7 @@ describe('file-parser', () => {
|
|
|
373
373
|
</div><!-- /wrapper -->
|
|
374
374
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
375
375
|
Code coverage
|
|
376
|
-
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at
|
|
376
|
+
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Wed May 05 2021 10:40:15 GMT+0100 (BST)
|
|
377
377
|
</div>
|
|
378
378
|
</div>
|
|
379
379
|
<script src="../../prettify.js"></script>
|