testit/dist/testit.min.js

10 lines
697 B
JavaScript
Raw Permalink Normal View History

2024-06-16 20:04:12 +00:00
/*! Test.it v1.1.3 | MIT | https://github.com/n2geoff/testit */const i={log:console.log,version:"v1.1.3",_tests:{},run:function(t,o){typeof t!="boolean"&&(o=t,t=!0);let r=this._tests||[],e=[],s=[];return Object.keys(r).forEach(n=>{let h=r[n];try{h(),s.push(`
+OK ${n}`)}catch(f){t?e.push(`
-ERR ${n}
2021-01-02 08:42:41 +00:00
---
${f.stack}
---`):e.push(`
2024-06-16 20:04:12 +00:00
-ERR ${n}`)}}),typeof o=="function"?o({pass:s,fail:e}):(i.log(...s,...e),i.log(`
# tests ${e.length+s.length} pass ${s.length} fail ${e.length}`),!e.length)},it:function(t){return this._tests=t,this},assert:(l,t)=>{try{if(!l)throw new Error(t||"Assertion Failed")}catch{throw new Error(t)}}};var u=i;export{u as default};
2021-01-02 08:42:41 +00:00
//# sourceMappingURL=testit.min.js.map