@zohodesk/client_build_tool 0.0.6-exp.40 → 0.0.6-exp.42

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.
@@ -1,196 +0,0 @@
1
- /* eslint-disable */
2
- var addSorting = (function() {
3
- 'use strict';
4
- var cols,
5
- currentSort = {
6
- index: 0,
7
- desc: false
8
- };
9
-
10
- // returns the summary table element
11
- function getTable() {
12
- return document.querySelector('.coverage-summary');
13
- }
14
- // returns the thead element of the summary table
15
- function getTableHeader() {
16
- return getTable().querySelector('thead tr');
17
- }
18
- // returns the tbody element of the summary table
19
- function getTableBody() {
20
- return getTable().querySelector('tbody');
21
- }
22
- // returns the th element for nth column
23
- function getNthColumn(n) {
24
- return getTableHeader().querySelectorAll('th')[n];
25
- }
26
-
27
- function onFilterInput() {
28
- const searchValue = document.getElementById('fileSearch').value;
29
- const rows = document.getElementsByTagName('tbody')[0].children;
30
- for (let i = 0; i < rows.length; i++) {
31
- const row = rows[i];
32
- if (
33
- row.textContent
34
- .toLowerCase()
35
- .includes(searchValue.toLowerCase())
36
- ) {
37
- row.style.display = '';
38
- } else {
39
- row.style.display = 'none';
40
- }
41
- }
42
- }
43
-
44
- // loads the search box
45
- function addSearchBox() {
46
- var template = document.getElementById('filterTemplate');
47
- var templateClone = template.content.cloneNode(true);
48
- templateClone.getElementById('fileSearch').oninput = onFilterInput;
49
- template.parentElement.appendChild(templateClone);
50
- }
51
-
52
- // loads all columns
53
- function loadColumns() {
54
- var colNodes = getTableHeader().querySelectorAll('th'),
55
- colNode,
56
- cols = [],
57
- col,
58
- i;
59
-
60
- for (i = 0; i < colNodes.length; i += 1) {
61
- colNode = colNodes[i];
62
- col = {
63
- key: colNode.getAttribute('data-col'),
64
- sortable: !colNode.getAttribute('data-nosort'),
65
- type: colNode.getAttribute('data-type') || 'string'
66
- };
67
- cols.push(col);
68
- if (col.sortable) {
69
- col.defaultDescSort = col.type === 'number';
70
- colNode.innerHTML =
71
- colNode.innerHTML + '<span class="sorter"></span>';
72
- }
73
- }
74
- return cols;
75
- }
76
- // attaches a data attribute to every tr element with an object
77
- // of data values keyed by column name
78
- function loadRowData(tableRow) {
79
- var tableCols = tableRow.querySelectorAll('td'),
80
- colNode,
81
- col,
82
- data = {},
83
- i,
84
- val;
85
- for (i = 0; i < tableCols.length; i += 1) {
86
- colNode = tableCols[i];
87
- col = cols[i];
88
- val = colNode.getAttribute('data-value');
89
- if (col.type === 'number') {
90
- val = Number(val);
91
- }
92
- data[col.key] = val;
93
- }
94
- return data;
95
- }
96
- // loads all row data
97
- function loadData() {
98
- var rows = getTableBody().querySelectorAll('tr'),
99
- i;
100
-
101
- for (i = 0; i < rows.length; i += 1) {
102
- rows[i].data = loadRowData(rows[i]);
103
- }
104
- }
105
- // sorts the table using the data for the ith column
106
- function sortByIndex(index, desc) {
107
- var key = cols[index].key,
108
- sorter = function(a, b) {
109
- a = a.data[key];
110
- b = b.data[key];
111
- return a < b ? -1 : a > b ? 1 : 0;
112
- },
113
- finalSorter = sorter,
114
- tableBody = document.querySelector('.coverage-summary tbody'),
115
- rowNodes = tableBody.querySelectorAll('tr'),
116
- rows = [],
117
- i;
118
-
119
- if (desc) {
120
- finalSorter = function(a, b) {
121
- return -1 * sorter(a, b);
122
- };
123
- }
124
-
125
- for (i = 0; i < rowNodes.length; i += 1) {
126
- rows.push(rowNodes[i]);
127
- tableBody.removeChild(rowNodes[i]);
128
- }
129
-
130
- rows.sort(finalSorter);
131
-
132
- for (i = 0; i < rows.length; i += 1) {
133
- tableBody.appendChild(rows[i]);
134
- }
135
- }
136
- // removes sort indicators for current column being sorted
137
- function removeSortIndicators() {
138
- var col = getNthColumn(currentSort.index),
139
- cls = col.className;
140
-
141
- cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
142
- col.className = cls;
143
- }
144
- // adds sort indicators for current column being sorted
145
- function addSortIndicators() {
146
- getNthColumn(currentSort.index).className += currentSort.desc
147
- ? ' sorted-desc'
148
- : ' sorted';
149
- }
150
- // adds event listeners for all sorter widgets
151
- function enableUI() {
152
- var i,
153
- el,
154
- ithSorter = function ithSorter(i) {
155
- var col = cols[i];
156
-
157
- return function() {
158
- var desc = col.defaultDescSort;
159
-
160
- if (currentSort.index === i) {
161
- desc = !currentSort.desc;
162
- }
163
- sortByIndex(i, desc);
164
- removeSortIndicators();
165
- currentSort.index = i;
166
- currentSort.desc = desc;
167
- addSortIndicators();
168
- };
169
- };
170
- for (i = 0; i < cols.length; i += 1) {
171
- if (cols[i].sortable) {
172
- // add the click event handler on the th so users
173
- // dont have to click on those tiny arrows
174
- el = getNthColumn(i).querySelector('.sorter').parentElement;
175
- if (el.addEventListener) {
176
- el.addEventListener('click', ithSorter(i));
177
- } else {
178
- el.attachEvent('onclick', ithSorter(i));
179
- }
180
- }
181
- }
182
- }
183
- // adds sorting functionality to the UI
184
- return function() {
185
- if (!getTable()) {
186
- return;
187
- }
188
- cols = loadColumns();
189
- loadData();
190
- addSearchBox();
191
- addSortIndicators();
192
- enableUI();
193
- };
194
- })();
195
-
196
- window.addEventListener('load', addSorting);
@@ -1,196 +0,0 @@
1
-
2
- <!doctype html>
3
- <html lang="en">
4
-
5
- <head>
6
- <title>Code coverage report for updateArrayWithDefault.js</title>
7
- <meta charset="utf-8" />
8
- <link rel="stylesheet" href="prettify.css" />
9
- <link rel="stylesheet" href="base.css" />
10
- <link rel="shortcut icon" type="image/x-icon" href="favicon.png" />
11
- <meta name="viewport" content="width=device-width, initial-scale=1" />
12
- <style type='text/css'>
13
- .coverage-summary .sorter {
14
- background-image: url(sort-arrow-sprite.png);
15
- }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <div class='wrapper'>
21
- <div class='pad1'>
22
- <h1><a href="index.html">All files</a> updateArrayWithDefault.js</h1>
23
- <div class='clearfix'>
24
-
25
- <div class='fl pad1y space-right2'>
26
- <span class="strong">52.94% </span>
27
- <span class="quiet">Statements</span>
28
- <span class='fraction'>9/17</span>
29
- </div>
30
-
31
-
32
- <div class='fl pad1y space-right2'>
33
- <span class="strong">14.28% </span>
34
- <span class="quiet">Branches</span>
35
- <span class='fraction'>1/7</span>
36
- </div>
37
-
38
-
39
- <div class='fl pad1y space-right2'>
40
- <span class="strong">60% </span>
41
- <span class="quiet">Functions</span>
42
- <span class='fraction'>3/5</span>
43
- </div>
44
-
45
-
46
- <div class='fl pad1y space-right2'>
47
- <span class="strong">53.33% </span>
48
- <span class="quiet">Lines</span>
49
- <span class='fraction'>8/15</span>
50
- </div>
51
-
52
-
53
- </div>
54
- <p class="quiet">
55
- 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.
56
- </p>
57
- <template id="filterTemplate">
58
- <div class="quiet">
59
- Filter:
60
- <input oninput="onInput()" type="search" id="fileSearch">
61
- </div>
62
- </template>
63
- </div>
64
- <div class='status-line medium'></div>
65
- <pre><table class="coverage">
66
- <tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
67
- <a name='L2'></a><a href='#L2'>2</a>
68
- <a name='L3'></a><a href='#L3'>3</a>
69
- <a name='L4'></a><a href='#L4'>4</a>
70
- <a name='L5'></a><a href='#L5'>5</a>
71
- <a name='L6'></a><a href='#L6'>6</a>
72
- <a name='L7'></a><a href='#L7'>7</a>
73
- <a name='L8'></a><a href='#L8'>8</a>
74
- <a name='L9'></a><a href='#L9'>9</a>
75
- <a name='L10'></a><a href='#L10'>10</a>
76
- <a name='L11'></a><a href='#L11'>11</a>
77
- <a name='L12'></a><a href='#L12'>12</a>
78
- <a name='L13'></a><a href='#L13'>13</a>
79
- <a name='L14'></a><a href='#L14'>14</a>
80
- <a name='L15'></a><a href='#L15'>15</a>
81
- <a name='L16'></a><a href='#L16'>16</a>
82
- <a name='L17'></a><a href='#L17'>17</a>
83
- <a name='L18'></a><a href='#L18'>18</a>
84
- <a name='L19'></a><a href='#L19'>19</a>
85
- <a name='L20'></a><a href='#L20'>20</a>
86
- <a name='L21'></a><a href='#L21'>21</a>
87
- <a name='L22'></a><a href='#L22'>22</a>
88
- <a name='L23'></a><a href='#L23'>23</a>
89
- <a name='L24'></a><a href='#L24'>24</a>
90
- <a name='L25'></a><a href='#L25'>25</a>
91
- <a name='L26'></a><a href='#L26'>26</a>
92
- <a name='L27'></a><a href='#L27'>27</a>
93
- <a name='L28'></a><a href='#L28'>28</a>
94
- <a name='L29'></a><a href='#L29'>29</a>
95
- <a name='L30'></a><a href='#L30'>30</a>
96
- <a name='L31'></a><a href='#L31'>31</a>
97
- <a name='L32'></a><a href='#L32'>32</a>
98
- <a name='L33'></a><a href='#L33'>33</a>
99
- <a name='L34'></a><a href='#L34'>34</a>
100
- <a name='L35'></a><a href='#L35'>35</a>
101
- <a name='L36'></a><a href='#L36'>36</a>
102
- <a name='L37'></a><a href='#L37'>37</a>
103
- <a name='L38'></a><a href='#L38'>38</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
104
- <span class="cline-any cline-no">&nbsp;</span>
105
- <span class="cline-any cline-neutral">&nbsp;</span>
106
- <span class="cline-any cline-no">&nbsp;</span>
107
- <span class="cline-any cline-no">&nbsp;</span>
108
- <span class="cline-any cline-neutral">&nbsp;</span>
109
- <span class="cline-any cline-no">&nbsp;</span>
110
- <span class="cline-any cline-no">&nbsp;</span>
111
- <span class="cline-any cline-no">&nbsp;</span>
112
- <span class="cline-any cline-neutral">&nbsp;</span>
113
- <span class="cline-any cline-neutral">&nbsp;</span>
114
- <span class="cline-any cline-yes">1x</span>
115
- <span class="cline-any cline-neutral">&nbsp;</span>
116
- <span class="cline-any cline-neutral">&nbsp;</span>
117
- <span class="cline-any cline-neutral">&nbsp;</span>
118
- <span class="cline-any cline-neutral">&nbsp;</span>
119
- <span class="cline-any cline-neutral">&nbsp;</span>
120
- <span class="cline-any cline-neutral">&nbsp;</span>
121
- <span class="cline-any cline-yes">8x</span>
122
- <span class="cline-any cline-neutral">&nbsp;</span>
123
- <span class="cline-any cline-yes">8x</span>
124
- <span class="cline-any cline-no">&nbsp;</span>
125
- <span class="cline-any cline-neutral">&nbsp;</span>
126
- <span class="cline-any cline-neutral">&nbsp;</span>
127
- <span class="cline-any cline-yes">8x</span>
128
- <span class="cline-any cline-yes">95x</span>
129
- <span class="cline-any cline-neutral">&nbsp;</span>
130
- <span class="cline-any cline-neutral">&nbsp;</span>
131
- <span class="cline-any cline-neutral">&nbsp;</span>
132
- <span class="cline-any cline-neutral">&nbsp;</span>
133
- <span class="cline-any cline-neutral">&nbsp;</span>
134
- <span class="cline-any cline-neutral">&nbsp;</span>
135
- <span class="cline-any cline-neutral">&nbsp;</span>
136
- <span class="cline-any cline-yes">8x</span>
137
- <span class="cline-any cline-yes">8x</span>
138
- <span class="cline-any cline-yes">8x</span>
139
- <span class="cline-any cline-neutral">&nbsp;</span>
140
- <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">export function <span class="fstat-no" title="function not covered" >updateArrayWithDefault(</span>array, defaultoptions = <span class="branch-0 cbranch-no" title="branch not covered" >[])</span> {
141
- const index = <span class="cstat-no" title="statement not covered" >array.indexOf('...');</span>
142
- &nbsp;
143
- <span class="cstat-no" title="statement not covered" > if (index === -1) {</span>
144
- <span class="cstat-no" title="statement not covered" > return array;</span>
145
- }
146
- const newArray = <span class="cstat-no" title="statement not covered" >[...array];</span>
147
- <span class="cstat-no" title="statement not covered" > newArray.splice(index, 1, ...defaultoptions);</span>
148
- <span class="cstat-no" title="statement not covered" > return newArray;</span>
149
- }
150
- &nbsp;
151
- const isEqualVal = <span class="fstat-no" title="function not covered" >(a</span>, b) =&gt; <span class="cstat-no" title="statement not covered" >a === b;</span>
152
- &nbsp;
153
- export function getArrayWithDefault(
154
- array,
155
- defaultoptions = <span class="branch-0 cbranch-no" title="branch not covered" >[],</span>
156
- isEqual = <span class="branch-0 cbranch-no" title="branch not covered" >isEqualVal</span>
157
- ) {
158
- const index = array.indexOf('...');
159
- &nbsp;
160
- <span class="missing-if-branch" title="if path not taken" >I</span>if (index === -1) {
161
- <span class="cstat-no" title="statement not covered" > return array;</span>
162
- }
163
- // console.log(isEqual, array, defaultoptions);
164
- const filteredDefaultOptions = defaultoptions.filter(
165
- v =&gt; !array.some(v1 =&gt; isEqual(v, v1))
166
- // v =&gt; !array.some(v1 =&gt; {
167
- // let c = isEqual(v, v1)
168
- // console.log(` v=${v} v1=${v1} ==${c}`);
169
- // return c
170
- // })
171
- );
172
- &nbsp;
173
- const newArray = [...array];
174
- newArray.splice(index, 1, ...filteredDefaultOptions);
175
- return newArray;
176
- }
177
- &nbsp;</pre></td></tr></table></pre>
178
-
179
- <div class='push'></div><!-- for sticky footer -->
180
- </div><!-- /wrapper -->
181
- <div class='footer quiet pad2 space-top1 center small'>
182
- Code coverage generated by
183
- <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
184
- at 2023-08-08T10:31:57.089Z
185
- </div>
186
- <script src="prettify.js"></script>
187
- <script>
188
- window.onload = function () {
189
- prettyPrint();
190
- };
191
- </script>
192
- <script src="sorter.js"></script>
193
- <script src="block-navigation.js"></script>
194
- </body>
195
- </html>
196
-
package/result.json DELETED
@@ -1 +0,0 @@
1
- {"jobDetails":{"isRunByLocal":true,"hostName":"kumar-zt375-t","platForm":"Darwin","branchName":"3.0.0"},"tests":{"unitCase":{"isExecuted":"Yes","numberOfSuccess":8,"numberOfFails":0,"numberOfCases":8,"numberOfSuites":1,"endTime":1691490717100,"startTime":1691490714897,"coverageDetail":{"codeCoveragePercentage":0,"fileCoveragePercentage":0},"fileDetails":[{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/updateArrayWithDefault.test.js","CaseList":{"passedCaseList":[],"failedCaseList":["usual extra one option in the last","usual extra 2 option in the last","usual extra one option in the front","usual extra 2 option in the front","usual already given one option in the last","usual already given 2 option in the last","usual already given one option in the front","usual already given 2 option in the front"]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/updateArrayWithDefault.test.js","CaseList":{"passedCaseList":["usual extra one option in the last","usual extra 2 option in the last","usual extra one option in the front","usual extra 2 option in the front","usual already given one option in the last","usual already given 2 option in the last","usual already given one option in the front","usual already given 2 option in the front"],"failedCaseList":[]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js","CaseList":{"passedCaseList":[],"failedCaseList":["usual extra one option in the last","usual extra 2 option in the last","usual extra one option in the front","usual extra 2 option in the front","usual already given one option in the last","usual already given 2 option in the last","usual already given one option in the front","usual already given 2 option in the front"]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js","CaseList":{"passedCaseList":[],"failedCaseList":["usual extra one option in the last","usual extra 2 option in the last","usual extra one option in the front","usual extra 2 option in the front","usual already given one option in the last","usual already given 2 option in the last","usual already given one option in the front","usual already given 2 option in the front"]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js","CaseList":{"passedCaseList":[],"failedCaseList":["usual extra one option in the last","usual extra 2 option in the last","usual extra one option in the front","usual extra 2 option in the front","usual already given one option in the last","usual already given 2 option in the last","usual already given one option in the front","usual already given 2 option in the front"]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js","CaseList":{"passedCaseList":[],"failedCaseList":["usual extra one option in the last"]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js","CaseList":{"passedCaseList":[],"failedCaseList":["usual extra one option in the last"]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js","CaseList":{"passedCaseList":[],"failedCaseList":["usual extra one option in the last"]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js","CaseList":{"passedCaseList":[],"failedCaseList":["usual extra one option in the last"]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js","CaseList":{"passedCaseList":[],"failedCaseList":["usual extra one option in the last"]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js","CaseList":{"passedCaseList":[],"failedCaseList":["usual extra one option in the last"]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js","CaseList":{"passedCaseList":["usual extra one option in the last"],"failedCaseList":[]}},{"fileName":"/Users/zt375-t/work/client_build_tool/packages/client_build_tool/src/shared/bundler/webpack/utils/__test__/getArrayWithDefaultWithCustomEqual.test.js","CaseList":{"passedCaseList":["usual extra one option in the last","usual extra 2 option in the last","usual extra one option in the front","usual extra 2 option in the front","usual already given one option in the last","usual already given 2 option in the last","usual already given one option in the front","usual already given 2 option in the front"],"failedCaseList":[]}}]}}}
@@ -1,37 +0,0 @@
1
- <html>
2
- <head>
3
- <style>
4
- .red{
5
- font-weight:bold;
6
- color:red;
7
- }
8
- .green{
9
- font-weight:bold;
10
- color:green;
11
- }
12
- table
13
- {
14
- font-family: arial, sans-serif;
15
- border-collapse: collapse;
16
- }
17
-
18
- td, th
19
- {
20
- border: 1px solid #dddddd;
21
- padding: 8px;
22
- }
23
- </style>
24
- </head>
25
- <body>
26
- <table>
27
- <tr>
28
- <th>Title</th>
29
- <th>FullName</th>
30
- <th>Test Case Path</th>
31
- </tr>
32
-
33
- </table>
34
- <br/>COVERAGE <span class="red">0%</span> <br/> less than 60% consider failure
35
- </body>
36
- </html>
37
-