UNPKG

siesta-lite

Version:

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

107 lines (76 loc) 3.09 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 */ Class(&#39;Siesta.Result.Assertion&#39;, { isa : Siesta.Result, has : { name : null, passed : null, annotation : null, index : null, // stored as string sourceLine : null, isTodo : false, isException : false, exceptionType : null, isWaitFor : false, completed : false // for waitFor assertions }, methods : { isPassed : function (raw) { if (raw) return this.passed if (this.isTodo) return true if (this.isWaitFor &amp;&amp; !this.completed) return true return this.passed }, toString : function () { var R = Siesta.Resource(&#39;Siesta.Result.Assertion&#39;); var text = (this.isTodo ? R.get(&#39;todoText&#39;) : &#39;&#39;) + (this.passed ? R.get(&#39;passText&#39;) : R.get(&#39;failText&#39;)) + &#39; &#39; + this.index + &#39; - &#39; + this.description if (this.annotation) text += &#39;\n&#39; + this.annotation return text }, toJSON : function () { var me = this var info = { parentId : this.parent.id, type : this.meta.name, passed : this.passed, index : this.index, description : String(this.description) || &#39;No description&#39; } if (this.annotation) info.annotation = String(this.annotation) // copy if true Joose.A.each([ &#39;isTodo&#39;, &#39;isWaitFor&#39;, &#39;isException&#39;, &#39;sourceLine&#39;, &#39;name&#39; ], function (name) { if (me[ name ]) info[ name ] = me[ name ] }) if (this.isException) { info.exceptionType = this.exceptionType } return info } } }) </pre> </body> </html>