UNPKG

siesta-lite

Version:

Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers

148 lines (134 loc) 4.65 kB
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>The source code</title> <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="../resources/prettify/prettify.js"></script> <style type="text/css"> .highlight { display: block; background-color: #ddd; } </style> <script type="text/javascript"> function highlight() { document.getElementById(location.hash.replace(/#/, "")).className = "highlight"; } </script> </head> <body onload="prettyPrint(); highlight();"> <pre class="prettyprint lang-js">/* Siesta 5.6.1 Copyright(c) 2009-2022 Bryntum AB https://bryntum.com/contact https://bryntum.com/products/siesta/license */ Ext.define(&#39;Siesta.Project.Browser.Model.CoverageUnit&#39;, { extend : &#39;Ext.data.Model&#39;, idProperty : &#39;id&#39;, fields : [ &#39;id&#39;, &#39;url&#39;, &#39;text&#39;, &#39;reportNode&#39;, { name : &#39;iconCls&#39;, defaultValue : &#39;x-fa fa-cube&#39;} ], getLineCoverage : function() { return this.getCoverageInPercent(&#39;lines&#39;); }, getStatementCoverage : function() { return this.getCoverageInPercent(&#39;statements&#39;); }, getBranchCoverage : function() { return this.getCoverageInPercent(&#39;branches&#39;); }, getFunctionCoverage : function() { return this.getCoverageInPercent(&#39;functions&#39;); }, getCoverageInPercent : function(type) { var node = this.data.reportNode; if (node) { return node.metrics[type].pct; } } // , // init : function () { // this.internalId = this.getId() || this.internalId // }, // // computeFolderStatus : function () { // if (!this.childNodes.length) return &#39;yellow&#39; // // var isWorking = false // var hasFailed = false // var allGreen = true // // Joose.A.each(this.childNodes, function (childNode) { // // if (childNode.isLeaf()) { // var test = childNode.get(&#39;test&#39;) // // if (test &amp;&amp; test.isFailed()) { // allGreen = false // hasFailed = true // // // stop iteration // return false // } // // if (!test &amp;&amp; childNode.get(&#39;isStarting&#39;)) isWorking = true // if (test &amp;&amp; !test.isFinished()) isWorking = true // if (test &amp;&amp; !test.isPassed()) allGreen = false // if (!test) allGreen = false // // } else { // var status = childNode.computeFolderStatus() // // if (status == &#39;red&#39;) { // allGreen = false // hasFailed = true // // // stop iteration // return false // } // // if (status == &#39;working&#39;) { // isWorking = true // // // stop iteration // return false // } // // if (status == &#39;yellow&#39;) allGreen = false // } // }) // // if (isWorking) return &#39;working&#39; // if (hasFailed) return &#39;red&#39; // if (allGreen) return &#39;green&#39; // // return &#39;yellow&#39; // }, // // // updateFolderStatus : function () { // this.set(&#39;folderStatus&#39;, this.computeFolderStatus()) // // var parentNode = this.parentNode // // if (parentNode &amp;&amp; !parentNode.isRoot()) parentNode.updateFolderStatus() // } }, // eof Ext.apply function () { Ext.data.NodeInterface.decorate(this); this.override({ expand : function () { Ext.suspendLayouts(); this.callParent(arguments); Ext.resumeLayouts(); } }); } ) </pre> </body> </html>