Skip to content

Commit

Permalink
test: fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
mohasarc committed Apr 23, 2024
1 parent de3d56e commit 538a940
Show file tree
Hide file tree
Showing 9 changed files with 648 additions and 587 deletions.
319 changes: 162 additions & 157 deletions coverage/clover.xml

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions coverage/coverage-final.json

Large diffs are not rendered by default.

118 changes: 74 additions & 44 deletions coverage/lcov-report/PTask.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ <h1><a href="index.html">All files</a> PTask.ts</h1>
<div class='clearfix'>

<div class='fl pad1y space-right2'>
<span class="strong">96% </span>
<span class="strong">96.1% </span>
<span class="quiet">Statements</span>
<span class='fraction'>72/75</span>
<span class='fraction'>74/77</span>
</div>


<div class='fl pad1y space-right2'>
<span class="strong">73.33% </span>
<span class="strong">74.07% </span>
<span class="quiet">Branches</span>
<span class='fraction'>22/30</span>
<span class='fraction'>20/27</span>
</div>


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


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


Expand Down Expand Up @@ -255,9 +255,20 @@ <h1><a href="index.html">All files</a> PTask.ts</h1>
<a name='L190'></a><a href='#L190'>190</a>
<a name='L191'></a><a href='#L191'>191</a>
<a name='L192'></a><a href='#L192'>192</a>
<a name='L193'></a><a href='#L193'>193</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
<a name='L193'></a><a href='#L193'>193</a>
<a name='L194'></a><a href='#L194'>194</a>
<a name='L195'></a><a href='#L195'>195</a>
<a name='L196'></a><a href='#L196'>196</a>
<a name='L197'></a><a href='#L197'>197</a>
<a name='L198'></a><a href='#L198'>198</a>
<a name='L199'></a><a href='#L199'>199</a>
<a name='L200'></a><a href='#L200'>200</a>
<a name='L201'></a><a href='#L201'>201</a>
<a name='L202'></a><a href='#L202'>202</a>
<a name='L203'></a><a href='#L203'>203</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</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>
Expand Down Expand Up @@ -293,7 +304,7 @@ <h1><a href="index.html">All files</a> PTask.ts</h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">43x</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>
Expand All @@ -313,42 +324,42 @@ <h1><a href="index.html">All files</a> PTask.ts</h1>
<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">40x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">96x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">104x</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">40x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">32x</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">35x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-yes">43x</span>
<span class="cline-any cline-yes">5x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">40x</span>
<span class="cline-any cline-yes">43x</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">39x</span>
<span class="cline-any cline-yes">42x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">24x</span>
<span class="cline-any cline-yes">27x</span>
<span class="cline-any cline-yes">27x</span>
<span class="cline-any cline-yes">27x</span>
<span class="cline-any cline-yes">27x</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>
Expand Down Expand Up @@ -414,42 +425,52 @@ <h1><a href="index.html">All files</a> PTask.ts</h1>
<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">136x</span>
<span class="cline-any cline-yes">142x</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">370x</span>
<span class="cline-any cline-yes">388x</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">42x</span>
<span class="cline-any cline-yes">45x</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">32x</span>
<span class="cline-any cline-yes">32x</span>
<span class="cline-any cline-yes">32x</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">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-yes">29x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">143x</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">129x</span>
<span class="cline-any cline-yes">27x</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">24x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</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">6x</span>
<span class="cline-any cline-no">&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">4x</span>
<span class="cline-any cline-yes">4x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">6x</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">import ProcessingPriorityQueue from "./ProcessingPriorityQueue";
&nbsp;
const DEFAULT_QUEUE_NAME = "default";
const DEFAULT_CONCURRENCY_LIMIT = 1;
&nbsp;
interface PTaskOptions&lt;T, R&gt; {
priority: number;
Expand Down Expand Up @@ -633,10 +654,19 @@ <h1><a href="index.html">All files</a> PTask.ts</h1>
.get(this.queueName)
.splice(PTask.pTaskLists.get(this.queueName).indexOf(this), 1);
}
&nbsp;
public static setConcurrencyLimit(limit: number, queueName: string = <span class="branch-0 cbranch-no" title="branch not covered" >DEFAULT_QUEUE_NAME)</span>: void {
ProcessingPriorityQueue.getInstance(queueName).setConcurrencyLimit(limit);
}
&nbsp;
public static getAllPTasks(queueName?: string): Array&lt;PTask&lt;any, any&gt;&gt; {
<span class="missing-if-branch" title="if path not taken" >I</span>if (!queueName) <span class="cstat-no" title="statement not covered" >return [...PTask.pTaskLists.get(DEFAULT_QUEUE_NAME)] ?? [];</span>
return [...PTask.pTaskLists.get(queueName)] ?? <span class="branch-1 cbranch-no" title="branch not covered" >[];</span>
<span class="missing-if-branch" title="if path not taken" >I</span>if (!queueName) {
<span class="cstat-no" title="statement not covered" > return PTask.pTaskLists.get(DEFAULT_QUEUE_NAME)</span>
? [...PTask.pTaskLists.get(DEFAULT_QUEUE_NAME)]
: []
}
&nbsp;
return PTask.pTaskLists.get(queueName) ? [...PTask.pTaskLists.get(queueName)] : <span class="branch-1 cbranch-no" title="branch not covered" >[];</span>
}
}
&nbsp;</pre></td></tr></table></pre>
Expand All @@ -646,7 +676,7 @@ <h1><a href="index.html">All files</a> PTask.ts</h1>
<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 Fri Sep 30 2022 13:12:02 GMT+0300 (GMT+03:00)
at Tue Apr 23 2024 10:35:57 GMT+0000 (Coordinated Universal Time)
</div>
<script src="prettify.js"></script>
<script>
Expand Down
Loading

0 comments on commit 538a940

Please sign in to comment.