-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.min.js
More file actions
11 lines (10 loc) · 1.36 KB
/
test.min.js
File metadata and controls
11 lines (10 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
/*
test.js
https://github.com/websperts/test.js
Copyright (c) 2014 websperts <hello@websperts.com>
Licensed under the MIT license.
https://github.com/websperts/test.js/blob/master/LICENSE
*/
(function(d,c){"function"===typeof define&&define.amd?define(function(){return c(d)}):"object"===typeof exports?module.exports=c(d):d.test=c(d)})(this,function(d){var c="object"===typeof exports,a={cli:{reset:"\u001b[0m",bold:"\u001b[1m",underscore:"\u001b[4m",red:"\u001b[31m",green:"\u001b[32m",yellow:"\u001b[33m",blue:"\u001b[34m",ok:"\u2714",fail:"\u2718"},suite:function(e,b,c,f){a.start(e);if("function"===typeof b)b();else for(var g in b)null==b[g][1]&&(b[g][1]=!0),"function"===typeof c&&c(g),
a.ok(b[g][0],b[g][1],g),"function"===typeof f&&f(g);a.end()},start:function(e){c?console.log(a.cli.bold+a.cli.underscore+e+a.cli.reset):console.group(e)},end:function(){console[c?"log":"groupEnd"]()},ok:function(e,b,d){var f=e===b;c?(console.log(),f?console.log(a.cli.bold+a.cli.green+a.cli.ok+" OK:"+a.cli.reset+" "+d):(console.log(a.cli.bold+a.cli.red+a.cli.fail+" FAIL:"+a.cli.reset+" "+d),console.log(),console.log(" "+a.cli.yellow+"Expected:"+a.cli.reset+" "+b),console.log(" "+a.cli.blue+"Result: "+
a.cli.reset+" "+e))):(console[f?"groupCollapsed":"group"]((f?"OK":"FAIL")+": "+d),console[f?"info":"warn"]("Expected: "+b),console.info("Result: "+e),console.groupEnd())}};return a});