From 14575aa727cc9b28859e03540928cccd2db43974 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Thu, 7 Aug 2014 08:40:48 +0800 Subject: [PATCH] minify mocha --- ajax/libs/mocha/0.0.1-alpha6/mocha.min.css | 1 + ajax/libs/mocha/0.0.1-alpha6/mocha.min.js | 1 + ajax/libs/mocha/0.0.1/mocha.min.css | 1 + ajax/libs/mocha/0.0.1/mocha.min.js | 1 + ajax/libs/mocha/0.0.2/mocha.min.css | 1 + ajax/libs/mocha/0.0.2/mocha.min.js | 1 + ajax/libs/mocha/0.0.3/mocha.min.css | 1 + ajax/libs/mocha/0.0.3/mocha.min.js | 1 + ajax/libs/mocha/0.0.4/mocha.min.css | 1 + ajax/libs/mocha/0.0.4/mocha.min.js | 1 + ajax/libs/mocha/0.0.5/mocha.min.css | 1 + ajax/libs/mocha/0.0.5/mocha.min.js | 1 + ajax/libs/mocha/0.0.6/mocha.min.css | 1 + ajax/libs/mocha/0.0.6/mocha.min.js | 1 + ajax/libs/mocha/0.0.7/mocha.min.css | 1 + ajax/libs/mocha/0.0.7/mocha.min.js | 1 + ajax/libs/mocha/0.0.8/mocha.min.css | 1 + ajax/libs/mocha/0.0.8/mocha.min.js | 1 + ajax/libs/mocha/0.1.0/mocha.min.css | 1 + ajax/libs/mocha/0.1.0/mocha.min.js | 1 + ajax/libs/mocha/0.10.0/mocha.min.css | 1 + ajax/libs/mocha/0.10.0/mocha.min.js | 1 + ajax/libs/mocha/0.10.1/mocha.min.css | 1 + ajax/libs/mocha/0.10.1/mocha.min.js | 1 + ajax/libs/mocha/0.10.2/mocha.min.css | 1 + ajax/libs/mocha/0.10.2/mocha.min.js | 1 + ajax/libs/mocha/0.11.0/mocha.min.css | 1 + ajax/libs/mocha/0.11.0/mocha.min.js | 1 + ajax/libs/mocha/0.12.0/mocha.min.css | 1 + ajax/libs/mocha/0.12.0/mocha.min.js | 1 + ajax/libs/mocha/0.12.1/mocha.min.css | 1 + ajax/libs/mocha/0.12.1/mocha.min.js | 1 + ajax/libs/mocha/0.13.0/mocha.min.css | 1 + ajax/libs/mocha/0.13.0/mocha.min.js | 1 + ajax/libs/mocha/0.14.0/mocha.min.css | 1 + ajax/libs/mocha/0.14.0/mocha.min.js | 1 + ajax/libs/mocha/0.14.1/mocha.min.css | 1 + ajax/libs/mocha/0.14.1/mocha.min.js | 1 + ajax/libs/mocha/0.2.0/mocha.min.css | 1 + ajax/libs/mocha/0.2.0/mocha.min.js | 1 + ajax/libs/mocha/0.3.0/mocha.min.css | 1 + ajax/libs/mocha/0.3.0/mocha.min.js | 1 + ajax/libs/mocha/0.3.1/mocha.min.css | 1 + ajax/libs/mocha/0.3.1/mocha.min.js | 1 + ajax/libs/mocha/0.3.2/mocha.min.css | 1 + ajax/libs/mocha/0.3.2/mocha.min.js | 1 + ajax/libs/mocha/0.3.3/mocha.min.css | 1 + ajax/libs/mocha/0.3.3/mocha.min.js | 1 + ajax/libs/mocha/0.3.4/mocha.min.css | 1 + ajax/libs/mocha/0.3.4/mocha.min.js | 1 + ajax/libs/mocha/0.3.6/mocha.min.css | 1 + ajax/libs/mocha/0.3.6/mocha.min.js | 1 + ajax/libs/mocha/0.4.0/mocha.min.css | 1 + ajax/libs/mocha/0.4.0/mocha.min.js | 1 + ajax/libs/mocha/0.5.0/mocha.min.css | 1 + ajax/libs/mocha/0.5.0/mocha.min.js | 1 + ajax/libs/mocha/0.6.0/mocha.min.css | 1 + ajax/libs/mocha/0.6.0/mocha.min.js | 1 + ajax/libs/mocha/0.7.0/mocha.min.css | 1 + ajax/libs/mocha/0.7.0/mocha.min.js | 1 + ajax/libs/mocha/0.7.1/mocha.min.css | 1 + ajax/libs/mocha/0.7.1/mocha.min.js | 1 + ajax/libs/mocha/0.8.0/mocha.min.css | 1 + ajax/libs/mocha/0.8.0/mocha.min.js | 1 + ajax/libs/mocha/0.8.1/mocha.min.css | 1 + ajax/libs/mocha/0.8.1/mocha.min.js | 1 + ajax/libs/mocha/0.9.0/mocha.min.css | 1 + ajax/libs/mocha/0.9.0/mocha.min.js | 1 + ajax/libs/mocha/1.0.0/mocha.min.css | 1 + ajax/libs/mocha/1.0.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.0.1/mocha.min.css | 1 + ajax/libs/mocha/1.0.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.0.2/mocha.min.css | 1 + ajax/libs/mocha/1.0.2/mocha.min.js | 2 ++ ajax/libs/mocha/1.0.3/mocha.min.css | 1 + ajax/libs/mocha/1.0.3/mocha.min.js | 2 ++ ajax/libs/mocha/1.1.0/mocha.min.css | 1 + ajax/libs/mocha/1.1.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.10.0/mocha.min.css | 1 + ajax/libs/mocha/1.10.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.11.0/mocha.min.css | 1 + ajax/libs/mocha/1.11.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.12.0/mocha.min.css | 1 + ajax/libs/mocha/1.12.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.14.0/mocha.min.css | 1 + ajax/libs/mocha/1.14.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.15.0/mocha.min.css | 1 + ajax/libs/mocha/1.15.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.15.1/mocha.min.css | 1 + ajax/libs/mocha/1.15.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.16.0/mocha.min.css | 1 + ajax/libs/mocha/1.16.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.16.1/mocha.min.css | 1 + ajax/libs/mocha/1.16.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.16.2/mocha.min.css | 1 + ajax/libs/mocha/1.16.2/mocha.min.js | 2 ++ ajax/libs/mocha/1.17.0/mocha.min.css | 1 + ajax/libs/mocha/1.17.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.17.1/mocha.min.css | 1 + ajax/libs/mocha/1.17.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.18.0/mocha.min.css | 1 + ajax/libs/mocha/1.18.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.18.1/mocha.min.css | 1 + ajax/libs/mocha/1.18.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.19.0/mocha.min.css | 1 + ajax/libs/mocha/1.19.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.2.0/mocha.min.css | 1 + ajax/libs/mocha/1.2.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.2.1/mocha.min.css | 1 + ajax/libs/mocha/1.2.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.2.2/mocha.min.css | 1 + ajax/libs/mocha/1.2.2/mocha.min.js | 2 ++ ajax/libs/mocha/1.20.0/mocha.min.css | 1 + ajax/libs/mocha/1.20.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.20.1/mocha.min.css | 1 + ajax/libs/mocha/1.20.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.21.0/mocha.min.css | 1 + ajax/libs/mocha/1.21.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.21.1/mocha.min.css | 1 + ajax/libs/mocha/1.21.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.21.2/mocha.min.css | 1 + ajax/libs/mocha/1.21.2/mocha.min.js | 2 ++ ajax/libs/mocha/1.21.3/mocha.min.css | 1 + ajax/libs/mocha/1.21.3/mocha.min.js | 2 ++ ajax/libs/mocha/1.3.0/mocha.min.css | 1 + ajax/libs/mocha/1.3.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.3.1/mocha.min.css | 1 + ajax/libs/mocha/1.3.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.3.2/mocha.min.css | 1 + ajax/libs/mocha/1.3.2/mocha.min.js | 2 ++ ajax/libs/mocha/1.4.0/mocha.min.css | 1 + ajax/libs/mocha/1.4.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.4.1/mocha.min.css | 1 + ajax/libs/mocha/1.4.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.4.2/mocha.min.css | 1 + ajax/libs/mocha/1.4.2/mocha.min.js | 2 ++ ajax/libs/mocha/1.4.3/mocha.min.css | 1 + ajax/libs/mocha/1.4.3/mocha.min.js | 2 ++ ajax/libs/mocha/1.5.0/mocha.min.css | 1 + ajax/libs/mocha/1.5.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.6.0/mocha.min.css | 1 + ajax/libs/mocha/1.6.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.7.0/mocha.min.css | 1 + ajax/libs/mocha/1.7.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.7.1/mocha.min.css | 1 + ajax/libs/mocha/1.7.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.7.2/mocha.min.css | 1 + ajax/libs/mocha/1.7.2/mocha.min.js | 2 ++ ajax/libs/mocha/1.7.3/mocha.min.css | 1 + ajax/libs/mocha/1.7.3/mocha.min.js | 2 ++ ajax/libs/mocha/1.7.4/mocha.min.css | 1 + ajax/libs/mocha/1.7.4/mocha.min.js | 2 ++ ajax/libs/mocha/1.8.0/mocha.min.css | 1 + ajax/libs/mocha/1.8.0/mocha.min.js | 2 ++ ajax/libs/mocha/1.8.1/mocha.min.css | 1 + ajax/libs/mocha/1.8.1/mocha.min.js | 2 ++ ajax/libs/mocha/1.8.2/mocha.min.css | 1 + ajax/libs/mocha/1.8.2/mocha.min.js | 2 ++ ajax/libs/mocha/1.9.0/mocha.min.css | 1 + ajax/libs/mocha/1.9.0/mocha.min.js | 2 ++ 160 files changed, 206 insertions(+) create mode 100644 ajax/libs/mocha/0.0.1-alpha6/mocha.min.css create mode 100644 ajax/libs/mocha/0.0.1-alpha6/mocha.min.js create mode 100644 ajax/libs/mocha/0.0.1/mocha.min.css create mode 100644 ajax/libs/mocha/0.0.1/mocha.min.js create mode 100644 ajax/libs/mocha/0.0.2/mocha.min.css create mode 100644 ajax/libs/mocha/0.0.2/mocha.min.js create mode 100644 ajax/libs/mocha/0.0.3/mocha.min.css create mode 100644 ajax/libs/mocha/0.0.3/mocha.min.js create mode 100644 ajax/libs/mocha/0.0.4/mocha.min.css create mode 100644 ajax/libs/mocha/0.0.4/mocha.min.js create mode 100644 ajax/libs/mocha/0.0.5/mocha.min.css create mode 100644 ajax/libs/mocha/0.0.5/mocha.min.js create mode 100644 ajax/libs/mocha/0.0.6/mocha.min.css create mode 100644 ajax/libs/mocha/0.0.6/mocha.min.js create mode 100644 ajax/libs/mocha/0.0.7/mocha.min.css create mode 100644 ajax/libs/mocha/0.0.7/mocha.min.js create mode 100644 ajax/libs/mocha/0.0.8/mocha.min.css create mode 100644 ajax/libs/mocha/0.0.8/mocha.min.js create mode 100644 ajax/libs/mocha/0.1.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.1.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.10.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.10.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.10.1/mocha.min.css create mode 100644 ajax/libs/mocha/0.10.1/mocha.min.js create mode 100644 ajax/libs/mocha/0.10.2/mocha.min.css create mode 100644 ajax/libs/mocha/0.10.2/mocha.min.js create mode 100644 ajax/libs/mocha/0.11.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.11.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.12.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.12.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.12.1/mocha.min.css create mode 100644 ajax/libs/mocha/0.12.1/mocha.min.js create mode 100644 ajax/libs/mocha/0.13.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.13.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.14.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.14.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.14.1/mocha.min.css create mode 100644 ajax/libs/mocha/0.14.1/mocha.min.js create mode 100644 ajax/libs/mocha/0.2.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.2.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.3.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.3.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.3.1/mocha.min.css create mode 100644 ajax/libs/mocha/0.3.1/mocha.min.js create mode 100644 ajax/libs/mocha/0.3.2/mocha.min.css create mode 100644 ajax/libs/mocha/0.3.2/mocha.min.js create mode 100644 ajax/libs/mocha/0.3.3/mocha.min.css create mode 100644 ajax/libs/mocha/0.3.3/mocha.min.js create mode 100644 ajax/libs/mocha/0.3.4/mocha.min.css create mode 100644 ajax/libs/mocha/0.3.4/mocha.min.js create mode 100644 ajax/libs/mocha/0.3.6/mocha.min.css create mode 100644 ajax/libs/mocha/0.3.6/mocha.min.js create mode 100644 ajax/libs/mocha/0.4.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.4.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.5.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.5.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.6.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.6.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.7.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.7.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.7.1/mocha.min.css create mode 100644 ajax/libs/mocha/0.7.1/mocha.min.js create mode 100644 ajax/libs/mocha/0.8.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.8.0/mocha.min.js create mode 100644 ajax/libs/mocha/0.8.1/mocha.min.css create mode 100644 ajax/libs/mocha/0.8.1/mocha.min.js create mode 100644 ajax/libs/mocha/0.9.0/mocha.min.css create mode 100644 ajax/libs/mocha/0.9.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.0.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.0.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.0.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.0.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.0.2/mocha.min.css create mode 100644 ajax/libs/mocha/1.0.2/mocha.min.js create mode 100644 ajax/libs/mocha/1.0.3/mocha.min.css create mode 100644 ajax/libs/mocha/1.0.3/mocha.min.js create mode 100644 ajax/libs/mocha/1.1.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.1.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.10.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.10.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.11.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.11.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.12.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.12.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.14.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.14.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.15.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.15.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.15.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.15.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.16.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.16.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.16.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.16.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.16.2/mocha.min.css create mode 100644 ajax/libs/mocha/1.16.2/mocha.min.js create mode 100644 ajax/libs/mocha/1.17.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.17.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.17.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.17.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.18.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.18.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.18.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.18.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.19.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.19.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.2.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.2.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.2.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.2.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.2.2/mocha.min.css create mode 100644 ajax/libs/mocha/1.2.2/mocha.min.js create mode 100644 ajax/libs/mocha/1.20.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.20.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.20.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.20.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.21.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.21.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.21.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.21.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.21.2/mocha.min.css create mode 100644 ajax/libs/mocha/1.21.2/mocha.min.js create mode 100644 ajax/libs/mocha/1.21.3/mocha.min.css create mode 100644 ajax/libs/mocha/1.21.3/mocha.min.js create mode 100644 ajax/libs/mocha/1.3.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.3.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.3.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.3.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.3.2/mocha.min.css create mode 100644 ajax/libs/mocha/1.3.2/mocha.min.js create mode 100644 ajax/libs/mocha/1.4.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.4.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.4.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.4.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.4.2/mocha.min.css create mode 100644 ajax/libs/mocha/1.4.2/mocha.min.js create mode 100644 ajax/libs/mocha/1.4.3/mocha.min.css create mode 100644 ajax/libs/mocha/1.4.3/mocha.min.js create mode 100644 ajax/libs/mocha/1.5.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.5.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.6.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.6.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.7.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.7.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.7.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.7.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.7.2/mocha.min.css create mode 100644 ajax/libs/mocha/1.7.2/mocha.min.js create mode 100644 ajax/libs/mocha/1.7.3/mocha.min.css create mode 100644 ajax/libs/mocha/1.7.3/mocha.min.js create mode 100644 ajax/libs/mocha/1.7.4/mocha.min.css create mode 100644 ajax/libs/mocha/1.7.4/mocha.min.js create mode 100644 ajax/libs/mocha/1.8.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.8.0/mocha.min.js create mode 100644 ajax/libs/mocha/1.8.1/mocha.min.css create mode 100644 ajax/libs/mocha/1.8.1/mocha.min.js create mode 100644 ajax/libs/mocha/1.8.2/mocha.min.css create mode 100644 ajax/libs/mocha/1.8.2/mocha.min.js create mode 100644 ajax/libs/mocha/1.9.0/mocha.min.css create mode 100644 ajax/libs/mocha/1.9.0/mocha.min.js diff --git a/ajax/libs/mocha/0.0.1-alpha6/mocha.min.css b/ajax/libs/mocha/0.0.1-alpha6/mocha.min.css new file mode 100644 index 000000000..b307d8ff1 --- /dev/null +++ b/ajax/libs/mocha/0.0.1-alpha6/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'◦';font-size:12px;display:block;float:left;margin-right:5px}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.1-alpha6/mocha.min.js b/ajax/libs/mocha/0.0.1-alpha6/mocha.min.js new file mode 100644 index 000000000..cec4b3232 --- /dev/null +++ b/ajax/libs/mocha/0.0.1-alpha6/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",s=t+"/index.js";return require.modules[o]&&o||require.modules[s]&&s||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),s=e.split("/");o.pop();for(var r=0;rr;++r)o[r].apply(this,e);return this}}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("interfaces/bdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.it=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){function e(t){var n;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new r(i,u))}}else{var n=s.create(o[0],i);o.unshift(n),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suite=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.test=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.0.1-alpha5",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Test=o("./test")}),require.register("reporters/base.js",function(t,e,o){function s(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,s.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var r=o("browser/tty"),n=r.isatty(1)&&r.isatty(2);e=t.exports=s,e.useColors=n,e.colors={pass:90,fail:31,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:n?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:r.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s: ")+i("error message","%s")+i("error stack","\n%s\n"),s=t.err.stack,r=s.indexOf("at"),n=s.slice(0,r);s=s.slice(r).replace(/^/gm," "),console.error(o,e,t.fullTitle(),n,s)})},s.prototype.epilogue=function(){var t=this.stats;return console.log(),t.failures?(console.error(" ✖ %d of %d tests failed:",t.failures,t.tests),s.list(this.failures),console.error(),void process.nextTick(function(){process.exit(t.failures)})):(console.log(" ✔ %d tests completed (%dms)",t.tests||0,t.duration),console.log(),void process.nextTick(function(){process.exit(0)}))}}),require.register("reporters/doc.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}n.call(this,t);var o=this.stats,s=(t.total,2);t.on("suite",function(t){t.root||(++s,console.log('%s
',e()),++s,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--s,console.log("%s
",e()),--s)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=r(t.fn.toString());console.log("%s
%s
",e(),o)}),t.on("end",function(){process.exit(o.failures)})}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var n=o("./base");e=t.exports=s}),require.register("reporters/dot.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,.75*r.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(n("pending","."))}),t.on("pass",function(t){++s%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?".":n(t.speed,"."))}),t.on("fail",function(){++s%o==0&&process.stdout.write("\n "),process.stdout.write(n("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=o("./base"),n=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/html.js",function(t,e,o){function s(t){i.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),s=[o],a=$(u).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");s[0].append(e),s.unshift($("
")),e.append(s[0])}}),t.on("suite end",function(t){t.root||s.shift()}),t.on("test end",function(t){var o=new Date-e.start;if(a.find(".passes em").text(e.passes),a.find(".failures em").text(e.failures),a.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var r=$('

'+t.title+"

");else{var r=$('

'+t.title+"

"),i=t.err.stack||t.err,u=$('
'+i+"
");r.append(u)}r.find("h2").toggle(function(){c.slideDown("fast")},function(){c.slideUp("fast")});var c=$("
"+n(t.fn.toString())+"
");c.appendTo(r).hide(),s[0].append(r)}),void t.on("end",function(){process.exit(e.failures)})):r("#mocha div missing, add it to your document")}function r(t){$('
'+t+"
").appendTo("body")}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base");e=t.exports=s;var u='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function s(t){n.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.color}e=t.exports=s}),require.register("reporters/json.js",function(t,e,o){function s(t){var e=this;n.call(this,t);var o=[],s=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(r),failures:s.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.cursor,n.color}e=t.exports=s}),require.register("reporters/landing.js",function(t,e,o){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}r.call(this,t);var o=this,s=(this.stats,.75*r.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),n.hide()}),t.on("test end",function(t){var o=-1==l?s*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(s-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var r=o("./base"),n=r.cursor,i=r.color;e=t.exports=s,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/list.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(n("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=n("checkmark"," -")+n("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=n("checkmark"," ✓")+n("pass"," %s: ")+n(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+n("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=o("./base"),n=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/progress.js",function(t,e,o){function s(t,e){r.call(this,t);{var o=this,e=e||{},s=(this.stats,.5*r.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),n.hide()}),t.on("test end",function(){var t=a++/u,o=s*t|0,r=s-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var r=o("./base"),n=r.cursor,i=r.color;e=t.exports=s,r.colors.progress=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/spec.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}r.call(this,t);var o=this,s=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(n("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+n("pass",t.title+": "))}),t.on("pending",function(t){var o=e()+n("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+n("checkmark"," ✓")+n("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+n("checkmark"," ✓")+n("pass"," %s ")+n(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+n("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var r=o("./base"),n=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/tap.js",function(t,e,o){function s(t){r.call(this,t);var e=this.stats,o=t.total,s=1;t.on("start",function(){console.log("%d..%d",1,o)}),t.on("test end",function(){++s}),t.on("pass",function(t){console.log("ok %d %s",s,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",s,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))}),t.on("end",function(){process.exit(e.failures)})}{var r=o("./base");r.cursor,r.color}e=t.exports=s}),require.register("runner.js",function(t,e,o){function s(t){var e=this;this.suite=t,this.total=t.total(),this.globals=Object.keys(global).concat(["errno"]),this.on("test end",function(){e.checkGlobals()}),this.grep(/.*/)}var r=o("browser/events").EventEmitter,n=o("./test"),i=function(){};t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.grep=function(t){return this._grep=t,this},s.prototype.checkGlobals=function(t){var e=Object.keys(global).filter(function(t){return!~this.globals.indexOf(t)},this);this.globals=this.globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))},s.prototype.fail=function(t,e){t.failed=!0,this.emit("fail",t,e)},s.prototype.failHook=function(t,e){var o=new n(t+" hook",i);o.parent=this.suite,this.fail(o,e),this.emit("end"),process.exit(0)},s.prototype.hook=function(t,e){function o(t){var s=r[t];if(!s)return e();if(1!=s.length)try{s(),process.nextTick(function(){o(++t)})}catch(n){e(n)}else try{s(function(s){return s?e(s):void o(++t)})}catch(n){e(n)}}{var s=this.suite,r=(this.test,s[t+"Callbacks"]);r.length}process.nextTick(function(){o(0)})},s.prototype.runTest=function(t){var e=this.test,o=this;if(e.async)try{return e.run(function(s){return e.finished?void o.fail(e,new Error("done() called multiple times")):void t(s)})}catch(s){t(s)}process.nextTick(function(){try{e.run(),t()}catch(o){t(o)}})},s.prototype.runTests=function(t,e){function o(t){return t&&(r.fail(s,t),r.emit("test end",s)),(s=n.shift())?r._grep.test(s.fullTitle())?s.pending?(r.emit("pending",s),r.emit("test end",s),o()):(r.emit("test",r.test=s),void r.hook("beforeEach",function(t){return t?r.failHook("beforeEach",t):void r.runTest(function(t){return t?o(t):(r.emit("pass",s),s.passed=!0,r.emit("test end",s),t?r.failHook("beforeEach",t):void r.hook("afterEach",function(t){return t?r.failHook("afterEach",t):void o()}))})})):o():e()}var s,r=this,n=t.tests;o()},s.prototype.runSuite=function(t,e){function o(){var e=t.suites[n++];return e?void r.runSuite(e,o):s()}function s(){r.suite=t,r.hook("afterAll",function(o){return o?r.failHook("afterAll",o):(r.emit("suite end",t),void e())})}var r=this,n=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(e){return e?r.failHook("beforeAll",e):void r.runTests(t,o)})},s.prototype.run=function(){var t=this;return this.emit("start"),this.runSuite(this.suite,function(){t.emit("end")}),process.on("uncaughtException",function(e){t.fail(t.test,e),t.emit("end")}),this}}),require.register("suite.js",function(t,e,o){function s(t){this.title=t,this.suites=[],this.tests=[],this.beforeAllCallbacks=[],this.beforeEachCallbacks=[],this.afterAllCallbacks=[],this.afterEachCallbacks=[],this.root=!t}var r=o("browser/events").EventEmitter;e=t.exports=s;var n={};e.create=function(t,e){var o=new s(e);return o.parent=t,e=o.fullTitle(),n[e]?n[e]:(t.addSuite(o),n[e]=o)},s.prototype=new r,s.prototype.constructor=s,s.prototype.timeout=function(t){return this._timeout=t,this},s.prototype.beforeAll=function(t){return this.beforeAllCallbacks.push(t),this.emit("beforeAll",t),this},s.prototype.afterAll=function(t){return this.afterAllCallbacks.push(t),this.emit("afterAll",t),this},s.prototype.beforeEach=function(t){return this.beforeEachCallbacks.push(t),this.emit("beforeEach",t),this},s.prototype.afterEach=function(t){return this.afterEachCallbacks.push(t),this.emit("afterEach",t),this},s.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t){function e(t,e){this.title=t,this.fn=e,this.pending=!e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}t.exports=e,e.prototype.timeout=function(t){return this._timeout=t,this},e.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},e.prototype.run=function(t){var e,o=this,s=this._timeout,r=new Date;this.async&&(e=setTimeout(function(){t(new Error("timeout of "+s+"ms exceeded"))},s)),this.async?this.fn(function(s){clearTimeout(e),o.duration=new Date-r,t(s),o.finished=!0}):(this.pending||this.fn(),this.duration=new Date-r)}}),process={},process.nextTick=function(t){setTimeout(t,0)},process.on=function(){},process.exit=function(){},process.stdout={},global=this,mocha=require("mocha"),function(){var t=new mocha.Suite,e=mocha.reporters.HTML;mocha.setup=function(e){if(e=mocha.interfaces[e],!e)throw new Error('invalid mocha interface "'+e+'"');e(t),t.emit("pre-require",global)},mocha.run=function(){t.emit("run");{var o=new mocha.Runner(t);new e(o)}o.run()}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.1/mocha.min.css b/ajax/libs/mocha/0.0.1/mocha.min.css new file mode 100644 index 000000000..b307d8ff1 --- /dev/null +++ b/ajax/libs/mocha/0.0.1/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'◦';font-size:12px;display:block;float:left;margin-right:5px}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.1/mocha.min.js b/ajax/libs/mocha/0.0.1/mocha.min.js new file mode 100644 index 000000000..cec4b3232 --- /dev/null +++ b/ajax/libs/mocha/0.0.1/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",s=t+"/index.js";return require.modules[o]&&o||require.modules[s]&&s||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),s=e.split("/");o.pop();for(var r=0;rr;++r)o[r].apply(this,e);return this}}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("interfaces/bdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.it=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){function e(t){var n;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new r(i,u))}}else{var n=s.create(o[0],i);o.unshift(n),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suite=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.test=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.0.1-alpha5",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Test=o("./test")}),require.register("reporters/base.js",function(t,e,o){function s(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,s.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var r=o("browser/tty"),n=r.isatty(1)&&r.isatty(2);e=t.exports=s,e.useColors=n,e.colors={pass:90,fail:31,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:n?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:r.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s: ")+i("error message","%s")+i("error stack","\n%s\n"),s=t.err.stack,r=s.indexOf("at"),n=s.slice(0,r);s=s.slice(r).replace(/^/gm," "),console.error(o,e,t.fullTitle(),n,s)})},s.prototype.epilogue=function(){var t=this.stats;return console.log(),t.failures?(console.error(" ✖ %d of %d tests failed:",t.failures,t.tests),s.list(this.failures),console.error(),void process.nextTick(function(){process.exit(t.failures)})):(console.log(" ✔ %d tests completed (%dms)",t.tests||0,t.duration),console.log(),void process.nextTick(function(){process.exit(0)}))}}),require.register("reporters/doc.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}n.call(this,t);var o=this.stats,s=(t.total,2);t.on("suite",function(t){t.root||(++s,console.log('%s
',e()),++s,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--s,console.log("%s
",e()),--s)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=r(t.fn.toString());console.log("%s
%s
",e(),o)}),t.on("end",function(){process.exit(o.failures)})}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var n=o("./base");e=t.exports=s}),require.register("reporters/dot.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,.75*r.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(n("pending","."))}),t.on("pass",function(t){++s%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?".":n(t.speed,"."))}),t.on("fail",function(){++s%o==0&&process.stdout.write("\n "),process.stdout.write(n("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=o("./base"),n=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/html.js",function(t,e,o){function s(t){i.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),s=[o],a=$(u).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");s[0].append(e),s.unshift($("
")),e.append(s[0])}}),t.on("suite end",function(t){t.root||s.shift()}),t.on("test end",function(t){var o=new Date-e.start;if(a.find(".passes em").text(e.passes),a.find(".failures em").text(e.failures),a.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var r=$('

'+t.title+"

");else{var r=$('

'+t.title+"

"),i=t.err.stack||t.err,u=$('
'+i+"
");r.append(u)}r.find("h2").toggle(function(){c.slideDown("fast")},function(){c.slideUp("fast")});var c=$("
"+n(t.fn.toString())+"
");c.appendTo(r).hide(),s[0].append(r)}),void t.on("end",function(){process.exit(e.failures)})):r("#mocha div missing, add it to your document")}function r(t){$('
'+t+"
").appendTo("body")}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base");e=t.exports=s;var u='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function s(t){n.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.color}e=t.exports=s}),require.register("reporters/json.js",function(t,e,o){function s(t){var e=this;n.call(this,t);var o=[],s=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(r),failures:s.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.cursor,n.color}e=t.exports=s}),require.register("reporters/landing.js",function(t,e,o){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}r.call(this,t);var o=this,s=(this.stats,.75*r.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),n.hide()}),t.on("test end",function(t){var o=-1==l?s*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(s-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var r=o("./base"),n=r.cursor,i=r.color;e=t.exports=s,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/list.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(n("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=n("checkmark"," -")+n("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=n("checkmark"," ✓")+n("pass"," %s: ")+n(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+n("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=o("./base"),n=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/progress.js",function(t,e,o){function s(t,e){r.call(this,t);{var o=this,e=e||{},s=(this.stats,.5*r.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),n.hide()}),t.on("test end",function(){var t=a++/u,o=s*t|0,r=s-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var r=o("./base"),n=r.cursor,i=r.color;e=t.exports=s,r.colors.progress=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/spec.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}r.call(this,t);var o=this,s=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(n("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+n("pass",t.title+": "))}),t.on("pending",function(t){var o=e()+n("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+n("checkmark"," ✓")+n("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+n("checkmark"," ✓")+n("pass"," %s ")+n(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+n("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var r=o("./base"),n=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/tap.js",function(t,e,o){function s(t){r.call(this,t);var e=this.stats,o=t.total,s=1;t.on("start",function(){console.log("%d..%d",1,o)}),t.on("test end",function(){++s}),t.on("pass",function(t){console.log("ok %d %s",s,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",s,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))}),t.on("end",function(){process.exit(e.failures)})}{var r=o("./base");r.cursor,r.color}e=t.exports=s}),require.register("runner.js",function(t,e,o){function s(t){var e=this;this.suite=t,this.total=t.total(),this.globals=Object.keys(global).concat(["errno"]),this.on("test end",function(){e.checkGlobals()}),this.grep(/.*/)}var r=o("browser/events").EventEmitter,n=o("./test"),i=function(){};t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.grep=function(t){return this._grep=t,this},s.prototype.checkGlobals=function(t){var e=Object.keys(global).filter(function(t){return!~this.globals.indexOf(t)},this);this.globals=this.globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))},s.prototype.fail=function(t,e){t.failed=!0,this.emit("fail",t,e)},s.prototype.failHook=function(t,e){var o=new n(t+" hook",i);o.parent=this.suite,this.fail(o,e),this.emit("end"),process.exit(0)},s.prototype.hook=function(t,e){function o(t){var s=r[t];if(!s)return e();if(1!=s.length)try{s(),process.nextTick(function(){o(++t)})}catch(n){e(n)}else try{s(function(s){return s?e(s):void o(++t)})}catch(n){e(n)}}{var s=this.suite,r=(this.test,s[t+"Callbacks"]);r.length}process.nextTick(function(){o(0)})},s.prototype.runTest=function(t){var e=this.test,o=this;if(e.async)try{return e.run(function(s){return e.finished?void o.fail(e,new Error("done() called multiple times")):void t(s)})}catch(s){t(s)}process.nextTick(function(){try{e.run(),t()}catch(o){t(o)}})},s.prototype.runTests=function(t,e){function o(t){return t&&(r.fail(s,t),r.emit("test end",s)),(s=n.shift())?r._grep.test(s.fullTitle())?s.pending?(r.emit("pending",s),r.emit("test end",s),o()):(r.emit("test",r.test=s),void r.hook("beforeEach",function(t){return t?r.failHook("beforeEach",t):void r.runTest(function(t){return t?o(t):(r.emit("pass",s),s.passed=!0,r.emit("test end",s),t?r.failHook("beforeEach",t):void r.hook("afterEach",function(t){return t?r.failHook("afterEach",t):void o()}))})})):o():e()}var s,r=this,n=t.tests;o()},s.prototype.runSuite=function(t,e){function o(){var e=t.suites[n++];return e?void r.runSuite(e,o):s()}function s(){r.suite=t,r.hook("afterAll",function(o){return o?r.failHook("afterAll",o):(r.emit("suite end",t),void e())})}var r=this,n=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(e){return e?r.failHook("beforeAll",e):void r.runTests(t,o)})},s.prototype.run=function(){var t=this;return this.emit("start"),this.runSuite(this.suite,function(){t.emit("end")}),process.on("uncaughtException",function(e){t.fail(t.test,e),t.emit("end")}),this}}),require.register("suite.js",function(t,e,o){function s(t){this.title=t,this.suites=[],this.tests=[],this.beforeAllCallbacks=[],this.beforeEachCallbacks=[],this.afterAllCallbacks=[],this.afterEachCallbacks=[],this.root=!t}var r=o("browser/events").EventEmitter;e=t.exports=s;var n={};e.create=function(t,e){var o=new s(e);return o.parent=t,e=o.fullTitle(),n[e]?n[e]:(t.addSuite(o),n[e]=o)},s.prototype=new r,s.prototype.constructor=s,s.prototype.timeout=function(t){return this._timeout=t,this},s.prototype.beforeAll=function(t){return this.beforeAllCallbacks.push(t),this.emit("beforeAll",t),this},s.prototype.afterAll=function(t){return this.afterAllCallbacks.push(t),this.emit("afterAll",t),this},s.prototype.beforeEach=function(t){return this.beforeEachCallbacks.push(t),this.emit("beforeEach",t),this},s.prototype.afterEach=function(t){return this.afterEachCallbacks.push(t),this.emit("afterEach",t),this},s.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t){function e(t,e){this.title=t,this.fn=e,this.pending=!e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}t.exports=e,e.prototype.timeout=function(t){return this._timeout=t,this},e.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},e.prototype.run=function(t){var e,o=this,s=this._timeout,r=new Date;this.async&&(e=setTimeout(function(){t(new Error("timeout of "+s+"ms exceeded"))},s)),this.async?this.fn(function(s){clearTimeout(e),o.duration=new Date-r,t(s),o.finished=!0}):(this.pending||this.fn(),this.duration=new Date-r)}}),process={},process.nextTick=function(t){setTimeout(t,0)},process.on=function(){},process.exit=function(){},process.stdout={},global=this,mocha=require("mocha"),function(){var t=new mocha.Suite,e=mocha.reporters.HTML;mocha.setup=function(e){if(e=mocha.interfaces[e],!e)throw new Error('invalid mocha interface "'+e+'"');e(t),t.emit("pre-require",global)},mocha.run=function(){t.emit("run");{var o=new mocha.Runner(t);new e(o)}o.run()}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.2/mocha.min.css b/ajax/libs/mocha/0.0.2/mocha.min.css new file mode 100644 index 000000000..b307d8ff1 --- /dev/null +++ b/ajax/libs/mocha/0.0.2/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'◦';font-size:12px;display:block;float:left;margin-right:5px}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.2/mocha.min.js b/ajax/libs/mocha/0.0.2/mocha.min.js new file mode 100644 index 000000000..27e0235f0 --- /dev/null +++ b/ajax/libs/mocha/0.0.2/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",s=t+"/index.js";return require.modules[o]&&o||require.modules[s]&&s||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),s=e.split("/");o.pop();for(var r=0;rr;++r)o[r].apply(this,e);return this}}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("interfaces/bdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.it=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){function e(t){var i;for(var n in t)if("function"==typeof t[n]){var a=t[n];switch(n){case"before":o[0].beforeAll(a);break;case"after":o[0].afterAll(a);break;case"beforeEach":o[0].beforeEach(a);break;case"afterEach":o[0].afterEach(a);break;default:o[0].addTest(new r(n,a))}}else{var i=s.create(o[0],n);o.unshift(i),e(t[n]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suite=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.test=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.0.1",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Test=o("./test")}),require.register("reporters/base.js",function(t,e,o){function s(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,s.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var r=o("browser/tty"),i=r.isatty(1)&&r.isatty(2);e=t.exports=s,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var n=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:r.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=n("error title"," %s) %s: ")+n("error message","%s")+n("error stack","\n%s\n"),s=t.err.stack,r=s.indexOf("at"),i=s.slice(0,r);s=s.slice(r).replace(/^/gm," "),console.error(o,e,t.fullTitle(),i,s)})},s.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=n("bright fail"," ✖")+n("fail"," %d of %d tests failed")+n("light",":"),console.error(t,e.failures,e.tests),s.list(this.failures),console.error(),void process.nextTick(function(){process.exit(e.failures)})):(t=n("bright pass"," ✔")+n("green"," %d tests complete")+n("light"," (%dms)"),console.log(t,e.tests||0,e.duration),console.log(),void process.nextTick(function(){process.exit(0)}))}}),require.register("reporters/doc.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}i.call(this,t);var o=this.stats,s=(t.total,2);t.on("suite",function(t){t.root||(++s,console.log('%s
',e()),++s,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--s,console.log("%s
",e()),--s)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=n.escape(r(t.fn.toString()));console.log("%s
%s
",e(),o)}),t.on("end",function(){process.exit(o.failures)})}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var i=o("./base"),n=o("../utils");e=t.exports=s}),require.register("reporters/dot.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,.75*r.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++s%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++s%o==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/html.js",function(t,e,o){function s(t){n.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),s=[o],c=$(u).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");s[0].append(e),s.unshift($("
")),e.append(s[0])}}),t.on("suite end",function(t){t.root||s.shift()}),t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var r=$('

'+t.title+"

");else if(t.pending)var r=$('

'+t.title+"

");else{var r=$('

'+t.title+"

"),n=t.err.stack||t.err,u=$('
'+n+"
");r.append(u)}if(r.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=a.escape(i(t.fn.toString())),f=$("
"+l+"
");f.appendTo(r).hide()}s[0].append(r)}),void t.on("end",function(){process.exit(e.failures)})):r("#mocha div missing, add it to your document")}function r(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var n=o("./base"),a=o("../utils");e=t.exports=s;var u='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function s(t){i.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.color}e=t.exports=s}),require.register("reporters/json.js",function(t,e,o){function s(t){var e=this;i.call(this,t);var o=[],s=[],n=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(r),failures:s.map(r),passes:n.map(r)};process.stdout.write(JSON.stringify(t),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.cursor,i.color}e=t.exports=s}),require.register("reporters/landing.js",function(t,e,o){function s(t){function e(){var t=Array(s).join("-");return" "+n("runway",t)}r.call(this,t);var o=this,s=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=n("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var o=-1==l?s*++f/a|0:l;t.failed&&(c=n("plane crash","✈"),l=o),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(n("runway",Array(o).join("⋅"))),u.write(c),u.write(n("runway",Array(s-o).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var r=o("./base"),i=r.cursor,n=r.color;e=t.exports=s,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/list.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+i("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/progress.js",function(t,e,o){function s(t,e){r.call(this,t);{var o=this,e=e||{},s=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=u++/a,o=s*t|0,r=s-o;process.stdout.write("\r"),process.stdout.write(n("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(n("progress",e.close)),e.verbose&&process.stdout.write(n("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var r=o("./base"),i=r.cursor,n=r.color;e=t.exports=s,r.colors.progress=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/spec.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}r.call(this,t);var o=this,s=(this.stats,0),n=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass",t.title+": "))}),t.on("pending",function(t){var o=e()+i("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+i("checkmark"," ✓")+i("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+i("fail"," %d) %s"),n++,t.title)}),t.on("end",o.epilogue.bind(o))}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/tap.js",function(t,e,o){function s(t){r.call(this,t);var e=this.stats,o=t.total,s=1;t.on("start",function(){console.log("%d..%d",1,o)}),t.on("test end",function(){++s}),t.on("pass",function(t){console.log("ok %d %s",s,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",s,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))}),t.on("end",function(){process.exit(e.failures)})}{var r=o("./base");r.cursor,r.color}e=t.exports=s}),require.register("runner.js",function(t,e,o){function s(t){var e=this;this.suite=t,this.total=t.total(),this.globals=Object.keys(global).concat(["errno"]),this.on("test end",function(){e.checkGlobals()}),this.grep(/.*/)}var r=o("browser/events").EventEmitter,i=o("./test"),n=function(){};t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.grep=function(t){return this._grep=t,this},s.prototype.checkGlobals=function(t){var e=Object.keys(global).filter(function(t){return!~this.globals.indexOf(t)},this);this.globals=this.globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))},s.prototype.fail=function(t,e){t.failed=!0,this.emit("fail",t,e)},s.prototype.failHook=function(t,e){var o=new i(t+" hook",n);o.parent=this.suite,this.fail(o,e),this.emit("end"),process.exit(0)},s.prototype.hook=function(t,e){function o(t){var s=r[t];if(!s)return e();if(1!=s.length)try{s(),process.nextTick(function(){o(++t)})}catch(i){e(i)}else try{s(function(s){return s?e(s):void o(++t)})}catch(i){e(i)}}{var s=this.suite,r=(this.test,s[t+"Callbacks"]);r.length}process.nextTick(function(){o(0)})},s.prototype.hooks=function(t,e,o){function s(n){return r.suite=n,n?void r.hook(t,function(t){return t?(r.suite=i,o(t)):void s(e.pop())}):(r.suite=i,o())}var r=this,i=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},s.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,o=this;if(e.async)try{return e.run(function(s){return e.finished?void o.fail(e,new Error("done() called multiple times")):void t(s)})}catch(s){t(s)}process.nextTick(function(){try{e.run(),t()}catch(o){t(o)}})},s.prototype.runTests=function(t,e){function o(t){return t&&(r.fail(s,t),r.emit("test end",s)),(s=i.shift())?r._grep.test(s.fullTitle())?s.pending?(r.emit("pending",s),r.emit("test end",s),o()):(r.emit("test",r.test=s),void r.hookDown("beforeEach",function(t){return t?r.failHook("beforeEach",t):void r.runTest(function(t){return t?o(t):(r.emit("pass",s),s.passed=!0,r.emit("test end",s),t?r.failHook("beforeEach",t):void r.hookUp("afterEach",function(t){return t?r.failHook("afterEach",t):void o()}))})})):o():e()}var s,r=this,i=t.tests;o()},s.prototype.runSuite=function(t,e){function o(){var e=t.suites[i++];return e?void r.runSuite(e,o):s()}function s(){r.suite=t,r.hook("afterAll",function(o){return o?r.failHook("afterAll",o):(r.emit("suite end",t),void e())})}var r=this,i=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(e){return e?r.failHook("beforeAll",e):void r.runTests(t,o)})},s.prototype.run=function(){var t=this;return this.emit("start"),this.runSuite(this.suite,function(){t.emit("end")}),process.on("uncaughtException",function(e){t.fail(t.test,e),t.emit("test end",t.test),t.emit("end")}),this}}),require.register("suite.js",function(t,e,o){function s(t){this.title=t,this.suites=[],this.tests=[],this.beforeAllCallbacks=[],this.beforeEachCallbacks=[],this.afterAllCallbacks=[],this.afterEachCallbacks=[],this.root=!t}var r=o("browser/events").EventEmitter;e=t.exports=s;var i={};e.create=function(t,e){var o=new s(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},s.prototype=new r,s.prototype.constructor=s,s.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},s.prototype.beforeAll=function(t){return this.beforeAllCallbacks.push(t),this.emit("beforeAll",t),this},s.prototype.afterAll=function(t){return this.afterAllCallbacks.push(t),this.emit("afterAll",t),this},s.prototype.beforeEach=function(t){return this.beforeEachCallbacks.push(t),this.emit("beforeEach",t),this},s.prototype.afterEach=function(t){return this.afterEachCallbacks.push(t),this.emit("afterEach",t),this},s.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t){function e(t,e){this.title=t,this.fn=e,this.pending=!e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}t.exports=e,e.prototype.timeout=function(t){return this._timeout=t,this},e.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},e.prototype.run=function(t){var e,o=this,s=this._timeout,r=new Date;this.async&&(e=setTimeout(function(){t(new Error("timeout of "+s+"ms exceeded"))},s)),this.async?this.fn(function(s){clearTimeout(e),o.duration=new Date-r,t(s),o.finished=!0}):(this.pending||this.fn(),this.duration=new Date-r)}}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),process={},process.nextTick=function(t){setTimeout(t,0)},process.on=function(){},process.exit=function(){},process.stdout={},global=this,mocha=require("mocha"),function(){var t=new mocha.Suite,e=mocha.reporters.HTML;mocha.setup=function(e){if(e=mocha.interfaces[e],!e)throw new Error('invalid mocha interface "'+e+'"');e(t),t.emit("pre-require",global)},mocha.run=function(){t.emit("run");{var o=new mocha.Runner(t);new e(o)}o.run()}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.3/mocha.min.css b/ajax/libs/mocha/0.0.3/mocha.min.css new file mode 100644 index 000000000..b307d8ff1 --- /dev/null +++ b/ajax/libs/mocha/0.0.3/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'◦';font-size:12px;display:block;float:left;margin-right:5px}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.3/mocha.min.js b/ajax/libs/mocha/0.0.3/mocha.min.js new file mode 100644 index 000000000..5f4aa9a9a --- /dev/null +++ b/ajax/libs/mocha/0.0.3/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",s=t+"/index.js";return require.modules[o]&&o||require.modules[s]&&s||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),s=e.split("/");o.pop();for(var r=0;rr;++r)o[r].apply(this,e);return this}}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("interfaces/bdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.it=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){function e(t){var i;for(var n in t)if("function"==typeof t[n]){var a=t[n];switch(n){case"before":o[0].beforeAll(a);break;case"after":o[0].afterAll(a);break;case"beforeEach":o[0].beforeEach(a);break;case"afterEach":o[0].afterEach(a);break;default:o[0].addTest(new r(n,a))}}else{var i=s.create(o[0],n);o.unshift(i),e(t[n]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suite=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.test=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.0.2",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Test=o("./test")}),require.register("reporters/base.js",function(t,e,o){function s(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,s.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var r=o("browser/tty"),i=r.isatty(1)&&r.isatty(2);e=t.exports=s,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var n=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:r.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=n("error title"," %s) %s: ")+n("error message","%s")+n("error stack","\n%s\n"),s=t.err.stack,r=s.indexOf("at"),i=s.slice(0,r);s=s.slice(r).replace(/^/gm," "),console.error(o,e,t.fullTitle(),i,s)})},s.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=n("bright fail"," ✖")+n("fail"," %d of %d tests failed")+n("light",":"),console.error(t,e.failures,e.tests),s.list(this.failures),console.error(),void process.nextTick(function(){process.exit(e.failures)})):(t=n("bright pass"," ✔")+n("green"," %d tests complete")+n("light"," (%dms)"),console.log(t,e.tests||0,e.duration),console.log(),void process.nextTick(function(){process.exit(0)}))}}),require.register("reporters/doc.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}i.call(this,t);var o=this.stats,s=(t.total,2);t.on("suite",function(t){t.root||(++s,console.log('%s
',e()),++s,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--s,console.log("%s
",e()),--s)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=n.escape(r(t.fn.toString()));console.log("%s
%s
",e(),o)}),t.on("end",function(){process.exit(o.failures)})}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var i=o("./base"),n=o("../utils");e=t.exports=s}),require.register("reporters/dot.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,.75*r.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++s%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++s%o==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/html.js",function(t,e,o){function s(t){n.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),s=[o],c=$(u).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");s[0].append(e),s.unshift($("
")),e.append(s[0])}}),t.on("suite end",function(t){t.root||s.shift()}),t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var r=$('

'+t.title+"

");else if(t.pending)var r=$('

'+t.title+"

");else{var r=$('

'+t.title+"

"),n=t.err.stack||t.err,u=$('
'+n+"
");r.append(u)}if(r.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=a.escape(i(t.fn.toString())),f=$("
"+l+"
");f.appendTo(r).hide()}s[0].append(r)}),void t.on("end",function(){process.exit(e.failures)})):r("#mocha div missing, add it to your document")}function r(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var n=o("./base"),a=o("../utils");e=t.exports=s;var u='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function s(t){i.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.color}e=t.exports=s}),require.register("reporters/json.js",function(t,e,o){function s(t){var e=this;i.call(this,t);var o=[],s=[],n=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(r),failures:s.map(r),passes:n.map(r)};process.stdout.write(JSON.stringify(t),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.cursor,i.color}e=t.exports=s}),require.register("reporters/landing.js",function(t,e,o){function s(t){function e(){var t=Array(s).join("-");return" "+n("runway",t)}r.call(this,t);var o=this,s=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=n("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var o=-1==l?s*++f/a|0:l;t.failed&&(c=n("plane crash","✈"),l=o),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(n("runway",Array(o).join("⋅"))),u.write(c),u.write(n("runway",Array(s-o).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var r=o("./base"),i=r.cursor,n=r.color;e=t.exports=s,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/list.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+i("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/progress.js",function(t,e,o){function s(t,e){r.call(this,t);{var o=this,e=e||{},s=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=u++/a,o=s*t|0,r=s-o;process.stdout.write("\r"),process.stdout.write(n("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(n("progress",e.close)),e.verbose&&process.stdout.write(n("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var r=o("./base"),i=r.cursor,n=r.color;e=t.exports=s,r.colors.progress=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/spec.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}r.call(this,t);var o=this,s=(this.stats,0),n=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass",t.title+": "))}),t.on("pending",function(t){var o=e()+i("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+i("checkmark"," ✓")+i("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+i("fail"," %d) %s"),n++,t.title)}),t.on("end",o.epilogue.bind(o))}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/tap.js",function(t,e,o){function s(t){r.call(this,t);var e=this.stats,o=t.total,s=1;t.on("start",function(){console.log("%d..%d",1,o)}),t.on("test end",function(){++s}),t.on("pass",function(t){console.log("ok %d %s",s,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",s,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))}),t.on("end",function(){process.exit(e.failures)})}{var r=o("./base");r.cursor,r.color}e=t.exports=s}),require.register("runner.js",function(t,e,o){function s(t){var e=this;this.suite=t,this.total=t.total(),this.globals=Object.keys(global).concat(["errno"]),this.on("test end",function(t){e.checkGlobals(t)}),this.grep(/.*/)}var r=o("browser/events").EventEmitter,i=o("./test"),n=function(){};t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.grep=function(t){return this._grep=t,this},s.prototype.checkGlobals=function(t){var e=Object.keys(global).filter(function(t){return!~this.globals.indexOf(t)},this);this.globals=this.globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))},s.prototype.fail=function(t,e){t.failed=!0,this.emit("fail",t,e)},s.prototype.failHook=function(t,e){var o=new i(t+" hook",n);o.parent=this.suite,this.fail(o,e),this.emit("end"),process.exit(0)},s.prototype.hook=function(t,e){function o(t){var s=r[t];if(!s)return e();if(1!=s.length)try{s(),process.nextTick(function(){o(++t)})}catch(i){e(i)}else try{s(function(s){return s?e(s):void o(++t)})}catch(i){e(i)}}{var s=this.suite,r=(this.test,s[t+"Callbacks"]);r.length}process.nextTick(function(){o(0)})},s.prototype.hooks=function(t,e,o){function s(n){return r.suite=n,n?void r.hook(t,function(t){return t?(r.suite=i,o(t)):void s(e.pop())}):(r.suite=i,o())}var r=this,i=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},s.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,o=this;if(e.async)try{return e.run(function(s){return e.finished?void o.fail(e,new Error("done() called multiple times")):void t(s)})}catch(s){t(s)}process.nextTick(function(){try{e.run(),t()}catch(o){t(o)}})},s.prototype.runTests=function(t,e){function o(t){return t&&(r.fail(s,t),r.emit("test end",s)),(s=i.shift())?r._grep.test(s.fullTitle())?s.pending?(r.emit("pending",s),r.emit("test end",s),o()):(r.emit("test",r.test=s),void r.hookDown("beforeEach",function(t){return t?r.failHook("beforeEach",t):void r.runTest(function(t){return t?o(t):(r.emit("pass",s),s.passed=!0,r.emit("test end",s),t?r.failHook("beforeEach",t):void r.hookUp("afterEach",function(t){return t?r.failHook("afterEach",t):void o()}))})})):o():e()}var s,r=this,i=t.tests;o()},s.prototype.runSuite=function(t,e){function o(){var e=t.suites[i++];return e?void r.runSuite(e,o):s()}function s(){r.suite=t,r.hook("afterAll",function(o){return o?r.failHook("afterAll",o):(r.emit("suite end",t),void e())})}var r=this,i=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(e){return e?r.failHook("beforeAll",e):void r.runTests(t,o)})},s.prototype.run=function(){var t=this;return this.emit("start"),this.runSuite(this.suite,function(){t.emit("end")}),process.on("uncaughtException",function(e){t.fail(t.test,e),t.emit("test end",t.test),t.emit("end")}),this}}),require.register("suite.js",function(t,e,o){function s(t){this.title=t,this.suites=[],this.tests=[],this.beforeAllCallbacks=[],this.beforeEachCallbacks=[],this.afterAllCallbacks=[],this.afterEachCallbacks=[],this.root=!t}var r=o("browser/events").EventEmitter;e=t.exports=s;var i={};e.create=function(t,e){var o=new s(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},s.prototype=new r,s.prototype.constructor=s,s.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},s.prototype.beforeAll=function(t){return this.beforeAllCallbacks.push(t),this.emit("beforeAll",t),this},s.prototype.afterAll=function(t){return this.afterAllCallbacks.push(t),this.emit("afterAll",t),this},s.prototype.beforeEach=function(t){return this.beforeEachCallbacks.push(t),this.emit("beforeEach",t),this},s.prototype.afterEach=function(t){return this.afterEachCallbacks.push(t),this.emit("afterEach",t),this},s.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t){function e(t,e){this.title=t,this.fn=e,this.pending=!e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}t.exports=e,e.prototype.timeout=function(t){return this._timeout=t,this},e.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},e.prototype.run=function(t){var e,o=this,s=this._timeout,r=new Date;this.async&&(e=setTimeout(function(){t(new Error("timeout of "+s+"ms exceeded"))},s)),this.async?this.fn(function(s){clearTimeout(e),o.duration=new Date-r,t(s),o.finished=!0}):(this.pending||this.fn(),this.duration=new Date-r)}}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),process={},process.nextTick=function(t){setTimeout(t,0)},process.on=function(){},process.exit=function(){},process.stdout={},global=this,mocha=require("mocha"),function(){var t=new mocha.Suite,e=mocha.reporters.HTML;mocha.setup=function(e){if(e=mocha.interfaces[e],!e)throw new Error('invalid mocha interface "'+e+'"');e(t),t.emit("pre-require",global)},mocha.run=function(){t.emit("run");{var o=new mocha.Runner(t);new e(o)}o.run()}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.4/mocha.min.css b/ajax/libs/mocha/0.0.4/mocha.min.css new file mode 100644 index 000000000..b307d8ff1 --- /dev/null +++ b/ajax/libs/mocha/0.0.4/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'◦';font-size:12px;display:block;float:left;margin-right:5px}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.4/mocha.min.js b/ajax/libs/mocha/0.0.4/mocha.min.js new file mode 100644 index 000000000..5f4aa9a9a --- /dev/null +++ b/ajax/libs/mocha/0.0.4/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",s=t+"/index.js";return require.modules[o]&&o||require.modules[s]&&s||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),s=e.split("/");o.pop();for(var r=0;rr;++r)o[r].apply(this,e);return this}}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("interfaces/bdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.it=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){function e(t){var i;for(var n in t)if("function"==typeof t[n]){var a=t[n];switch(n){case"before":o[0].beforeAll(a);break;case"after":o[0].afterAll(a);break;case"beforeEach":o[0].beforeEach(a);break;case"afterEach":o[0].afterEach(a);break;default:o[0].addTest(new r(n,a))}}else{var i=s.create(o[0],n);o.unshift(i),e(t[n]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suite=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.test=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.0.2",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Test=o("./test")}),require.register("reporters/base.js",function(t,e,o){function s(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,s.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var r=o("browser/tty"),i=r.isatty(1)&&r.isatty(2);e=t.exports=s,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var n=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:r.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=n("error title"," %s) %s: ")+n("error message","%s")+n("error stack","\n%s\n"),s=t.err.stack,r=s.indexOf("at"),i=s.slice(0,r);s=s.slice(r).replace(/^/gm," "),console.error(o,e,t.fullTitle(),i,s)})},s.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=n("bright fail"," ✖")+n("fail"," %d of %d tests failed")+n("light",":"),console.error(t,e.failures,e.tests),s.list(this.failures),console.error(),void process.nextTick(function(){process.exit(e.failures)})):(t=n("bright pass"," ✔")+n("green"," %d tests complete")+n("light"," (%dms)"),console.log(t,e.tests||0,e.duration),console.log(),void process.nextTick(function(){process.exit(0)}))}}),require.register("reporters/doc.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}i.call(this,t);var o=this.stats,s=(t.total,2);t.on("suite",function(t){t.root||(++s,console.log('%s
',e()),++s,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--s,console.log("%s
",e()),--s)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=n.escape(r(t.fn.toString()));console.log("%s
%s
",e(),o)}),t.on("end",function(){process.exit(o.failures)})}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var i=o("./base"),n=o("../utils");e=t.exports=s}),require.register("reporters/dot.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,.75*r.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++s%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++s%o==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/html.js",function(t,e,o){function s(t){n.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),s=[o],c=$(u).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");s[0].append(e),s.unshift($("
")),e.append(s[0])}}),t.on("suite end",function(t){t.root||s.shift()}),t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var r=$('

'+t.title+"

");else if(t.pending)var r=$('

'+t.title+"

");else{var r=$('

'+t.title+"

"),n=t.err.stack||t.err,u=$('
'+n+"
");r.append(u)}if(r.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=a.escape(i(t.fn.toString())),f=$("
"+l+"
");f.appendTo(r).hide()}s[0].append(r)}),void t.on("end",function(){process.exit(e.failures)})):r("#mocha div missing, add it to your document")}function r(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var n=o("./base"),a=o("../utils");e=t.exports=s;var u='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function s(t){i.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.color}e=t.exports=s}),require.register("reporters/json.js",function(t,e,o){function s(t){var e=this;i.call(this,t);var o=[],s=[],n=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(r),failures:s.map(r),passes:n.map(r)};process.stdout.write(JSON.stringify(t),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.cursor,i.color}e=t.exports=s}),require.register("reporters/landing.js",function(t,e,o){function s(t){function e(){var t=Array(s).join("-");return" "+n("runway",t)}r.call(this,t);var o=this,s=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=n("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var o=-1==l?s*++f/a|0:l;t.failed&&(c=n("plane crash","✈"),l=o),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(n("runway",Array(o).join("⋅"))),u.write(c),u.write(n("runway",Array(s-o).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var r=o("./base"),i=r.cursor,n=r.color;e=t.exports=s,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/list.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+i("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/progress.js",function(t,e,o){function s(t,e){r.call(this,t);{var o=this,e=e||{},s=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=u++/a,o=s*t|0,r=s-o;process.stdout.write("\r"),process.stdout.write(n("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(n("progress",e.close)),e.verbose&&process.stdout.write(n("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var r=o("./base"),i=r.cursor,n=r.color;e=t.exports=s,r.colors.progress=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/spec.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}r.call(this,t);var o=this,s=(this.stats,0),n=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass",t.title+": "))}),t.on("pending",function(t){var o=e()+i("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+i("checkmark"," ✓")+i("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+i("fail"," %d) %s"),n++,t.title)}),t.on("end",o.epilogue.bind(o))}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/tap.js",function(t,e,o){function s(t){r.call(this,t);var e=this.stats,o=t.total,s=1;t.on("start",function(){console.log("%d..%d",1,o)}),t.on("test end",function(){++s}),t.on("pass",function(t){console.log("ok %d %s",s,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",s,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))}),t.on("end",function(){process.exit(e.failures)})}{var r=o("./base");r.cursor,r.color}e=t.exports=s}),require.register("runner.js",function(t,e,o){function s(t){var e=this;this.suite=t,this.total=t.total(),this.globals=Object.keys(global).concat(["errno"]),this.on("test end",function(t){e.checkGlobals(t)}),this.grep(/.*/)}var r=o("browser/events").EventEmitter,i=o("./test"),n=function(){};t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.grep=function(t){return this._grep=t,this},s.prototype.checkGlobals=function(t){var e=Object.keys(global).filter(function(t){return!~this.globals.indexOf(t)},this);this.globals=this.globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))},s.prototype.fail=function(t,e){t.failed=!0,this.emit("fail",t,e)},s.prototype.failHook=function(t,e){var o=new i(t+" hook",n);o.parent=this.suite,this.fail(o,e),this.emit("end"),process.exit(0)},s.prototype.hook=function(t,e){function o(t){var s=r[t];if(!s)return e();if(1!=s.length)try{s(),process.nextTick(function(){o(++t)})}catch(i){e(i)}else try{s(function(s){return s?e(s):void o(++t)})}catch(i){e(i)}}{var s=this.suite,r=(this.test,s[t+"Callbacks"]);r.length}process.nextTick(function(){o(0)})},s.prototype.hooks=function(t,e,o){function s(n){return r.suite=n,n?void r.hook(t,function(t){return t?(r.suite=i,o(t)):void s(e.pop())}):(r.suite=i,o())}var r=this,i=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},s.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,o=this;if(e.async)try{return e.run(function(s){return e.finished?void o.fail(e,new Error("done() called multiple times")):void t(s)})}catch(s){t(s)}process.nextTick(function(){try{e.run(),t()}catch(o){t(o)}})},s.prototype.runTests=function(t,e){function o(t){return t&&(r.fail(s,t),r.emit("test end",s)),(s=i.shift())?r._grep.test(s.fullTitle())?s.pending?(r.emit("pending",s),r.emit("test end",s),o()):(r.emit("test",r.test=s),void r.hookDown("beforeEach",function(t){return t?r.failHook("beforeEach",t):void r.runTest(function(t){return t?o(t):(r.emit("pass",s),s.passed=!0,r.emit("test end",s),t?r.failHook("beforeEach",t):void r.hookUp("afterEach",function(t){return t?r.failHook("afterEach",t):void o()}))})})):o():e()}var s,r=this,i=t.tests;o()},s.prototype.runSuite=function(t,e){function o(){var e=t.suites[i++];return e?void r.runSuite(e,o):s()}function s(){r.suite=t,r.hook("afterAll",function(o){return o?r.failHook("afterAll",o):(r.emit("suite end",t),void e())})}var r=this,i=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(e){return e?r.failHook("beforeAll",e):void r.runTests(t,o)})},s.prototype.run=function(){var t=this;return this.emit("start"),this.runSuite(this.suite,function(){t.emit("end")}),process.on("uncaughtException",function(e){t.fail(t.test,e),t.emit("test end",t.test),t.emit("end")}),this}}),require.register("suite.js",function(t,e,o){function s(t){this.title=t,this.suites=[],this.tests=[],this.beforeAllCallbacks=[],this.beforeEachCallbacks=[],this.afterAllCallbacks=[],this.afterEachCallbacks=[],this.root=!t}var r=o("browser/events").EventEmitter;e=t.exports=s;var i={};e.create=function(t,e){var o=new s(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},s.prototype=new r,s.prototype.constructor=s,s.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},s.prototype.beforeAll=function(t){return this.beforeAllCallbacks.push(t),this.emit("beforeAll",t),this},s.prototype.afterAll=function(t){return this.afterAllCallbacks.push(t),this.emit("afterAll",t),this},s.prototype.beforeEach=function(t){return this.beforeEachCallbacks.push(t),this.emit("beforeEach",t),this},s.prototype.afterEach=function(t){return this.afterEachCallbacks.push(t),this.emit("afterEach",t),this},s.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t){function e(t,e){this.title=t,this.fn=e,this.pending=!e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}t.exports=e,e.prototype.timeout=function(t){return this._timeout=t,this},e.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},e.prototype.run=function(t){var e,o=this,s=this._timeout,r=new Date;this.async&&(e=setTimeout(function(){t(new Error("timeout of "+s+"ms exceeded"))},s)),this.async?this.fn(function(s){clearTimeout(e),o.duration=new Date-r,t(s),o.finished=!0}):(this.pending||this.fn(),this.duration=new Date-r)}}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),process={},process.nextTick=function(t){setTimeout(t,0)},process.on=function(){},process.exit=function(){},process.stdout={},global=this,mocha=require("mocha"),function(){var t=new mocha.Suite,e=mocha.reporters.HTML;mocha.setup=function(e){if(e=mocha.interfaces[e],!e)throw new Error('invalid mocha interface "'+e+'"');e(t),t.emit("pre-require",global)},mocha.run=function(){t.emit("run");{var o=new mocha.Runner(t);new e(o)}o.run()}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.5/mocha.min.css b/ajax/libs/mocha/0.0.5/mocha.min.css new file mode 100644 index 000000000..b307d8ff1 --- /dev/null +++ b/ajax/libs/mocha/0.0.5/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'◦';font-size:12px;display:block;float:left;margin-right:5px}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.5/mocha.min.js b/ajax/libs/mocha/0.0.5/mocha.min.js new file mode 100644 index 000000000..5f4aa9a9a --- /dev/null +++ b/ajax/libs/mocha/0.0.5/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",s=t+"/index.js";return require.modules[o]&&o||require.modules[s]&&s||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),s=e.split("/");o.pop();for(var r=0;rr;++r)o[r].apply(this,e);return this}}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("interfaces/bdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.it=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){function e(t){var i;for(var n in t)if("function"==typeof t[n]){var a=t[n];switch(n){case"before":o[0].beforeAll(a);break;case"after":o[0].afterAll(a);break;case"beforeEach":o[0].beforeEach(a);break;case"afterEach":o[0].afterEach(a);break;default:o[0].addTest(new r(n,a))}}else{var i=s.create(o[0],n);o.unshift(i),e(t[n]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suite=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.test=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.0.2",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Test=o("./test")}),require.register("reporters/base.js",function(t,e,o){function s(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,s.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var r=o("browser/tty"),i=r.isatty(1)&&r.isatty(2);e=t.exports=s,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var n=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:r.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=n("error title"," %s) %s: ")+n("error message","%s")+n("error stack","\n%s\n"),s=t.err.stack,r=s.indexOf("at"),i=s.slice(0,r);s=s.slice(r).replace(/^/gm," "),console.error(o,e,t.fullTitle(),i,s)})},s.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=n("bright fail"," ✖")+n("fail"," %d of %d tests failed")+n("light",":"),console.error(t,e.failures,e.tests),s.list(this.failures),console.error(),void process.nextTick(function(){process.exit(e.failures)})):(t=n("bright pass"," ✔")+n("green"," %d tests complete")+n("light"," (%dms)"),console.log(t,e.tests||0,e.duration),console.log(),void process.nextTick(function(){process.exit(0)}))}}),require.register("reporters/doc.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}i.call(this,t);var o=this.stats,s=(t.total,2);t.on("suite",function(t){t.root||(++s,console.log('%s
',e()),++s,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--s,console.log("%s
",e()),--s)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=n.escape(r(t.fn.toString()));console.log("%s
%s
",e(),o)}),t.on("end",function(){process.exit(o.failures)})}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var i=o("./base"),n=o("../utils");e=t.exports=s}),require.register("reporters/dot.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,.75*r.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++s%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++s%o==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/html.js",function(t,e,o){function s(t){n.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),s=[o],c=$(u).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");s[0].append(e),s.unshift($("
")),e.append(s[0])}}),t.on("suite end",function(t){t.root||s.shift()}),t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var r=$('

'+t.title+"

");else if(t.pending)var r=$('

'+t.title+"

");else{var r=$('

'+t.title+"

"),n=t.err.stack||t.err,u=$('
'+n+"
");r.append(u)}if(r.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=a.escape(i(t.fn.toString())),f=$("
"+l+"
");f.appendTo(r).hide()}s[0].append(r)}),void t.on("end",function(){process.exit(e.failures)})):r("#mocha div missing, add it to your document")}function r(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var n=o("./base"),a=o("../utils");e=t.exports=s;var u='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function s(t){i.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.color}e=t.exports=s}),require.register("reporters/json.js",function(t,e,o){function s(t){var e=this;i.call(this,t);var o=[],s=[],n=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(r),failures:s.map(r),passes:n.map(r)};process.stdout.write(JSON.stringify(t),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.cursor,i.color}e=t.exports=s}),require.register("reporters/landing.js",function(t,e,o){function s(t){function e(){var t=Array(s).join("-");return" "+n("runway",t)}r.call(this,t);var o=this,s=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=n("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var o=-1==l?s*++f/a|0:l;t.failed&&(c=n("plane crash","✈"),l=o),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(n("runway",Array(o).join("⋅"))),u.write(c),u.write(n("runway",Array(s-o).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var r=o("./base"),i=r.cursor,n=r.color;e=t.exports=s,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/list.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+i("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/progress.js",function(t,e,o){function s(t,e){r.call(this,t);{var o=this,e=e||{},s=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=u++/a,o=s*t|0,r=s-o;process.stdout.write("\r"),process.stdout.write(n("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(n("progress",e.close)),e.verbose&&process.stdout.write(n("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var r=o("./base"),i=r.cursor,n=r.color;e=t.exports=s,r.colors.progress=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/spec.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}r.call(this,t);var o=this,s=(this.stats,0),n=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass",t.title+": "))}),t.on("pending",function(t){var o=e()+i("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+i("checkmark"," ✓")+i("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+i("fail"," %d) %s"),n++,t.title)}),t.on("end",o.epilogue.bind(o))}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/tap.js",function(t,e,o){function s(t){r.call(this,t);var e=this.stats,o=t.total,s=1;t.on("start",function(){console.log("%d..%d",1,o)}),t.on("test end",function(){++s}),t.on("pass",function(t){console.log("ok %d %s",s,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",s,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))}),t.on("end",function(){process.exit(e.failures)})}{var r=o("./base");r.cursor,r.color}e=t.exports=s}),require.register("runner.js",function(t,e,o){function s(t){var e=this;this.suite=t,this.total=t.total(),this.globals=Object.keys(global).concat(["errno"]),this.on("test end",function(t){e.checkGlobals(t)}),this.grep(/.*/)}var r=o("browser/events").EventEmitter,i=o("./test"),n=function(){};t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.grep=function(t){return this._grep=t,this},s.prototype.checkGlobals=function(t){var e=Object.keys(global).filter(function(t){return!~this.globals.indexOf(t)},this);this.globals=this.globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))},s.prototype.fail=function(t,e){t.failed=!0,this.emit("fail",t,e)},s.prototype.failHook=function(t,e){var o=new i(t+" hook",n);o.parent=this.suite,this.fail(o,e),this.emit("end"),process.exit(0)},s.prototype.hook=function(t,e){function o(t){var s=r[t];if(!s)return e();if(1!=s.length)try{s(),process.nextTick(function(){o(++t)})}catch(i){e(i)}else try{s(function(s){return s?e(s):void o(++t)})}catch(i){e(i)}}{var s=this.suite,r=(this.test,s[t+"Callbacks"]);r.length}process.nextTick(function(){o(0)})},s.prototype.hooks=function(t,e,o){function s(n){return r.suite=n,n?void r.hook(t,function(t){return t?(r.suite=i,o(t)):void s(e.pop())}):(r.suite=i,o())}var r=this,i=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},s.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,o=this;if(e.async)try{return e.run(function(s){return e.finished?void o.fail(e,new Error("done() called multiple times")):void t(s)})}catch(s){t(s)}process.nextTick(function(){try{e.run(),t()}catch(o){t(o)}})},s.prototype.runTests=function(t,e){function o(t){return t&&(r.fail(s,t),r.emit("test end",s)),(s=i.shift())?r._grep.test(s.fullTitle())?s.pending?(r.emit("pending",s),r.emit("test end",s),o()):(r.emit("test",r.test=s),void r.hookDown("beforeEach",function(t){return t?r.failHook("beforeEach",t):void r.runTest(function(t){return t?o(t):(r.emit("pass",s),s.passed=!0,r.emit("test end",s),t?r.failHook("beforeEach",t):void r.hookUp("afterEach",function(t){return t?r.failHook("afterEach",t):void o()}))})})):o():e()}var s,r=this,i=t.tests;o()},s.prototype.runSuite=function(t,e){function o(){var e=t.suites[i++];return e?void r.runSuite(e,o):s()}function s(){r.suite=t,r.hook("afterAll",function(o){return o?r.failHook("afterAll",o):(r.emit("suite end",t),void e())})}var r=this,i=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(e){return e?r.failHook("beforeAll",e):void r.runTests(t,o)})},s.prototype.run=function(){var t=this;return this.emit("start"),this.runSuite(this.suite,function(){t.emit("end")}),process.on("uncaughtException",function(e){t.fail(t.test,e),t.emit("test end",t.test),t.emit("end")}),this}}),require.register("suite.js",function(t,e,o){function s(t){this.title=t,this.suites=[],this.tests=[],this.beforeAllCallbacks=[],this.beforeEachCallbacks=[],this.afterAllCallbacks=[],this.afterEachCallbacks=[],this.root=!t}var r=o("browser/events").EventEmitter;e=t.exports=s;var i={};e.create=function(t,e){var o=new s(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},s.prototype=new r,s.prototype.constructor=s,s.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},s.prototype.beforeAll=function(t){return this.beforeAllCallbacks.push(t),this.emit("beforeAll",t),this},s.prototype.afterAll=function(t){return this.afterAllCallbacks.push(t),this.emit("afterAll",t),this},s.prototype.beforeEach=function(t){return this.beforeEachCallbacks.push(t),this.emit("beforeEach",t),this},s.prototype.afterEach=function(t){return this.afterEachCallbacks.push(t),this.emit("afterEach",t),this},s.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t){function e(t,e){this.title=t,this.fn=e,this.pending=!e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}t.exports=e,e.prototype.timeout=function(t){return this._timeout=t,this},e.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},e.prototype.run=function(t){var e,o=this,s=this._timeout,r=new Date;this.async&&(e=setTimeout(function(){t(new Error("timeout of "+s+"ms exceeded"))},s)),this.async?this.fn(function(s){clearTimeout(e),o.duration=new Date-r,t(s),o.finished=!0}):(this.pending||this.fn(),this.duration=new Date-r)}}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),process={},process.nextTick=function(t){setTimeout(t,0)},process.on=function(){},process.exit=function(){},process.stdout={},global=this,mocha=require("mocha"),function(){var t=new mocha.Suite,e=mocha.reporters.HTML;mocha.setup=function(e){if(e=mocha.interfaces[e],!e)throw new Error('invalid mocha interface "'+e+'"');e(t),t.emit("pre-require",global)},mocha.run=function(){t.emit("run");{var o=new mocha.Runner(t);new e(o)}o.run()}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.6/mocha.min.css b/ajax/libs/mocha/0.0.6/mocha.min.css new file mode 100644 index 000000000..b307d8ff1 --- /dev/null +++ b/ajax/libs/mocha/0.0.6/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'◦';font-size:12px;display:block;float:left;margin-right:5px}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.6/mocha.min.js b/ajax/libs/mocha/0.0.6/mocha.min.js new file mode 100644 index 000000000..72e7af5ab --- /dev/null +++ b/ajax/libs/mocha/0.0.6/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",s=t+"/index.js";return require.modules[o]&&o||require.modules[s]&&s||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),s=e.split("/");o.pop();for(var r=0;rr;++r)o[r].apply(this,e);return this}}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("interfaces/bdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.it=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){function e(t){var i;for(var n in t)if("function"==typeof t[n]){var u=t[n];switch(n){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new r(n,u))}}else{var i=s.create(o[0],n);o.unshift(i),e(t[n]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var s=o("../suite"),r=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suite=function(t,o){var r=s.create(e[0],t);e.unshift(r),o(),e.shift()},t.test=function(t,o){e[0].addTest(new r(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.0.5",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Test=o("./test")}),require.register("reporters/base.js",function(t,e,o){function s(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,s.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var r=o("browser/tty"),i=r.isatty(1)&&r.isatty(2);e=t.exports=s,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var n=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:r.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=n("error title"," %s) %s:\n")+n("error message"," %s")+n("error stack","\n%s\n"),s=t.err.stack,r=s.indexOf("at"),i=s.slice(0,r);s=s.slice(r).replace(/^/gm," "),console.error(o,e,t.fullTitle(),i,s)})},s.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=n("bright fail"," ✖")+n("fail"," %d of %d tests failed")+n("light",":"),console.error(t,e.failures,e.tests),s.list(this.failures),console.error(),void process.nextTick(function(){process.exit(e.failures)})):(t=n("bright pass"," ✔")+n("green"," %d tests complete")+n("light"," (%dms)"),console.log(t,e.tests||0,e.duration),console.log(),void process.nextTick(function(){process.exit(0)}))}}),require.register("reporters/doc.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}i.call(this,t);var o=this.stats,s=(t.total,2);t.on("suite",function(t){t.root||(++s,console.log('%s
',e()),++s,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--s,console.log("%s
",e()),--s)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=n.escape(r(t.fn.toString()));console.log("%s
%s
",e(),o)}),t.on("end",function(){process.exit(o.failures)})}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var i=o("./base"),n=o("../utils");e=t.exports=s}),require.register("reporters/dot.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,.75*r.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++s%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++s%o==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/html.js",function(t,e,o){function s(t){n.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),s=[o],c=$(a).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");s[0].append(e),s.unshift($("
")),e.append(s[0])}}),t.on("suite end",function(t){t.root||s.shift()}),t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var r=$('

'+t.title+"

");else if(t.pending)var r=$('

'+t.title+"

");else{var r=$('

'+t.title+"

"),n=t.err.stack||t.err,a=$('
'+n+"
");r.append(a)}if(r.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=u.escape(i(t.fn.toString())),f=$("
"+l+"
");f.appendTo(r).hide()}s[0].append(r)}),void t.on("end",function(){process.exit(e.failures)})):r("#mocha div missing, add it to your document")}function r(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var n=o("./base"),u=o("../utils");e=t.exports=s;var a='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function s(t){i.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.color}e=t.exports=s}),require.register("reporters/json.js",function(t,e,o){function s(t){var e=this;i.call(this,t);var o=[],s=[],n=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(r),failures:s.map(r),passes:n.map(r)};process.stdout.write(JSON.stringify(t),function(){process.exit(0)})})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.cursor,i.color}e=t.exports=s}),require.register("reporters/landing.js",function(t,e,o){function s(t){function e(){var t=Array(s).join("-");return" "+n("runway",t)}r.call(this,t);var o=this,s=(this.stats,.75*r.window.width|0),u=t.total,a=process.stdout,c=n("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),i.hide()}),t.on("test end",function(t){var o=-1==l?s*++f/u|0:l;t.failed&&(c=n("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(n("runway",Array(o).join("⋅"))),a.write(c),a.write(n("runway",Array(s-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var r=o("./base"),i=r.cursor,n=r.color;e=t.exports=s,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/list.js",function(t,e,o){function s(t){r.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+i("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/progress.js",function(t,e,o){function s(t,e){r.call(this,t);{var o=this,e=e||{},s=(this.stats,.5*r.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=a++/u,o=s*t|0,r=s-o;process.stdout.write("\r"),process.stdout.write(n("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(n("progress",e.close)),e.verbose&&process.stdout.write(n("progress"," "+a+" of "+u))}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var r=o("./base"),i=r.cursor,n=r.color;e=t.exports=s,r.colors.progress=90,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/spec.js",function(t,e,o){function s(t){function e(){return Array(s).join(" ")}r.call(this,t);var o=this,s=(this.stats,0),n=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass",t.title+": "))}),t.on("pending",function(t){var o=e()+i("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+i("checkmark"," ✓")+i("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+i("fail"," %d) %s"),n++,t.title)}),t.on("end",o.epilogue.bind(o))}var r=o("./base"),i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),require.register("reporters/tap.js",function(t,e,o){function s(t){r.call(this,t);var e=this.stats,o=t.total,s=1;t.on("start",function(){console.log("%d..%d",1,o)}),t.on("test end",function(){++s}),t.on("pass",function(t){console.log("ok %d %s",s,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",s,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))}),t.on("end",function(){process.exit(e.failures)})}{var r=o("./base");r.cursor,r.color}e=t.exports=s}),require.register("runner.js",function(t,e,o){function s(t){var e=this;this.suite=t,this.total=t.total(),this.globals=Object.keys(global).concat(["errno"]),this.on("test end",function(t){e.checkGlobals(t)}),this.grep(/.*/)}var r=o("browser/events").EventEmitter,i=o("./test"),n=function(){};t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.grep=function(t){return this._grep=t,this},s.prototype.checkGlobals=function(t){var e=Object.keys(global).filter(function(t){return!~this.globals.indexOf(t)},this);this.globals=this.globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))},s.prototype.fail=function(t,e){t.failed=!0,this.emit("fail",t,e)},s.prototype.failHook=function(t,e){var o=new i(t+" hook",n);o.parent=this.suite,this.fail(o,e),this.emit("end"),process.exit(0)},s.prototype.hook=function(t,e){function o(t){var r=i[t];if(!r)return e();if(1!=r.length)try{r(),process.nextTick(function(){o(++t)})}catch(u){e(u)}else{s=setTimeout(function(){e(new Error("timeout of "+n+"ms exceeded"))},n);try{r(function(r){return clearTimeout(s),r?e(r):void o(++t)})}catch(u){e(u)}}}var s,r=this.suite,i=r[t+"Callbacks"],n=r._timeout;process.nextTick(function(){o(0)})},s.prototype.hooks=function(t,e,o){function s(n){return r.suite=n,n?void r.hook(t,function(t){return t?(r.suite=i,o(t)):void s(e.pop())}):(r.suite=i,o())}var r=this,i=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},s.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,o=this;if(e.async)try{e.run(function(s){return e.finished?void o.fail(e,new Error("done() called multiple times")):void t(s)})}catch(s){t(s)}else process.nextTick(function(){try{e.run(),t()}catch(o){t(o)}})},s.prototype.runTests=function(t,e){function o(t){return t&&(r.fail(s,t),r.emit("test end",s)),(s=i.shift())?r._grep.test(s.fullTitle())?s.pending?(r.emit("pending",s),r.emit("test end",s),o()):(r.emit("test",r.test=s),void r.hookDown("beforeEach",function(t){return t?r.failHook("beforeEach",t):void r.runTest(function(t){return t?o(t):(r.emit("pass",s),s.passed=!0,r.emit("test end",s),t?r.failHook("beforeEach",t):void r.hookUp("afterEach",function(t){return t?r.failHook("afterEach",t):void o()}))})})):o():e()}var s,r=this,i=t.tests;o()},s.prototype.runSuite=function(t,e){function o(){var e=t.suites[i++];return e?void r.runSuite(e,o):s()}function s(){r.suite=t,r.hook("afterAll",function(o){return o?r.failHook("afterAll",o):(r.emit("suite end",t),void e())})}var r=this,i=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(e){return e?r.failHook("beforeAll",e):void r.runTests(t,o)})},s.prototype.run=function(){var t=this;return this.emit("start"),this.runSuite(this.suite,function(){t.emit("end")}),process.on("uncaughtException",function(e){t.fail(t.test,e),t.emit("test end",t.test),t.emit("end")}),this}}),require.register("suite.js",function(t,e,o){function s(t){this.title=t,this.suites=[],this.tests=[],this.beforeAllCallbacks=[],this.beforeEachCallbacks=[],this.afterAllCallbacks=[],this.afterEachCallbacks=[],this.root=!t,this.timeout(2e3)}var r=o("browser/events").EventEmitter;e=t.exports=s;var i={};e.create=function(t,e){var o=new s(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},s.prototype=new r,s.prototype.constructor=s,s.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},s.prototype.beforeAll=function(t){return this.beforeAllCallbacks.push(t),this.emit("beforeAll",t),this},s.prototype.afterAll=function(t){return this.afterAllCallbacks.push(t),this.emit("afterAll",t),this},s.prototype.beforeEach=function(t){return this.beforeEachCallbacks.push(t),this.emit("beforeEach",t),this},s.prototype.afterEach=function(t){return this.afterEachCallbacks.push(t),this.emit("afterEach",t),this},s.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t){function e(t,e){this.title=t,this.fn=e,this.pending=!e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}t.exports=e,e.prototype.timeout=function(t){return this._timeout=t,this},e.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},e.prototype.run=function(t){var e,o=this,s=this._timeout,r=new Date;this.async&&(e=setTimeout(function(){t(new Error("timeout of "+s+"ms exceeded"))},s)),this.async?this.fn(function(s){clearTimeout(e),o.duration=new Date-r,t(s),o.finished=!0}):(this.pending||this.fn(),this.duration=new Date-r)}}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),process={},process.nextTick=function(t){setTimeout(t,0)},process.on=function(){},process.exit=function(){},process.stdout={},global=this,mocha=require("mocha"),function(){var t=new mocha.Suite,e=mocha.reporters.HTML;mocha.setup=function(e){if(e=mocha.interfaces[e],!e)throw new Error('invalid mocha interface "'+e+'"');e(t),t.emit("pre-require",global)},mocha.run=function(){t.emit("run");{var o=new mocha.Runner(t);new e(o)}o.run()}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.7/mocha.min.css b/ajax/libs/mocha/0.0.7/mocha.min.css new file mode 100644 index 000000000..b307d8ff1 --- /dev/null +++ b/ajax/libs/mocha/0.0.7/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'◦';font-size:12px;display:block;float:left;margin-right:5px}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.7/mocha.min.js b/ajax/libs/mocha/0.0.7/mocha.min.js new file mode 100644 index 000000000..58b9f70e6 --- /dev/null +++ b/ajax/libs/mocha/0.0.7/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",r=t+"/index.js";return require.modules[o]&&o||require.modules[r]&&r||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),r=e.split("/");o.pop();for(var s=0;ss;++s)o[s].apply(this,e);return this}}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("hook.js",function(t,e,o){function r(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("interfaces/bdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var n;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new s(i,u))}}else{var n=r.create(o[0],i);o.unshift(n),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suite=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.0.6",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test")}),require.register("reporters/base.js",function(t,e,o){function r(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},r=this.failures=[];t&&(t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var r=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>r?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,r.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),n=s.isatty(1)&&s.isatty(2);e=t.exports=r,e.useColors=n,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:n?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),r=t.err.stack,s=r.indexOf("at"),n=r.slice(0,s);r=r.slice(s).replace(/^/gm," "),console.error(o,e,t.fullTitle(),n,r)})},r.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,e.tests),r.list(this.failures),console.error(),void process.nextTick(function(){process.exit(e.failures)})):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),console.log(),void process.nextTick(function(){process.exit(0)}))}}),require.register("reporters/doc.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}n.call(this,t);var o=this.stats,r=(t.total,2);t.on("suite",function(t){t.root||(++r,console.log('%s
',e()),++r,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--r,console.log("%s
",e()),--r)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)}),t.on("end",function(){process.exit(o.failures)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var n=o("./base"),i=o("../utils");e=t.exports=r}),require.register("reporters/dot.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(n("pending","."))}),t.on("pass",function(t){++r%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?n("bright yellow","."):n(t.speed,"."))}),t.on("fail",function(){++r%o==0&&process.stdout.write("\n "),process.stdout.write(n("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/html.js",function(t,e,o){function r(t){i.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),r=[o],c=$(a).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");r[0].append(e),r.unshift($("
")),e.append(r[0])}}),t.on("suite end",function(t){t.root||r.shift()}),t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var s=$('

'+t.title+"

");else if(t.pending)var s=$('

'+t.title+"

");else{var s=$('

'+t.title+"

"),i=t.err.stack||t.err,a=$('
'+i+"
");s.append(a)}if(s.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=u.escape(n(t.fn.toString())),f=$("
"+l+"
");f.appendTo(s).hide()}r[0].append(s)}),void t.on("end",function(){process.exit(e.failures)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),u=o("../utils");e=t.exports=r;var a='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function r(t){n.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]),function(){process.exit(0)})})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.color}e=t.exports=r}),require.register("reporters/json.js",function(t,e,o){function r(t){var e=this;n.call(this,t);var o=[],r=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:r.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t),function(){process.exit(0)})})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.cursor,n.color}e=t.exports=r}),require.register("reporters/landing.js",function(t,e,o){function r(t){function e(){var t=Array(r).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,r=(this.stats,.75*s.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),n.hide()}),t.on("test end",function(t){var o=-1==l?r*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(r-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/list.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(n("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=n("checkmark"," -")+n("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=n("checkmark"," ✓")+n("pass"," %s: ")+n(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+n("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/progress.js",function(t,e,o){function r(t,e){s.call(this,t);{var o=this,e=e||{},r=(this.stats,.5*s.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),n.hide()}),t.on("test end",function(){var t=a++/u,o=r*t|0,s=r-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.progress=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/spec.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}s.call(this,t);var o=this,r=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(n("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("test",function(t){process.stdout.write(e()+n("pass",t.title+": "))}),t.on("pending",function(t){var o=e()+n("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+n("checkmark"," ✓")+n("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+n("checkmark"," ✓")+n("pass"," %s ")+n(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+n("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/tap.js",function(t,e,o){function r(t){s.call(this,t);var e=this.stats,o=t.total,r=1;t.on("start",function(){console.log("%d..%d",1,o)}),t.on("test end",function(){++r}),t.on("pass",function(t){console.log("ok %d %s",r,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",r,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))}),t.on("end",function(){process.exit(e.failures)})}{var s=o("./base");s.cursor,s.color}e=t.exports=r}),require.register("runnable.js",function(t,e,o){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}var s=o("browser/events").EventEmitter;t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(this._timeout=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function o(o){return r?e():(clearTimeout(n),i.duration=new Date-a,r=!0,void t(o))}var r,s,n,i=this,u=this._timeout,a=new Date;if(this.async&&(n=setTimeout(function(){t(new Error("timeout of "+u+"ms exceeded"))},u)),this.async)try{this.fn(o)}catch(c){o(c)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(c){t(c)}}}),require.register("runner.js",function(t,e,o){function r(t){var e=this;this.suite=t,this.total=t.total(),this.globals=Object.keys(global).concat(["errno"]),this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/)}{var s=o("browser/events").EventEmitter;o("./test")}t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.grep=function(t){return this._grep=t,this},r.prototype.checkGlobals=function(t){var e=Object.keys(global).filter(function(t){return!~this.globals.indexOf(t)},this);this.globals=this.globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))},r.prototype.fail=function(t,e){t.failed=!0,this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end"),process.exit(0)},r.prototype.hook=function(t,e){function o(t){var r=s[t];return r?(n.emit("hook",r),r.on("error",function(t){n.failHook(r,t)}),void r.run(function(e){return e?n.failHook(r,e):(n.emit("hook end",r),void o(++t))})):e()}var r=this.suite,s=r["_"+t],n=(r._timeout,this);process.nextTick(function(){o(0)})},r.prototype.hooks=function(t,e,o){function r(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=n,o(t)):void r(e.pop())}):(s.suite=n,o())}var s=this,n=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},r.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function o(t){return t&&(s.fail(r,t),s.emit("test end",r)),(r=n.shift())?s._grep.test(r.fullTitle())?r.pending?(s.emit("pending",r),s.emit("test end",r),o()):(s.emit("test",s.test=r),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?o(t):(s.emit("pass",r),r.passed=!0,s.emit("test end",r),void s.hookUp("afterEach",o))})})):o():e()}var r,s=this,n=t.tests;o()},r.prototype.runSuite=function(t,e){function o(){var e=t.suites[n++];return e?void s.runSuite(e,o):r()}function r(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,n=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},r.prototype.run=function(){var t=this;return this.emit("start"),this.runSuite(this.suite,function(){t.emit("end")}),process.on("uncaughtException",function(e){t.fail(t.test,e),t.emit("test end",t.test),t.emit("end")}),this}}),require.register("suite.js",function(t,e,o){function r(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this.timeout(2e3)}var s=o("browser/events").EventEmitter,n=o("./hook");e=t.exports=r;var i={};e.create=function(t,e){var o=new r(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},r.prototype.beforeAll=function(t){var e=new n('"before all" hook',t);return e.parent=this,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){var e=new n('"after all" hook',t);return e.parent=this,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){var e=new n('"before each" hook',t);return e.parent=this,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){var e=new n('"after each" hook',t);return e.parent=this,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t,e,o){function r(t,e){s.call(this,t,e),this.pending=!e}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),process={},process.nextTick=function(t){setTimeout(t,0)},process.on=function(){},process.exit=function(){},process.stdout={},global=this,mocha=require("mocha"),function(){var t=new mocha.Suite,e=mocha.reporters.HTML;mocha.setup=function(e){if(e=mocha.interfaces[e],!e)throw new Error('invalid mocha interface "'+e+'"');e(t),t.emit("pre-require",global)},mocha.run=function(){t.emit("run");{var o=new mocha.Runner(t);new e(o)}o.run()}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.8/mocha.min.css b/ajax/libs/mocha/0.0.8/mocha.min.css new file mode 100644 index 000000000..b307d8ff1 --- /dev/null +++ b/ajax/libs/mocha/0.0.8/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'◦';font-size:12px;display:block;float:left;margin-right:5px}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.0.8/mocha.min.js b/ajax/libs/mocha/0.0.8/mocha.min.js new file mode 100644 index 000000000..58b9f70e6 --- /dev/null +++ b/ajax/libs/mocha/0.0.8/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",r=t+"/index.js";return require.modules[o]&&o||require.modules[r]&&r||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),r=e.split("/");o.pop();for(var s=0;ss;++s)o[s].apply(this,e);return this}}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("hook.js",function(t,e,o){function r(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("interfaces/bdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var n;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new s(i,u))}}else{var n=r.create(o[0],i);o.unshift(n),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suite=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.0.6",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test")}),require.register("reporters/base.js",function(t,e,o){function r(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},r=this.failures=[];t&&(t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var r=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>r?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,r.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),n=s.isatty(1)&&s.isatty(2);e=t.exports=r,e.useColors=n,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:n?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),r=t.err.stack,s=r.indexOf("at"),n=r.slice(0,s);r=r.slice(s).replace(/^/gm," "),console.error(o,e,t.fullTitle(),n,r)})},r.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,e.tests),r.list(this.failures),console.error(),void process.nextTick(function(){process.exit(e.failures)})):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),console.log(),void process.nextTick(function(){process.exit(0)}))}}),require.register("reporters/doc.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}n.call(this,t);var o=this.stats,r=(t.total,2);t.on("suite",function(t){t.root||(++r,console.log('%s
',e()),++r,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--r,console.log("%s
",e()),--r)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)}),t.on("end",function(){process.exit(o.failures)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var n=o("./base"),i=o("../utils");e=t.exports=r}),require.register("reporters/dot.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(n("pending","."))}),t.on("pass",function(t){++r%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?n("bright yellow","."):n(t.speed,"."))}),t.on("fail",function(){++r%o==0&&process.stdout.write("\n "),process.stdout.write(n("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/html.js",function(t,e,o){function r(t){i.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),r=[o],c=$(a).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");r[0].append(e),r.unshift($("
")),e.append(r[0])}}),t.on("suite end",function(t){t.root||r.shift()}),t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var s=$('

'+t.title+"

");else if(t.pending)var s=$('

'+t.title+"

");else{var s=$('

'+t.title+"

"),i=t.err.stack||t.err,a=$('
'+i+"
");s.append(a)}if(s.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=u.escape(n(t.fn.toString())),f=$("
"+l+"
");f.appendTo(s).hide()}r[0].append(s)}),void t.on("end",function(){process.exit(e.failures)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),u=o("../utils");e=t.exports=r;var a='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function r(t){n.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]),function(){process.exit(0)})})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.color}e=t.exports=r}),require.register("reporters/json.js",function(t,e,o){function r(t){var e=this;n.call(this,t);var o=[],r=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:r.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t),function(){process.exit(0)})})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.cursor,n.color}e=t.exports=r}),require.register("reporters/landing.js",function(t,e,o){function r(t){function e(){var t=Array(r).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,r=(this.stats,.75*s.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),n.hide()}),t.on("test end",function(t){var o=-1==l?r*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(r-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/list.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(n("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=n("checkmark"," -")+n("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=n("checkmark"," ✓")+n("pass"," %s: ")+n(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+n("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/progress.js",function(t,e,o){function r(t,e){s.call(this,t);{var o=this,e=e||{},r=(this.stats,.5*s.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),n.hide()}),t.on("test end",function(){var t=a++/u,o=r*t|0,s=r-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.progress=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/spec.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}s.call(this,t);var o=this,r=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(n("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("test",function(t){process.stdout.write(e()+n("pass",t.title+": "))}),t.on("pending",function(t){var o=e()+n("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+n("checkmark"," ✓")+n("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+n("checkmark"," ✓")+n("pass"," %s ")+n(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+n("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/tap.js",function(t,e,o){function r(t){s.call(this,t);var e=this.stats,o=t.total,r=1;t.on("start",function(){console.log("%d..%d",1,o)}),t.on("test end",function(){++r}),t.on("pass",function(t){console.log("ok %d %s",r,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",r,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))}),t.on("end",function(){process.exit(e.failures)})}{var s=o("./base");s.cursor,s.color}e=t.exports=r}),require.register("runnable.js",function(t,e,o){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}var s=o("browser/events").EventEmitter;t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(this._timeout=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function o(o){return r?e():(clearTimeout(n),i.duration=new Date-a,r=!0,void t(o))}var r,s,n,i=this,u=this._timeout,a=new Date;if(this.async&&(n=setTimeout(function(){t(new Error("timeout of "+u+"ms exceeded"))},u)),this.async)try{this.fn(o)}catch(c){o(c)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(c){t(c)}}}),require.register("runner.js",function(t,e,o){function r(t){var e=this;this.suite=t,this.total=t.total(),this.globals=Object.keys(global).concat(["errno"]),this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/)}{var s=o("browser/events").EventEmitter;o("./test")}t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.grep=function(t){return this._grep=t,this},r.prototype.checkGlobals=function(t){var e=Object.keys(global).filter(function(t){return!~this.globals.indexOf(t)},this);this.globals=this.globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))},r.prototype.fail=function(t,e){t.failed=!0,this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end"),process.exit(0)},r.prototype.hook=function(t,e){function o(t){var r=s[t];return r?(n.emit("hook",r),r.on("error",function(t){n.failHook(r,t)}),void r.run(function(e){return e?n.failHook(r,e):(n.emit("hook end",r),void o(++t))})):e()}var r=this.suite,s=r["_"+t],n=(r._timeout,this);process.nextTick(function(){o(0)})},r.prototype.hooks=function(t,e,o){function r(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=n,o(t)):void r(e.pop())}):(s.suite=n,o())}var s=this,n=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},r.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function o(t){return t&&(s.fail(r,t),s.emit("test end",r)),(r=n.shift())?s._grep.test(r.fullTitle())?r.pending?(s.emit("pending",r),s.emit("test end",r),o()):(s.emit("test",s.test=r),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?o(t):(s.emit("pass",r),r.passed=!0,s.emit("test end",r),void s.hookUp("afterEach",o))})})):o():e()}var r,s=this,n=t.tests;o()},r.prototype.runSuite=function(t,e){function o(){var e=t.suites[n++];return e?void s.runSuite(e,o):r()}function r(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,n=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},r.prototype.run=function(){var t=this;return this.emit("start"),this.runSuite(this.suite,function(){t.emit("end")}),process.on("uncaughtException",function(e){t.fail(t.test,e),t.emit("test end",t.test),t.emit("end")}),this}}),require.register("suite.js",function(t,e,o){function r(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this.timeout(2e3)}var s=o("browser/events").EventEmitter,n=o("./hook");e=t.exports=r;var i={};e.create=function(t,e){var o=new r(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},r.prototype.beforeAll=function(t){var e=new n('"before all" hook',t);return e.parent=this,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){var e=new n('"after all" hook',t);return e.parent=this,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){var e=new n('"before each" hook',t);return e.parent=this,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){var e=new n('"after each" hook',t);return e.parent=this,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t,e,o){function r(t,e){s.call(this,t,e),this.pending=!e}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),process={},process.nextTick=function(t){setTimeout(t,0)},process.on=function(){},process.exit=function(){},process.stdout={},global=this,mocha=require("mocha"),function(){var t=new mocha.Suite,e=mocha.reporters.HTML;mocha.setup=function(e){if(e=mocha.interfaces[e],!e)throw new Error('invalid mocha interface "'+e+'"');e(t),t.emit("pre-require",global)},mocha.run=function(){t.emit("run");{var o=new mocha.Runner(t);new e(o)}o.run()}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.1.0/mocha.min.css b/ajax/libs/mocha/0.1.0/mocha.min.css new file mode 100644 index 000000000..b307d8ff1 --- /dev/null +++ b/ajax/libs/mocha/0.1.0/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'◦';font-size:12px;display:block;float:left;margin-right:5px}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.1.0/mocha.min.js b/ajax/libs/mocha/0.1.0/mocha.min.js new file mode 100644 index 000000000..58b9f70e6 --- /dev/null +++ b/ajax/libs/mocha/0.1.0/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",r=t+"/index.js";return require.modules[o]&&o||require.modules[r]&&r||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),r=e.split("/");o.pop();for(var s=0;ss;++s)o[s].apply(this,e);return this}}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("hook.js",function(t,e,o){function r(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("interfaces/bdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var n;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new s(i,u))}}else{var n=r.create(o[0],i);o.unshift(n),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suite=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.0.6",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test")}),require.register("reporters/base.js",function(t,e,o){function r(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},r=this.failures=[];t&&(t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var r=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>r?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,r.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),n=s.isatty(1)&&s.isatty(2);e=t.exports=r,e.useColors=n,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:n?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),r=t.err.stack,s=r.indexOf("at"),n=r.slice(0,s);r=r.slice(s).replace(/^/gm," "),console.error(o,e,t.fullTitle(),n,r)})},r.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,e.tests),r.list(this.failures),console.error(),void process.nextTick(function(){process.exit(e.failures)})):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),console.log(),void process.nextTick(function(){process.exit(0)}))}}),require.register("reporters/doc.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}n.call(this,t);var o=this.stats,r=(t.total,2);t.on("suite",function(t){t.root||(++r,console.log('%s
',e()),++r,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--r,console.log("%s
",e()),--r)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)}),t.on("end",function(){process.exit(o.failures)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var n=o("./base"),i=o("../utils");e=t.exports=r}),require.register("reporters/dot.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(n("pending","."))}),t.on("pass",function(t){++r%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?n("bright yellow","."):n(t.speed,"."))}),t.on("fail",function(){++r%o==0&&process.stdout.write("\n "),process.stdout.write(n("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/html.js",function(t,e,o){function r(t){i.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),r=[o],c=$(a).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");r[0].append(e),r.unshift($("
")),e.append(r[0])}}),t.on("suite end",function(t){t.root||r.shift()}),t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var s=$('

'+t.title+"

");else if(t.pending)var s=$('

'+t.title+"

");else{var s=$('

'+t.title+"

"),i=t.err.stack||t.err,a=$('
'+i+"
");s.append(a)}if(s.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=u.escape(n(t.fn.toString())),f=$("
"+l+"
");f.appendTo(s).hide()}r[0].append(s)}),void t.on("end",function(){process.exit(e.failures)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),u=o("../utils");e=t.exports=r;var a='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function r(t){n.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]),function(){process.exit(0)})})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.color}e=t.exports=r}),require.register("reporters/json.js",function(t,e,o){function r(t){var e=this;n.call(this,t);var o=[],r=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:r.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t),function(){process.exit(0)})})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.cursor,n.color}e=t.exports=r}),require.register("reporters/landing.js",function(t,e,o){function r(t){function e(){var t=Array(r).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,r=(this.stats,.75*s.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),n.hide()}),t.on("test end",function(t){var o=-1==l?r*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(r-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/list.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(n("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=n("checkmark"," -")+n("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=n("checkmark"," ✓")+n("pass"," %s: ")+n(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+n("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/progress.js",function(t,e,o){function r(t,e){s.call(this,t);{var o=this,e=e||{},r=(this.stats,.5*s.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),n.hide()}),t.on("test end",function(){var t=a++/u,o=r*t|0,s=r-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.progress=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/spec.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}s.call(this,t);var o=this,r=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(n("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("test",function(t){process.stdout.write(e()+n("pass",t.title+": "))}),t.on("pending",function(t){var o=e()+n("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+n("checkmark"," ✓")+n("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+n("checkmark"," ✓")+n("pass"," %s ")+n(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+n("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/tap.js",function(t,e,o){function r(t){s.call(this,t);var e=this.stats,o=t.total,r=1;t.on("start",function(){console.log("%d..%d",1,o)}),t.on("test end",function(){++r}),t.on("pass",function(t){console.log("ok %d %s",r,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",r,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))}),t.on("end",function(){process.exit(e.failures)})}{var s=o("./base");s.cursor,s.color}e=t.exports=r}),require.register("runnable.js",function(t,e,o){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}var s=o("browser/events").EventEmitter;t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(this._timeout=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function o(o){return r?e():(clearTimeout(n),i.duration=new Date-a,r=!0,void t(o))}var r,s,n,i=this,u=this._timeout,a=new Date;if(this.async&&(n=setTimeout(function(){t(new Error("timeout of "+u+"ms exceeded"))},u)),this.async)try{this.fn(o)}catch(c){o(c)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(c){t(c)}}}),require.register("runner.js",function(t,e,o){function r(t){var e=this;this.suite=t,this.total=t.total(),this.globals=Object.keys(global).concat(["errno"]),this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/)}{var s=o("browser/events").EventEmitter;o("./test")}t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.grep=function(t){return this._grep=t,this},r.prototype.checkGlobals=function(t){var e=Object.keys(global).filter(function(t){return!~this.globals.indexOf(t)},this);this.globals=this.globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))},r.prototype.fail=function(t,e){t.failed=!0,this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end"),process.exit(0)},r.prototype.hook=function(t,e){function o(t){var r=s[t];return r?(n.emit("hook",r),r.on("error",function(t){n.failHook(r,t)}),void r.run(function(e){return e?n.failHook(r,e):(n.emit("hook end",r),void o(++t))})):e()}var r=this.suite,s=r["_"+t],n=(r._timeout,this);process.nextTick(function(){o(0)})},r.prototype.hooks=function(t,e,o){function r(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=n,o(t)):void r(e.pop())}):(s.suite=n,o())}var s=this,n=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},r.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function o(t){return t&&(s.fail(r,t),s.emit("test end",r)),(r=n.shift())?s._grep.test(r.fullTitle())?r.pending?(s.emit("pending",r),s.emit("test end",r),o()):(s.emit("test",s.test=r),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?o(t):(s.emit("pass",r),r.passed=!0,s.emit("test end",r),void s.hookUp("afterEach",o))})})):o():e()}var r,s=this,n=t.tests;o()},r.prototype.runSuite=function(t,e){function o(){var e=t.suites[n++];return e?void s.runSuite(e,o):r()}function r(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,n=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},r.prototype.run=function(){var t=this;return this.emit("start"),this.runSuite(this.suite,function(){t.emit("end")}),process.on("uncaughtException",function(e){t.fail(t.test,e),t.emit("test end",t.test),t.emit("end")}),this}}),require.register("suite.js",function(t,e,o){function r(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this.timeout(2e3)}var s=o("browser/events").EventEmitter,n=o("./hook");e=t.exports=r;var i={};e.create=function(t,e){var o=new r(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},r.prototype.beforeAll=function(t){var e=new n('"before all" hook',t);return e.parent=this,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){var e=new n('"after all" hook',t);return e.parent=this,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){var e=new n('"before each" hook',t);return e.parent=this,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){var e=new n('"after each" hook',t);return e.parent=this,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t,e,o){function r(t,e){s.call(this,t,e),this.pending=!e}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),process={},process.nextTick=function(t){setTimeout(t,0)},process.on=function(){},process.exit=function(){},process.stdout={},global=this,mocha=require("mocha"),function(){var t=new mocha.Suite,e=mocha.reporters.HTML;mocha.setup=function(e){if(e=mocha.interfaces[e],!e)throw new Error('invalid mocha interface "'+e+'"');e(t),t.emit("pre-require",global)},mocha.run=function(){t.emit("run");{var o=new mocha.Runner(t);new e(o)}o.run()}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.10.0/mocha.min.css b/ajax/libs/mocha/0.10.0/mocha.min.css new file mode 100644 index 000000000..70d5f1349 --- /dev/null +++ b/ajax/libs/mocha/0.10.0/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}#mocha h1,h2{margin:0}#mocha h1{font-size:1em;font-weight:200}#mocha .suite .suite h1{font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;color:#888}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00c41c}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:30px;right:30px;font-size:12px;margin:0;color:#888}#stats .progress{margin-bottom:10px}#stats em{color:#000}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.10.0/mocha.min.js b/ajax/libs/mocha/0.10.0/mocha.min.js new file mode 100644 index 000000000..e2a1118f4 --- /dev/null +++ b/ajax/libs/mocha/0.10.0/mocha.min.js @@ -0,0 +1 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",s=e+"/index.js";return t.modules[o]&&o||t.modules[s]&&s||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),s=n.split("/");o.pop();for(var i=0;ii;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){s=i;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),i=0,r=s.length;r>i;i++)s[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(12),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,i=o,r=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,i,r,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,i,r-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,n){function o(t,e){s.call(this,t,e)}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.it=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var i;for(var r in t)if("function"==typeof t[r]){var a=t[r];switch(r){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(r,a))}}else{var i=o.create(n[0],r);n.unshift(i),e(t[r]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.10.0",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test")}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(){n.suites=n.suites||0,n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}var s=n("browser/tty"),i=s.isatty(1)&&s.isatty(2);e=t.exports=o,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var r=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=r("error title"," %s) %s:\n")+r("error message"," %s")+r("error stack","\n%s\n"),o=t.err,s=o.message||"",i=o.stack||s,a=i.indexOf(s)+s.length,u=i.slice(0,a);i=i.slice(a+1).replace(/^/gm," "),console.error(n,e,t.fullTitle(),u,i)})},o.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=r("bright fail"," ✖")+r("fail"," %d of %d tests failed")+r("light",":"),console.error(t,e.failures,this.runner.total),o.list(this.failures),void console.error()):(t=r("bright pass"," ✔")+r("green"," %d tests complete")+r("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}i.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=r.escape(s(t.fn.toString()));console.log("%s
%s
",e(),n)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var i=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=n("./base"),i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html.js",function(t,e,n){function o(t){r.call(this,t);var e,n,o=this.stats,a=t.total,f=$("#mocha"),p=[f],h=$(l).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(n=d.getContext("2d"),e=new u),f.length?(e&&e.size(50),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var s=o.tests/a*100|0;e&&e.update(s).draw(n);var r=new Date-o.start;if(h.find(".passes em").text(o.passes),h.find(".failures em").text(o.failures),h.find(".duration em").text((r/1e3).toFixed(2)),t.passed)var u=$('

'+c(t.title)+"

");else if(t.pending)var u=$('

'+c(t.title)+"

");else{var u=$('

'+c(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+c(l)+"
").appendTo(u)}if(u.find("h2").toggle(function(){d.slideDown("fast")},function(){d.slideUp("fast")}),!t.pending){var f=c(i(t.fn.toString())),d=$("
"+f+"
");d.appendTo(u).hide()}p[0].append(u)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var r=n("./base"),a=n("../utils"),u=n("../browser/progress"),c=a.escape;e=t.exports=o;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;i.call(this,t);var n=[],o=[],r=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){r.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:r.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+r("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),a=t.total,u=process.stdout,c=r("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;t.failed&&(c=r("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(r("runway",Array(n).join("⋅"))),u.write(c),u.write(r("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(r("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=r("checkmark"," -")+r("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=r("checkmark"," ✓")+r("pass"," %s: ")+r(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(r("fail"," %d) %s"),n++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=u++/a,n=o*t|0,s=o-n;i.CR(),process.stdout.write(""),process.stdout.write(r("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(r("progress",e.close)),e.verbose&&process.stdout.write(r("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.progress=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(r("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+r("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+r("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+r("checkmark"," ✓")+r("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+r("checkmark"," ✓")+r("pass"," %s ")+r(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+r("fail"," %d) %s"),a++,t.title)}),t.on("end",n.epilogue.bind(n))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,s(t))}),t.on("pass",function(t){console.log("ok %d %s",n,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",s(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",s(t.fullTitle()),s(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",s(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",s(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function s(t){return t.replace(/'/g,"|'")}var i=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(s),console.log("")})}function s(t){var e={classname:t.fullTitle(),name:t.title,time:t.duration/1e3};if(t.failed){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,r(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var s,i=n?"/>":">",r=[];for(var a in e)r.push(a+'="'+c(e[a])+'"');return s="<"+t+(r.length?" "+r.join(" "):"")+i,o&&(s+=o+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.context=this}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){clearTimeout(this.timer)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded"))},e))},o.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function n(n){return o?e():(i.clearTimeout(),i.duration=new Date-a,o=!0,void t(n))}var o,s,i=this,r=this.timeout(),a=new Date,u=this.context;if(this.async&&r&&(this.timer=setTimeout(function(){n(new Error("timeout of "+r+"ms exceeded"))},r)),this.callback=n,this.async)try{this.fn.call(u,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}else try{this.pending||this.fn.call(u),this.duration=new Date-a,t()}catch(c){t(c)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(r.keys(global).concat(["errno"]))}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),r=(n("./test"),n("./utils"));t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this},o.prototype.globals=function(t){return i("globals %j",t),r.forEach(t,function(t){this._globals.push(t)},this),this},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r.filter(r.keys(global),function(t){return!(~r.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},o.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(i.currentRunnable=o,o.context=i.test,i.emit("hook",o),o.on("error",function(t){i.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?i.failHook(o,e):(i.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],i=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(r){return s.suite=r,r?void s.hook(t,function(t){return t?(s.suite=i,n(t)):void o(e.pop())}):(s.suite=i,n())}var s=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return s.failures&&t._bail?e():(o=i.shift())?s._grep.test(o.fullTitle())?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=s.test,s.runTest(function(t){return o=s.test,t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.passed=!0,s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n():e()}var o,s=this,i=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[r++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,r=0;i("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,n)})},o.prototype.run=function(t){function e(t){var e=n.currentRunnable;i("uncaught exception"),e.failed||(e.clearTimeout(),t.uncaught=!0,n.fail(e,t),"test"==e.type?(n.emit("test end",e),n.hookUp("afterEach",n.next)):n.emit("end"))}var n=this,t=t||function(){};return i("start"),n.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var s=n("browser/events").EventEmitter,i=n("browser/debug")("suite"),r=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.timeout(this.timeout()),t.bail(this._bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return r.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var s=n("browser/fs"),i=n("browser/path"),r=i.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var s=n,i=0,r=t.length;r>i;i++)s=e.call(o,s,t[i],i,t);return s},e.filter=function(t,e,n){for(var o=[],s=0,i=t.length;i>s;s++){var r=t[s];e.call(n,r,s,t)&&o.push(r)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),s.watchFile(t,n,function(n,o){o.mtimei;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){s=i;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),i=0,r=s.length;r>i;i++)s[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(12),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,i=o,r=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,i,r,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,i,r-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,n){function o(t,e){s.call(this,t,e)}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.it=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var i;for(var r in t)if("function"==typeof t[r]){var a=t[r];switch(r){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(r,a))}}else{var i=o.create(n[0],r);n.unshift(i),e(t[r]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.10.1",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test")}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(){n.suites=n.suites||0,n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}var s=n("browser/tty"),i=s.isatty(1)&&s.isatty(2);e=t.exports=o,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var r=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=r("error title"," %s) %s:\n")+r("error message"," %s")+r("error stack","\n%s\n"),o=t.err,s=o.message||"",i=o.stack||s,a=i.indexOf(s)+s.length,u=i.slice(0,a);i=i.slice(a+1).replace(/^/gm," "),console.error(n,e,t.fullTitle(),u,i)})},o.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=r("bright fail"," ✖")+r("fail"," %d of %d tests failed")+r("light",":"),console.error(t,e.failures,this.runner.total),o.list(this.failures),void console.error()):(t=r("bright pass"," ✔")+r("green"," %d tests complete")+r("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}i.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=r.escape(s(t.fn.toString()));console.log("%s
%s
",e(),n)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var i=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=n("./base"),i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html.js",function(t,e,n){function o(t){r.call(this,t);var e,n,o=this.stats,a=t.total,f=$("#mocha"),p=[f],h=$(l).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(n=d.getContext("2d"),e=new u),f.length?(e&&e.size(50),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var s=o.tests/a*100|0;e&&e.update(s).draw(n);var r=new Date-o.start;if(h.find(".passes em").text(o.passes),h.find(".failures em").text(o.failures),h.find(".duration em").text((r/1e3).toFixed(2)),t.passed)var u=$('

'+c(t.title)+"

");else if(t.pending)var u=$('

'+c(t.title)+"

");else{var u=$('

'+c(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+c(l)+"
").appendTo(u)}if(u.find("h2").toggle(function(){d.slideDown("fast")},function(){d.slideUp("fast")}),!t.pending){var f=c(i(t.fn.toString())),d=$("
"+f+"
");d.appendTo(u).hide()}p[0].append(u)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var r=n("./base"),a=n("../utils"),u=n("../browser/progress"),c=a.escape;e=t.exports=o;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;i.call(this,t);var n=[],o=[],r=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){r.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:r.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+r("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),a=t.total,u=process.stdout,c=r("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;t.failed&&(c=r("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(r("runway",Array(n).join("⋅"))),u.write(c),u.write(r("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(r("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=r("checkmark"," -")+r("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=r("checkmark"," ✓")+r("pass"," %s: ")+r(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(r("fail"," %d) %s"),n++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=u++/a,n=o*t|0,s=o-n;i.CR(),process.stdout.write(""),process.stdout.write(r("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(r("progress",e.close)),e.verbose&&process.stdout.write(r("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.progress=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(r("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+r("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+r("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+r("checkmark"," ✓")+r("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+r("checkmark"," ✓")+r("pass"," %s ")+r(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+r("fail"," %d) %s"),a++,t.title)}),t.on("end",n.epilogue.bind(n))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,s(t))}),t.on("pass",function(t){console.log("ok %d %s",n,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",s(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",s(t.fullTitle()),s(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",s(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",s(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function s(t){return t.replace(/'/g,"|'")}var i=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(s),console.log("")})}function s(t){var e={classname:t.fullTitle(),name:t.title,time:t.duration/1e3};if(t.failed){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,r(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var s,i=n?"/>":">",r=[];for(var a in e)r.push(a+'="'+c(e[a])+'"');return s="<"+t+(r.length?" "+r.join(" "):"")+i,o&&(s+=o+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.context=this}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){clearTimeout(this.timer)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded"))},e))},o.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function n(n){return o?e():(i.clearTimeout(),i.duration=new Date-a,o=!0,void t(n))}var o,s,i=this,r=this.timeout(),a=new Date,u=this.context;if(this.async&&r&&(this.timer=setTimeout(function(){n(new Error("timeout of "+r+"ms exceeded"))},r)),this.callback=n,this.async)try{this.fn.call(u,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}else try{this.pending||this.fn.call(u),this.duration=new Date-a,t()}catch(c){t(c)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(r.keys(global).concat(["errno"]))}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),r=(n("./test"),n("./utils"));t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this},o.prototype.globals=function(t){return i("globals %j",t),r.forEach(t,function(t){this._globals.push(t)},this),this},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r.filter(r.keys(global),function(t){return!(~r.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},o.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(i.currentRunnable=o,o.context=i.test,i.emit("hook",o),o.on("error",function(t){i.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?i.failHook(o,e):(i.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],i=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(r){return s.suite=r,r?void s.hook(t,function(t){return t?(s.suite=i,n(t)):void o(e.pop())}):(s.suite=i,n())}var s=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return s.failures&&t._bail?e():(o=i.shift())?s._grep.test(o.fullTitle())?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=s.test,s.runTest(function(t){return o=s.test,t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.passed=!0,s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n():e()}var o,s=this,i=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[r++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,r=0;i("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,n)})},o.prototype.run=function(t){function e(t){var e=n.currentRunnable;i("uncaught exception"),e.failed||(e.clearTimeout(),t.uncaught=!0,n.fail(e,t),"test"==e.type?(n.emit("test end",e),n.hookUp("afterEach",n.next)):n.emit("end"))}var n=this,t=t||function(){};return i("start"),n.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var s=n("browser/events").EventEmitter,i=n("browser/debug")("suite"),r=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return r.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var s=n("browser/fs"),i=n("browser/path"),r=i.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var s=n,i=0,r=t.length;r>i;i++)s=e.call(o,s,t[i],i,t);return s},e.filter=function(t,e,n){for(var o=[],s=0,i=t.length;i>s;s++){var r=t[s];e.call(n,r,s,t)&&o.push(r)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),s.watchFile(t,n,function(n,o){o.mtimei;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){s=i;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),i=0,r=s.length;r>i;i++)s[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(12),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,i=o,r=o-1,u=this._fontSize;t.font=u+"px "+this._font;var a=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,i,r,0,a,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,i,r-1,0,a,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,i+u/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,n){function o(t,e){s.call(this,t,e)}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.it=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var i;for(var r in t)if("function"==typeof t[r]){var u=t[r];switch(r){case"before":n[0].beforeAll(u);break;case"after":n[0].afterAll(u);break;case"beforeEach":n[0].beforeEach(u);break;case"afterEach":n[0].afterEach(u);break;default:n[0].addTest(new s(r,u))}}else{var i=o.create(n[0],r);n.unshift(i),e(t[r]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.11.0",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test")}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}var s=n("browser/tty"),i=s.isatty(1)&&s.isatty(2);e=t.exports=o,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var r=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=r("error title"," %s) %s:\n")+r("error message"," %s")+r("error stack","\n%s\n"),o=t.err,s=o.message||"",i=o.stack||s,u=i.indexOf(s)+s.length,a=i.slice(0,u);i=i.slice(u+1).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),a,i)})},o.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=r("bright fail"," ✖")+r("fail"," %d of %d tests failed")+r("light",":"),console.error(t,e.failures,this.runner.total),o.list(this.failures),void console.error()):(t=r("bright pass"," ✔")+r("green"," %d tests complete")+r("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}i.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=r.escape(s(t.fn.toString()));console.log("%s
%s
",e(),n)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var i=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=n("./base"),i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html.js",function(t,e,n){function o(t){r.call(this,t);var e,n,o=this.stats,u=t.total,f=$("#mocha"),h=[f],p=$(l).appendTo(f),d=p.find("canvas").get(0);return d.getContext&&(n=d.getContext("2d"),e=new a),f.length?(e&&e.size(50),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");h[0].append(e),h.unshift($("
")),e.append(h[0])}}),t.on("suite end",function(t){t.root||h.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var s=o.tests/u*100|0;e&&e.update(s).draw(n);var r=new Date-o.start;if(p.find(".passes em").text(o.passes),p.find(".failures em").text(o.failures),p.find(".duration em").text((r/1e3).toFixed(2)),t.passed)var a=$('

'+c(t.title)+"

");else if(t.pending)var a=$('

'+c(t.title)+"

");else{var a=$('

'+c(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+c(l)+"
").appendTo(a)}if(a.find("h2").toggle(function(){d&&d.slideDown("fast")},function(){d&&d.slideUp("fast")}),!t.pending){var f=c(i(t.fn.toString())),d=$("
"+f+"
");d.appendTo(a).hide()}h[0].append(a)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var r=n("./base"),u=n("../utils"),a=n("../browser/progress"),c=u.escape;e=t.exports=o;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;i.call(this,t);var n=[],o=[],r=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){r.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:r.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+r("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),u=t.total,a=process.stdout,c=r("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/u|0:l;t.failed&&(c=r("plane crash","✈"),l=n),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(r("runway",Array(n).join("⋅"))),a.write(c),a.write(r("runway",Array(o-n).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(r("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=r("checkmark"," -")+r("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=r("checkmark"," ✓")+r("pass"," %s: ")+r(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(r("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=a++/u,n=o*t|0,s=o-n;i.CR(),process.stdout.write(""),process.stdout.write(r("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(r("progress",e.close)),e.verbose&&process.stdout.write(r("progress"," "+a+" of "+u))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.progress=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),u=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(r("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+r("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+r("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+r("checkmark"," ✓")+r("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+r("checkmark"," ✓")+r("pass"," %s ")+r(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+r("fail"," %d) %s"),u++,t.title)}),t.on("end",n.epilogue.bind(n))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,s(t))}),t.on("pass",function(t){console.log("ok %d %s",n,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",s(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",s(t.fullTitle()),s(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",s(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",s(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function s(t){return t.replace(/'/g,"|'")}var i=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(s),console.log("")})}function s(t){var e={classname:t.fullTitle(),name:t.title,time:t.duration/1e3};if(t.failed){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,r(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var s,i=n?"/>":">",r=[];for(var u in e)r.push(u+'="'+c(e[u])+'"');return s="<"+t+(r.length?" "+r.join(" "):"")+i,o&&(s+=o+""}var u=n("./base"),a=n("../utils"),c=a.escape;e=t.exports=o,o.prototype=new u,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1,this.context=this}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){clearTimeout(this.timer)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(o)return e();i.clearTimeout(),i.duration=new Date-u,o=!0,t(n)}}var o,s,i=this,r=this.timeout(),u=new Date,a=this.context;if(this.async&&r&&(this.timer=setTimeout(function(){n(new Error("timeout of "+r+"ms exceeded")),i.timedOut=!0},r)),this.callback=n,this.async)try{this.fn.call(a,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}else try{this.pending||this.fn.call(a),this.duration=new Date-u,t()}catch(c){t(c)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(r.keys(global).concat(["errno"]))}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),r=(n("./test"),n("./utils"));t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),r.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r.filter(r.keys(global),function(t){return!(~r.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(i.currentRunnable=o,o.context=i.test,i.emit("hook",o),o.on("error",function(t){i.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?i.failHook(o,e):(i.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],i=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(r){return s.suite=r,r?void s.hook(t,function(t){return t?(s.suite=i,n(t)):void o(e.pop())}):(s.suite=i,n())}var s=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return s.failures&&t._bail?e():(o=i.shift())?s._grep.test(o.fullTitle())?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=s.test,s.runTest(function(t){return o=s.test,t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.passed=!0,s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n():e()}var o,s=this,i=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[r++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,r=0;i("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,n)})},o.prototype.uncaught=function(t){i("uncaught exception");var e=this.currentRunnable;if(!e.failed)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){var e=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function o(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var s=n("browser/events").EventEmitter,i=n("browser/debug")("suite"),r=n("./utils"),u=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){var e=new u('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new u('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new u('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new u('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return r.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~a.indexOf(t)}var s=n("browser/fs"),i=n("browser/path"),r=i.join,u=n("browser/debug")("watch"),a=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var s=n,i=0,r=t.length;r>i;i++)s=e.call(o,s,t[i],i,t);return s},e.filter=function(t,e,n){for(var o=[],s=0,i=t.length;i>s;s++){var r=t[s];e.call(n,r,s,t)&&o.push(r)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),s.watchFile(t,n,function(n,o){o.mtimei;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){s=i;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),i=0,r=s.length;r>i;i++)s[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,i=o,r=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,i,r,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,i,r-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,n){function o(t,e){s.call(this,t,e)}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.it=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var i;for(var r in t)if("function"==typeof t[r]){var a=t[r];switch(r){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(r,a))}}else{var i=o.create(n[0],r);n.unshift(i),e(t[r]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.12.0",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test")}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}var s=n("browser/tty"),i=s.isatty(1)&&s.isatty(2);e=t.exports=o,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var r=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=r("error title"," %s) %s:\n")+r("error message"," %s")+r("error stack","\n%s\n"),o=t.err,s=o.message||"",i=o.stack||s,a=i.indexOf(s)+s.length,u=i.slice(0,a);i=i.slice(a+1).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),u,i)})},o.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=r("bright fail"," ✖")+r("fail"," %d of %d tests failed")+r("light",":"),console.error(t,e.failures,this.runner.total),o.list(this.failures),void console.error()):(t=r("bright pass"," ✔")+r("green"," %d tests complete")+r("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}i.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=r.escape(s(t.fn.toString()));console.log("%s
%s
",e(),n)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var i=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=n("./base"),i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html.js",function(t,e,n){function o(t){r.call(this,t);var e,n,o=this.stats,a=t.total,f=$("#mocha"),p=[f],h=$(l).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(n=d.getContext("2d"),e=new u),f.length?(e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var s=o.tests/a*100|0;e&&e.update(s).draw(n);var r=new Date-o.start;if(h.find(".passes em").text(o.passes),h.find(".failures em").text(o.failures),h.find(".duration em").text((r/1e3).toFixed(2)),t.passed)var u=$('

'+c(t.title)+"

");else if(t.pending)var u=$('

'+c(t.title)+"

");else{var u=$('

'+c(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+c(l)+"
").appendTo(u)}if(u.find("h2").toggle(function(){d&&d.slideDown("fast")},function(){d&&d.slideUp("fast")}),!t.pending){var f=c(i(t.fn.toString())),d=$("
"+f+"
");d.appendTo(u).hide()}p[0].append(u)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var r=n("./base"),a=n("../utils"),u=n("../browser/progress"),c=a.escape;e=t.exports=o;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;i.call(this,t);var n=[],o=[],r=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){r.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:r.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+r("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),a=t.total,u=process.stdout,c=r("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;t.failed&&(c=r("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(r("runway",Array(n).join("⋅"))),u.write(c),u.write(r("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(r("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=r("checkmark"," -")+r("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=r("checkmark"," ✓")+r("pass"," %s: ")+r(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(r("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=u++/a,n=o*t|0,s=o-n;i.CR(),process.stdout.write(""),process.stdout.write(r("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(r("progress",e.close)),e.verbose&&process.stdout.write(r("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.progress=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(r("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+r("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+r("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+r("checkmark"," ✓")+r("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+r("checkmark"," ✓")+r("pass"," %s ")+r(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+r("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,s(t))}),t.on("pass",function(t){console.log("ok %d %s",n,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",s(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",s(t.fullTitle()),s(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",s(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",s(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function s(t){return t.replace(/'/g,"|'")}var i=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(s),console.log("")})}function s(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if(t.failed){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,r(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var s,i=n?"/>":">",r=[];for(var a in e)r.push(a+'="'+c(e[a])+'"');return s="<"+t+(r.length?" "+r.join(" "):"")+i,o&&(s+=o+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1,this.context=this}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){clearTimeout(this.timer)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(o)return e();i.clearTimeout(),i.duration=new Date-a,o=!0,t(n)}}var o,s,i=this,r=this.timeout(),a=new Date,u=this.context;if(this.async&&r&&(this.timer=setTimeout(function(){n(new Error("timeout of "+r+"ms exceeded")),i.timedOut=!0},r)),this.callback=n,this.async)try{this.fn.call(u,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}else try{this.pending||this.fn.call(u),this.duration=new Date-a,t()}catch(c){t(c)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(r.keys(global).concat(["errno"]))}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),r=(n("./test"),n("./utils"));t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),r.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r.filter(r.keys(global),function(t){return!(~r.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(i.currentRunnable=o,o.context=i.test,i.emit("hook",o),o.on("error",function(t){i.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?i.failHook(o,e):(i.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],i=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(r){return s.suite=r,r?void s.hook(t,function(t){return t?(s.suite=i,n(t)):void o(e.pop())}):(s.suite=i,n())}var s=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return s.failures&&t._bail?e():(o=i.shift())?s._grep.test(o.fullTitle())?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=s.test,s.runTest(function(t){return o=s.test,t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.passed=!0,s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n():e()}var o,s=this,i=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[r++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,r=0;i("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,n)})},o.prototype.uncaught=function(t){i("uncaught exception");var e=this.currentRunnable;if(!e.failed)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){var e=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function o(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var s=n("browser/events").EventEmitter,i=n("browser/debug")("suite"),r=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return r.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var s=n("browser/fs"),i=n("browser/path"),r=i.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var s=n,i=0,r=t.length;r>i;i++)s=e.call(o,s,t[i],i,t);return s},e.filter=function(t,e,n){for(var o=[],s=0,i=t.length;i>s;s++){var r=t[s];e.call(n,r,s,t)&&o.push(r)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),s.watchFile(t,n,function(n,o){o.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),o=e.slice(0,n),s=e.slice(++n);return t[o]=decodeURIComponent(s),t},{})}var n=new mocha.Suite,o=mocha.utils,s=mocha.reporters.HTML;mocha.setup=function(t){if(t=mocha.interfaces[t],!t)throw new Error('invalid mocha interface "'+t+'"');t(n),n.emit("pre-require",window)},mocha.run=function(){n.emit("run");var o=new mocha.Runner(n),i=(new s(o),e(window.location.search||""));return i.grep&&o.grep(new RegExp(i.grep)),o.on("end",function(){$("code").each(function(){$(this).html(t($(this).text()))})}),o.run()}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.12.0/mocha.min.css b/ajax/libs/mocha/0.12.0/mocha.min.css new file mode 100644 index 000000000..868f11678 --- /dev/null +++ b/ajax/libs/mocha/0.12.0/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha h1,h2{margin:0}#mocha h1{font-size:1em;font-weight:200}#mocha .suite .suite h1{font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)'}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00c41c}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/0.12.0/mocha.min.js b/ajax/libs/mocha/0.12.0/mocha.min.js new file mode 100644 index 000000000..29ce0b5db --- /dev/null +++ b/ajax/libs/mocha/0.12.0/mocha.min.js @@ -0,0 +1 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",s=e+"/index.js";return t.modules[o]&&o||t.modules[s]&&s||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),s=n.split("/");o.pop();for(var i=0;ii;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){s=i;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),i=0,r=s.length;r>i;i++)s[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,i=o,r=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,i,r,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,i,r-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.test=function(t){return this._test=t,this},e.prototype.timeout=function(t){return this._test.timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_test"==t?void 0:e},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.type="hook"}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.it=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var i;for(var r in t)if("function"==typeof t[r]){var a=t[r];switch(r){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(r,a))}}else{var i=o.create(n[0],r);n.unshift(i),e(t[r]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.12.0",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test")}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}var s=n("browser/tty"),i=s.isatty(1)&&s.isatty(2);e=t.exports=o,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var r=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=r("error title"," %s) %s:\n")+r("error message"," %s")+r("error stack","\n%s\n"),o=t.err,s=o.message||"",i=o.stack||s,a=i.indexOf(s)+s.length,u=i.slice(0,a);i=i.slice(a+1).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),u,i)})},o.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=r("bright fail"," ✖")+r("fail"," %d of %d tests failed")+r("light",":"),console.error(t,e.failures,this.runner.total),o.list(this.failures),void console.error()):(t=r("bright pass"," ✔")+r("green"," %d tests complete")+r("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}i.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=r.escape(s(t.fn.toString()));console.log("%s
%s
",e(),n)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var i=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=n("./base"),i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html.js",function(t,e,n){function o(t){r.call(this,t);var e,n,o=this.stats,a=t.total,f=$("#mocha"),p=[f],h=$(l).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(n=d.getContext("2d"),e=new u),f.length?(e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var s=o.tests/a*100|0;e&&e.update(s).draw(n);var r=new Date-o.start;if(h.find(".passes em").text(o.passes),h.find(".failures em").text(o.failures),h.find(".duration em").text((r/1e3).toFixed(2)),t.passed)var u=$('

'+c(t.title)+"

");else if(t.pending)var u=$('

'+c(t.title)+"

");else{var u=$('

'+c(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+c(l)+"
").appendTo(u)}if(u.find("h2").toggle(function(){d&&d.slideDown("fast")},function(){d&&d.slideUp("fast")}),!t.pending){var f=c(i(t.fn.toString())),d=$("
"+f+"
");d.appendTo(u).hide()}p[0].append(u)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var r=n("./base"),a=n("../utils"),u=n("../browser/progress"),c=a.escape;e=t.exports=o;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;i.call(this,t);var n=[],o=[],r=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){r.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:r.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+r("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),a=t.total,u=process.stdout,c=r("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;t.failed&&(c=r("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(r("runway",Array(n).join("⋅"))),u.write(c),u.write(r("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(r("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=r("checkmark"," -")+r("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=r("checkmark"," ✓")+r("pass"," %s: ")+r(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(r("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=u++/a,n=o*t|0,s=o-n;i.CR(),process.stdout.write(""),process.stdout.write(r("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(r("progress",e.close)),e.verbose&&process.stdout.write(r("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.progress=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(r("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+r("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+r("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+r("checkmark"," ✓")+r("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+r("checkmark"," ✓")+r("pass"," %s ")+r(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+r("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,s(t))}),t.on("pass",function(t){console.log("ok %d %s",n,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",s(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",s(t.fullTitle()),s(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",s(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",s(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function s(t){return t.replace(/'/g,"|'")}var i=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(s),console.log("")})}function s(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if(t.failed){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,r(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var s,i=n?"/>":">",r=[];for(var a in e)r.push(a+'="'+c(e[a])+'"');return s="<"+t+(r.length?" "+r.join(" "):"")+i,o&&(s+=o+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){clearTimeout(this.timer)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(o)return e();i.clearTimeout(),i.duration=new Date-a,o=!0,t(n)}}var o,s,i=this,r=this.timeout(),a=new Date,u=this.ctx;if(this.async&&r&&(this.timer=setTimeout(function(){n(new Error("timeout of "+r+"ms exceeded")),i.timedOut=!0},r)),this.callback=n,this.async)try{this.fn.call(u,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}else try{this.pending||this.fn.call(u),this.duration=new Date-a,t()}catch(c){t(c)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(r.keys(global).concat(["errno"]))}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),r=(n("./test"),n("./utils"));t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),r.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r.filter(r.keys(global),function(t){return!(~r.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(i.currentRunnable=o,o.ctx.test(i.test),i.emit("hook",o),o.on("error",function(t){i.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?i.failHook(o,e):(i.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],i=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(r){return s.suite=r,r?void s.hook(t,function(t){return t?(s.suite=i,n(t)):void o(e.pop())}):(s.suite=i,n())}var s=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.ctx.test(e),e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return s.failures&&t._bail?e():(o=i.shift())?s._grep.test(o.fullTitle())?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=s.test,s.runTest(function(t){return o=s.test,t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.passed=!0,s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n():e()}var o,s=this,i=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[r++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,r=0;i("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,n)})},o.prototype.uncaught=function(t){i("uncaught exception");var e=this.currentRunnable;if(!e.failed)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){var e=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var s=n("browser/events").EventEmitter,i=n("browser/debug")("suite"),r=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return r.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"==t[0]?void 0:"parent"==t?"#":e},2)}}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var s=n("browser/fs"),i=n("browser/path"),r=i.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var s=n,i=0,r=t.length;r>i;i++)s=e.call(o,s,t[i],i,t);return s},e.filter=function(t,e,n){for(var o=[],s=0,i=t.length;i>s;s++){var r=t[s];e.call(n,r,s,t)&&o.push(r)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),s.watchFile(t,n,function(n,o){o.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),o=e.slice(0,n),s=e.slice(++n);return t[o]=decodeURIComponent(s),t},{})}var n=new mocha.Suite("",new mocha.Context),o=mocha.utils,s=mocha.reporters.HTML;$(function(){$("code").each(function(){$(this).html(t($(this).text()))})}),mocha.setup=function(t){if(t=mocha.interfaces[t],!t)throw new Error('invalid mocha interface "'+t+'"');t(n),n.emit("pre-require",window)},mocha.run=function(){n.emit("run");var o=new mocha.Runner(n),i=(new s(o),e(window.location.search||""));return i.grep&&o.grep(new RegExp(i.grep)),o.on("end",function(){$("code").each(function(){$(this).html(t($(this).text()))})}),o.run()}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.12.1/mocha.min.css b/ajax/libs/mocha/0.12.1/mocha.min.css new file mode 100644 index 000000000..868f11678 --- /dev/null +++ b/ajax/libs/mocha/0.12.1/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha h1,h2{margin:0}#mocha h1{font-size:1em;font-weight:200}#mocha .suite .suite h1{font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)'}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00c41c}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/0.12.1/mocha.min.js b/ajax/libs/mocha/0.12.1/mocha.min.js new file mode 100644 index 000000000..56178a298 --- /dev/null +++ b/ajax/libs/mocha/0.12.1/mocha.min.js @@ -0,0 +1 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",s=e+"/index.js";return t.modules[o]&&o||t.modules[s]&&s||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),s=n.split("/");o.pop();for(var i=0;ii;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){s=i;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),i=0,r=s.length;r>i;i++)s[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,i=o,r=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,i,r,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,i,r-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.test=function(t){return this._test=t,this},e.prototype.timeout=function(t){return this._test.timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_test"==t?void 0:e},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.type="hook"}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.it=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var i;for(var r in t)if("function"==typeof t[r]){var a=t[r];switch(r){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(r,a))}}else{var i=o.create(n[0],r);n.unshift(i),e(t[r]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.12.1",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test")}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}var s=n("browser/tty"),i=s.isatty(1)&&s.isatty(2);e=t.exports=o,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var r=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=r("error title"," %s) %s:\n")+r("error message"," %s")+r("error stack","\n%s\n"),o=t.err,s=o.message||"",i=o.stack||s,a=i.indexOf(s)+s.length,u=i.slice(0,a);i=i.slice(a+1).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),u,i)})},o.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=r("bright fail"," ✖")+r("fail"," %d of %d tests failed")+r("light",":"),console.error(t,e.failures,this.runner.total),o.list(this.failures),void console.error()):(t=r("bright pass"," ✔")+r("green"," %d tests complete")+r("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}i.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=r.escape(s(t.fn.toString()));console.log("%s
%s
",e(),n)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var i=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=n("./base"),i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html.js",function(t,e,n){function o(t){r.call(this,t);var e,n,o=this.stats,a=t.total,f=$("#mocha"),p=[f],h=$(l).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(n=d.getContext("2d"),e=new u),f.length?(e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var s=o.tests/a*100|0;e&&e.update(s).draw(n);var r=new Date-o.start;if(h.find(".passes em").text(o.passes),h.find(".failures em").text(o.failures),h.find(".duration em").text((r/1e3).toFixed(2)),t.passed)var u=$('

'+c(t.title)+"

");else if(t.pending)var u=$('

'+c(t.title)+"

");else{var u=$('

'+c(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+c(l)+"
").appendTo(u)}if(u.find("h2").toggle(function(){d&&d.slideDown("fast")},function(){d&&d.slideUp("fast")}),!t.pending){var f=c(i(t.fn.toString())),d=$("
"+f+"
");d.appendTo(u).hide()}p[0].append(u)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var r=n("./base"),a=n("../utils"),u=n("../browser/progress"),c=a.escape;e=t.exports=o;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;i.call(this,t);var n=[],o=[],r=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){r.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:r.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+r("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),a=t.total,u=process.stdout,c=r("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;t.failed&&(c=r("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(r("runway",Array(n).join("⋅"))),u.write(c),u.write(r("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(r("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=r("checkmark"," -")+r("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=r("checkmark"," ✓")+r("pass"," %s: ")+r(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(r("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=u++/a,n=o*t|0,s=o-n;i.CR(),process.stdout.write(""),process.stdout.write(r("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(r("progress",e.close)),e.verbose&&process.stdout.write(r("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,s.colors.progress=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(r("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+r("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+r("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+r("checkmark"," ✓")+r("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+r("checkmark"," ✓")+r("pass"," %s ")+r(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+r("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var s=n("./base"),i=s.cursor,r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,s(t))}),t.on("pass",function(t){console.log("ok %d %s",n,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",s(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",s(t.fullTitle()),s(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",s(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",s(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function s(t){return t.replace(/'/g,"|'")}var i=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(s),console.log("")})}function s(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if(t.failed){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,r(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var s,i=n?"/>":">",r=[];for(var a in e)r.push(a+'="'+c(e[a])+'"');return s="<"+t+(r.length?" "+r.join(" "):"")+i,o&&(s+=o+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){clearTimeout(this.timer)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(o)return e();i.clearTimeout(),i.duration=new Date-a,o=!0,t(n)}}var o,s,i=this,r=this.timeout(),a=new Date,u=this.ctx;if(this.async&&r&&(this.timer=setTimeout(function(){n(new Error("timeout of "+r+"ms exceeded")),i.timedOut=!0},r)),this.callback=n,this.async)try{this.fn.call(u,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}else try{this.pending||this.fn.call(u),this.duration=new Date-a,t()}catch(c){t(c)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(r.keys(global).concat(["errno"]))}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),r=(n("./test"),n("./utils"));t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),r.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r.filter(r.keys(global),function(t){return!(~r.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(i.currentRunnable=o,o.ctx.test(i.test),i.emit("hook",o),o.on("error",function(t){i.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?i.failHook(o,e):(i.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],i=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(r){return s.suite=r,r?void s.hook(t,function(t){return t?(s.suite=i,n(t)):void o(e.pop())}):(s.suite=i,n())}var s=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.ctx.test(e),e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return s.failures&&t._bail?e():(o=i.shift())?s._grep.test(o.fullTitle())?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=s.test,s.runTest(function(t){return o=s.test,t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.passed=!0,s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n():e()}var o,s=this,i=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[r++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,r=0;i("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,n)})},o.prototype.uncaught=function(t){i("uncaught exception");var e=this.currentRunnable;if(!e.failed)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){var e=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var s=n("browser/events").EventEmitter,i=n("browser/debug")("suite"),r=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return r.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"==t[0]?void 0:"parent"==t?"#":e},2)}}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var s=n("browser/fs"),i=n("browser/path"),r=i.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var s=n,i=0,r=t.length;r>i;i++)s=e.call(o,s,t[i],i,t);return s},e.filter=function(t,e,n){for(var o=[],s=0,i=t.length;i>s;s++){var r=t[s];e.call(n,r,s,t)&&o.push(r)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),s.watchFile(t,n,function(n,o){o.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),o=e.slice(0,n),s=e.slice(++n);return t[o]=decodeURIComponent(s),t},{})}var n=new mocha.Suite("",new mocha.Context),o=mocha.utils,s=mocha.reporters.HTML;$(function(){$("code").each(function(){$(this).html(t($(this).text()))})}),mocha.setup=function(t){if(t=mocha.interfaces[t],!t)throw new Error('invalid mocha interface "'+t+'"');t(n),n.emit("pre-require",window)},mocha.run=function(){n.emit("run");var o=new mocha.Runner(n),i=(new s(o),e(window.location.search||""));return i.grep&&o.grep(new RegExp(i.grep)),o.on("end",function(){$("code").each(function(){$(this).html(t($(this).text()))})}),o.run()}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.13.0/mocha.min.css b/ajax/libs/mocha/0.13.0/mocha.min.css new file mode 100644 index 000000000..74b3dbc9d --- /dev/null +++ b/ajax/libs/mocha/0.13.0/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha h1,h2{margin:0}#mocha h1{font-size:1em;font-weight:200}#mocha .suite .suite h1{font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00c41c}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/0.13.0/mocha.min.js b/ajax/libs/mocha/0.13.0/mocha.min.js new file mode 100644 index 000000000..bb69f3bc1 --- /dev/null +++ b/ajax/libs/mocha/0.13.0/mocha.min.js @@ -0,0 +1 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",o=e+"/index.js";return t.modules[s]&&s||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),o=n.split("/");s.pop();for(var i=0;ii;i++)if(s[i]===e||s[i].listener&&s[i].listener===e){o=i;break}if(0>o)return this;s.splice(o,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var o=e.slice(),i=0,r=o.length;r>i;i++)o[i].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,o=s,i=s,r=s-1,a=this._fontSize;t.font=a+"px "+this._font;var c=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,r,0,c,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,r-1,0,c,!0),t.stroke();var u=this._text||(0|e)+"%",l=t.measureText(u).width;return t.fillText(u,o-l/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.test=function(t){return this._test=t,this},e.prototype.timeout=function(t){return this._test.timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_test"==t?void 0:e},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.it=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var r in t)if("function"==typeof t[r]){var a=t[r];switch(r){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(r,a))}}else{var i=s.create(n[0],r);n.unshift(i),e(t[r]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.13.0",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test")}),t.register("reporters/base.js",function(t,e,n){function s(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,s.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}var o=n("browser/tty"),i=o.isatty(1)&&o.isatty(2);e=t.exports=s,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var r=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:o.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=r("error title"," %s) %s:\n")+r("error message"," %s")+r("error stack","\n%s\n"),s=t.err,o=s.message||"",i=s.stack||o,a=i.indexOf(o)+o.length,c=i.slice(0,a);i=i.slice(a+1).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,i)})},s.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=r("bright fail"," ✖")+r("fail"," %d of %d tests failed")+r("light",":"),console.error(t,e.failures,this.runner.total),s.list(this.failures),void console.error()):(t=r("bright pass"," ✔")+r("green"," %d tests complete")+r("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}i.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=r.escape(o(t.fn.toString()));console.log("%s
%s
",e(),n)})}function o(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var i=n("./base"),r=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=r.readFileSync(s,"utf8"),c=e.compile(a,{filename:s}),u=this;i.call(this,t,!1),t.on("end",function(){process.stdout.write(c({cov:u.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var i=n("./json-cov"),r=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t){r.call(this,t);var e,n,s=this.stats,a=t.total,f=$("#mocha"),p=[f],h=$(l).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(n=d.getContext("2d"),e=new c),f.length?(e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var o=s.tests/a*100|0;e&&e.update(o).draw(n);var r=new Date-s.start;if(h.find(".passes em").text(s.passes),h.find(".failures em").text(s.failures),h.find(".duration em").text((r/1e3).toFixed(2)),"passed"==t.state)var c=$('

'+u(t.title)+"

");else if(t.pending)var c=$('

'+u(t.title)+"

");else{var c=$('

'+u(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+u(l)+"
").appendTo(c)}if(c.find("h2").toggle(function(){d&&d.slideDown("fast")},function(){d&&d.slideUp("fast")}),!t.pending){var f=u(i(t.fn.toString())),d=$("
"+f+"
");d.appendTo(c).hide()}p[0].append(c)})):o("#mocha div missing, add it to your document")}function o(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var r=n("./base"),a=n("../utils"),c=n("../browser/progress"),u=a.escape;e=t.exports=s;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-cov.js",function(t,e,n){function s(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var s=[],i=[],c=[];t.on("test end",function(t){s.push(t)}),t.on("pass",function(t){c.push(t)}),t.on("fail",function(t){i.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=o(t);a.stats=n.stats,a.tests=s.map(r),a.failures=i.map(r),a.passes=c.map(r),e&&process.stdout.write(JSON.stringify(a,null,2))})}function o(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var s=i(n,t[n]);e.files.push(s),e.hits+=s.hits,e.misses+=s.misses,e.sloc+=s.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function i(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;i.call(this,t);var n=[],s=[],r=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){r.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:s.map(o),passes:r.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+r("runway",t)}o.call(this,t);var n=this,s=(this.stats,.75*o.window.width|0),a=t.total,c=process.stdout,u=r("plane","✈"),l=-1,f=0;t.on("start",function(){c.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==l?s*++f/a|0:l;"failed"==t.state&&(u=r("plane crash","✈"),l=n),c.write("\n\n"),c.write(e()),c.write("\n "),c.write(r("runway",Array(n).join("⋅"))),c.write(u),c.write(r("runway",Array(s-n).join("⋅")+"\n")),c.write(e()),c.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var o=n("./base"),i=o.cursor,r=o.color;e=t.exports=s,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(r("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=r("checkmark"," -")+r("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=r("checkmark"," ✓")+r("pass"," %s: ")+r(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(r("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),i=o.cursor,r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){o.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*o.window.width|0),a=t.total,c=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=c++/a,n=s*t|0,o=s-n;i.CR(),process.stdout.write(""),process.stdout.write(r("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(r("progress",e.close)),e.verbose&&process.stdout.write(r("progress"," "+c+" of "+a))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var o=n("./base"),i=o.cursor,r=o.color;e=t.exports=s,o.colors.progress=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}o.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(r("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+r("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+r("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+r("checkmark"," ✓")+r("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+r("checkmark"," ✓")+r("pass"," %s ")+r(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+r("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),i=o.cursor,r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){i.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,o(t))}),t.on("pass",function(t){console.log("ok %d %s",n,o(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,o(t)),console.log(e.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",o(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",o(t.fullTitle()),o(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",o(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",o(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function o(t){return t.replace(/'/g,"|'")}var i=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=u(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,r(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,s){var o,i=n?"/>":">",r=[];for(var a in e)r.push(a+'="'+u(e[a])+'"');return o="<"+t+(r.length?" "+r.join(" "):"")+i,s&&(o+=s+""}var a=n("./base"),c=n("../utils"),u=c.escape;e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}var o=n("browser/events").EventEmitter,i=n("browser/debug")("runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){clearTimeout(this.timer)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(){o||(o=!0,i.emit("error",new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(s)return e();i.clearTimeout(),i.duration=new Date-a,s=!0,t(n)}}var s,o,i=this,r=this.timeout(),a=new Date,c=this.ctx;if(this.async&&r&&(this.timer=setTimeout(function(){n(new Error("timeout of "+r+"ms exceeded")),i.timedOut=!0},r)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(u){n(u)}else try{this.pending||this.fn.call(c),this.duration=new Date-a,t()}catch(u){t(u)}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(r.keys(global).concat(["errno"]))}var o=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),r=(n("./test"),n("./utils"));t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this},s.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),r.forEach(t,function(t){this._globals.push(t)},this),this)},s.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r.filter(r.keys(global),function(t){return!(~r.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed",this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=o[t];return s?(i.currentRunnable=s,s.ctx.test(i.test),i.emit("hook",s),s.on("error",function(t){i.failHook(s,t)}),void s.run(function(e){return s.removeAllListeners("error"),e?i.failHook(s,e):(i.emit("hook end",s),void n(++t))})):e()}var s=this.suite,o=s["_"+t],i=(s._timeout,this);process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(r){return o.suite=r,r?void o.hook(t,function(t){return t?(o.suite=i,n(t)):void s(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;try{e.ctx.test(e),e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){return o.failures&&t._bail?e():(s=i.shift())?o._grep.test(s.fullTitle())?s.pending?(o.emit("pending",s),o.emit("test end",s),n()):(o.emit("test",o.test=s),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return s=o.test,t?(o.fail(s,t),o.emit("test end",s),o.hookUp("afterEach",n)):(s.state="passed",o.emit("pass",s),o.emit("test end",s),void o.hookUp("afterEach",n))})})):n():e()}var s,o=this,i=t.tests;this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[r++];return e?void o.runSuite(e,n):s()}function s(){o.suite=t,o.hook("afterAll",function(){o.emit("suite end",t),e()})}var o=this,r=0;i("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){o.runTests(t,n)})},s.prototype.uncaught=function(t){i("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){var e=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var o=n("browser/events").EventEmitter,i=n("browser/debug")("suite"),r=n("./utils"),a=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},s.prototype=new o,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return r.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"==t[0]?void 0:"parent"==t?"#":e},2)}}),t.register("utils.js",function(t,e,n){function s(t){return!~c.indexOf(t)}var o=n("browser/fs"),i=n("browser/path"),r=i.join,a=n("browser/debug")("watch"),c=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,o=t.length;o>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,o=t.length;o>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n,s){for(var o=n,i=0,r=t.length;r>i;i++)o=e.call(s,o,t[i],i,t);return o},e.filter=function(t,e,n){for(var s=[],o=0,i=t.length;i>o;o++){var r=t[o];e.call(n,r,o,t)&&s.push(r)}return s},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),o.watchFile(t,n,function(n,s){s.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(t){return s.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),s=e.slice(0,n),o=e.slice(++n);return t[s]=decodeURIComponent(o),t},{})}var n=new mocha.Suite("",new mocha.Context),s=mocha.utils,o=mocha.reporters.HTML;$(function(){$("code").each(function(){$(this).html(t($(this).text()))})}),mocha.setup=function(t){if(t=mocha.interfaces[t],!t)throw new Error('invalid mocha interface "'+t+'"');t(n),n.emit("pre-require",window)},mocha.run=function(){n.emit("run");var s=new mocha.Runner(n),i=(new o(s),e(window.location.search||""));return i.grep&&s.grep(new RegExp(i.grep)),s.on("end",function(){$("code").each(function(){$(this).html(t($(this).text()))})}),s.run()}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.14.0/mocha.min.css b/ajax/libs/mocha/0.14.0/mocha.min.css new file mode 100644 index 000000000..74b3dbc9d --- /dev/null +++ b/ajax/libs/mocha/0.14.0/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha h1,h2{margin:0}#mocha h1{font-size:1em;font-weight:200}#mocha .suite .suite h1{font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00c41c}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/0.14.0/mocha.min.js b/ajax/libs/mocha/0.14.0/mocha.min.js new file mode 100644 index 000000000..bb69f3bc1 --- /dev/null +++ b/ajax/libs/mocha/0.14.0/mocha.min.js @@ -0,0 +1 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",o=e+"/index.js";return t.modules[s]&&s||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),o=n.split("/");s.pop();for(var i=0;ii;i++)if(s[i]===e||s[i].listener&&s[i].listener===e){o=i;break}if(0>o)return this;s.splice(o,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var o=e.slice(),i=0,r=o.length;r>i;i++)o[i].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,o=s,i=s,r=s-1,a=this._fontSize;t.font=a+"px "+this._font;var c=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,r,0,c,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,r-1,0,c,!0),t.stroke();var u=this._text||(0|e)+"%",l=t.measureText(u).width;return t.fillText(u,o-l/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.test=function(t){return this._test=t,this},e.prototype.timeout=function(t){return this._test.timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_test"==t?void 0:e},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.it=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var r in t)if("function"==typeof t[r]){var a=t[r];switch(r){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(r,a))}}else{var i=s.create(n[0],r);n.unshift(i),e(t[r]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.13.0",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test")}),t.register("reporters/base.js",function(t,e,n){function s(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,s.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}var o=n("browser/tty"),i=o.isatty(1)&&o.isatty(2);e=t.exports=s,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var r=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:o.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=r("error title"," %s) %s:\n")+r("error message"," %s")+r("error stack","\n%s\n"),s=t.err,o=s.message||"",i=s.stack||o,a=i.indexOf(o)+o.length,c=i.slice(0,a);i=i.slice(a+1).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,i)})},s.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=r("bright fail"," ✖")+r("fail"," %d of %d tests failed")+r("light",":"),console.error(t,e.failures,this.runner.total),s.list(this.failures),void console.error()):(t=r("bright pass"," ✔")+r("green"," %d tests complete")+r("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}i.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=r.escape(o(t.fn.toString()));console.log("%s
%s
",e(),n)})}function o(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var i=n("./base"),r=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=r.readFileSync(s,"utf8"),c=e.compile(a,{filename:s}),u=this;i.call(this,t,!1),t.on("end",function(){process.stdout.write(c({cov:u.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var i=n("./json-cov"),r=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t){r.call(this,t);var e,n,s=this.stats,a=t.total,f=$("#mocha"),p=[f],h=$(l).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(n=d.getContext("2d"),e=new c),f.length?(e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var o=s.tests/a*100|0;e&&e.update(o).draw(n);var r=new Date-s.start;if(h.find(".passes em").text(s.passes),h.find(".failures em").text(s.failures),h.find(".duration em").text((r/1e3).toFixed(2)),"passed"==t.state)var c=$('

'+u(t.title)+"

");else if(t.pending)var c=$('

'+u(t.title)+"

");else{var c=$('

'+u(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+u(l)+"
").appendTo(c)}if(c.find("h2").toggle(function(){d&&d.slideDown("fast")},function(){d&&d.slideUp("fast")}),!t.pending){var f=u(i(t.fn.toString())),d=$("
"+f+"
");d.appendTo(c).hide()}p[0].append(c)})):o("#mocha div missing, add it to your document")}function o(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var r=n("./base"),a=n("../utils"),c=n("../browser/progress"),u=a.escape;e=t.exports=s;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-cov.js",function(t,e,n){function s(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var s=[],i=[],c=[];t.on("test end",function(t){s.push(t)}),t.on("pass",function(t){c.push(t)}),t.on("fail",function(t){i.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=o(t);a.stats=n.stats,a.tests=s.map(r),a.failures=i.map(r),a.passes=c.map(r),e&&process.stdout.write(JSON.stringify(a,null,2))})}function o(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var s=i(n,t[n]);e.files.push(s),e.hits+=s.hits,e.misses+=s.misses,e.sloc+=s.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function i(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;i.call(this,t);var n=[],s=[],r=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){r.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:s.map(o),passes:r.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+r("runway",t)}o.call(this,t);var n=this,s=(this.stats,.75*o.window.width|0),a=t.total,c=process.stdout,u=r("plane","✈"),l=-1,f=0;t.on("start",function(){c.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==l?s*++f/a|0:l;"failed"==t.state&&(u=r("plane crash","✈"),l=n),c.write("\n\n"),c.write(e()),c.write("\n "),c.write(r("runway",Array(n).join("⋅"))),c.write(u),c.write(r("runway",Array(s-n).join("⋅")+"\n")),c.write(e()),c.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var o=n("./base"),i=o.cursor,r=o.color;e=t.exports=s,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(r("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=r("checkmark"," -")+r("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=r("checkmark"," ✓")+r("pass"," %s: ")+r(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(r("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),i=o.cursor,r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){o.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*o.window.width|0),a=t.total,c=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=c++/a,n=s*t|0,o=s-n;i.CR(),process.stdout.write(""),process.stdout.write(r("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(r("progress",e.close)),e.verbose&&process.stdout.write(r("progress"," "+c+" of "+a))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var o=n("./base"),i=o.cursor,r=o.color;e=t.exports=s,o.colors.progress=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}o.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(r("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+r("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+r("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+r("checkmark"," ✓")+r("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+r("checkmark"," ✓")+r("pass"," %s ")+r(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+r("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),i=o.cursor,r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){i.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,o(t))}),t.on("pass",function(t){console.log("ok %d %s",n,o(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,o(t)),console.log(e.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",o(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",o(t.fullTitle()),o(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",o(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",o(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function o(t){return t.replace(/'/g,"|'")}var i=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=u(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,r(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,s){var o,i=n?"/>":">",r=[];for(var a in e)r.push(a+'="'+u(e[a])+'"');return o="<"+t+(r.length?" "+r.join(" "):"")+i,s&&(o+=s+""}var a=n("./base"),c=n("../utils"),u=c.escape;e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}var o=n("browser/events").EventEmitter,i=n("browser/debug")("runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){clearTimeout(this.timer)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(){o||(o=!0,i.emit("error",new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(s)return e();i.clearTimeout(),i.duration=new Date-a,s=!0,t(n)}}var s,o,i=this,r=this.timeout(),a=new Date,c=this.ctx;if(this.async&&r&&(this.timer=setTimeout(function(){n(new Error("timeout of "+r+"ms exceeded")),i.timedOut=!0},r)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(u){n(u)}else try{this.pending||this.fn.call(c),this.duration=new Date-a,t()}catch(u){t(u)}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(r.keys(global).concat(["errno"]))}var o=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),r=(n("./test"),n("./utils"));t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this},s.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),r.forEach(t,function(t){this._globals.push(t)},this),this)},s.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r.filter(r.keys(global),function(t){return!(~r.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed",this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=o[t];return s?(i.currentRunnable=s,s.ctx.test(i.test),i.emit("hook",s),s.on("error",function(t){i.failHook(s,t)}),void s.run(function(e){return s.removeAllListeners("error"),e?i.failHook(s,e):(i.emit("hook end",s),void n(++t))})):e()}var s=this.suite,o=s["_"+t],i=(s._timeout,this);process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(r){return o.suite=r,r?void o.hook(t,function(t){return t?(o.suite=i,n(t)):void s(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;try{e.ctx.test(e),e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){return o.failures&&t._bail?e():(s=i.shift())?o._grep.test(s.fullTitle())?s.pending?(o.emit("pending",s),o.emit("test end",s),n()):(o.emit("test",o.test=s),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return s=o.test,t?(o.fail(s,t),o.emit("test end",s),o.hookUp("afterEach",n)):(s.state="passed",o.emit("pass",s),o.emit("test end",s),void o.hookUp("afterEach",n))})})):n():e()}var s,o=this,i=t.tests;this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[r++];return e?void o.runSuite(e,n):s()}function s(){o.suite=t,o.hook("afterAll",function(){o.emit("suite end",t),e()})}var o=this,r=0;i("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){o.runTests(t,n)})},s.prototype.uncaught=function(t){i("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){var e=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var o=n("browser/events").EventEmitter,i=n("browser/debug")("suite"),r=n("./utils"),a=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},s.prototype=new o,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return r.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"==t[0]?void 0:"parent"==t?"#":e},2)}}),t.register("utils.js",function(t,e,n){function s(t){return!~c.indexOf(t)}var o=n("browser/fs"),i=n("browser/path"),r=i.join,a=n("browser/debug")("watch"),c=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,o=t.length;o>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,o=t.length;o>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n,s){for(var o=n,i=0,r=t.length;r>i;i++)o=e.call(s,o,t[i],i,t);return o},e.filter=function(t,e,n){for(var s=[],o=0,i=t.length;i>o;o++){var r=t[o];e.call(n,r,o,t)&&s.push(r)}return s},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),o.watchFile(t,n,function(n,s){s.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(t){return s.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),s=e.slice(0,n),o=e.slice(++n);return t[s]=decodeURIComponent(o),t},{})}var n=new mocha.Suite("",new mocha.Context),s=mocha.utils,o=mocha.reporters.HTML;$(function(){$("code").each(function(){$(this).html(t($(this).text()))})}),mocha.setup=function(t){if(t=mocha.interfaces[t],!t)throw new Error('invalid mocha interface "'+t+'"');t(n),n.emit("pre-require",window)},mocha.run=function(){n.emit("run");var s=new mocha.Runner(n),i=(new o(s),e(window.location.search||""));return i.grep&&s.grep(new RegExp(i.grep)),s.on("end",function(){$("code").each(function(){$(this).html(t($(this).text()))})}),s.run()}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.14.1/mocha.min.css b/ajax/libs/mocha/0.14.1/mocha.min.css new file mode 100644 index 000000000..2a26b349f --- /dev/null +++ b/ajax/libs/mocha/0.14.1/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha h1,h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00c41c}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/0.14.1/mocha.min.js b/ajax/libs/mocha/0.14.1/mocha.min.js new file mode 100644 index 000000000..f3d0b4b8f --- /dev/null +++ b/ajax/libs/mocha/0.14.1/mocha.min.js @@ -0,0 +1 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",o=e+"/index.js";return t.modules[s]&&s||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),o=n.split("/");s.pop();for(var r=0;rr;r++)if(s[r]===e||s[r].listener&&s[r].listener===e){o=r;break}if(0>o)return this;s.splice(o,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var o=e.slice(),r=0,i=o.length;i>r;r++)o[r].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,o=s,r=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var c=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,r,i,0,c,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,r,i-1,0,c,!0),t.stroke();var u=this._text||(0|e)+"%",l=t.measureText(u).width;return t.fillText(u,o-l/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.test=function(t){return this._test=t,this},e.prototype.timeout=function(t){return this._test.timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_test"==t?void 0:e},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.it=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(i,a))}}else{var r=s.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.14.0",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test")}),t.register("reporters/base.js",function(t,e,n){function s(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,s.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e){return c["diff"+e](t.actual,t.expected).map(function(t){return t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return l(t,e)}).join("\n")}var a=n("browser/tty"),c=n("browser/diff"),u=a.isatty(1)&&a.isatty(2);e=t.exports=s,e.useColors=u,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var l=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:u?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=l("error title"," %s) %s:\n")+l("error message"," %s")+l("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,c=a.indexOf(i)+i.length,u=a.slice(0,c),f=s.actual,p=s.expected;if("string"==typeof f&&"string"==typeof p){var h=Math.max(f.length,p.length);u=20>h?r(s,"Chars"):r(s,"Words");var d=u.split("\n");if(d.length>4){var g=String(d.length).length;u=d.map(function(t,e){return o(++e,g)+" | "+t}).join("\n")}u="\n"+l("diff removed","actual")+" "+l("diff added","expected")+"\n\n"+u+"\n",u=u.replace(/^/gm," "),n=l("error title"," %s) %s:\n%s")+l("error stack","\n%s\n")}a=a.slice(c+1).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),u,a)})},s.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=l("bright fail"," ✖")+l("fail"," %d of %d tests failed")+l("light",":"),console.error(t,e.failures,this.runner.total),s.list(this.failures),void console.error()):(t=l("bright pass"," ✔")+l("green"," %d tests complete")+l("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=i.escape(o(t.fn.toString()));console.log("%s
%s
",e(),n)})}function o(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),c=e.compile(a,{filename:s}),u=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(c({cov:u.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t){u.call(this,t);var e,n,s=this.stats,l=t.total,p=document.getElementById("mocha"),d=r(h),g=d.getElementsByTagName("li"),m=g[1].getElementsByTagName("em")[0],v=g[2].getElementsByTagName("em")[0],w=g[3].getElementsByTagName("em")[0],y=d.getElementsByTagName("canvas")[0],b=[p];return y.getContext&&(n=y.getContext("2d"),e=new f),p?(p.appendChild(d),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r('

%s

',t.title);b[0].appendChild(e),b.unshift(document.createElement("div")),e.appendChild(b[0])}}),t.on("suite end",function(t){t.root||b.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var o=s.tests/l*100|0;e&&e.update(o).draw(n);var u=new Date-s.start;if(i(m,s.passes),i(v,s.failures),i(w,(u/1e3).toFixed(2)),"passed"==t.state)var f=r('

%e

',t.title);else if(t.pending)var f=r('

%e

',t.title);else{var f=r('

%e

',t.title),p=t.err.stack||t.err;"[object Error]"==p&&(p=t.err.message),f.appendChild(r('
%e
',p))}var h=f.getElementsByTagName("h2")[0];if(a(h,"click",function(){d.style.display="none"==d.style.display?"block":"none"}),!t.pending){var d=r("
%e
",c(t.fn.toString()));f.appendChild(d),d.style.display="none"}b[0].appendChild(f)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(r('
%s
',t))}function r(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return p(e[s++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function c(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var u=n("./base"),l=n("../utils"),f=n("../browser/progress"),p=l.escape;e=t.exports=s;var h='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-cov.js",function(t,e,n){function s(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var s=[],r=[],c=[];t.on("test end",function(t){s.push(t)}),t.on("pass",function(t){c.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=o(t);a.stats=n.stats,a.tests=s.map(i),a.failures=r.map(i),a.passes=c.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function o(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var s=r(n,t[n]);e.files.push(s),e.hits+=s.hits,e.misses+=s.misses,e.sloc+=s.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;r.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:s.map(o),passes:i.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}o.call(this,t);var n=this,s=(this.stats,.75*o.window.width|0),a=t.total,c=process.stdout,u=i("plane","✈"),l=-1,f=0;t.on("start",function(){c.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==l?s*++f/a|0:l;"failed"==t.state&&(u=i("plane crash","✈"),l=n),c.write("\n\n"),c.write(e()),c.write("\n "),c.write(i("runway",Array(n).join("⋅"))),c.write(u),c.write(i("runway",Array(s-n).join("⋅")+"\n")),c.write(e()),c.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){o.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*o.window.width|0),a=t.total,c=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){var t=c++/a,n=s*t|0,o=s-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+c+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.progress=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}o.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){r.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,o(t))}),t.on("pass",function(t){console.log("ok %d %s",n,o(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,o(t)),console.log(e.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",o(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",o(t.fullTitle()),o(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",o(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",o(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function o(t){return t.replace(/'/g,"|'")}var r=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=u(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,s){var o,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+u(e[a])+'"');return o="<"+t+(i.length?" "+i.join(" "):"")+r,s&&(o+=s+""}var a=n("./base"),c=n("../utils"),u=c.escape;e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){clearTimeout(this.timer)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(){o||(o=!0,r.emit("error",new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(s)return e();r.clearTimeout(),r.duration=new Date-a,s=!0,t(n)}}var s,o,r=this,i=this.timeout(),a=new Date,c=this.ctx;if(this.async&&i&&(this.timer=setTimeout(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(u){n(u)}else try{this.pending||this.fn.call(c),this.duration=new Date-a,t()}catch(u){t(u)}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(i.keys(global).concat(["errno"]))}var o=n("browser/events").EventEmitter,r=n("browser/debug")("runner"),i=(n("./test"),n("./utils"));t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this},s.prototype.globals=function(t){return 0==arguments.length?this._globals:(r("globals %j",t),i.forEach(t,function(t){this._globals.push(t)},this),this)},s.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=i.filter(i.keys(global),function(t){return!(~i.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed",this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=o[t];return s?(r.currentRunnable=s,s.ctx.test(r.test),r.emit("hook",s),s.on("error",function(t){r.failHook(s,t)}),void s.run(function(e){return s.removeAllListeners("error"),e?r.failHook(s,e):(r.emit("hook end",s),void n(++t))})):e()}var s=this.suite,o=s["_"+t],r=(s._timeout,this);process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return o.suite=i,i?void o.hook(t,function(t){return t?(o.suite=r,n(t)):void s(e.pop())}):(o.suite=r,n())}var o=this,r=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;try{e.ctx.test(e),e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){return o.failures&&t._bail?e():(s=r.shift())?o._grep.test(s.fullTitle())?s.pending?(o.emit("pending",s),o.emit("test end",s),n()):(o.emit("test",o.test=s),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return s=o.test,t?(o.fail(s,t),o.emit("test end",s),o.hookUp("afterEach",n)):(s.state="passed",o.emit("pass",s),o.emit("test end",s),void o.hookUp("afterEach",n))})})):n():e()}var s,o=this,r=t.tests;this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void o.runSuite(e,n):s()}function s(){o.suite=t,o.hook("afterAll",function(){o.emit("suite end",t),e()})}var o=this,i=0;r("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){o.runTests(t,n)})},s.prototype.uncaught=function(t){r("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){var e=this,t=t||function(){};return r("start"),this.on("end",function(){r("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},s.prototype=new o,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return r("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(r("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"==t[0]?void 0:"parent"==t?"#":e},2)}}),t.register("utils.js",function(t,e,n){function s(t){return!~c.indexOf(t)}var o=n("browser/fs"),r=n("browser/path"),i=r.join,a=n("browser/debug")("watch"),c=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,o=t.length;o>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,o=t.length;o>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n,s){for(var o=n,r=0,i=t.length;i>r;r++)o=e.call(s,o,t[r],r,t);return o},e.filter=function(t,e,n){for(var s=[],o=0,r=t.length;r>o;o++){var i=t[o];e.call(n,i,o,t)&&s.push(i)}return s},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),o.watchFile(t,n,function(n,s){s.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,s=e.length;s>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),s=e.slice(0,n),o=e.slice(++n);return t[s]=decodeURIComponent(o),t},{})}var s=new mocha.Suite("",new mocha.Context),o=mocha.utils;mocha.setup=function(t){if(t=mocha.interfaces[t],!t)throw new Error('invalid mocha interface "'+t+'"');t(s),s.emit("pre-require",window)},mocha.run=function(t){s.emit("run");var o=new mocha.Runner(s);t=t||mocha.reporters.HTML;var r=(new t(o),n(window.location.search||""));return r.grep&&o.grep(new RegExp(r.grep)),o.on("end",e),o.run()}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.2.0/mocha.min.css b/ajax/libs/mocha/0.2.0/mocha.min.css new file mode 100644 index 000000000..8569ff167 --- /dev/null +++ b/ajax/libs/mocha/0.2.0/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'◦';font-size:12px;display:block;float:left;margin-right:5px}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0;color:#888}#stats em{color:#000}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.2.0/mocha.min.js b/ajax/libs/mocha/0.2.0/mocha.min.js new file mode 100644 index 000000000..7005e47da --- /dev/null +++ b/ajax/libs/mocha/0.2.0/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",r=t+"/index.js";return require.modules[o]&&o||require.modules[r]&&r||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),r=e.split("/");o.pop();for(var s=0;ss;++s)o[s].apply(this,e);return this}}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("hook.js",function(t,e,o){function r(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("interfaces/bdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var n;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new s(i,u))}}else{var n=r.create(o[0],i);o.unshift(n),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.2.0",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test")}),require.register("reporters/base.js",function(t,e,o){function r(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},r=this.failures=[];t&&(this.runner=t,t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var r=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>r?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,r.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),n=s.isatty(1)&&s.isatty(2);e=t.exports=r,e.useColors=n,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:n?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),r=t.err,s=r.stack,n=s.indexOf(r.message)+r.message.length,u=s.slice(0,n);s=s.slice(n+1).replace(/^/gm," "),console.error(o,e,t.fullTitle(),u,s)})},r.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),r.list(this.failures),console.error(),void process.nextTick(function(){process.exit(e.failures)})):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),console.log(),void process.nextTick(function(){process.exit(0)}))}}),require.register("reporters/doc.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}n.call(this,t);var o=this.stats,r=(t.total,2);t.on("suite",function(t){t.root||(++r,console.log('%s
',e()),++r,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--r,console.log("%s
",e()),--r)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)}),t.on("end",function(){process.exit(o.failures)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var n=o("./base"),i=o("../utils");e=t.exports=r}),require.register("reporters/dot.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(n("pending","."))}),t.on("pass",function(t){++r%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?n("bright yellow","."):n(t.speed,"."))}),t.on("fail",function(){++r%o==0&&process.stdout.write("\n "),process.stdout.write(n("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/html.js",function(t,e,o){function r(t){i.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),r=[o],c=$(a).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");r[0].append(e),r.unshift($("
")),e.append(r[0])}}),t.on("suite end",function(t){t.root||r.shift()}),t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var s=$('

'+t.title+"

");else if(t.pending)var s=$('

'+t.title+"

");else{var s=$('

'+t.title+"

"),i=t.err.stack||t.err,a=$('
'+i+"
");s.append(a)}if(s.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=u.escape(n(t.fn.toString())),f=$("
"+l+"
");f.appendTo(s).hide()}r[0].append(s)}),void t.on("end",function(){process.exit(e.failures)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),u=o("../utils");e=t.exports=r;var a='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function r(t){n.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]),function(){process.exit(0)})})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.color}e=t.exports=r}),require.register("reporters/json.js",function(t,e,o){function r(t){var e=this;n.call(this,t);var o=[],r=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:r.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t),function(){process.exit(0)})})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.cursor,n.color}e=t.exports=r}),require.register("reporters/landing.js",function(t,e,o){function r(t){function e(){var t=Array(r).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,r=(this.stats,.75*s.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),n.hide()}),t.on("test end",function(t){var o=-1==l?r*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(r-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/list.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(n("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=n("checkmark"," -")+n("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=n("checkmark"," ✓")+n("pass"," %s: ")+n(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+n("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/progress.js",function(t,e,o){function r(t,e){s.call(this,t);{var o=this,e=e||{},r=(this.stats,.5*s.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),n.hide()}),t.on("test end",function(){var t=a++/u,o=r*t|0,s=r-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.progress=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/spec.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}s.call(this,t);var o=this,r=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(n("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("test",function(t){process.stdout.write(e()+n("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var o=e()+n("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+n("checkmark"," ✓")+n("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+n("checkmark"," ✓")+n("pass"," %s ")+n(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+n("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/tap.js",function(t,e,o){function r(t){s.call(this,t);var e=this.stats,o=t.total,r=1;t.on("start",function(){console.log("%d..%d",1,o)}),t.on("test end",function(){++r}),t.on("pass",function(t){console.log("ok %d %s",r,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",r,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))}),t.on("end",function(){process.exit(e.failures)})}{var s=o("./base");s.cursor,s.color}e=t.exports=r}),require.register("runnable.js",function(t,e,o){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}var s=o("browser/events").EventEmitter;t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(this._timeout=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function o(o){return r?e():(clearTimeout(n),i.duration=new Date-a,r=!0,void t(o))}var r,s,n,i=this,u=this.timeout(),a=new Date;if(this.async&&(n=setTimeout(function(){o(new Error("timeout of "+u+"ms exceeded"))},u)),this.async)try{this.fn(o)}catch(c){o(c)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(c){t(c)}}}),require.register("runner.js",function(t,e,o){function r(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(Object.keys(global).concat(["errno"]))}{var s=o("browser/events").EventEmitter;o("./test")}t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.grep=function(t){return this._grep=t,this},r.prototype.globals=function(t){return t.forEach(function(t){this._globals.push(t)},this),this},r.prototype.checkGlobals=function(t){var e=Object.keys(global).filter(function(t){return!~this._globals.indexOf(t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))},r.prototype.fail=function(t,e){t.failed=!0,this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end"),process.exit(0)},r.prototype.hook=function(t,e){function o(t){var r=s[t];return r?(n.emit("hook",r),r.on("error",function(t){n.failHook(r,t)}),void r.run(function(e){return e?n.failHook(r,e):(n.emit("hook end",r),void o(++t))})):e()}var r=this.suite,s=r["_"+t],n=(r._timeout,this);process.nextTick(function(){o(0)})},r.prototype.hooks=function(t,e,o){function r(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=n,o(t)):void r(e.pop())}):(s.suite=n,o())}var s=this,n=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},r.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function o(t){return t&&(s.fail(r,t),s.emit("test end",r)),(r=n.shift())?s._grep.test(r.fullTitle())?r.pending?(s.emit("pending",r),s.emit("test end",r),o()):(s.emit("test",s.test=r),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?o(t):(s.emit("pass",r),r.passed=!0,s.emit("test end",r),void s.hookUp("afterEach",o))})})):o():e()}var r,s=this,n=t.tests;o()},r.prototype.runSuite=function(t,e){function o(){var e=t.suites[n++];return e?void s.runSuite(e,o):r()}function r(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,n=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},r.prototype.run=function(){var t=this;return this.emit("start"),this.runSuite(this.suite,function(){t.emit("end")}),process.on("uncaughtException",function(e){t.fail(t.test,e),t.emit("test end",t.test),t.emit("end")}),this}}),require.register("suite.js",function(t,e,o){function r(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this.timeout(2e3)}var s=o("browser/events").EventEmitter,n=o("./hook");e=t.exports=r;var i={};e.create=function(t,e){var o=new r(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},r.prototype.beforeAll=function(t){var e=new n('"before all" hook',t);return e.parent=this,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){var e=new n('"after all" hook',t);return e.parent=this,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){var e=new n('"before each" hook',t);return e.parent=this,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){var e=new n('"after each" hook',t);return e.parent=this,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t,e,o){function r(t,e){s.call(this,t,e),this.pending=!e}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),process={},process.nextTick=function(t){setTimeout(t,0)},process.on=function(){},process.exit=function(){},process.stdout={},global=this,mocha=require("mocha"),function(){var t=new mocha.Suite,e=mocha.reporters.HTML;mocha.setup=function(e){if(e=mocha.interfaces[e],!e)throw new Error('invalid mocha interface "'+e+'"');e(t),t.emit("pre-require",global)},mocha.run=function(){t.emit("run");{var o=new mocha.Runner(t);new e(o)}o.run()}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/0.3.0/mocha.min.css b/ajax/libs/mocha/0.3.0/mocha.min.css new file mode 100644 index 000000000..aabde36fa --- /dev/null +++ b/ajax/libs/mocha/0.3.0/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Aria;,sans-serif;padding:60px 50px}h1,h2{margin:0}h1{font-size:1em;font-weight:200}.suite .suite h1{font-size:.8em}h2{font-size:12px;font-weight:400;cursor:pointer}.suite,.test{margin-left:15px}.test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00c41c}.test.pending{color:#0b97c4}.test.pending::before{content:'◦';color:#0b97c4}.test.fail{color:#c00}.test.fail pre{color:#000}.test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}.test pre.error{color:#c00}.test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:30px;font-size:12px;margin:0;color:#888}#stats em{color:#000}#stats li{list-style:none} \ No newline at end of file diff --git a/ajax/libs/mocha/0.3.0/mocha.min.js b/ajax/libs/mocha/0.3.0/mocha.min.js new file mode 100644 index 000000000..1d465f6d7 --- /dev/null +++ b/ajax/libs/mocha/0.3.0/mocha.min.js @@ -0,0 +1 @@ +function require(t){var e=require.resolve(t),o=require.modules[e];if(!o)throw new Error('failed to require "'+t+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,require.relative(e))),o.exports}require.modules={},require.resolve=function(t){var e=t,o=t+".js",r=t+"/index.js";return require.modules[o]&&o||require.modules[r]&&r||e},require.register=function(t,e){require.modules[t]=e},require.relative=function(t){return function(e){if("."!=e[0])return require(e);var o=t.split("/"),r=e.split("/");o.pop();for(var s=0;ss;++s)o[s].apply(this,e);return this}}),require.register("browser/fs.js",function(){}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("hook.js",function(t,e,o){function r(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("interfaces/bdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var n;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new s(i,u))}}else{var n=r.create(o[0],i);o.unshift(n),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.3.0",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test"),e.watch=o("./watch")}),require.register("reporters/base.js",function(t,e,o){function r(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},r=this.failures=[];t&&(this.runner=t,t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var r=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>r?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,r.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),n=s.isatty(1)&&s.isatty(2);e=t.exports=r,e.useColors=n,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:n?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),r=t.err,s=r.stack,n=s.indexOf(r.message)+r.message.length,u=s.slice(0,n);s=s.slice(n+1).replace(/^/gm," "),console.error(o,e,t.fullTitle(),u,s)})},r.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),r.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),require.register("reporters/doc.js",function(t,e,o){function r(t){function e(){return Array(o).join(" ")}n.call(this,t);var o=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++o,console.log('%s
',e()),++o,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--o,console.log("%s
",e()),--o)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var n=o("./base"),i=o("../utils");e=t.exports=r}),require.register("reporters/dot.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(n("pending","."))}),t.on("pass",function(t){++r%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?n("bright yellow","."):n(t.speed,"."))}),t.on("fail",function(){++r%o==0&&process.stdout.write("\n "),process.stdout.write(n("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/html.js",function(t,e,o){function r(t){i.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),r=[o],c=$(a).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");r[0].append(e),r.unshift($("
")),e.append(r[0])}}),t.on("suite end",function(t){t.root||r.shift()}),void t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var s=$('

'+t.title+"

");else if(t.pending)var s=$('

'+t.title+"

");else{var s=$('

'+t.title+"

"),i=t.err.stack||t.err,a=$('
'+i+"
");s.append(a)}if(s.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=u.escape(n(t.fn.toString())),f=$("
"+l+"
");f.appendTo(s).hide()}r[0].append(s)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),u=o("../utils");e=t.exports=r;var a='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function r(t){n.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.color}e=t.exports=r}),require.register("reporters/json.js",function(t,e,o){function r(t){var e=this;n.call(this,t);var o=[],r=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:r.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.cursor,n.color}e=t.exports=r}),require.register("reporters/landing.js",function(t,e,o){function r(t){function e(){var t=Array(r).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,r=(this.stats,.75*s.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),n.hide()}),t.on("test end",function(t){var o=-1==l?r*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(r-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/list.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(n("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=n("checkmark"," -")+n("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=n("checkmark"," ✓")+n("pass"," %s: ")+n(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+n("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/progress.js",function(t,e,o){function r(t,e){s.call(this,t);{var o=this,e=e||{},r=(this.stats,.5*s.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),n.hide()}),t.on("test end",function(){var t=a++/u,o=r*t|0,s=r-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.progress=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/spec.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}s.call(this,t);var o=this,r=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(n("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("test",function(t){process.stdout.write(e()+n("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var o=e()+n("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+n("checkmark"," ✓")+n("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+n("checkmark"," ✓")+n("pass"," %s ")+n(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+n("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/tap.js",function(t,e,o){function r(t){s.call(this,t);var e=(this.stats,t.total),o=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++o}),t.on("pass",function(t){console.log("ok %d %s",o,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",o,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))})}{var s=o("./base");s.cursor,s.color}e=t.exports=r}),require.register("runnable.js",function(t,e,o){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}var s=o("browser/events").EventEmitter;t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(this._timeout=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function o(o){return r?e():(clearTimeout(n),i.duration=new Date-a,r=!0,void t(o))}var r,s,n,i=this,u=this.timeout(),a=new Date;if(this.async&&(n=setTimeout(function(){o(new Error("timeout of "+u+"ms exceeded"))},u)),this.async)try{this.fn(o)}catch(c){o(c)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(c){t(c)}}}),require.register("runner.js",function(t,e,o){function r(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(Object.keys(global).concat(["errno"]))}{var s=o("browser/events").EventEmitter;o("./test")}t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.grep=function(t){return this._grep=t,this},r.prototype.globals=function(t){return t.forEach(function(t){this._globals.push(t)},this),this},r.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=Object.keys(global).filter(function(t){return!~this._globals.indexOf(t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},r.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},r.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},r.prototype.hook=function(t,e){function o(t){var r=s[t];return r?(n.emit("hook",r),r.on("error",function(t){n.failHook(r,t)}),void r.run(function(e){return e?n.failHook(r,e):(n.emit("hook end",r),void o(++t))})):e()}var r=this.suite,s=r["_"+t],n=(r._timeout,this);process.nextTick(function(){o(0)})},r.prototype.hooks=function(t,e,o){function r(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=n,o(t)):void r(e.pop())}):(s.suite=n,o())}var s=this,n=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},r.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function o(t){return t&&(s.fail(r,t),s.emit("test end",r)),(r=n.shift())?s._grep.test(r.fullTitle())?r.pending?(s.emit("pending",r),s.emit("test end",r),o()):(s.emit("test",s.test=r),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?o(t):(s.emit("pass",r),r.passed=!0,s.emit("test end",r),void s.hookUp("afterEach",o))})})):o():e()}var r,s=this,n=t.tests;o()},r.prototype.runSuite=function(t,e){function o(){var e=t.suites[n++];return e?void s.runSuite(e,o):r()}function r(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,n=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},r.prototype.run=function(t){function e(t){o.fail(o.test,t),o.emit("test end",o.test),o.emit("end")}var o=this,t=t||function(){};return o.on("end",function(){process.removeListener("uncaughtException",e),t(o.failures)}),this.emit("start"),this.runSuite(this.suite,function(){o.emit("end")}),process.on("uncaughtException",e),this}}),require.register("suite.js",function(t,e,o){function r(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this.timeout(2e3)}var s=o("browser/events").EventEmitter,n=o("./hook");e=t.exports=r;var i={};e.reset=function(){i={}},e.create=function(t,e){var o=new r(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},r.prototype=new s,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return t.timeout(this._timeout),t},r.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},r.prototype.beforeAll=function(t){var e=new n('"before all" hook',t);return e.parent=this,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){var e=new n('"after all" hook',t);return e.parent=this,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){var e=new n('"before each" hook',t);return e.parent=this,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){var e=new n('"after each" hook',t);return e.parent=this,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t,e,o){function r(t,e){s.call(this,t,e),this.pending=!e}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),require.register("watch.js",function(t,e,o){var r=o("browser/fs");t.exports=function(t,e){var o={interval:100};t.forEach(function(t){r.watchFile(t,o,function(o,r){r.mtimes;++s)o[s].apply(this,e);return this}}),require.register("browser/fs.js",function(){}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("hook.js",function(t,e,o){function r(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("interfaces/bdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var n;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new s(i,u))}}else{var n=r.create(o[0],i);o.unshift(n),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.3.0",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test"),e.watch=o("./watch")}),require.register("reporters/base.js",function(t,e,o){function r(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},r=this.failures=[];t&&(this.runner=t,t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var r=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>r?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,r.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),n=s.isatty(1)&&s.isatty(2);e=t.exports=r,e.useColors=n,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:n?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),r=t.err,s=r.stack,n=s.indexOf(r.message)+r.message.length,u=s.slice(0,n);s=s.slice(n+1).replace(/^/gm," "),console.error(o,e,t.fullTitle(),u,s)})},r.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),r.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),require.register("reporters/doc.js",function(t,e,o){function r(t){function e(){return Array(o).join(" ")}n.call(this,t);var o=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++o,console.log('%s
',e()),++o,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--o,console.log("%s
",e()),--o)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var n=o("./base"),i=o("../utils");e=t.exports=r}),require.register("reporters/dot.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(n("pending","."))}),t.on("pass",function(t){++r%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?n("bright yellow","."):n(t.speed,"."))}),t.on("fail",function(){++r%o==0&&process.stdout.write("\n "),process.stdout.write(n("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/html.js",function(t,e,o){function r(t){i.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),r=[o],c=$(a).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");r[0].append(e),r.unshift($("
")),e.append(r[0])}}),t.on("suite end",function(t){t.root||r.shift()}),void t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var s=$('

'+t.title+"

");else if(t.pending)var s=$('

'+t.title+"

");else{var s=$('

'+t.title+"

"),i=t.err.stack||t.err,a=$('
'+i+"
");s.append(a)}if(s.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=u.escape(n(t.fn.toString())),f=$("
"+l+"
");f.appendTo(s).hide()}r[0].append(s)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),u=o("../utils");e=t.exports=r;var a='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function r(t){n.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.color}e=t.exports=r}),require.register("reporters/json.js",function(t,e,o){function r(t){var e=this;n.call(this,t);var o=[],r=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:r.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.cursor,n.color}e=t.exports=r}),require.register("reporters/landing.js",function(t,e,o){function r(t){function e(){var t=Array(r).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,r=(this.stats,.75*s.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),n.hide()}),t.on("test end",function(t){var o=-1==l?r*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(r-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/list.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(n("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=n("checkmark"," -")+n("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=n("checkmark"," ✓")+n("pass"," %s: ")+n(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+n("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/progress.js",function(t,e,o){function r(t,e){s.call(this,t);{var o=this,e=e||{},r=(this.stats,.5*s.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),n.hide()}),t.on("test end",function(){var t=a++/u,o=r*t|0,s=r-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.progress=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/spec.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}s.call(this,t);var o=this,r=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(n("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("test",function(t){process.stdout.write(e()+n("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var o=e()+n("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+n("checkmark"," ✓")+n("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+n("checkmark"," ✓")+n("pass"," %s ")+n(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+n("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/tap.js",function(t,e,o){function r(t){s.call(this,t);var e=(this.stats,t.total),o=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++o}),t.on("pass",function(t){console.log("ok %d %s",o,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",o,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))})}{var s=o("./base");s.cursor,s.color}e=t.exports=r}),require.register("runnable.js",function(t,e,o){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}var s=o("browser/events").EventEmitter;t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(this._timeout=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function o(o){return r?e():(clearTimeout(n),i.duration=new Date-a,r=!0,void t(o))}var r,s,n,i=this,u=this.timeout(),a=new Date;if(this.async&&(n=setTimeout(function(){o(new Error("timeout of "+u+"ms exceeded"))},u)),this.async)try{this.fn(o)}catch(c){o(c)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(c){t(c)}}}),require.register("runner.js",function(t,e,o){function r(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(Object.keys(global).concat(["errno"]))}{var s=o("browser/events").EventEmitter;o("./test")}t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.grep=function(t){return this._grep=t,this},r.prototype.globals=function(t){return t.forEach(function(t){this._globals.push(t)},this),this},r.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=Object.keys(global).filter(function(t){return!~this._globals.indexOf(t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},r.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},r.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},r.prototype.hook=function(t,e){function o(t){var r=s[t];return r?(n.emit("hook",r),r.on("error",function(t){n.failHook(r,t)}),void r.run(function(e){return e?n.failHook(r,e):(n.emit("hook end",r),void o(++t))})):e()}var r=this.suite,s=r["_"+t],n=(r._timeout,this);process.nextTick(function(){o(0)})},r.prototype.hooks=function(t,e,o){function r(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=n,o(t)):void r(e.pop())}):(s.suite=n,o())}var s=this,n=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},r.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function o(t){return t&&(s.fail(r,t),s.emit("test end",r)),(r=n.shift())?s._grep.test(r.fullTitle())?r.pending?(s.emit("pending",r),s.emit("test end",r),o()):(s.emit("test",s.test=r),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?o(t):(s.emit("pass",r),r.passed=!0,s.emit("test end",r),void s.hookUp("afterEach",o))})})):o():e()}var r,s=this,n=t.tests;o()},r.prototype.runSuite=function(t,e){function o(){var e=t.suites[n++];return e?void s.runSuite(e,o):r()}function r(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,n=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},r.prototype.run=function(t){function e(t){o.fail(o.test,t),o.emit("test end",o.test),o.emit("end")}var o=this,t=t||function(){};return o.on("end",function(){process.removeListener("uncaughtException",e),t(o.failures)}),this.emit("start"),this.runSuite(this.suite,function(){o.emit("end")}),process.on("uncaughtException",e),this}}),require.register("suite.js",function(t,e,o){function r(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this.timeout(2e3)}var s=o("browser/events").EventEmitter,n=o("./hook");e=t.exports=r;var i={};e.reset=function(){i={}},e.create=function(t,e){var o=new r(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},r.prototype=new s,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return t.timeout(this._timeout),t},r.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},r.prototype.beforeAll=function(t){var e=new n('"before all" hook',t);return e.parent=this,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){var e=new n('"after all" hook',t);return e.parent=this,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){var e=new n('"before each" hook',t);return e.parent=this,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){var e=new n('"after each" hook',t);return e.parent=this,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t,e,o){function r(t,e){s.call(this,t,e),this.pending=!e}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),require.register("watch.js",function(t,e,o){var r=o("browser/fs");t.exports=function(t,e){var o={interval:100};t.forEach(function(t){r.watchFile(t,o,function(o,r){r.mtimes;++s)o[s].apply(this,e);return this}}),require.register("browser/fs.js",function(){}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("hook.js",function(t,e,o){function r(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("interfaces/bdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var n;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new s(i,u))}}else{var n=r.create(o[0],i);o.unshift(n),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.3.0",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test"),e.watch=o("./watch")}),require.register("reporters/base.js",function(t,e,o){function r(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},r=this.failures=[];t&&(this.runner=t,t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var r=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>r?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,r.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),n=s.isatty(1)&&s.isatty(2);e=t.exports=r,e.useColors=n,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:n?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),r=t.err,s=r.stack,n=s.indexOf(r.message)+r.message.length,u=s.slice(0,n);s=s.slice(n+1).replace(/^/gm," "),console.error(o,e,t.fullTitle(),u,s)})},r.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),r.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),require.register("reporters/doc.js",function(t,e,o){function r(t){function e(){return Array(o).join(" ")}n.call(this,t);var o=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++o,console.log('%s
',e()),++o,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--o,console.log("%s
",e()),--o)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var n=o("./base"),i=o("../utils");e=t.exports=r}),require.register("reporters/dot.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(n("pending","."))}),t.on("pass",function(t){++r%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?n("bright yellow","."):n(t.speed,"."))}),t.on("fail",function(){++r%o==0&&process.stdout.write("\n "),process.stdout.write(n("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/html.js",function(t,e,o){function r(t){i.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),r=[o],c=$(a).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");r[0].append(e),r.unshift($("
")),e.append(r[0])}}),t.on("suite end",function(t){t.root||r.shift()}),void t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var s=$('

'+t.title+"

");else if(t.pending)var s=$('

'+t.title+"

");else{var s=$('

'+t.title+"

"),i=t.err.stack||t.err,a=$('
'+i+"
");s.append(a)}if(s.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=u.escape(n(t.fn.toString())),f=$("
"+l+"
");f.appendTo(s).hide()}r[0].append(s)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),u=o("../utils");e=t.exports=r;var a='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function r(t){n.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.color}e=t.exports=r}),require.register("reporters/json.js",function(t,e,o){function r(t){var e=this;n.call(this,t);var o=[],r=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:r.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.cursor,n.color}e=t.exports=r}),require.register("reporters/landing.js",function(t,e,o){function r(t){function e(){var t=Array(r).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,r=(this.stats,.75*s.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),n.hide()}),t.on("test end",function(t){var o=-1==l?r*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(r-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/list.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(n("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=n("checkmark"," -")+n("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=n("checkmark"," ✓")+n("pass"," %s: ")+n(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+n("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/progress.js",function(t,e,o){function r(t,e){s.call(this,t);{var o=this,e=e||{},r=(this.stats,.5*s.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),n.hide()}),t.on("test end",function(){var t=a++/u,o=r*t|0,s=r-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.progress=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/spec.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}s.call(this,t);var o=this,r=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(n("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("test",function(t){process.stdout.write(e()+n("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var o=e()+n("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+n("checkmark"," ✓")+n("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+n("checkmark"," ✓")+n("pass"," %s ")+n(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+n("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/tap.js",function(t,e,o){function r(t){s.call(this,t);var e=(this.stats,t.total),o=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++o}),t.on("pass",function(t){console.log("ok %d %s",o,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",o,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))})}{var s=o("./base");s.cursor,s.color}e=t.exports=r}),require.register("runnable.js",function(t,e,o){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}var s=o("browser/events").EventEmitter;t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(this._timeout=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function o(o){return r?e():(clearTimeout(n),i.duration=new Date-a,r=!0,void t(o))}var r,s,n,i=this,u=this.timeout(),a=new Date;if(this.async&&(n=setTimeout(function(){o(new Error("timeout of "+u+"ms exceeded"))},u)),this.async)try{this.fn(o)}catch(c){o(c)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(c){t(c)}}}),require.register("runner.js",function(t,e,o){function r(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(Object.keys(global).concat(["errno"]))}{var s=o("browser/events").EventEmitter;o("./test")}t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.grep=function(t){return this._grep=t,this},r.prototype.globals=function(t){return t.forEach(function(t){this._globals.push(t)},this),this},r.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=Object.keys(global).filter(function(t){return!~this._globals.indexOf(t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},r.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},r.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},r.prototype.hook=function(t,e){function o(t){var r=s[t];return r?(n.emit("hook",r),r.on("error",function(t){n.failHook(r,t)}),void r.run(function(e){return e?n.failHook(r,e):(n.emit("hook end",r),void o(++t))})):e()}var r=this.suite,s=r["_"+t],n=(r._timeout,this);process.nextTick(function(){o(0)})},r.prototype.hooks=function(t,e,o){function r(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=n,o(t)):void r(e.pop())}):(s.suite=n,o())}var s=this,n=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},r.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function o(t){return t&&(s.fail(r,t),s.emit("test end",r)),(r=n.shift())?s._grep.test(r.fullTitle())?r.pending?(s.emit("pending",r),s.emit("test end",r),o()):(s.emit("test",s.test=r),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?o(t):(s.emit("pass",r),r.passed=!0,s.emit("test end",r),void s.hookUp("afterEach",o))})})):o():e()}var r,s=this,n=t.tests;o()},r.prototype.runSuite=function(t,e){function o(){var e=t.suites[n++];return e?void s.runSuite(e,o):r()}function r(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,n=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},r.prototype.run=function(t){function e(t){o.fail(o.test,t),o.emit("test end",o.test),o.emit("end")}var o=this,t=t||function(){};return o.on("end",function(){process.removeListener("uncaughtException",e),t(o.failures)}),this.emit("start"),this.runSuite(this.suite,function(){o.emit("end")}),process.on("uncaughtException",e),this}}),require.register("suite.js",function(t,e,o){function r(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this.timeout(2e3)}var s=o("browser/events").EventEmitter,n=o("./hook");e=t.exports=r;var i={};e.reset=function(){i={}},e.create=function(t,e){var o=new r(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},r.prototype=new s,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return t.timeout(this._timeout),t},r.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},r.prototype.beforeAll=function(t){var e=new n('"before all" hook',t);return e.parent=this,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){var e=new n('"after all" hook',t);return e.parent=this,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){var e=new n('"before each" hook',t);return e.parent=this,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){var e=new n('"after each" hook',t);return e.parent=this,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t,e,o){function r(t,e){s.call(this,t,e),this.pending=!e}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),require.register("watch.js",function(t,e,o){var r=o("browser/fs");t.exports=function(t,e){var o={interval:100};t.forEach(function(t){r.watchFile(t,o,function(o,r){r.mtimes;++s)o[s].apply(this,e);return this}}),require.register("browser/fs.js",function(){}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("hook.js",function(t,e,o){function r(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("interfaces/bdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("interfaces/exports.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var n;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new s(i,u))}}else{var n=r.create(o[0],i);o.unshift(n),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),require.register("interfaces/tdd.js",function(t,e,o){var r=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,o){var s=r.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),require.register("mocha.js",function(t,e,o){e.version="0.3.0",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test"),e.watch=o("./watch")}),require.register("reporters/base.js",function(t,e,o){function r(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},r=this.failures=[];t&&(this.runner=t,t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var r=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>r?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,r.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),n=s.isatty(1)&&s.isatty(2);e=t.exports=r,e.useColors=n,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:n?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),r=t.err,s=r.stack,n=s.indexOf(r.message)+r.message.length,u=s.slice(0,n);s=s.slice(n+1).replace(/^/gm," "),console.error(o,e,t.fullTitle(),u,s)})},r.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),r.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),require.register("reporters/doc.js",function(t,e,o){function r(t){function e(){return Array(o).join(" ")}n.call(this,t);var o=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++o,console.log('%s
',e()),++o,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--o,console.log("%s
",e()),--o)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var n=o("./base"),i=o("../utils");e=t.exports=r}),require.register("reporters/dot.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(n("pending","."))}),t.on("pass",function(t){++r%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?n("bright yellow","."):n(t.speed,"."))}),t.on("fail",function(){++r%o==0&&process.stdout.write("\n "),process.stdout.write(n("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/html.js",function(t,e,o){function r(t){i.call(this,t);var e=this.stats,o=(t.total,$("#mocha")),r=[o],c=$(a).appendTo(o);return o.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");r[0].append(e),r.unshift($("
")),e.append(r[0])}}),t.on("suite end",function(t){t.root||r.shift()}),void t.on("test end",function(t){var o=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((o/1e3).toFixed(2)),t.passed)var s=$('

'+t.title+"

");else if(t.pending)var s=$('

'+t.title+"

");else{var s=$('

'+t.title+"

"),i=t.err.stack||t.err,a=$('
'+i+"
");s.append(a)}if(s.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=u.escape(n(t.fn.toString())),f=$("
"+l+"
");f.appendTo(s).hide()}r[0].append(s)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),u=o("../utils");e=t.exports=r;var a='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,o){function r(t){n.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.color}e=t.exports=r}),require.register("reporters/json.js",function(t,e,o){function r(t){var e=this;n.call(this,t);var o=[],r=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:r.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var n=o("./base");n.cursor,n.color}e=t.exports=r}),require.register("reporters/landing.js",function(t,e,o){function r(t){function e(){var t=Array(r).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,r=(this.stats,.75*s.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),n.hide()}),t.on("test end",function(t){var o=-1==l?r*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(r-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/list.js",function(t,e,o){function r(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(n("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=n("checkmark"," -")+n("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=n("checkmark"," ✓")+n("pass"," %s: ")+n(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+n("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/progress.js",function(t,e,o){function r(t,e){s.call(this,t);{var o=this,e=e||{},r=(this.stats,.5*s.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),n.hide()}),t.on("test end",function(){var t=a++/u,o=r*t|0,s=r-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){n.show(),console.log(),o.epilogue()})}var s=o("./base"),n=s.cursor,i=s.color;e=t.exports=r,s.colors.progress=90,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/spec.js",function(t,e,o){function r(t){function e(){return Array(r).join(" ")}s.call(this,t);var o=this,r=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(n("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("test",function(t){process.stdout.write(e()+n("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var o=e()+n("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+n("checkmark"," ✓")+n("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+n("checkmark"," ✓")+n("pass"," %s ")+n(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+n("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),n=s.color;e=t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("reporters/tap.js",function(t,e,o){function r(t){s.call(this,t);var e=(this.stats,t.total),o=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++o}),t.on("pass",function(t){console.log("ok %d %s",o,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",o,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))})}{var s=o("./base");s.cursor,s.color}e=t.exports=r}),require.register("runnable.js",function(t,e,o){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this.timeout(2e3)}var s=o("browser/events").EventEmitter;t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(this._timeout=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function o(o){return r?e():(clearTimeout(n),i.duration=new Date-a,r=!0,void t(o))}var r,s,n,i=this,u=this.timeout(),a=new Date;if(this.async&&(n=setTimeout(function(){o(new Error("timeout of "+u+"ms exceeded"))},u)),this.async)try{this.fn(o)}catch(c){o(c)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(c){t(c)}}}),require.register("runner.js",function(t,e,o){function r(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(Object.keys(global).concat(["errno"]))}{var s=o("browser/events").EventEmitter;o("./test")}t.exports=r,r.prototype=new s,r.prototype.constructor=r,r.prototype.grep=function(t){return this._grep=t,this},r.prototype.globals=function(t){return t.forEach(function(t){this._globals.push(t)},this),this},r.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=Object.keys(global).filter(function(t){return!~this._globals.indexOf(t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},r.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},r.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},r.prototype.hook=function(t,e){function o(t){var r=s[t];return r?(n.emit("hook",r),r.on("error",function(t){n.failHook(r,t)}),void r.run(function(e){return e?n.failHook(r,e):(n.emit("hook end",r),void o(++t))})):e()}var r=this.suite,s=r["_"+t],n=(r._timeout,this);process.nextTick(function(){o(0)})},r.prototype.hooks=function(t,e,o){function r(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=n,o(t)):void r(e.pop())}):(s.suite=n,o())}var s=this,n=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},r.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function o(t){return t&&(s.fail(r,t),s.emit("test end",r)),(r=n.shift())?s._grep.test(r.fullTitle())?r.pending?(s.emit("pending",r),s.emit("test end",r),o()):(s.emit("test",s.test=r),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?o(t):(s.emit("pass",r),r.passed=!0,s.emit("test end",r),void s.hookUp("afterEach",o))})})):o():e()}var r,s=this,n=t.tests;o()},r.prototype.runSuite=function(t,e){function o(){var e=t.suites[n++];return e?void s.runSuite(e,o):r()}function r(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,n=0;this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},r.prototype.run=function(t){function e(t){o.fail(o.test,t),o.emit("test end",o.test),o.emit("end")}var o=this,t=t||function(){};return o.on("end",function(){process.removeListener("uncaughtException",e),t(o.failures)}),this.emit("start"),this.runSuite(this.suite,function(){o.emit("end")}),process.on("uncaughtException",e),this}}),require.register("suite.js",function(t,e,o){function r(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this.timeout(2e3)}var s=o("browser/events").EventEmitter,n=o("./hook");e=t.exports=r;var i={};e.reset=function(){i={}},e.create=function(t,e){var o=new r(e);return o.parent=t,e=o.fullTitle(),i[e]?i[e]:(t.addSuite(o),i[e]=o)},r.prototype=new s,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return t.timeout(this._timeout),t},r.prototype.timeout=function(t){return String(t).match(/s$/)&&(t=1e3*parseFloat(t)),this._timeout=parseInt(t,10),this},r.prototype.beforeAll=function(t){var e=new n('"before all" hook',t);return e.parent=this,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){var e=new n('"after all" hook',t);return e.parent=this,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){var e=new n('"before each" hook',t);return e.parent=this,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){var e=new n('"after each" hook',t);return e.parent=this,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,this._timeout&&t.timeout(this._timeout),this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t,e,o){function r(t,e){s.call(this,t,e),this.pending=!e}var s=o("./runnable");t.exports=r,r.prototype=new s,r.prototype.constructor=r}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),require.register("watch.js",function(t,e,o){var r=o("browser/fs");t.exports=function(t,e){var o={interval:100};t.forEach(function(t){r.watchFile(t,o,function(o,r){r.mtimen;++n)r[n].apply(this,e);return this}}),require.register("browser/fs.js",function(){}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("hook.js",function(t,e,r){function o(t,e){n.call(this,t,e)}var n=r("./runnable");t.exports=o,o.prototype=new n,o.prototype.constructor=o}),require.register("interfaces/bdd.js",function(t,e,r){var o=r("../suite"),n=r("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,r){var n=o.create(e[0],t);e.unshift(n),r(),e.shift()},t.it=function(t,r){e[0].addTest(new n(t,r))}})}}),require.register("interfaces/exports.js",function(t,e,r){var o=r("../suite"),n=r("../test");t.exports=function(t){function e(t){var s;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":r[0].beforeAll(u);break;case"after":r[0].afterAll(u);break;case"beforeEach":r[0].beforeEach(u);break;case"afterEach":r[0].afterEach(u);break;default:r[0].addTest(new n(i,u))}}else{var s=o.create(r[0],i);r.unshift(s),e(t[i]),r.shift()}}var r=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,r){e.bdd=r("./bdd"),e.tdd=r("./tdd"),e.exports=r("./exports")}),require.register("interfaces/tdd.js",function(t,e,r){var o=r("../suite"),n=r("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,r){var n=o.create(e[0],t);e.unshift(n),r(),e.shift()},t.test=function(t,r){e[0].addTest(new n(t,r))}})}}),require.register("mocha.js",function(t,e,r){e.version="0.3.5",e.interfaces=r("./interfaces"),e.reporters=r("./reporters"),e.Runnable=r("./runnable"),e.Runner=r("./runner"),e.Suite=r("./suite"),e.Hook=r("./hook"),e.Test=r("./test"),e.watch=r("./watch")}),require.register("reporters/base.js",function(t,e,r){function o(t){var r=this.stats={suites:0,tests:0,passes:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){r.start=new Date}),t.on("suite",function(){r.suites=r.suites||0,r.suites++}),t.on("test end",function(){r.tests=r.tests||0,r.tests++}),t.on("pass",function(t){r.passes=r.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",r.passes++}),t.on("fail",function(t,e){r.failures=r.failures||0,r.failures++,t.err=e,o.push(t)}),t.on("end",function(){r.end=new Date,r.duration=new Date-r.start}))}var n=r("browser/tty"),s=n.isatty(1)&&n.isatty(2);e=t.exports=o,e.useColors=s,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,r){return e.useColors?"["+e.colors[t]+"m"+r+"":r};e.window={width:s?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:n.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var r=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),o=t.err,n=o.stack,s=o.message||"",u=n.indexOf(s)+s.length,a=n.slice(0,u);n=n.slice(u+1).replace(/^/gm," "),console.error(r,e,t.fullTitle(),a,n)})},o.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),o.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),require.register("reporters/doc.js",function(t,e,r){function o(t){function e(){return Array(r).join(" ")}s.call(this,t);var r=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++r,console.log('%s
',e()),++r,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--r,console.log("%s
",e()),--r)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var r=i.escape(n(t.fn.toString()));console.log("%s
%s
",e(),r)})}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,r=new RegExp("^ {"+e+"}","gm");return t=t.replace(r,"")}var s=r("./base"),i=r("../utils");e=t.exports=o}),require.register("reporters/dot.js",function(t,e,r){function o(t){n.call(this,t);var e=this,r=(this.stats,.75*n.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(s("pending","."))}),t.on("pass",function(t){++o%r==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?s("bright yellow","."):s(t.speed,"."))}),t.on("fail",function(){++o%r==0&&process.stdout.write("\n "),process.stdout.write(s("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var n=r("./base"),s=n.color;e=t.exports=o,o.prototype=new n,o.prototype.constructor=o}),require.register("reporters/html.js",function(t,e,r){function o(t){i.call(this,t);var e=this.stats,r=(t.total,$("#mocha")),o=[r],c=$(a).appendTo(r);return r.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");o[0].append(e),o.unshift($("
")),e.append(o[0])}}),t.on("suite end",function(t){t.root||o.shift()}),void t.on("test end",function(t){var r=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((r/1e3).toFixed(2)),t.passed)var n=$('

'+t.title+"

");else if(t.pending)var n=$('

'+t.title+"

");else{var n=$('

'+t.title+"

"),i=t.err.stack||t.err,a=$('
'+i+"
");n.append(a)}if(n.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=u.escape(s(t.fn.toString())),f=$("
"+l+"
");f.appendTo(n).hide()}o[0].append(n)})):n("#mocha div missing, add it to your document")}function n(t){$('
'+t+"
").appendTo("body")}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,r=new RegExp("^ {"+e+"}","gm");return t=t.replace(r,"").replace(/^\s+/,"")}var i=r("./base"),u=r("../utils");e=t.exports=o;var a='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,r){e.Base=r("./base"),e.Dot=r("./dot"),e.Doc=r("./doc"),e.TAP=r("./tap"),e.JSON=r("./json"),e.HTML=r("./html"),e.List=r("./list"),e.Spec=r("./spec"),e.Progress=r("./progress"),e.Landing=r("./landing"),e.JSONStream=r("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,r){function o(t){s.call(this,t);var e=this,r=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:r}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",n(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",n(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function n(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=r("./base");s.color}e=t.exports=o}),require.register("reporters/json.js",function(t,e,r){function o(t){var e=this;s.call(this,t);var r=[],o=[],i=[];t.on("test end",function(t){r.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:r.map(n),failures:o.map(n),passes:i.map(n)};process.stdout.write(JSON.stringify(t))})}function n(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=r("./base");s.cursor,s.color}e=t.exports=o}),require.register("reporters/landing.js",function(t,e,r){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}n.call(this,t);var r=this,o=(this.stats,.75*n.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),s.hide()}),t.on("test end",function(t){var r=-1==l?o*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=r),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(r).join("⋅"))),a.write(c),a.write(i("runway",Array(o-r).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){s.show(),console.log(),r.epilogue()})}var n=r("./base"),s=n.cursor,i=n.color;e=t.exports=o,n.colors.plane=0,n.colors["plane crash"]=31,n.colors.runway=90,o.prototype=new n,o.prototype.constructor=o}),require.register("reporters/list.js",function(t,e,r){function o(t){n.call(this,t);var e=this,r=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(s("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=s("checkmark"," -")+s("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=s("checkmark"," ✓")+s("pass"," %s: ")+s(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+s("fail"," %d) %s"),r++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var n=r("./base"),s=n.color;e=t.exports=o,o.prototype=new n,o.prototype.constructor=o}),require.register("reporters/progress.js",function(t,e,r){function o(t,e){n.call(this,t);{var r=this,e=e||{},o=(this.stats,.5*n.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),s.hide()}),t.on("test end",function(){var t=a++/u,r=o*t|0,n=o-r;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(r).join(e.complete)),process.stdout.write(Array(n).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){s.show(),console.log(),r.epilogue()})}var n=r("./base"),s=n.cursor,i=n.color;e=t.exports=o,n.colors.progress=90,o.prototype=new n,o.prototype.constructor=o}),require.register("reporters/spec.js",function(t,e,r){function o(t){function e(){return Array(o).join(" ")}n.call(this,t);var r=this,o=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(s("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+s("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var r=e()+s("pending"," - %s");console.log(r,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var r=e()+s("checkmark"," ✓")+s("pass"," %s ");console.log("\r"+r,t.title)}else{var r=e()+s("checkmark"," ✓")+s("pass"," %s ")+s(t.speed,"(%dms)");console.log("\r"+r,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+s("fail"," %d) %s"),i++,t.title)}),t.on("end",r.epilogue.bind(r))}var n=r("./base"),s=n.color;e=t.exports=o,o.prototype=new n,o.prototype.constructor=o}),require.register("reporters/tap.js",function(t,e,r){function o(t){n.call(this,t);var e=(this.stats,t.total),r=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++r}),t.on("pass",function(t){console.log("ok %d %s",r,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",r,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))})}{var n=r("./base");n.cursor,n.color}e=t.exports=o}),require.register("runnable.js",function(t,e,r){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3}var n=r("browser/events").EventEmitter,s=r("browser/debug")("runnable");t.exports=o,o.prototype=new n,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(s("timeout %d",t),this._timeout=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){clearTimeout(this.timer)},o.prototype.run=function(t){function e(){n||(n=!0,s.emit("error",new Error("done() called multiple times")))}function r(r){return o?e():(s.clearTimeout(),s.duration=new Date-u,o=!0,void t(r))}var o,n,s=this,i=this.timeout(),u=new Date;if(this.async&&(this.timer=setTimeout(function(){r(new Error("timeout of "+i+"ms exceeded"))},i)),this.async)try{this.fn(function(t){return t instanceof Error?r(t):void r()})}catch(a){r(a)}else try{this.pending||this.fn(),this.duration=new Date-u,t()}catch(a){t(a)}}}),require.register("runner.js",function(t,e,r){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(Object.keys(global).concat(["errno"]))}{var n=r("browser/events").EventEmitter,s=r("browser/debug")("runner");r("./test")}t.exports=o,o.prototype=new n,o.prototype.constructor=o,o.prototype.grep=function(t){return s("grep %s",t),this._grep=t,this},o.prototype.globals=function(t){return s("globals %j",t),t.forEach(function(t){this._globals.push(t)},this),this},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=Object.keys(global).filter(function(t){return!~this._globals.indexOf(t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},o.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function r(t){var o=n[t];return o?(s.currentRunnable=o,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?s.failHook(o,e):(s.emit("hook end",o),void r(++t))})):e()}var o=this.suite,n=o["_"+t],s=(o._timeout,this);process.nextTick(function(){r(0)})},o.prototype.hooks=function(t,e,r){function o(i){return n.suite=i,i?void n.hook(t,function(t){return t?(n.suite=s,r(t)):void o(e.pop())}):(n.suite=s,r())}var n=this,s=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var r=[this.suite].concat(this.parents()).reverse();this.hooks(t,r,e)},o.prototype.hookDown=function(t,e){var r=[this.suite].concat(this.parents());this.hooks(t,r,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,r=this;try{e.on("error",function(t){r.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function r(){return(o=s.shift())?n._grep.test(o.fullTitle())?o.pending?(n.emit("pending",o),n.emit("test end",o),r()):(n.emit("test",n.test=n.currentRunnable=o),void n.hookDown("beforeEach",function(){n.runTest(function(t){return t?(n.fail(o,t),n.emit("test end",o),n.hookUp("afterEach",r)):(n.emit("pass",o),o.passed=!0,n.emit("test end",o),void n.hookUp("afterEach",r))})})):r():e()}var o,n=this,s=t.tests;r()},o.prototype.runSuite=function(t,e){function r(){var e=t.suites[i++];return e?void n.runSuite(e,r):o()}function o(){n.suite=t,n.hook("afterAll",function(){n.emit("suite end",t),e()})}var n=this,i=0;s("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){n.runTests(t,r)})},o.prototype.run=function(t){function e(t){s("uncaught exception"),r.currentRunnable.clearTimeout(),r.fail(r.currentRunnable,t),r.emit("test end",r.test),r.emit("end")}var r=this,t=t||function(){};return s("start"),r.on("end",function(){s("end"),process.removeListener("uncaughtException",e),t(r.failures)}),this.emit("start"),this.runSuite(this.suite,function(){s("finished running"),r.emit("end")}),process.on("uncaughtException",e),this}}),require.register("suite.js",function(t,e,r){function o(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3}var n=r("browser/events").EventEmitter,s=r("browser/debug")("suite"),i=r("./hook");e=t.exports=o;var u={};e.reset=function(){u={}},e.create=function(t,e){var r=new o(e);return r.parent=t,e=r.fullTitle(),u[e]?u[e]:(t.addSuite(r),u[e]=r)},o.prototype=new n,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.timeout(this.timeout()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.beforeAll=function(t){var e=new i('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new i('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new i('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new i('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t,e,r){function o(t,e){n.call(this,t,e),this.pending=!e}var n=r("./runnable");t.exports=o,o.prototype=new n,o.prototype.constructor=o}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),require.register("watch.js",function(t,e,r){var o=r("browser/fs"),n=r("browser/debug")("watch");t.exports=function(t,e){var r={interval:100};t.forEach(function(t){n("watch %s",t),o.watchFile(t,r,function(r,o){o.mtimen;++n)r[n].apply(this,e);return this}}),require.register("browser/fs.js",function(){}),require.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),require.register("hook.js",function(t,e,r){function o(t,e){n.call(this,t,e)}var n=r("./runnable");t.exports=o,o.prototype=new n,o.prototype.constructor=o}),require.register("interfaces/bdd.js",function(t,e,r){var o=r("../suite"),n=r("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,r){var n=o.create(e[0],t);e.unshift(n),r(),e.shift()},t.it=function(t,r){e[0].addTest(new n(t,r))}})}}),require.register("interfaces/exports.js",function(t,e,r){var o=r("../suite"),n=r("../test");t.exports=function(t){function e(t){var s;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":r[0].beforeAll(u);break;case"after":r[0].afterAll(u);break;case"beforeEach":r[0].beforeEach(u);break;case"afterEach":r[0].afterEach(u);break;default:r[0].addTest(new n(i,u))}}else{var s=o.create(r[0],i);r.unshift(s),e(t[i]),r.shift()}}var r=[t];t.on("require",e)}}),require.register("interfaces/index.js",function(t,e,r){e.bdd=r("./bdd"),e.tdd=r("./tdd"),e.exports=r("./exports")}),require.register("interfaces/tdd.js",function(t,e,r){var o=r("../suite"),n=r("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,r){var n=o.create(e[0],t);e.unshift(n),r(),e.shift()},t.test=function(t,r){e[0].addTest(new n(t,r))}})}}),require.register("mocha.js",function(t,e,r){e.version="0.3.6",e.interfaces=r("./interfaces"),e.reporters=r("./reporters"),e.Runnable=r("./runnable"),e.Runner=r("./runner"),e.Suite=r("./suite"),e.Hook=r("./hook"),e.Test=r("./test"),e.watch=r("./watch")}),require.register("reporters/base.js",function(t,e,r){function o(t){var r=this.stats={suites:0,tests:0,passes:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){r.start=new Date}),t.on("suite",function(){r.suites=r.suites||0,r.suites++}),t.on("test end",function(){r.tests=r.tests||0,r.tests++}),t.on("pass",function(t){r.passes=r.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",r.passes++}),t.on("fail",function(t,e){r.failures=r.failures||0,r.failures++,t.err=e,o.push(t)}),t.on("end",function(){r.end=new Date,r.duration=new Date-r.start}))}var n=r("browser/tty"),s=n.isatty(1)&&n.isatty(2);e=t.exports=o,e.useColors=s,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:"40","error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,r){return e.useColors?"["+e.colors[t]+"m"+r+"":r};e.window={width:s?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:n.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var r=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),o=t.err,n=o.stack,s=o.message||"",u=n.indexOf(s)+s.length,a=n.slice(0,u);n=n.slice(u+1).replace(/^/gm," "),console.error(r,e,t.fullTitle(),a,n)})},o.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),o.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),require.register("reporters/doc.js",function(t,e,r){function o(t){function e(){return Array(r).join(" ")}s.call(this,t);var r=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++r,console.log('%s
',e()),++r,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--r,console.log("%s
",e()),--r)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var r=i.escape(n(t.fn.toString()));console.log("%s
%s
",e(),r)})}function n(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,r=new RegExp("^ {"+e+"}","gm");return t=t.replace(r,"")}var s=r("./base"),i=r("../utils");e=t.exports=o}),require.register("reporters/dot.js",function(t,e,r){function o(t){n.call(this,t);var e=this,r=(this.stats,.75*n.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(s("pending","."))}),t.on("pass",function(t){++o%r==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?s("bright yellow","."):s(t.speed,"."))}),t.on("fail",function(){++o%r==0&&process.stdout.write("\n "),process.stdout.write(s("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var n=r("./base"),s=n.color;e=t.exports=o,o.prototype=new n,o.prototype.constructor=o}),require.register("reporters/html.js",function(t,e,r){function o(t){i.call(this,t);var e=this.stats,r=(t.total,$("#mocha")),o=[r],c=$(a).appendTo(r);return r.length?(t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");o[0].append(e),o.unshift($("
")),e.append(o[0])}}),t.on("suite end",function(t){t.root||o.shift()}),void t.on("test end",function(t){var r=new Date-e.start;if(c.find(".passes em").text(e.passes),c.find(".failures em").text(e.failures),c.find(".duration em").text((r/1e3).toFixed(2)),t.passed)var n=$('

'+t.title+"

");else if(t.pending)var n=$('

'+t.title+"

");else{var n=$('

'+t.title+"

"),i=t.err.stack||t.err,a=$('
'+i+"
");n.append(a)}if(n.find("h2").toggle(function(){f.slideDown("fast")},function(){f.slideUp("fast")}),!t.pending){var l=u.escape(s(t.fn.toString())),f=$("
"+l+"
");f.appendTo(n).hide()}o[0].append(n)})):n("#mocha div missing, add it to your document")}function n(t){$('
'+t+"
").appendTo("body")}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,r=new RegExp("^ {"+e+"}","gm");return t=t.replace(r,"").replace(/^\s+/,"")}var i=r("./base"),u=r("../utils");e=t.exports=o;var a='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),require.register("reporters/index.js",function(t,e,r){e.Base=r("./base"),e.Dot=r("./dot"),e.Doc=r("./doc"),e.TAP=r("./tap"),e.JSON=r("./json"),e.HTML=r("./html"),e.List=r("./list"),e.Spec=r("./spec"),e.Progress=r("./progress"),e.Landing=r("./landing"),e.JSONStream=r("./json-stream")}),require.register("reporters/json-stream.js",function(t,e,r){function o(t){s.call(this,t);var e=this,r=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:r}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",n(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",n(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function n(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=r("./base");s.color}e=t.exports=o}),require.register("reporters/json.js",function(t,e,r){function o(t){var e=this;s.call(this,t);var r=[],o=[],i=[];t.on("test end",function(t){r.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:r.map(n),failures:o.map(n),passes:i.map(n)};process.stdout.write(JSON.stringify(t))})}function n(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=r("./base");s.cursor,s.color}e=t.exports=o}),require.register("reporters/landing.js",function(t,e,r){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}n.call(this,t);var r=this,o=(this.stats,.75*n.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),s.hide()}),t.on("test end",function(t){var r=-1==l?o*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=r),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(r).join("⋅"))),a.write(c),a.write(i("runway",Array(o-r).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){s.show(),console.log(),r.epilogue()})}var n=r("./base"),s=n.cursor,i=n.color;e=t.exports=o,n.colors.plane=0,n.colors["plane crash"]=31,n.colors.runway=90,o.prototype=new n,o.prototype.constructor=o}),require.register("reporters/list.js",function(t,e,r){function o(t){n.call(this,t);var e=this,r=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(s("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=s("checkmark"," -")+s("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=s("checkmark"," ✓")+s("pass"," %s: ")+s(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+s("fail"," %d) %s"),r++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var n=r("./base"),s=n.color;e=t.exports=o,o.prototype=new n,o.prototype.constructor=o}),require.register("reporters/progress.js",function(t,e,r){function o(t,e){n.call(this,t);{var r=this,e=e||{},o=(this.stats,.5*n.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),s.hide()}),t.on("test end",function(){var t=a++/u,r=o*t|0,n=o-r;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(r).join(e.complete)),process.stdout.write(Array(n).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){s.show(),console.log(),r.epilogue()})}var n=r("./base"),s=n.cursor,i=n.color;e=t.exports=o,n.colors.progress=90,o.prototype=new n,o.prototype.constructor=o}),require.register("reporters/spec.js",function(t,e,r){function o(t){function e(){return Array(o).join(" ")}n.call(this,t);var r=this,o=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(s("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+s("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var r=e()+s("pending"," - %s");console.log(r,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var r=e()+s("checkmark"," ✓")+s("pass"," %s ");console.log("\r"+r,t.title)}else{var r=e()+s("checkmark"," ✓")+s("pass"," %s ")+s(t.speed,"(%dms)");console.log("\r"+r,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+s("fail"," %d) %s"),i++,t.title)}),t.on("end",r.epilogue.bind(r))}var n=r("./base"),s=n.color;e=t.exports=o,o.prototype=new n,o.prototype.constructor=o}),require.register("reporters/tap.js",function(t,e,r){function o(t){n.call(this,t);var e=(this.stats,t.total),r=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++r}),t.on("pass",function(t){console.log("ok %d %s",r,t.fullTitle())}),t.on("fail",function(t,e){console.log("not ok %d %s",r,t.fullTitle()),console.log(e.stack.replace(/^/gm," "))})}{var n=r("./base");n.cursor,n.color}e=t.exports=o}),require.register("runnable.js",function(t,e,r){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3}var n=r("browser/events").EventEmitter,s=r("browser/debug")("runnable");t.exports=o,o.prototype=new n,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(s("timeout %d",t),this._timeout=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){clearTimeout(this.timer)},o.prototype.run=function(t){function e(){n||(n=!0,s.emit("error",new Error("done() called multiple times")))}function r(r){return o?e():(s.clearTimeout(),s.duration=new Date-u,o=!0,void t(r))}var o,n,s=this,i=this.timeout(),u=new Date;if(this.async&&(this.timer=setTimeout(function(){r(new Error("timeout of "+i+"ms exceeded"))},i)),this.async)try{this.fn(function(t){return t instanceof Error?r(t):void r()})}catch(a){r(a)}else try{this.pending||this.fn(),this.duration=new Date-u,t()}catch(a){t(a)}}}),require.register("runner.js",function(t,e,r){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(Object.keys(global).concat(["errno"]))}{var n=r("browser/events").EventEmitter,s=r("browser/debug")("runner");r("./test")}t.exports=o,o.prototype=new n,o.prototype.constructor=o,o.prototype.grep=function(t){return s("grep %s",t),this._grep=t,this},o.prototype.globals=function(t){return s("globals %j",t),t.forEach(function(t){this._globals.push(t)},this),this},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=Object.keys(global).filter(function(t){return!~this._globals.indexOf(t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},o.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function r(t){var o=n[t];return o?(s.currentRunnable=o,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?s.failHook(o,e):(s.emit("hook end",o),void r(++t))})):e()}var o=this.suite,n=o["_"+t],s=(o._timeout,this);process.nextTick(function(){r(0)})},o.prototype.hooks=function(t,e,r){function o(i){return n.suite=i,i?void n.hook(t,function(t){return t?(n.suite=s,r(t)):void o(e.pop())}):(n.suite=s,r())}var n=this,s=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var r=[this.suite].concat(this.parents()).reverse();this.hooks(t,r,e)},o.prototype.hookDown=function(t,e){var r=[this.suite].concat(this.parents());this.hooks(t,r,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,r=this;try{e.on("error",function(t){r.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function r(){return(o=s.shift())?n._grep.test(o.fullTitle())?o.pending?(n.emit("pending",o),n.emit("test end",o),r()):(n.emit("test",n.test=n.currentRunnable=o),void n.hookDown("beforeEach",function(){n.runTest(function(t){return t?(n.fail(o,t),n.emit("test end",o),n.hookUp("afterEach",r)):(n.emit("pass",o),o.passed=!0,n.emit("test end",o),void n.hookUp("afterEach",r))})})):r():e()}var o,n=this,s=t.tests;r()},o.prototype.runSuite=function(t,e){function r(){var e=t.suites[i++];return e?void n.runSuite(e,r):o()}function o(){n.suite=t,n.hook("afterAll",function(){n.emit("suite end",t),e()})}var n=this,i=0;s("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){n.runTests(t,r)})},o.prototype.run=function(t){function e(t){s("uncaught exception"),r.currentRunnable.clearTimeout(),r.fail(r.currentRunnable,t),r.emit("test end",r.test),r.emit("end")}var r=this,t=t||function(){};return s("start"),r.on("end",function(){s("end"),process.removeListener("uncaughtException",e),t(r.failures)}),this.emit("start"),this.runSuite(this.suite,function(){s("finished running"),r.emit("end")}),process.on("uncaughtException",e),this}}),require.register("suite.js",function(t,e,r){function o(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3}var n=r("browser/events").EventEmitter,s=r("browser/debug")("suite"),i=r("./hook");e=t.exports=o,e.create=function(t,e){var r=new o(e);return r.parent=t,e=r.fullTitle(),t.addSuite(r),r},o.prototype=new n,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.timeout(this.timeout()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.beforeAll=function(t){var e=new i('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new i('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new i('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new i('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),require.register("test.js",function(t,e,r){function o(t,e){n.call(this,t,e),this.pending=!e}var n=r("./runnable");t.exports=o,o.prototype=new n,o.prototype.constructor=o}),require.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),require.register("watch.js",function(t,e,r){var o=r("browser/fs"),n=r("browser/debug")("watch");t.exports=function(t,e){var r={interval:100};t.forEach(function(t){n("watch %s",t),o.watchFile(t,r,function(r,o){o.mtimer;r++)if(n[r]===e||n[r].listener&&n[r].listener===e){s=r;break}if(0>s)return this;n.splice(s,1),n.length||delete this.$events[t]}else(n===e||n.listener&&n.listener===e)&&delete this.$events[t]}return this},n.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},n.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),o(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},n.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var n=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,n);else{if(!o(e))return!1;for(var s=e.slice(),r=0,i=s.length;i>r;r++)s[r].apply(this,n)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(12),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),o=this._size,n=o/2,s=n,r=n,i=n-1,u=this._fontSize;t.font=u+"px "+this._font;var a=2*Math.PI*(e/100);t.clearRect(0,0,o,o),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,r,i,0,a,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,r,i-1,0,a,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,r+u/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,o){function n(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("interfaces/bdd.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=n.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),t.register("interfaces/exports.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new s(i,u))}}else{var r=n.create(o[0],i);o.unshift(r),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),t.register("interfaces/tdd.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,o){var s=n.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),t.register("mocha.js",function(t,e,o){e.version="0.4.0",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test"),e.watch=o("./watch")}),t.register("reporters/base.js",function(t,e,o){function n(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var n=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>n?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,n.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),r=s.isatty(1)&&s.isatty(2);e=t.exports=n,e.useColors=r,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:r?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),n=t.err,s=n.stack,r=n.message||"",u=s.indexOf(r)+r.length,a=s.slice(0,u);s=s.slice(u+1).replace(/^/gm," "),console.error(o,e,t.fullTitle(),a,s)})},n.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),n.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,o){function n(t){function e(){return Array(o).join(" ")}r.call(this,t);var o=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++o,console.log('%s
',e()),++o,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--o,console.log("%s
",e()),--o)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var r=o("./base"),i=o("../utils");e=t.exports=n}),t.register("reporters/dot.js",function(t,e,o){function n(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),n=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++n%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++n%o==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),r=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/html.js",function(t,e,o){function n(t){i.call(this,t);var e=this.stats,o=t.total,n=$("#mocha"),l=[n],f=$(c).appendTo(n),p=f.find("canvas").get(0),h=p.getContext("2d"),d=new a;return n.length?(d.size(50),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");l[0].append(e),l.unshift($("
")),e.append(l[0])}}),t.on("suite end",function(t){t.root||l.shift()}),void t.on("test end",function(t){var n=e.tests/o*100|0;d.update(n).draw(h);var s=new Date-e.start;if(f.find(".passes em").text(e.passes),f.find(".failures em").text(e.failures),f.find(".duration em").text((s/1e3).toFixed(2)),t.passed)var i=$('

'+t.title+"

");else if(t.pending)var i=$('

'+t.title+"

");else{var i=$('

'+t.title+"

"),a=t.err.stack||t.err,c=$('
'+a+"
");i.append(c)}if(i.find("h2").toggle(function(){g.slideDown("fast")},function(){g.slideUp("fast")}),!t.pending){var p=u.escape(r(t.fn.toString())),g=$("
"+p+"
");g.appendTo(i).hide()}l[0].append(i)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),u=o("../utils"),a=o("../browser/progress");e=t.exports=n;var c='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Spec=o("./spec"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),t.register("reporters/json-stream.js",function(t,e,o){function n(t){r.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=o("./base");r.color}e=t.exports=n}),t.register("reporters/json.js",function(t,e,o){function n(t){var e=this;r.call(this,t);var o=[],n=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:n.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=o("./base");r.cursor,r.color}e=t.exports=n}),t.register("reporters/landing.js",function(t,e,o){function n(t){function e(){var t=Array(n).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,n=(this.stats,.75*s.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),r.hide()}),t.on("test end",function(t){var o=-1==l?n*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(n-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){r.show(),console.log(),o.epilogue()})}var s=o("./base"),r=s.cursor,i=s.color;e=t.exports=n,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/list.js",function(t,e,o){function n(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(r("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=r("checkmark"," -")+r("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=r("checkmark"," ✓")+r("pass"," %s: ")+r(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+r("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),r=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/progress.js",function(t,e,o){function n(t,e){s.call(this,t);{var o=this,e=e||{},n=(this.stats,.5*s.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){var t=a++/u,o=n*t|0,s=n-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){r.show(),console.log(),o.epilogue()})}var s=o("./base"),r=s.cursor,i=s.color;e=t.exports=n,s.colors.progress=90,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/spec.js",function(t,e,o){function n(t){function e(){return Array(n).join(" ")}s.call(this,t);var o=this,n=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++n,console.log(r("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--n,1==n&&console.log()}),t.on("test",function(t){process.stdout.write(e()+r("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var o=e()+r("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+r("checkmark"," ✓")+r("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+r("checkmark"," ✓")+r("pass"," %s ")+r(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+r("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),r=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/tap.js",function(t,e,o){function n(t){r.call(this,t);var e=(this.stats,t.total),o=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++o}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",o,s(t))}),t.on("pass",function(t){console.log("ok %d %s",o,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",o,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var r=o("./base");r.cursor,r.color}e=t.exports=n}),t.register("runnable.js",function(t,e,o){function n(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3}var s=o("browser/events").EventEmitter,r=o("browser/debug")("runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n,n.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},n.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},n.prototype.clearTimeout=function(){clearTimeout(this.timer)},n.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded"))},e))},n.prototype.run=function(t){function e(){s||(s=!0,r.emit("error",new Error("done() called multiple times")))}function o(o){return n?e():(r.clearTimeout(),r.duration=new Date-u,n=!0,void t(o))}var n,s,r=this,i=this.timeout(),u=new Date;if(this.async&&i&&(this.timer=setTimeout(function(){o(new Error("timeout of "+i+"ms exceeded"))},i)),this.callback=o,this.async)try{this.fn(function(t){return t instanceof Error?o(t):void o()})}catch(a){o(a)}else try{this.pending||this.fn(),this.duration=new Date-u,t()}catch(a){t(a)}}}),t.register("runner.js",function(t,e,o){function n(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(Object.keys(global).concat(["errno"]))}{var s=o("browser/events").EventEmitter,r=o("browser/debug")("runner");o("./test")}t.exports=n,n.prototype=new s,n.prototype.constructor=n,n.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this},n.prototype.globals=function(t){return r("globals %j",t),t.forEach(function(t){this._globals.push(t)},this),this},n.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=Object.keys(global).filter(function(t){return!~this._globals.indexOf(t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},n.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},n.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},n.prototype.hook=function(t,e){function o(t){var n=s[t];return n?(r.currentRunnable=n,r.emit("hook",n),n.on("error",function(t){r.failHook(n,t)}),void n.run(function(e){return n.removeAllListeners("error"),e?r.failHook(n,e):(r.emit("hook end",n),void o(++t))})):e()}var n=this.suite,s=n["_"+t],r=(n._timeout,this);process.nextTick(function(){o(0)})},n.prototype.hooks=function(t,e,o){function n(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=r,o(t)):void n(e.pop())}):(s.suite=r,o())}var s=this,r=this.suite;n(e.pop())},n.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},n.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},n.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},n.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(n){t(n)}},n.prototype.runTests=function(t,e){function o(){return(n=r.shift())?s._grep.test(n.fullTitle())?n.pending?(s.emit("pending",n),s.emit("test end",n),o()):(s.emit("test",s.test=s.currentRunnable=n),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?(s.fail(n,t),s.emit("test end",n),s.hookUp("afterEach",o)):(s.emit("pass",n),n.passed=!0,s.emit("test end",n),void s.hookUp("afterEach",o))})})):o():e()}var n,s=this,r=t.tests;o()},n.prototype.runSuite=function(t,e){function o(){var e=t.suites[i++];return e?void s.runSuite(e,o):n()}function n(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,i=0;r("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},n.prototype.run=function(t){function e(t){r("uncaught exception"),o.currentRunnable.clearTimeout(),o.fail(o.currentRunnable,t),o.emit("test end",o.test),o.emit("end")}var o=this,t=t||function(){};return r("start"),o.on("end",function(){r("end"),process.removeListener("uncaughtException",e),t(o.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),o.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,o){function n(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3}var s=o("browser/events").EventEmitter,r=o("browser/debug")("suite"),i=o("./hook");e=t.exports=n,e.create=function(t,e){var o=new n(e);return o.parent=t,e=o.fullTitle(),t.addSuite(o),o},n.prototype=new s,n.prototype.constructor=n,n.prototype.clone=function(){var t=new n(this.title);return r("clone"),t.timeout(this.timeout()),t},n.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},n.prototype.beforeAll=function(t){var e=new i('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},n.prototype.afterAll=function(t){var e=new i('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},n.prototype.beforeEach=function(t){var e=new i('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},n.prototype.afterEach=function(t){var e=new i('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},n.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),this.suites.push(t),this.emit("suite",t),this},n.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},n.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},n.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,o){function n(t,e){s.call(this,t,e),this.pending=!e}var s=o("./runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),t.register("watch.js",function(t,e,o){var n=o("browser/fs"),s=o("browser/debug")("watch");t.exports=function(t,e){var o={interval:100};t.forEach(function(t){s("watch %s",t),n.watchFile(t,o,function(o,n){n.mtimer;r++)if(n[r]===e||n[r].listener&&n[r].listener===e){s=r;break}if(0>s)return this;n.splice(s,1),n.length||delete this.$events[t]}else(n===e||n.listener&&n.listener===e)&&delete this.$events[t]}return this},n.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},n.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),o(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},n.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var n=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,n);else{if(!o(e))return!1;for(var s=e.slice(),r=0,i=s.length;i>r;r++)s[r].apply(this,n)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(12),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),o=this._size,n=o/2,s=n,r=n,i=n-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,o,o),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,r,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,o){function n(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("interfaces/bdd.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=n.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),t.register("interfaces/exports.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":o[0].beforeAll(a);break;case"after":o[0].afterAll(a);break;case"beforeEach":o[0].beforeEach(a);break;case"afterEach":o[0].afterEach(a);break;default:o[0].addTest(new s(i,a))}}else{var r=n.create(o[0],i);o.unshift(r),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),t.register("interfaces/tdd.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,o){var s=n.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),t.register("mocha.js",function(t,e,o){e.version="0.5.0",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test"),e.watch=o("./watch")}),t.register("reporters/base.js",function(t,e,o){function n(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var n=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>n?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,n.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),r=s.isatty(1)&&s.isatty(2);e=t.exports=n,e.useColors=r,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:r?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),n=t.err,s=n.stack,r=n.message||"",a=s.indexOf(r)+r.length,u=s.slice(0,a);s=s.slice(a+1).replace(/^/gm," "),console.error(o,e,t.fullTitle(),u,s)})},n.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),n.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,o){function n(t){function e(){return Array(o).join(" ")}r.call(this,t);var o=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++o,console.log('%s
',e()),++o,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--o,console.log("%s
",e()),--o)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var r=o("./base"),i=o("../utils");e=t.exports=n}),t.register("reporters/dot.js",function(t,e,o){function n(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),n=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++n%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++n%o==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),r=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/html.js",function(t,e,o){function n(t){i.call(this,t);var e=this.stats,o=t.total,n=$("#mocha"),l=[n],f=$(c).appendTo(n),p=f.find("canvas").get(0),h=p.getContext("2d"),d=new u;return n.length?(d.size(50),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");l[0].append(e),l.unshift($("
")),e.append(l[0])}}),t.on("suite end",function(t){t.root||l.shift()}),void t.on("test end",function(t){var n=e.tests/o*100|0;d.update(n).draw(h);var s=new Date-e.start;if(f.find(".passes em").text(e.passes),f.find(".failures em").text(e.failures),f.find(".duration em").text((s/1e3).toFixed(2)),t.passed)var i=$('

'+t.title+"

");else if(t.pending)var i=$('

'+t.title+"

");else{var i=$('

'+t.title+"

"),u=t.err.stack||t.err,c=$('
'+u+"
");i.append(c)}if(i.find("h2").toggle(function(){g.slideDown("fast")},function(){g.slideUp("fast")}),!t.pending){var p=a.escape(r(t.fn.toString())),g=$("
"+p+"
");g.appendTo(i).hide()}l[0].append(i)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),a=o("../utils"),u=o("../browser/progress");e=t.exports=n;var c='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Spec=o("./spec"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),t.register("reporters/json-stream.js",function(t,e,o){function n(t){r.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=o("./base");r.color}e=t.exports=n}),t.register("reporters/json.js",function(t,e,o){function n(t){var e=this;r.call(this,t);var o=[],n=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:n.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=o("./base");r.cursor,r.color}e=t.exports=n}),t.register("reporters/landing.js",function(t,e,o){function n(t){function e(){var t=Array(n).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,n=(this.stats,.75*s.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var o=-1==l?n*++f/a|0:l;t.failed&&(c=i("plane crash","✈"),l=o),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(o).join("⋅"))),u.write(c),u.write(i("runway",Array(n-o).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),o.epilogue()})}var s=o("./base"),r=s.cursor,i=s.color;e=t.exports=n,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/list.js",function(t,e,o){function n(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(r("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=r("checkmark"," -")+r("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=r("checkmark"," ✓")+r("pass"," %s: ")+r(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+r("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),r=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/progress.js",function(t,e,o){function n(t,e){s.call(this,t);{var o=this,e=e||{},n=(this.stats,.5*s.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){var t=u++/a,o=n*t|0,s=n-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),o.epilogue()})}var s=o("./base"),r=s.cursor,i=s.color;e=t.exports=n,s.colors.progress=90,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/spec.js",function(t,e,o){function n(t){function e(){return Array(n).join(" ")}s.call(this,t);var o=this,n=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++n,console.log(r("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--n,1==n&&console.log()}),t.on("test",function(t){process.stdout.write(e()+r("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var o=e()+r("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+r("checkmark"," ✓")+r("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+r("checkmark"," ✓")+r("pass"," %s ")+r(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+r("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),r=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/tap.js",function(t,e,o){function n(t){r.call(this,t);var e=(this.stats,t.total),o=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++o}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",o,s(t))}),t.on("pass",function(t){console.log("ok %d %s",o,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",o,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var r=o("./base");r.cursor,r.color}e=t.exports=n}),t.register("reporters/teamcity.js",function(t,e,o){function n(t){s.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",t.fullTitle())}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",t.fullTitle(),e.message)}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",t.fullTitle())}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",t.fullTitle(),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}var s=o("./base");e=t.exports=n}),t.register("runnable.js",function(t,e,o){function n(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3}var s=o("browser/events").EventEmitter,r=o("browser/debug")("runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n,n.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},n.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},n.prototype.clearTimeout=function(){clearTimeout(this.timer)},n.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded"))},e))},n.prototype.run=function(t){function e(){s||(s=!0,r.emit("error",new Error("done() called multiple times")))}function o(o){return n?e():(r.clearTimeout(),r.duration=new Date-a,n=!0,void t(o))}var n,s,r=this,i=this.timeout(),a=new Date;if(this.async&&i&&(this.timer=setTimeout(function(){o(new Error("timeout of "+i+"ms exceeded"))},i)),this.callback=o,this.async)try{this.fn(function(t){return t instanceof Error?o(t):void o()})}catch(u){o(u)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(u){t(u)}}}),t.register("runner.js",function(t,e,o){function n(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(Object.keys(global).concat(["errno"]))}{var s=o("browser/events").EventEmitter,r=o("browser/debug")("runner");o("./test")}t.exports=n,n.prototype=new s,n.prototype.constructor=n,n.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this},n.prototype.globals=function(t){return r("globals %j",t),t.forEach(function(t){this._globals.push(t)},this),this},n.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=Object.keys(global).filter(function(t){return!~this._globals.indexOf(t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},n.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},n.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},n.prototype.hook=function(t,e){function o(t){var n=s[t];return n?(r.currentRunnable=n,r.emit("hook",n),n.on("error",function(t){r.failHook(n,t)}),void n.run(function(e){return n.removeAllListeners("error"),e?r.failHook(n,e):(r.emit("hook end",n),void o(++t))})):e()}var n=this.suite,s=n["_"+t],r=(n._timeout,this);process.nextTick(function(){o(0)})},n.prototype.hooks=function(t,e,o){function n(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=r,o(t)):void n(e.pop())}):(s.suite=r,o())}var s=this,r=this.suite;n(e.pop())},n.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},n.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},n.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},n.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(n){t(n)}},n.prototype.runTests=function(t,e){function o(){return(n=r.shift())?s._grep.test(n.fullTitle())?n.pending?(s.emit("pending",n),s.emit("test end",n),o()):(s.emit("test",s.test=s.currentRunnable=n),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?(s.fail(n,t),s.emit("test end",n),s.hookUp("afterEach",o)):(n.passed=!0,s.emit("pass",n),s.emit("test end",n),void s.hookUp("afterEach",o))})})):o():e()}var n,s=this,r=t.tests;this.next=o,o()},n.prototype.runSuite=function(t,e){function o(){var e=t.suites[i++];return e?void s.runSuite(e,o):n()}function n(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,i=0;r("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},n.prototype.run=function(t){function e(t){var e=o.currentRunnable;r("uncaught exception"),e.clearTimeout(),o.fail(e,t),"test"==e.type?(o.emit("test end",e),o.hookUp("afterEach",o.next)):o.emit("end")}var o=this,t=t||function(){};return r("start"),o.on("end",function(){r("end"),process.removeListener("uncaughtException",e),t(o.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),o.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,o){function n(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3}var s=o("browser/events").EventEmitter,r=o("browser/debug")("suite"),i=o("./hook");e=t.exports=n,e.create=function(t,e){var o=new n(e);return o.parent=t,e=o.fullTitle(),t.addSuite(o),o},n.prototype=new s,n.prototype.constructor=n,n.prototype.clone=function(){var t=new n(this.title);return r("clone"),t.timeout(this.timeout()),t},n.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},n.prototype.beforeAll=function(t){var e=new i('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},n.prototype.afterAll=function(t){var e=new i('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},n.prototype.beforeEach=function(t){var e=new i('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},n.prototype.afterEach=function(t){var e=new i('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},n.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),this.suites.push(t),this.emit("suite",t),this},n.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},n.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},n.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,o){function n(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=o("./runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),t.register("watch.js",function(t,e,o){var n=o("browser/fs"),s=o("browser/debug")("watch");t.exports=function(t,e){var o={interval:100};t.forEach(function(t){s("watch %s",t),n.watchFile(t,o,function(o,n){n.mtimei;i++)if(n[i]===e||n[i].listener&&n[i].listener===e){s=i;break}if(0>s)return this;n.splice(s,1),n.length||delete this.$events[t]}else(n===e||n.listener&&n.listener===e)&&delete this.$events[t]}return this},n.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},n.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),o(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},n.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var n=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,n);else{if(!o(e))return!1;for(var s=e.slice(),i=0,r=s.length;r>i;i++)s[i].apply(this,n)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(12),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),o=this._size,n=o/2,s=n,i=n,r=n-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,o,o),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,i,r,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,i,r-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,o){function n(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("interfaces/bdd.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=n.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),t.register("interfaces/exports.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var i;for(var r in t)if("function"==typeof t[r]){var a=t[r];switch(r){case"before":o[0].beforeAll(a);break;case"after":o[0].afterAll(a);break;case"beforeEach":o[0].beforeEach(a);break;case"afterEach":o[0].afterEach(a);break;default:o[0].addTest(new s(r,a))}}else{var i=n.create(o[0],r);o.unshift(i),e(t[r]),o.shift()}}var o=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),t.register("interfaces/tdd.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,o){var s=n.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),t.register("mocha.js",function(t,e,o){e.version="0.5.0",e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test"),e.watch=o("./watch")}),t.register("reporters/base.js",function(t,e,o){function n(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var n=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>n?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,n.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),i=s.isatty(1)&&s.isatty(2);e=t.exports=n,e.useColors=i,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var r=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:i?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=r("error title"," %s) %s:\n")+r("error message"," %s")+r("error stack","\n%s\n"),n=t.err,s=n.stack,i=n.message||"",a=s.indexOf(i)+i.length,u=s.slice(0,a);s=s.slice(a+1).replace(/^/gm," "),console.error(o,e,t.fullTitle(),u,s)})},n.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=r("bright fail"," ✖")+r("fail"," %d of %d tests failed")+r("light",":"),console.error(t,e.failures,this.runner.total),n.list(this.failures),void console.error()):(t=r("bright pass"," ✔")+r("green"," %d tests complete")+r("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,o){function n(t){function e(){return Array(o).join(" ")}i.call(this,t);var o=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++o,console.log('%s
',e()),++o,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--o,console.log("%s
",e()),--o)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=r.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var i=o("./base"),r=o("../utils");e=t.exports=n}),t.register("reporters/dot.js",function(t,e,o){function n(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),n=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending","."))}),t.on("pass",function(t){++n%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow","."):i(t.speed,"."))}),t.on("fail",function(){++n%o==0&&process.stdout.write("\n "),process.stdout.write(i("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),i=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/html.js",function(t,e,o){function n(t){r.call(this,t);var e=this.stats,o=t.total,n=$("#mocha"),l=[n],f=$(c).appendTo(n),p=f.find("canvas").get(0),h=p.getContext("2d"),d=new u;return n.length?(d.size(50),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");l[0].append(e),l.unshift($("
")),e.append(l[0])}}),t.on("suite end",function(t){t.root||l.shift()}),t.on("fail",function(e,o){o.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var n=e.tests/o*100|0;d.update(n).draw(h);var s=new Date-e.start;if(f.find(".passes em").text(e.passes),f.find(".failures em").text(e.failures),f.find(".duration em").text((s/1e3).toFixed(2)),t.passed)var r=$('

'+t.title+"

");else if(t.pending)var r=$('

'+t.title+"

");else{var r=$('

'+t.title+"

"),u=t.err.stack||t.err,c=$('
'+u+"
");r.append(c)}if(r.find("h2").toggle(function(){g.slideDown("fast")},function(){g.slideUp("fast")}),!t.pending){var p=a.escape(i(t.fn.toString())),g=$("
"+p+"
");g.appendTo(r).hide()}l[0].append(r)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function i(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var r=o("./base"),a=o("../utils"),u=o("../browser/progress");e=t.exports=n;var c='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Spec=o("./spec"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),t.register("reporters/json-stream.js",function(t,e,o){function n(t){i.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.color}e=t.exports=n}),t.register("reporters/json.js",function(t,e,o){function n(t){var e=this;i.call(this,t);var o=[],n=[],r=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){r.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:n.map(s),passes:r.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=o("./base");i.cursor,i.color}e=t.exports=n}),t.register("reporters/landing.js",function(t,e,o){function n(t){function e(){var t=Array(n).join("-");return" "+r("runway",t)}s.call(this,t);var o=this,n=(this.stats,.75*s.window.width|0),a=t.total,u=process.stdout,c=r("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var o=-1==l?n*++f/a|0:l;t.failed&&(c=r("plane crash","✈"),l=o),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(r("runway",Array(o).join("⋅"))),u.write(c),u.write(r("runway",Array(n-o).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var s=o("./base"),i=s.cursor,r=s.color;e=t.exports=n,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/list.js",function(t,e,o){function n(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+i("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),i=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/progress.js",function(t,e,o){function n(t,e){s.call(this,t);{var o=this,e=e||{},n=(this.stats,.5*s.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){var t=u++/a,o=n*t|0,s=n-o;process.stdout.write("\r"),process.stdout.write(r("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(r("progress",e.close)),e.verbose&&process.stdout.write(r("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),o.epilogue()})}var s=o("./base"),i=s.cursor,r=s.color;e=t.exports=n,s.colors.progress=90,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/spec.js",function(t,e,o){function n(t){function e(){return Array(n).join(" ")}s.call(this,t);var o=this,n=(this.stats,0),r=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++n,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--n,1==n&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var o=e()+i("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+i("checkmark"," ✓")+i("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+i("fail"," %d) %s"),r++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),i=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/tap.js",function(t,e,o){function n(t){i.call(this,t);var e=(this.stats,t.total),o=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++o}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",o,s(t))}),t.on("pass",function(t){console.log("ok %d %s",o,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",o,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var i=o("./base");i.cursor,i.color}e=t.exports=n}),t.register("reporters/teamcity.js",function(t,e,o){function n(t){s.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",t.fullTitle())}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",t.fullTitle(),e.message)}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",t.fullTitle())}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",t.fullTitle(),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}var s=o("./base");e=t.exports=n}),t.register("runnable.js",function(t,e,o){function n(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3}var s=o("browser/events").EventEmitter,i=o("browser/debug")("runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n,n.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},n.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},n.prototype.clearTimeout=function(){clearTimeout(this.timer)},n.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded"))},e))},n.prototype.run=function(t){function e(){s||(s=!0,i.emit("error",new Error("done() called multiple times")))}function o(o){return n?e():(i.clearTimeout(),i.duration=new Date-a,n=!0,void t(o))}var n,s,i=this,r=this.timeout(),a=new Date;if(this.async&&r&&(this.timer=setTimeout(function(){o(new Error("timeout of "+r+"ms exceeded"))},r)),this.callback=o,this.async)try{this.fn(function(t){return t instanceof Error?o(t):void o()})}catch(u){o(u)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(u){t(u)}}}),t.register("runner.js",function(t,e,o){function n(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(Object.keys(global).concat(["errno"]))}{var s=o("browser/events").EventEmitter,i=o("browser/debug")("runner");o("./test")}t.exports=n,n.prototype=new s,n.prototype.constructor=n,n.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this},n.prototype.globals=function(t){return i("globals %j",t),t.forEach(function(t){this._globals.push(t)},this),this},n.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=Object.keys(global).filter(function(t){return!~this._globals.indexOf(t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},n.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},n.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},n.prototype.hook=function(t,e){function o(t){var n=s[t];return n?(i.currentRunnable=n,i.emit("hook",n),n.on("error",function(t){i.failHook(n,t)}),void n.run(function(e){return n.removeAllListeners("error"),e?i.failHook(n,e):(i.emit("hook end",n),void o(++t))})):e()}var n=this.suite,s=n["_"+t],i=(n._timeout,this);process.nextTick(function(){o(0)})},n.prototype.hooks=function(t,e,o){function n(r){return s.suite=r,r?void s.hook(t,function(t){return t?(s.suite=i,o(t)):void n(e.pop())}):(s.suite=i,o())}var s=this,i=this.suite;n(e.pop())},n.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},n.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},n.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},n.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(n){t(n)}},n.prototype.runTests=function(t,e){function o(){return(n=i.shift())?s._grep.test(n.fullTitle())?n.pending?(s.emit("pending",n),s.emit("test end",n),o()):(s.emit("test",s.test=s.currentRunnable=n),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?(s.fail(n,t),s.emit("test end",n),s.hookUp("afterEach",o)):(n.passed=!0,s.emit("pass",n),s.emit("test end",n),void s.hookUp("afterEach",o))})})):o():e()}var n,s=this,i=t.tests;this.next=o,o()},n.prototype.runSuite=function(t,e){function o(){var e=t.suites[r++];return e?void s.runSuite(e,o):n()}function n(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,r=0;i("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},n.prototype.run=function(t){function e(t){var e=o.currentRunnable;i("uncaught exception"),e.clearTimeout(),t.uncaught=!0,o.fail(e,t),"test"==e.type?(o.emit("test end",e),o.hookUp("afterEach",o.next)):o.emit("end")}var o=this,t=t||function(){};return i("start"),o.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(o.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),o.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,o){function n(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3}var s=o("browser/events").EventEmitter,i=o("browser/debug")("suite"),r=o("./hook");e=t.exports=n,e.create=function(t,e){var o=new n(e);return o.parent=t,e=o.fullTitle(),t.addSuite(o),o},n.prototype=new s,n.prototype.constructor=n,n.prototype.clone=function(){var t=new n(this.title);return i("clone"),t.timeout(this.timeout()),t},n.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},n.prototype.beforeAll=function(t){var e=new r('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},n.prototype.afterAll=function(t){var e=new r('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},n.prototype.beforeEach=function(t){var e=new r('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},n.prototype.afterEach=function(t){var e=new r('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},n.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),this.suites.push(t),this.emit("suite",t),this},n.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},n.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},n.prototype.total=function(){return this.suites.reduce(function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,o){function n(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=o("./runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")}}),t.register("watch.js",function(t,e,o){var n=o("browser/fs"),s=o("browser/debug")("watch");t.exports=function(t,e){var o={interval:100};t.forEach(function(t){s("watch %s",t),n.watchFile(t,o,function(o,n){n.mtimer;r++)if(n[r]===e||n[r].listener&&n[r].listener===e){s=r;break}if(0>s)return this;n.splice(s,1),n.length||delete this.$events[t]}else(n===e||n.listener&&n.listener===e)&&delete this.$events[t]}return this},n.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},n.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),o(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},n.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var n=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,n);else{if(!o(e))return!1;for(var s=e.slice(),r=0,i=s.length;i>r;r++)s[r].apply(this,n)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(12),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),o=this._size,n=o/2,s=n,r=n,i=n-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,o,o),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,r,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,o){function n(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("interfaces/bdd.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=n.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),t.register("interfaces/exports.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":o[0].beforeAll(a);break;case"after":o[0].afterAll(a);break;case"beforeEach":o[0].beforeEach(a);break;case"afterEach":o[0].afterEach(a);break;default:o[0].addTest(new s(i,a))}}else{var r=n.create(o[0],i);o.unshift(r),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),t.register("interfaces/tdd.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,o){var s=n.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),t.register("mocha.js",function(t,e,o){e.version="0.7.0",e.utils=o("./utils"),e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test"),e.watch=o("./watch")}),t.register("reporters/base.js",function(t,e,o){function n(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var n=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>n?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,n.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),r=s.isatty(1)&&s.isatty(2);e=t.exports=n,e.useColors=r,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:r?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),n=t.err,s=n.stack,r=n.message||"",a=s.indexOf(r)+r.length,u=s.slice(0,a);s=s.slice(a+1).replace(/^/gm," "),console.error(o,e,t.fullTitle(),u,s)})},n.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),n.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,o){function n(t){function e(){return Array(o).join(" ")}r.call(this,t);var o=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++o,console.log('%s
',e()),++o,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--o,console.log("%s
",e()),--o)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var r=o("./base"),i=o("../utils");e=t.exports=n}),t.register("reporters/dot.js",function(t,e,o){function n(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),n=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++n%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++n%o==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),r=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/html.js",function(t,e,o){function n(t){i.call(this,t);var e,o,n=this.stats,l=t.total,f=$("#mocha"),p=[f],h=$(c).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(e=d.getContext("2d"),o=new u),f.length?(o&&o.size(50),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,o){o.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var s=n.tests/l*100|0;o&&o.update(s).draw(e);var i=new Date-n.start;if(h.find(".passes em").text(n.passes),h.find(".failures em").text(n.failures),h.find(".duration em").text((i/1e3).toFixed(2)),t.passed)var u=$('

'+t.title+"

");else if(t.pending)var u=$('

'+t.title+"

");else{var u=$('

'+t.title+"

"),c=t.err.stack||t.err;"[object Error]"==c&&(c=t.err.message);var f=$('
'+c+"
");u.append(f)}if(u.find("h2").toggle(function(){g.slideDown("fast")},function(){g.slideUp("fast")}),!t.pending){var d=a.escape(r(t.fn.toString())),g=$("
"+d+"
");g.appendTo(u).hide()}p[0].append(u)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),a=o("../utils"),u=o("../browser/progress");e=t.exports=n;var c='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Spec=o("./spec"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),t.register("reporters/json-stream.js",function(t,e,o){function n(t){r.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=o("./base");r.color}e=t.exports=n}),t.register("reporters/json.js",function(t,e,o){function n(t){var e=this;r.call(this,t);var o=[],n=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:n.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=o("./base");r.cursor,r.color}e=t.exports=n}),t.register("reporters/landing.js",function(t,e,o){function n(t){function e(){var t=Array(n).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,n=(this.stats,.75*s.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var o=-1==l?n*++f/a|0:l;t.failed&&(c=i("plane crash","✈"),l=o),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(o).join("⋅"))),u.write(c),u.write(i("runway",Array(n-o).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),o.epilogue()})}var s=o("./base"),r=s.cursor,i=s.color;e=t.exports=n,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/list.js",function(t,e,o){function n(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(r("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=r("checkmark"," -")+r("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=r("checkmark"," ✓")+r("pass"," %s: ")+r(t.speed,"%dms");console.log("\r"+e,t.fullTitle(),t.duration)}),t.on("fail",function(t){console.log("\r"+r("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),r=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/progress.js",function(t,e,o){function n(t,e){s.call(this,t);{var o=this,e=e||{},n=(this.stats,.5*s.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){var t=u++/a,o=n*t|0,s=n-o;process.stdout.write("\r"),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),o.epilogue()})}var s=o("./base"),r=s.cursor,i=s.color;e=t.exports=n,s.colors.progress=90,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/spec.js",function(t,e,o){function n(t){function e(){return Array(n).join(" ")}s.call(this,t);var o=this,n=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++n,console.log(r("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--n,1==n&&console.log()}),t.on("test",function(t){process.stdout.write(e()+r("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var o=e()+r("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+r("checkmark"," ✓")+r("pass"," %s ");console.log("\r"+o,t.title)}else{var o=e()+r("checkmark"," ✓")+r("pass"," %s ")+r(t.speed,"(%dms)");console.log("\r"+o,t.title,t.duration)}}),t.on("fail",function(t){console.log("\r"+e()+r("fail"," %d) %s"),i++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),r=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/tap.js",function(t,e,o){function n(t){r.call(this,t);var e=(this.stats,t.total),o=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++o}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",o,s(t))}),t.on("pass",function(t){console.log("ok %d %s",o,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",o,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var r=o("./base");r.cursor,r.color}e=t.exports=n}),t.register("reporters/teamcity.js",function(t,e,o){function n(t){s.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",t.fullTitle())}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",t.fullTitle(),e.message)}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",t.fullTitle())}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",t.fullTitle(),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}var s=o("./base");e=t.exports=n}),t.register("runnable.js",function(t,e,o){function n(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3}var s=o("browser/events").EventEmitter,r=o("browser/debug")("runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n,n.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},n.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},n.prototype.clearTimeout=function(){clearTimeout(this.timer)},n.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded"))},e))},n.prototype.run=function(t){function e(){s||(s=!0,r.emit("error",new Error("done() called multiple times")))}function o(o){return n?e():(r.clearTimeout(),r.duration=new Date-a,n=!0,void t(o))}var n,s,r=this,i=this.timeout(),a=new Date;if(this.async&&i&&(this.timer=setTimeout(function(){o(new Error("timeout of "+i+"ms exceeded"))},i)),this.callback=o,this.async)try{this.fn(function(t){return t instanceof Error?o(t):void o()})}catch(u){o(u)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(u){t(u)}}}),t.register("runner.js",function(t,e,o){function n(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(i.keys(global).concat(["errno"]))}var s=o("browser/events").EventEmitter,r=o("browser/debug")("runner"),i=(o("./test"),o("./utils"));t.exports=n,n.prototype=new s,n.prototype.constructor=n,n.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this},n.prototype.globals=function(t){return r("globals %j",t),i.forEach(t,function(t){this._globals.push(t)},this),this},n.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=i.filter(i.keys(global),function(t){return!~i.indexOf(this._globals,t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},n.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},n.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},n.prototype.hook=function(t,e){function o(t){var n=s[t];return n?(r.currentRunnable=n,r.emit("hook",n),n.on("error",function(t){r.failHook(n,t)}),void n.run(function(e){return n.removeAllListeners("error"),e?r.failHook(n,e):(r.emit("hook end",n),void o(++t))})):e()}var n=this.suite,s=n["_"+t],r=(n._timeout,this);process.nextTick(function(){o(0)})},n.prototype.hooks=function(t,e,o){function n(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=r,o(t)):void n(e.pop())}):(s.suite=r,o())}var s=this,r=this.suite;n(e.pop())},n.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},n.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},n.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},n.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(n){t(n)}},n.prototype.runTests=function(t,e){function o(){return(n=r.shift())?s._grep.test(n.fullTitle())?n.pending?(s.emit("pending",n),s.emit("test end",n),o()):(s.emit("test",s.test=s.currentRunnable=n),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?(s.fail(n,t),s.emit("test end",n),s.hookUp("afterEach",o)):(n.passed=!0,s.emit("pass",n),s.emit("test end",n),void s.hookUp("afterEach",o))})})):o():e()}var n,s=this,r=t.tests;this.next=o,o()},n.prototype.runSuite=function(t,e){function o(){var e=t.suites[i++];return e?void s.runSuite(e,o):n()}function n(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,i=0;r("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},n.prototype.run=function(t){function e(t){var e=o.currentRunnable;r("uncaught exception"),e.clearTimeout(),t.uncaught=!0,o.fail(e,t),"test"==e.type?(o.emit("test end",e),o.hookUp("afterEach",o.next)):o.emit("end")}var o=this,t=t||function(){};return r("start"),o.on("end",function(){r("end"),process.removeListener("uncaughtException",e),t(o.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),o.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,o){function n(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3}var s=o("browser/events").EventEmitter,r=o("browser/debug")("suite"),i=o("./utils"),a=o("./hook");e=t.exports=n,e.create=function(t,e){var o=new n(e);return o.parent=t,e=o.fullTitle(),t.addSuite(o),o},n.prototype=new s,n.prototype.constructor=n,n.prototype.clone=function(){var t=new n(this.title);return r("clone"),t.timeout(this.timeout()),t},n.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},n.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},n.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},n.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},n.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},n.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),this.suites.push(t),this.emit("suite",t),this},n.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},n.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},n.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,o){function n(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=o("./runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,o){for(var n=0,s=t.length;s>n;n++)e.call(o,t[n],n)},e.indexOf=function(t,e,o){for(var n=o||0,s=t.length;s>n;n++)if(t[n]===e)return n;return-1},e.reduce=function(t,e,o,n){for(var s=o,r=0,i=t.length;i>r;r++)s=e.call(n,s,t[r],r,t);return s},e.filter=function(t,e,o){for(var n=[],s=0,r=t.length;r>s;s++){var i=t[s];e.call(o,i,s,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],o=Object.prototype.hasOwnProperty;for(var n in t)o.call(t,n)&&e.push(n);return e}}),t.register("watch.js",function(t,e,o){var n=o("browser/fs"),s=o("browser/debug")("watch");t.exports=function(t,e){var o={interval:100};t.forEach(function(t){s("watch %s",t),n.watchFile(t,o,function(o,n){n.mtimer;r++)if(n[r]===e||n[r].listener&&n[r].listener===e){s=r;break}if(0>s)return this;n.splice(s,1),n.length||delete this.$events[t]}else(n===e||n.listener&&n.listener===e)&&delete this.$events[t]}return this},n.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},n.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),o(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},n.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var n=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,n);else{if(!o(e))return!1;for(var s=e.slice(),r=0,i=s.length;i>r;r++)s[r].apply(this,n)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(12),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),o=this._size,n=o/2,s=n,r=n,i=n-1,u=this._fontSize;t.font=u+"px "+this._font;var a=2*Math.PI*(e/100);t.clearRect(0,0,o,o),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,r,i,0,a,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,r,i-1,0,a,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,r+u/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,o){function n(t,e){s.call(this,t,e)}var s=o("./runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("interfaces/bdd.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,o){var s=n.create(e[0],t);e.unshift(s),o(),e.shift()},t.it=function(t,o){e[0].addTest(new s(t,o))}})}}),t.register("interfaces/exports.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var u=t[i];switch(i){case"before":o[0].beforeAll(u);break;case"after":o[0].afterAll(u);break;case"beforeEach":o[0].beforeEach(u);break;case"afterEach":o[0].afterEach(u);break;default:o[0].addTest(new s(i,u))}}else{var r=n.create(o[0],i);o.unshift(r),e(t[i]),o.shift()}}var o=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,o){e.bdd=o("./bdd"),e.tdd=o("./tdd"),e.exports=o("./exports")}),t.register("interfaces/tdd.js",function(t,e,o){var n=o("../suite"),s=o("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,o){var s=n.create(e[0],t);e.unshift(s),o(),e.shift()},t.test=function(t,o){e[0].addTest(new s(t,o))}})}}),t.register("mocha.js",function(t,e,o){e.version="0.7.0",e.utils=o("./utils"),e.interfaces=o("./interfaces"),e.reporters=o("./reporters"),e.Runnable=o("./runnable"),e.Runner=o("./runner"),e.Suite=o("./suite"),e.Hook=o("./hook"),e.Test=o("./test"),e.watch=o("./watch")}),t.register("reporters/base.js",function(t,e,o){function n(t){var o=this.stats={suites:0,tests:0,passes:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.on("start",function(){o.start=new Date}),t.on("suite",function(){o.suites=o.suites||0,o.suites++}),t.on("test end",function(){o.tests=o.tests||0,o.tests++}),t.on("pass",function(t){o.passes=o.passes||0;var n=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>n?"medium":"fast",o.passes++}),t.on("fail",function(t,e){o.failures=o.failures||0,o.failures++,t.err=e,n.push(t)}),t.on("end",function(){o.end=new Date,o.duration=new Date-o.start}))}var s=o("browser/tty"),r=s.isatty(1)&&s.isatty(2);e=t.exports=n,e.useColors=r,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,o){return e.useColors?"["+e.colors[t]+"m"+o+"":o};e.window={width:r?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var o=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),n=t.err,s=n.stack,r=n.message||"",u=s.indexOf(r)+r.length,a=s.slice(0,u);s=s.slice(u+1).replace(/^/gm," "),console.error(o,e,t.fullTitle(),a,s)})},n.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),n.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,o){function n(t){function e(){return Array(o).join(" ")}r.call(this,t);var o=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++o,console.log('%s
',e()),++o,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--o,console.log("%s
",e()),--o)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var o=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),o)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"")}var r=o("./base"),i=o("../utils");e=t.exports=n}),t.register("reporters/dot.js",function(t,e,o){function n(t){s.call(this,t);var e=this,o=(this.stats,.75*s.window.width|0),n=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++n%o==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++n%o==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=o("./base"),r=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/html.js",function(t,e,o){function n(t){i.call(this,t);var e,o,n=this.stats,u=t.total,f=$("#mocha"),p=[f],h=$(l).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(o=d.getContext("2d"),e=new a),f.length?(e&&e.size(50),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,o){o.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var s=n.tests/u*100|0;e&&e.update(s).draw(o);var i=new Date-n.start;if(h.find(".passes em").text(n.passes),h.find(".failures em").text(n.failures),h.find(".duration em").text((i/1e3).toFixed(2)),t.passed)var a=$('

'+c(t.title)+"

");else if(t.pending)var a=$('

'+c(t.title)+"

");else{var a=$('

'+c(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+c(l)+"
").appendTo(a)}if(a.find("h2").toggle(function(){d.slideDown("fast")},function(){d.slideUp("fast")}),!t.pending){var f=c(r(t.fn.toString())),d=$("
"+f+"
");d.appendTo(a).hide()}p[0].append(a)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,o=new RegExp("^ {"+e+"}","gm");return t=t.replace(o,"").replace(/^\s+/,"")}var i=o("./base"),u=o("../utils"),a=o("../browser/progress"),c=u.escape;e=t.exports=n;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,o){e.Base=o("./base"),e.Dot=o("./dot"),e.Doc=o("./doc"),e.TAP=o("./tap"),e.JSON=o("./json"),e.HTML=o("./html"),e.List=o("./list"),e.Spec=o("./spec"),e.Progress=o("./progress"),e.Landing=o("./landing"),e.JSONStream=o("./json-stream")}),t.register("reporters/json-stream.js",function(t,e,o){function n(t){r.call(this,t);var e=this,o=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:o}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=o("./base");r.color}e=t.exports=n}),t.register("reporters/json.js",function(t,e,o){function n(t){var e=this;r.call(this,t);var o=[],n=[],i=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:o.map(s),failures:n.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=o("./base");r.cursor,r.color}e=t.exports=n}),t.register("reporters/landing.js",function(t,e,o){function n(t){function e(){var t=Array(n).join("-");return" "+i("runway",t)}s.call(this,t);var o=this,n=(this.stats,.75*s.window.width|0),u=t.total,a=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){a.write("\n "),r.hide()}),t.on("test end",function(t){var o=-1==l?n*++f/u|0:l;t.failed&&(c=i("plane crash","✈"),l=o),a.write("\n\n"),a.write(e()),a.write("\n "),a.write(i("runway",Array(o).join("⋅"))),a.write(c),a.write(i("runway",Array(n-o).join("⋅")+"\n")),a.write(e()),a.write("")}),t.on("end",function(){r.show(),console.log(),o.epilogue()})}var s=o("./base"),r=s.cursor,i=s.color;e=t.exports=n,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/list.js",function(t,e,o){function n(t){s.call(this,t);var e=this,o=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),o++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=o("./base"),r=s.cursor,i=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/progress.js",function(t,e,o){function n(t,e){s.call(this,t);{var o=this,e=e||{},n=(this.stats,.5*s.window.width|0),u=t.total,a=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){var t=a++/u,o=n*t|0,s=n-o;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(o).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+a+" of "+u))}),t.on("end",function(){r.show(),console.log(),o.epilogue()})}var s=o("./base"),r=s.cursor,i=s.color;e=t.exports=n,s.colors.progress=90,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/spec.js",function(t,e,o){function n(t){function e(){return Array(n).join(" ")}s.call(this,t);var o=this,n=(this.stats,0),u=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++n,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--n,1==n&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var o=e()+i("pending"," - %s");console.log(o,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var o=e()+i("checkmark"," ✓")+i("pass"," %s ");r.CR(),console.log(o,t.title)}else{var o=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(o,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),u++,t.title)}),t.on("end",o.epilogue.bind(o))}var s=o("./base"),r=s.cursor,i=s.color;e=t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("reporters/tap.js",function(t,e,o){function n(t){r.call(this,t);var e=(this.stats,t.total),o=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++o}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",o,s(t))}),t.on("pass",function(t){console.log("ok %d %s",o,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",o,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var r=o("./base");r.cursor,r.color}e=t.exports=n}),t.register("reporters/teamcity.js",function(t,e,o){function n(t){s.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",t.fullTitle())}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",t.fullTitle(),e.message)}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",t.fullTitle())}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",t.fullTitle(),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}var s=o("./base");e=t.exports=n}),t.register("runnable.js",function(t,e,o){function n(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3}var s=o("browser/events").EventEmitter,r=o("browser/debug")("runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n,n.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},n.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},n.prototype.clearTimeout=function(){clearTimeout(this.timer)},n.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded"))},e))},n.prototype.run=function(t){function e(){s||(s=!0,r.emit("error",new Error("done() called multiple times")))}function o(o){return n?e():(r.clearTimeout(),r.duration=new Date-u,n=!0,void t(o))}var n,s,r=this,i=this.timeout(),u=new Date;if(this.async&&i&&(this.timer=setTimeout(function(){o(new Error("timeout of "+i+"ms exceeded"))},i)),this.callback=o,this.async)try{this.fn(function(t){return t instanceof Error?o(t):void o()})}catch(a){o(a)}else try{this.pending||this.fn(),this.duration=new Date-u,t()}catch(a){t(a)}}}),t.register("runner.js",function(t,e,o){function n(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(i.keys(global).concat(["errno"]))}var s=o("browser/events").EventEmitter,r=o("browser/debug")("runner"),i=(o("./test"),o("./utils"));t.exports=n,n.prototype=new s,n.prototype.constructor=n,n.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this},n.prototype.globals=function(t){return r("globals %j",t),i.forEach(t,function(t){this._globals.push(t)},this),this},n.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=i.filter(i.keys(global),function(t){return!~i.indexOf(this._globals,t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},n.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},n.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},n.prototype.hook=function(t,e){function o(t){var n=s[t];return n?(r.currentRunnable=n,r.emit("hook",n),n.on("error",function(t){r.failHook(n,t)}),void n.run(function(e){return n.removeAllListeners("error"),e?r.failHook(n,e):(r.emit("hook end",n),void o(++t))})):e()}var n=this.suite,s=n["_"+t],r=(n._timeout,this);process.nextTick(function(){o(0)})},n.prototype.hooks=function(t,e,o){function n(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=r,o(t)):void n(e.pop())}):(s.suite=r,o())}var s=this,r=this.suite;n(e.pop())},n.prototype.hookUp=function(t,e){var o=[this.suite].concat(this.parents()).reverse();this.hooks(t,o,e)},n.prototype.hookDown=function(t,e){var o=[this.suite].concat(this.parents());this.hooks(t,o,e)},n.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},n.prototype.runTest=function(t){var e=this.test,o=this;try{e.on("error",function(t){o.fail(e,t)}),e.run(t)}catch(n){t(n)}},n.prototype.runTests=function(t,e){function o(){return(n=r.shift())?s._grep.test(n.fullTitle())?n.pending?(s.emit("pending",n),s.emit("test end",n),o()):(s.emit("test",s.test=s.currentRunnable=n),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?(s.fail(n,t),s.emit("test end",n),s.hookUp("afterEach",o)):(n.passed=!0,s.emit("pass",n),s.emit("test end",n),void s.hookUp("afterEach",o))})})):o():e()}var n,s=this,r=t.tests;this.next=o,o()},n.prototype.runSuite=function(t,e){function o(){var e=t.suites[i++];return e?void s.runSuite(e,o):n()}function n(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,i=0;r("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,o)})},n.prototype.run=function(t){function e(t){var e=o.currentRunnable;r("uncaught exception"),e.clearTimeout(),t.uncaught=!0,o.fail(e,t),"test"==e.type?(o.emit("test end",e),o.hookUp("afterEach",o.next)):o.emit("end")}var o=this,t=t||function(){};return r("start"),o.on("end",function(){r("end"),process.removeListener("uncaughtException",e),t(o.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),o.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,o){function n(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3}var s=o("browser/events").EventEmitter,r=o("browser/debug")("suite"),i=o("./utils"),u=o("./hook");e=t.exports=n,e.create=function(t,e){var o=new n(e);return o.parent=t,e=o.fullTitle(),t.addSuite(o),o},n.prototype=new s,n.prototype.constructor=n,n.prototype.clone=function(){var t=new n(this.title);return r("clone"),t.timeout(this.timeout()),t},n.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},n.prototype.beforeAll=function(t){var e=new u('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},n.prototype.afterAll=function(t){var e=new u('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},n.prototype.beforeEach=function(t){var e=new u('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},n.prototype.afterEach=function(t){var e=new u('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},n.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),this.suites.push(t),this.emit("suite",t),this},n.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},n.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},n.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,o){function n(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=o("./runnable");t.exports=n,n.prototype=new s,n.prototype.constructor=n}),t.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,o){for(var n=0,s=t.length;s>n;n++)e.call(o,t[n],n)},e.indexOf=function(t,e,o){for(var n=o||0,s=t.length;s>n;n++)if(t[n]===e)return n;return-1},e.reduce=function(t,e,o,n){for(var s=o,r=0,i=t.length;i>r;r++)s=e.call(n,s,t[r],r,t);return s},e.filter=function(t,e,o){for(var n=[],s=0,r=t.length;r>s;s++){var i=t[s];e.call(o,i,s,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],o=Object.prototype.hasOwnProperty;for(var n in t)o.call(t,n)&&e.push(n);return e}}),t.register("watch.js",function(t,e,o){var n=o("browser/fs"),s=o("browser/debug")("watch");t.exports=function(t,e){var o={interval:100};t.forEach(function(t){s("watch %s",t),n.watchFile(t,o,function(o,n){n.mtimer;r++)if(o[r]===e||o[r].listener&&o[r].listener===e){s=r;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),r=0,i=s.length;i>r;r++)s[r].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(12),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,r=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,r,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,n){function o(t,e){s.call(this,t,e)}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.it=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(i,a))}}else{var r=o.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.exports=n("./exports")}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.8.0",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),e.watch=n("./watch")}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(){n.suites=n.suites||0,n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}var s=n("browser/tty"),r=s.isatty(1)&&s.isatty(2);e=t.exports=o,e.useColors=r,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:r?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),o=t.err,s=o.stack||o.message,r=o.message||"",a=s.indexOf(r)+r.length,u=s.slice(0,a);s=s.slice(a+1).replace(/^/gm," "),console.error(n,e,t.fullTitle(),u,s)})},o.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),o.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),n)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=n("./base"),r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html.js",function(t,e,n){function o(t){i.call(this,t);var e,n,o=this.stats,a=t.total,f=$("#mocha"),p=[f],h=$(l).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(n=d.getContext("2d"),e=new u),f.length?(e&&e.size(50),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var s=o.tests/a*100|0;e&&e.update(s).draw(n);var i=new Date-o.start;if(h.find(".passes em").text(o.passes),h.find(".failures em").text(o.failures),h.find(".duration em").text((i/1e3).toFixed(2)),t.passed)var u=$('

'+c(t.title)+"

");else if(t.pending)var u=$('

'+c(t.title)+"

");else{var u=$('

'+c(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+c(l)+"
").appendTo(u)}if(u.find("h2").toggle(function(){d.slideDown("fast")},function(){d.slideUp("fast")}),!t.pending){var f=c(r(t.fn.toString())),d=$("
"+f+"
");d.appendTo(u).hide()}p[0].append(u)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var i=n("./base"),a=n("../utils"),u=n("../browser/progress"),c=a.escape;e=t.exports=o;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;r.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;t.failed&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),n++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){var t=u++/a,n=o*t|0,s=o-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,s.colors.progress=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),a++,t.title)}),t.on("end",n.epilogue.bind(n))}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){r.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,s(t))}),t.on("pass",function(t){console.log("ok %d %s",n,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",s(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",s(t.fullTitle()),s(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",s(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",s(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function s(t){return t.replace(/'/g,"|'")}var r=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(s),console.log("")})}function s(t){var e={classname:t.fullTitle(),name:t.title,time:t.duration/1e3};if(t.failed){var n=t.err;e.message=c(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,o){var s,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return s="<"+t+(i.length?" "+i.join(" "):"")+r,o&&(s+=o+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3}var s=n("browser/events").EventEmitter,r=n("browser/debug")("runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){clearTimeout(this.timer)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded"))},e))},o.prototype.run=function(t){function e(){s||(s=!0,r.emit("error",new Error("done() called multiple times")))}function n(n){return o?e():(r.clearTimeout(),r.duration=new Date-a,o=!0,void t(n))}var o,s,r=this,i=this.timeout(),a=new Date;if(this.async&&i&&(this.timer=setTimeout(function(){n(new Error("timeout of "+i+"ms exceeded"))},i)),this.callback=n,this.async)try{this.fn(function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(u){n(u)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(u){t(u)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(i.keys(global).concat(["errno"]))}var s=n("browser/events").EventEmitter,r=n("browser/debug")("runner"),i=(n("./test"),n("./utils"));t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this},o.prototype.globals=function(t){return r("globals %j",t),i.forEach(t,function(t){this._globals.push(t)},this),this},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=i.filter(i.keys(global),function(t){return!(~i.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},o.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(r.currentRunnable=o,r.emit("hook",o),o.on("error",function(t){r.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?r.failHook(o,e):(r.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],r=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=r,n(t)):void o(e.pop())}):(s.suite=r,n())}var s=this,r=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return(o=r.shift())?s._grep.test(o.fullTitle())?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=s.currentRunnable=o),void s.hookDown("beforeEach",function(){s.runTest(function(t){return t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.passed=!0,s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n():e()}var o,s=this,r=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,i=0;r("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,n)})},o.prototype.run=function(t){function e(t){var e=n.currentRunnable;r("uncaught exception"),e.clearTimeout(),t.uncaught=!0,n.fail(e,t),"test"==e.type?(n.emit("test end",e),n.hookUp("afterEach",n.next)):n.emit("end")}var n=this,t=t||function(){};return r("start"),n.on("end",function(){r("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3}var s=n("browser/events").EventEmitter,r=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return r("clone"),t.timeout(this.timeout()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var s=n,r=0,i=t.length;i>r;r++)s=e.call(o,s,t[r],r,t);return s},e.filter=function(t,e,n){for(var o=[],s=0,r=t.length;r>s;s++){var i=t[s];e.call(n,i,s,t)&&o.push(i)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e}}),t.register("watch.js",function(t,e,n){var o=n("browser/fs"),s=n("browser/debug")("watch");t.exports=function(t,e){var n={interval:100};t.forEach(function(t){s("watch %s",t),o.watchFile(t,n,function(n,o){o.mtimer;r++)if(o[r]===e||o[r].listener&&o[r].listener===e){s=r;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),r=0,i=s.length;i>r;r++)s[r].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(12),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,r=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,r,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,n){function o(t,e){s.call(this,t,e)}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.it=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(i,a))}}else{var r=o.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.exports=n("./exports")}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.8.1",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),e.watch=n("./watch")}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(){n.suites=n.suites||0,n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}var s=n("browser/tty"),r=s.isatty(1)&&s.isatty(2);e=t.exports=o,e.useColors=r,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:r?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),o=t.err,s=o.message||"",r=o.stack||s,a=r.indexOf(s)+s.length,u=r.slice(0,a);r=r.slice(a+1).replace(/^/gm," "),console.error(n,e,t.fullTitle(),u,r)})},o.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),o.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),n)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=n("./base"),r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html.js",function(t,e,n){function o(t){i.call(this,t);var e,n,o=this.stats,a=t.total,f=$("#mocha"),p=[f],h=$(l).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(n=d.getContext("2d"),e=new u),f.length?(e&&e.size(50),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var s=o.tests/a*100|0;e&&e.update(s).draw(n);var i=new Date-o.start;if(h.find(".passes em").text(o.passes),h.find(".failures em").text(o.failures),h.find(".duration em").text((i/1e3).toFixed(2)),t.passed)var u=$('

'+c(t.title)+"

");else if(t.pending)var u=$('

'+c(t.title)+"

");else{var u=$('

'+c(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+c(l)+"
").appendTo(u)}if(u.find("h2").toggle(function(){d.slideDown("fast")},function(){d.slideUp("fast")}),!t.pending){var f=c(r(t.fn.toString())),d=$("
"+f+"
");d.appendTo(u).hide()}p[0].append(u)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var i=n("./base"),a=n("../utils"),u=n("../browser/progress"),c=a.escape;e=t.exports=o;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;r.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;t.failed&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),n++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){var t=u++/a,n=o*t|0,s=o-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,s.colors.progress=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),a++,t.title)}),t.on("end",n.epilogue.bind(n))}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){r.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,s(t))}),t.on("pass",function(t){console.log("ok %d %s",n,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",s(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",s(t.fullTitle()),s(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",s(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",s(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function s(t){return t.replace(/'/g,"|'")}var r=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(s),console.log("")})}function s(t){var e={classname:t.fullTitle(),name:t.title,time:t.duration/1e3};if(t.failed){var n=t.err;e.message=c(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,o){var s,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return s="<"+t+(i.length?" "+i.join(" "):"")+r,o&&(s+=o+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3}var s=n("browser/events").EventEmitter,r=n("browser/debug")("runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){clearTimeout(this.timer)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded"))},e))},o.prototype.run=function(t){function e(){s||(s=!0,r.emit("error",new Error("done() called multiple times")))}function n(n){return o?e():(r.clearTimeout(),r.duration=new Date-a,o=!0,void t(n))}var o,s,r=this,i=this.timeout(),a=new Date;if(this.async&&i&&(this.timer=setTimeout(function(){n(new Error("timeout of "+i+"ms exceeded"))},i)),this.callback=n,this.async)try{this.fn(function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(u){n(u)}else try{this.pending||this.fn(),this.duration=new Date-a,t()}catch(u){t(u)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(i.keys(global).concat(["errno"]))}var s=n("browser/events").EventEmitter,r=n("browser/debug")("runner"),i=(n("./test"),n("./utils"));t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this},o.prototype.globals=function(t){return r("globals %j",t),i.forEach(t,function(t){this._globals.push(t)},this),this},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=i.filter(i.keys(global),function(t){return!(~i.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},o.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(r.currentRunnable=o,r.emit("hook",o),o.on("error",function(t){r.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?r.failHook(o,e):(r.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],r=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=r,n(t)):void o(e.pop())}):(s.suite=r,n())}var s=this,r=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return(o=r.shift())?s._grep.test(o.fullTitle())?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=o,s.runTest(function(t){return t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.passed=!0,s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n():e()}var o,s=this,r=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,i=0;r("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,n)})},o.prototype.run=function(t){function e(t){var e=n.currentRunnable;r("uncaught exception"),e.clearTimeout(),t.uncaught=!0,n.fail(e,t),"test"==e.type?(n.emit("test end",e),n.hookUp("afterEach",n.next)):n.emit("end")}var n=this,t=t||function(){};return r("start"),n.on("end",function(){r("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3}var s=n("browser/events").EventEmitter,r=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return r("clone"),t.timeout(this.timeout()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var s=n,r=0,i=t.length;i>r;r++)s=e.call(o,s,t[r],r,t);return s},e.filter=function(t,e,n){for(var o=[],s=0,r=t.length;r>s;s++){var i=t[s];e.call(n,i,s,t)&&o.push(i)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e}}),t.register("watch.js",function(t,e,n){var o=n("browser/fs"),s=n("browser/debug")("watch");t.exports=function(t,e){var n={interval:100};t.forEach(function(t){s("watch %s",t),o.watchFile(t,n,function(n,o){o.mtimer;r++)if(o[r]===e||o[r].listener&&o[r].listener===e){s=r;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),r=0,i=s.length;i>r;r++)s[r].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(12),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,r=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,r,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,s-l/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("hook.js",function(t,e,n){function o(t,e){s.call(this,t,e)}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.it=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(i,a))}}else{var r=o.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.exports=n("./exports")}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);e.unshift(s),n(),e.shift()},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("mocha.js",function(t,e,n){e.version="0.9.0",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),e.watch=n("./watch")}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(){n.suites=n.suites||0,n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}var s=n("browser/tty"),r=s.isatty(1)&&s.isatty(2);e=t.exports=o,e.useColors=r,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90};var i=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:r?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:s.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=i("error title"," %s) %s:\n")+i("error message"," %s")+i("error stack","\n%s\n"),o=t.err,s=o.message||"",r=o.stack||s,a=r.indexOf(s)+s.length,u=r.slice(0,a);r=r.slice(a+1).replace(/^/gm," "),console.error(n,e,t.fullTitle(),u,r)})},o.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=i("bright fail"," ✖")+i("fail"," %d of %d tests failed")+i("light",":"),console.error(t,e.failures,this.runner.total),o.list(this.failures),void console.error()):(t=i("bright pass"," ✔")+i("green"," %d tests complete")+i("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=i.escape(s(t.fn.toString()));console.log("%s
%s
",e(),n)})}function s(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var s=n("./base"),r=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html.js",function(t,e,n){function o(t){i.call(this,t);var e,n,o=this.stats,a=t.total,f=$("#mocha"),p=[f],h=$(l).appendTo(f),d=h.find("canvas").get(0);return d.getContext&&(n=d.getContext("2d"),e=new u),f.length?(e&&e.size(50),t.on("suite",function(t){if(!t.root){var e=$('

'+t.title+"

");p[0].append(e),p.unshift($("
")),e.append(p[0])}}),t.on("suite end",function(t){t.root||p.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var s=o.tests/a*100|0;e&&e.update(s).draw(n);var i=new Date-o.start;if(h.find(".passes em").text(o.passes),h.find(".failures em").text(o.failures),h.find(".duration em").text((i/1e3).toFixed(2)),t.passed)var u=$('

'+c(t.title)+"

");else if(t.pending)var u=$('

'+c(t.title)+"

");else{var u=$('

'+c(t.title)+"

"),l=t.err.stack||t.err;"[object Error]"==l&&(l=t.err.message),$('
'+c(l)+"
").appendTo(u)}if(u.find("h2").toggle(function(){d.slideDown("fast")},function(){d.slideUp("fast")}),!t.pending){var f=c(r(t.fn.toString())),d=$("
"+f+"
");d.appendTo(u).hide()}p[0].append(u)})):s("#mocha div missing, add it to your document")}function s(t){$('
'+t+"
").appendTo("body")}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var i=n("./base"),a=n("../utils"),u=n("../browser/progress"),c=a.escape;e=t.exports=o;var l='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit")}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;r.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;t.failed&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),n++,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){var t=u++/a,n=o*t|0,s=o-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(s).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,s.colors.progress=90,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),a++,t.title)}),t.on("end",n.epilogue.bind(n))}var s=n("./base"),r=s.cursor,i=s.color;e=t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){r.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,s(t))}),t.on("pass",function(t){console.log("ok %d %s",n,s(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,s(t)),console.log(e.stack.replace(/^/gm," "))})}function s(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",s(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",s(t.fullTitle()),s(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",s(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",s(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function s(t){return t.replace(/'/g,"|'")}var r=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(s),console.log("")})}function s(t){var e={classname:t.fullTitle(),name:t.title,time:t.duration/1e3};if(t.failed){var n=t.err;e.message=c(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,o){var s,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return s="<"+t+(i.length?" "+i.join(" "):"")+r,o&&(s+=o+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.context=this}var s=n("browser/events").EventEmitter,r=n("browser/debug")("runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){clearTimeout(this.timer)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded"))},e))},o.prototype.run=function(t){function e(){s||(s=!0,r.emit("error",new Error("done() called multiple times")))}function n(n){return o?e():(r.clearTimeout(),r.duration=new Date-a,o=!0,void t(n))}var o,s,r=this,i=this.timeout(),a=new Date,u=this.context;if(this.async&&i&&(this.timer=setTimeout(function(){n(new Error("timeout of "+i+"ms exceeded"))},i)),this.callback=n,this.async)try{this.fn.call(u,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}else try{this.pending||this.fn.call(u),this.duration=new Date-a,t()}catch(c){t(c)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(i.keys(global).concat(["errno"]))}var s=n("browser/events").EventEmitter,r=n("browser/debug")("runner"),i=(n("./test"),n("./utils"));t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this},o.prototype.globals=function(t){return r("globals %j",t),i.forEach(t,function(t){this._globals.push(t)},this),this},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=i.filter(i.keys(global),function(t){return!(~i.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.failed=!0,this.emit("fail",t,e)},o.prototype.failHook=function(t,e){++this.failures,this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(r.currentRunnable=o,o.context=r.test,r.emit("hook",o),o.on("error",function(t){r.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?r.failHook(o,e):(r.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],r=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=r,n(t)):void o(e.pop())}):(s.suite=r,n())}var s=this,r=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return(o=r.shift())?s._grep.test(o.fullTitle())?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=o,s.runTest(function(t){return t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.passed=!0,s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n():e()}var o,s=this,r=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var s=this,i=0;r("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){s.runTests(t,n)})},o.prototype.run=function(t){function e(t){var e=n.currentRunnable;r("uncaught exception"),e.clearTimeout(),t.uncaught=!0,n.fail(e,t),"test"==e.type?(n.emit("test end",e),n.hookUp("afterEach",n.next)):n.emit("end")}var n=this,t=t||function(){};return r("start"),n.on("end",function(){r("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t){this.title=t,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3}var s=n("browser/events").EventEmitter,r=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return r("clone"),t.timeout(this.timeout()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}var s=n("./runnable");t.exports=o,o.prototype=new s,o.prototype.constructor=o}),t.register("utils.js",function(t,e){e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var s=n,r=0,i=t.length;i>r;r++)s=e.call(o,s,t[r],r,t);return s},e.filter=function(t,e,n){for(var o=[],s=0,r=t.length;r>s;s++){var i=t[s];e.call(n,i,s,t)&&o.push(i)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e}}),t.register("watch.js",function(t,e,n){var o=n("browser/fs"),s=n("browser/debug")("watch");t.exports=function(t,e){var n={interval:100};t.forEach(function(t){s("watch %s",t),o.watchFile(t,n,function(n,o){o.mtimer;r++)if(s[r]===e||s[r].listener&&s[r].listener===e){o=r;break}if(0>o)return this;s.splice(o,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var o=e.slice(),r=0,i=o.length;i>r;r++)o[r].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,o=s,r=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,r,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,o-l/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.test=function(t){return this._test=t,this},e.prototype.timeout=function(t){return this._test.timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_test"==t?void 0:e},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.it=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(i,a))}}else{var r=s.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var r=n("browser/path");e=t.exports=o,e.version="1.0.0",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(){var t=this.suite;this.files.forEach(function(e){e=r.resolve(e),t.emit("pre-require",global,e),t.emit("require",n(e),e),t.emit("post-require",global,e)})},o.prototype.growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";o(r,{title:"Failed",image:s("fail")})}else o(n.passes+" tests passed in "+n.duration+"ms",{title:"Passed",image:s("pass")})})},o.prototype.run=function(t){this.loadFiles();var n=this.suite,s=this.options,o=new e.Runner(n),r=new this._reporter(o);return o.ignoreLeaks=s.ignoreLeaks,s.grep&&o.grep(s.grep),s.globals&&o.globals(s.globals),s.growl&&this.growl(o,r),o.run(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,s.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return l(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=a.isatty(1)&&a.isatty(2);e=t.exports=s,e.useColors=c,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var l=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:c?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=l("error title"," %s) %s:\n")+l("error message"," %s")+l("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),f=s.actual,p=s.expected;if("string"==typeof f&&"string"==typeof p){var h=Math.max(f.length,p.length);c=20>h?r(s,"Chars"):r(s,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return o(++e,g)+" | "+t}).join("\n")}c="\n"+l("diff removed","actual")+" "+l("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=l("error title"," %s) %s:\n%s")+l("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},s.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=l("bright fail"," ✖")+l("fail"," %d of %d tests failed")+l("light",":"),console.error(t,e.failures,this.runner.total),s.list(this.failures),void console.error()):(t=l("bright pass"," ✔")+l("green"," %d tests complete")+l("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=i.escape(o(t.fn.toString()));console.log("%s
%s
",e(),n)})}function o(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),c=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t){c.call(this,t);var e,n,s=this.stats,l=t.total,p=document.getElementById("mocha"),d=r(h),g=d.getElementsByTagName("li"),m=g[1].getElementsByTagName("em")[0],v=g[2].getElementsByTagName("em")[0],w=g[3].getElementsByTagName("em")[0],y=d.getElementsByTagName("canvas")[0],b=[p];return y.getContext&&(n=y.getContext("2d"),e=new f),p?(p.appendChild(d),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r('

%s

',t.title);b[0].appendChild(e),b.unshift(document.createElement("div")),e.appendChild(b[0])}}),t.on("suite end",function(t){t.root||b.shift()}),t.on("fail",function(e,n){n.uncaught&&t.emit("test end",e)}),void t.on("test end",function(t){var o=s.tests/l*100|0;e&&e.update(o).draw(n);var c=new Date-s.start;if(i(m,s.passes),i(v,s.failures),i(w,(c/1e3).toFixed(2)),"passed"==t.state)var f=r('

%e

',t.title);else if(t.pending)var f=r('

%e

',t.title);else{var f=r('

%e

',t.title),p=t.err.stack||t.err.toString();~p.indexOf(t.err.message)||(p=t.err.message+"\n"+p),"[object Error]"==p&&(p=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(p+="\n("+t.err.sourceURL+":"+t.err.line+")"),f.appendChild(r('
%e
',p))}var h=f.getElementsByTagName("h2")[0];if(a(h,"click",function(){d.style.display="none"==d.style.display?"block":"none"}),!t.pending){var d=r("
%e
",u(t.fn.toString()));f.appendChild(d),d.style.display="none"}b[0].appendChild(f)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(r('
%s
',t))}function r(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return p(e[s++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function u(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var c=n("./base"),l=n("../utils"),f=n("../browser/progress"),p=l.escape;e=t.exports=s;var h='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function s(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var s=[],r=[],u=[];t.on("test end",function(t){s.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=o(t);a.stats=n.stats,a.tests=s.map(i),a.failures=r.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function o(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var s=r(n,t[n]);e.files.push(s),e.hits+=s.hits,e.misses+=s.misses,e.sloc+=s.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;r.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:s.map(o),passes:i.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}o.call(this,t);var n=this,s=(this.stats,.75*o.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==l?s*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,o="";for(var r in t)"suite"!=r&&(r&&(n=" - ["+r+"](#"+i.slug(t[r].suite.fullTitle())+")\n"),r&&(o+=Array(e).join(" ")+n),o+=s(t[r],e));return--e,o}function a(t){var e=n(t,{});return s(e,0)}r.call(this,t);var u=(this.stats,t.total,0),c="";a(t.suite),t.on("suite",function(t){++u;var n=i.slug(t.fullTitle());c+='\n',c+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=o(t.fn.toString());c+=t.title+".\n",c+="\n```js",c+=e+"\n",c+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(a(t.suite)),process.stdout.write(c)})}function o(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){o.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var o=n("./base");e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){o.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*o.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){var t=u++/a,n=s*t|0,o=s-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.progress=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}o.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){r.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,o(t))}),t.on("pass",function(t){console.log("ok %d %s",n,o(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,o(t)),console.log(e.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",o(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",o(t.fullTitle()),o(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",o(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",o(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function o(t){return t.replace(/'/g,"|'")}var r=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,s){var o,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return o="<"+t+(i.length?" "+i.join(" "):"")+r,s&&(o+=s+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){clearTimeout(this.timer)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(){o||(o=!0,r.emit("error",new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(s)return e();r.clearTimeout(),r.duration=new Date-a,s=!0,t(n)}}var s,o,r=this,i=this.timeout(),a=new Date,u=this.ctx;if(this.async&&i&&(this.timer=setTimeout(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(u,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}else try{this.pending||this.fn.call(u),this.duration=new Date-a,t()}catch(c){t(c)}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(i.keys(global).concat(["errno"]))}var o=n("browser/events").EventEmitter,r=n("browser/debug")("runner"),i=(n("./test"),n("./utils"));t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this},s.prototype.globals=function(t){return 0==arguments.length?this._globals:(r("globals %j",t),i.forEach(t,function(t){this._globals.push(t)},this),this)},s.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=i.filter(i.keys(global),function(t){return!(~i.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed",this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=o[t];return s?(r.currentRunnable=s,s.ctx.test(r.test),r.emit("hook",s),s.on("error",function(t){r.failHook(s,t)}),void s.run(function(e){return s.removeAllListeners("error"),e?r.failHook(s,e):(r.emit("hook end",s),void n(++t))})):e()}var s=this.suite,o=s["_"+t],r=(s._timeout,this);process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return o.suite=i,i?void o.hook(t,function(t){return t?(o.suite=r,n(t)):void s(e.pop())}):(o.suite=r,n())}var o=this,r=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;try{e.ctx.test(e),e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){return o.failures&&t._bail?e():(s=r.shift())?o._grep.test(s.fullTitle())?s.pending?(o.emit("pending",s),o.emit("test end",s),n()):(o.emit("test",o.test=s),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return s=o.test,t?(o.fail(s,t),o.emit("test end",s),o.hookUp("afterEach",n)):(s.state="passed",o.emit("pass",s),o.emit("test end",s),void o.hookUp("afterEach",n))})})):n():e()}var s,o=this,r=t.tests;this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void o.runSuite(e,n):s()}function s(){o.suite=t,o.hook("afterAll",function(){o.emit("suite end",t),e()})}var o=this,i=0;r("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){o.runTests(t,n)})},s.prototype.uncaught=function(t){r("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){var e=this,t=t||function(){};return r("start"),this.on("end",function(){r("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},s.prototype=new o,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return r("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(r("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"==t[0]?void 0:"parent"==t?"#":e},2)}}),t.register("utils.js",function(t,e,n){function s(t){return!~u.indexOf(t)}var o=n("browser/fs"),r=n("browser/path"),i=r.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,o=t.length;o>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,o=t.length;o>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n,s){for(var o=n,r=0,i=t.length;i>r;r++)o=e.call(s,o,t[r],r,t); +return o},e.filter=function(t,e,n){for(var s=[],o=0,r=t.length;r>o;o++){var i=t[o];e.call(n,i,o,t)&&s.push(i)}return s},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),o.watchFile(t,n,function(n,s){s.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,s=e.length;s>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),s=e.slice(0,n),o=e.slice(++n);return t[s]=decodeURIComponent(o),t},{})}var s=new mocha.Suite("",new mocha.Context),o=mocha.utils,r={};mocha.setup=function(t){if("string"==typeof t?r.ui=t:r=t,ui=mocha.interfaces[r.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');r.timeout&&s.timeout(r.timeout),ui(s),s.emit("pre-require",window)},mocha.run=function(){s.emit("run");var t=new mocha.Runner(s),o=r.reporter||mocha.reporters.HTML,i=(new o(t),n(window.location.search||""));return i.grep&&t.grep(new RegExp(i.grep)),r.ignoreLeaks&&(t.ignoreLeaks=!0),r.globals&&t.globals(r.globals),t.globals(["location"]),t.on("end",e),t.run()}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.0.1/mocha.min.css b/ajax/libs/mocha/1.0.1/mocha.min.css new file mode 100644 index 000000000..2a26b349f --- /dev/null +++ b/ajax/libs/mocha/1.0.1/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha h1,h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00c41c}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.0.1/mocha.min.js b/ajax/libs/mocha/1.0.1/mocha.min.js new file mode 100644 index 000000000..9c427dce5 --- /dev/null +++ b/ajax/libs/mocha/1.0.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",o=e+"/index.js";return t.modules[s]&&s||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),o=n.split("/");s.pop();for(var r=0;rr;r++)if(s[r]===e||s[r].listener&&s[r].listener===e){o=r;break}if(0>o)return this;s.splice(o,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var o=e.slice(),r=0,i=o.length;i>r;r++)o[r].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,o=s,r=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,r,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,o-l/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return this._runnable=t,this},e.prototype.timeout=function(t){return this._runnable.timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"==t?void 0:e},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.it=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(i,a))}}else{var r=s.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var r=n("browser/path");e=t.exports=o,e.version="1.0.1",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(){var t=this.suite;this.files.forEach(function(e){e=r.resolve(e),t.emit("pre-require",global,e),t.emit("require",n(e),e),t.emit("post-require",global,e)})},o.prototype.growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";o(r,{title:"Failed",image:s("fail")})}else o(n.passes+" tests passed in "+n.duration+"ms",{title:"Passed",image:s("pass")})})},o.prototype.run=function(t){this.loadFiles();var n=this.suite,s=this.options,o=new e.Runner(n),r=new this._reporter(o);return o.ignoreLeaks=s.ignoreLeaks,s.grep&&o.grep(s.grep),s.globals&&o.globals(s.globals),s.growl&&this.growl(o,r),o.run(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var n=this.stats={suites:0,tests:0,passes:0,failures:0},s=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,s.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return l(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=a.isatty(1)&&a.isatty(2);e=t.exports=s,e.useColors=c,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var l=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:c?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=l("error title"," %s) %s:\n")+l("error message"," %s")+l("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),f=s.actual,p=s.expected;if("string"==typeof f&&"string"==typeof p){var h=Math.max(f.length,p.length);c=20>h?r(s,"Chars"):r(s,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return o(++e,g)+" | "+t}).join("\n")}c="\n"+l("diff removed","actual")+" "+l("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=l("error title"," %s) %s:\n%s")+l("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},s.prototype.epilogue=function(){var t,e=this.stats;return console.log(),e.failures?(t=l("bright fail"," ✖")+l("fail"," %d of %d tests failed")+l("light",":"),console.error(t,e.failures,this.runner.total),s.list(this.failures),void console.error()):(t=l("bright pass"," ✔")+l("green"," %d tests complete")+l("light"," (%dms)"),console.log(t,e.tests||0,e.duration),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=i.escape(o(t.fn.toString()));console.log("%s
%s
",e(),n)})}function o(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),c=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t){c.call(this,t);var e,n,s=this.stats,l=t.total,p=document.getElementById("mocha"),d=r(h),g=d.getElementsByTagName("li"),m=g[1].getElementsByTagName("em")[0],v=g[2].getElementsByTagName("em")[0],w=g[3].getElementsByTagName("em")[0],y=d.getElementsByTagName("canvas")[0],b=[p];return y.getContext&&(n=y.getContext("2d"),e=new f),p?(p.appendChild(d),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r('

%s

',t.title);b[0].appendChild(e),b.unshift(document.createElement("div")),e.appendChild(b[0])}}),t.on("suite end",function(t){t.root||b.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){var o=s.tests/l*100|0;e&&e.update(o).draw(n);var c=new Date-s.start;if(i(m,s.passes),i(v,s.failures),i(w,(c/1e3).toFixed(2)),"passed"==t.state)var f=r('

%e

',t.title);else if(t.pending)var f=r('

%e

',t.title);else{var f=r('

%e

',t.title),p=t.err.stack||t.err.toString();~p.indexOf(t.err.message)||(p=t.err.message+"\n"+p),"[object Error]"==p&&(p=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(p+="\n("+t.err.sourceURL+":"+t.err.line+")"),f.appendChild(r('
%e
',p))}var h=f.getElementsByTagName("h2")[0];if(a(h,"click",function(){d.style.display="none"==d.style.display?"block":"none"}),!t.pending){var d=r("
%e
",u(t.fn.toString()));f.appendChild(d),d.style.display="none"}b[0].appendChild(f)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(r('
%s
',t))}function r(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return p(e[s++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function u(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var c=n("./base"),l=n("../utils"),f=n("../browser/progress"),p=l.escape;e=t.exports=s;var h='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function s(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var s=[],r=[],u=[];t.on("test end",function(t){s.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=o(t);a.stats=n.stats,a.tests=s.map(i),a.failures=r.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function o(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var s=r(n,t[n]);e.files.push(s),e.hits+=s.hits,e.misses+=s.misses,e.sloc+=s.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;r.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:s.map(o),passes:i.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}o.call(this,t);var n=this,s=(this.stats,.75*o.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==l?s*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,o="";for(var r in t)"suite"!=r&&(r&&(n=" - ["+r+"](#"+i.slug(t[r].suite.fullTitle())+")\n"),r&&(o+=Array(e).join(" ")+n),o+=s(t[r],e));return--e,o}function a(t){var e=n(t,{});return s(e,0)}r.call(this,t);var u=(this.stats,t.total,0),c="";a(t.suite),t.on("suite",function(t){++u;var n=i.slug(t.fullTitle());c+='
\n',c+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=o(t.fn.toString());c+=t.title+".\n",c+="\n```js",c+=e+"\n",c+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(a(t.suite)),process.stdout.write(c)})}function o(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){o.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var o=n("./base");e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){o.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*o.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){var t=u++/a,n=s*t|0,o=s-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.progress=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}o.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){r.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,o(t))}),t.on("pass",function(t){console.log("ok %d %s",n,o(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,o(t)),console.log(e.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",o(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",o(t.fullTitle()),o(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",o(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",o(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function o(t){return t.replace(/'/g,"|'")}var r=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,s){var o,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return o="<"+t+(i.length?" "+i.join(" "):"")+r,s&&(o+=s+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){clearTimeout(this.timer)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(){o||(o=!0,r.emit("error",new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(s)return e();r.clearTimeout(),r.duration=new Date-a,s=!0,t(n)}}var s,o,r=this,i=this.timeout(),a=new Date,u=this.ctx;if(u&&u.runnable(this),this.async&&i&&(this.timer=setTimeout(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(u,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}else try{this.pending||this.fn.call(u),this.duration=new Date-a,t()}catch(c){t(c)}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(i.keys(global).concat(["errno"]))}var o=n("browser/events").EventEmitter,r=n("browser/debug")("runner"),i=(n("./test"),n("./utils"));t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this},s.prototype.globals=function(t){return 0==arguments.length?this._globals:(r("globals %j",t),i.forEach(t,function(t){this._globals.push(t)},this),this)},s.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=i.filter(i.keys(global),function(t){return!(~i.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed",this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=o[t];return s?(r.currentRunnable=s,r.emit("hook",s),s.on("error",function(t){r.failHook(s,t)}),void s.run(function(e){return s.removeAllListeners("error"),e?r.failHook(s,e):(r.emit("hook end",s),void n(++t))})):e()}var s=this.suite,o=s["_"+t],r=(s._timeout,this);process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return o.suite=i,i?void o.hook(t,function(t){return t?(o.suite=r,n(t)):void s(e.pop())}):(o.suite=r,n())}var o=this,r=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){return o.failures&&t._bail?e():(s=r.shift())?o._grep.test(s.fullTitle())?s.pending?(o.emit("pending",s),o.emit("test end",s),n()):(o.emit("test",o.test=s),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return s=o.test,t?(o.fail(s,t),o.emit("test end",s),o.hookUp("afterEach",n)):(s.state="passed",o.emit("pass",s),o.emit("test end",s),void o.hookUp("afterEach",n))})})):n():e()}var s,o=this,r=t.tests;this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void o.runSuite(e,n):s()}function s(){o.suite=t,o.hook("afterAll",function(){o.emit("suite end",t),e()})}var o=this,i=0;r("run suite %s",t.fullTitle()),this.emit("suite",this.suite=t),this.hook("beforeAll",function(){o.runTests(t,n)})},s.prototype.uncaught=function(t){r("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){var e=this,t=t||function(){};return r("start"),this.on("end",function(){r("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},s.prototype=new o,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return r("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(r("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length}}),t.register("test.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"==t[0]?void 0:"parent"==t?"#":e},2)}}),t.register("utils.js",function(t,e,n){function s(t){return!~u.indexOf(t)}var o=n("browser/fs"),r=n("browser/path"),i=r.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,o=t.length;o>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,o=t.length;o>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n,s){for(var o=n,r=0,i=t.length;i>r;r++)o=e.call(s,o,t[r],r,t); +return o},e.filter=function(t,e,n){for(var s=[],o=0,r=t.length;r>o;o++){var i=t[o];e.call(n,i,o,t)&&s.push(i)}return s},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),o.watchFile(t,n,function(n,s){s.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,s=e.length;s>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),s=e.slice(0,n),o=e.slice(++n);return t[s]=decodeURIComponent(o),t},{})}var s=new mocha.Suite("",new mocha.Context),o=mocha.utils,r={};mocha.setup=function(t){if("string"==typeof t?r.ui=t:r=t,ui=mocha.interfaces[r.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');r.timeout&&s.timeout(r.timeout),ui(s),s.emit("pre-require",window)},mocha.run=function(t){s.emit("run");var o=new mocha.Runner(s),i=r.reporter||mocha.reporters.HTML,a=(new i(o),n(window.location.search||""));return a.grep&&o.grep(new RegExp(a.grep)),r.ignoreLeaks&&(o.ignoreLeaks=!0),r.globals&&o.globals(r.globals),o.globals(["location"]),o.on("end",e),o.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.0.2/mocha.min.css b/ajax/libs/mocha/1.0.2/mocha.min.css new file mode 100644 index 000000000..03c469473 --- /dev/null +++ b/ajax/libs/mocha/1.0.2/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha h1,h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.0.2/mocha.min.js b/ajax/libs/mocha/1.0.2/mocha.min.js new file mode 100644 index 000000000..7a16f16f5 --- /dev/null +++ b/ajax/libs/mocha/1.0.2/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",o=e+"/index.js";return t.modules[s]&&s||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),o=n.split("/");s.pop();for(var r=0;rr;r++)if(s[r]===e||s[r].listener&&s[r].listener===e){o=r;break}if(0>o)return this;s.splice(o,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var o=e.slice(),r=0,i=o.length;i>r;r++)o[r].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,o=s,r=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,r,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,o-l/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return this._runnable=t,this},e.prototype.timeout=function(t){return this._runnable.timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"==t?void 0:e},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.it=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(i,a))}}else{var r=s.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var r=n("browser/path");e=t.exports=o,e.version="1.0.2",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(){var t=this.suite;this.files.forEach(function(e){e=r.resolve(e),t.emit("pre-require",global,e),t.emit("require",n(e),e),t.emit("post-require",global,e)})},o.prototype.growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";o(r,{title:"Failed",image:s("fail")})}else o(n.passes+" tests passed in "+n.duration+"ms",{title:"Passed",image:s("pass")})})},o.prototype.run=function(t){this.loadFiles();var n=this.suite,s=this.options,o=new e.Runner(n),r=new this._reporter(o);return o.ignoreLeaks=s.ignoreLeaks,s.grep&&o.grep(s.grep),s.globals&&o.globals(s.globals),s.growl&&this.growl(o,r),o.run(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},s=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,s.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}),t.on("pending",function(){n.pending++}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return l(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=a.isatty(1)&&a.isatty(2);e=t.exports=s,e.useColors=c,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var l=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:c?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=l("error title"," %s) %s:\n")+l("error message"," %s")+l("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),f=s.actual,p=s.expected;if("string"==typeof f&&"string"==typeof p){var h=Math.max(f.length,p.length);c=20>h?r(s,"Chars"):r(s,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return o(++e,g)+" | "+t}).join("\n")}c="\n"+l("diff removed","actual")+" "+l("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=l("error title"," %s) %s:\n%s")+l("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},s.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=l("bright fail"," ✖")+l("fail"," %d of %d %s failed")+l("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),s.list(this.failures),void console.error()):(e=l("bright pass"," ✔")+l("green"," %d %s complete")+l("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=l("pending"," •")+l("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=i.escape(o(t.fn.toString()));console.log("%s
%s
",e(),n)})}function o(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),c=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t){c.call(this,t);var e,n,s=this.stats,l=t.total,p=document.getElementById("mocha"),d=r(h),g=d.getElementsByTagName("li"),m=g[1].getElementsByTagName("em")[0],v=g[2].getElementsByTagName("em")[0],w=g[3].getElementsByTagName("em")[0],y=d.getElementsByTagName("canvas")[0],b=[p];return y.getContext&&(n=y.getContext("2d"),e=new f),p?(p.appendChild(d),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r('

%s

',t.title);b[0].appendChild(e),b.unshift(document.createElement("div")),e.appendChild(b[0])}}),t.on("suite end",function(t){t.root||b.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){var o=s.tests/l*100|0;e&&e.update(o).draw(n);var c=new Date-s.start;if(i(m,s.passes),i(v,s.failures),i(w,(c/1e3).toFixed(2)),"passed"==t.state)var f=r('

%e%ems

',t.speed,t.title,t.duration);else if(t.pending)var f=r('

%e

',t.title);else{var f=r('

%e

',t.title),p=t.err.stack||t.err.toString();~p.indexOf(t.err.message)||(p=t.err.message+"\n"+p),"[object Error]"==p&&(p=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(p+="\n("+t.err.sourceURL+":"+t.err.line+")"),f.appendChild(r('
%e
',p))}var h=f.getElementsByTagName("h2")[0];if(a(h,"click",function(){d.style.display="none"==d.style.display?"block":"none"}),!t.pending){var d=r("
%e
",u(t.fn.toString()));f.appendChild(d),d.style.display="none"}b[0].appendChild(f)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(r('
%s
',t))}function r(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return p(e[s++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function u(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var c=n("./base"),l=n("../utils"),f=n("../browser/progress"),p=l.escape;e=t.exports=s;var h='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function s(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var s=[],r=[],u=[];t.on("test end",function(t){s.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=o(t);a.stats=n.stats,a.tests=s.map(i),a.failures=r.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function o(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var s=r(n,t[n]);e.files.push(s),e.hits+=s.hits,e.misses+=s.misses,e.sloc+=s.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;r.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:s.map(o),passes:i.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}o.call(this,t);var n=this,s=(this.stats,.75*o.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==l?s*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,o="";for(var r in t)"suite"!=r&&(r&&(n=" - ["+r+"](#"+i.slug(t[r].suite.fullTitle())+")\n"),r&&(o+=Array(e).join(" ")+n),o+=s(t[r],e));return--e,o}function a(t){var e=n(t,{});return s(e,0)}r.call(this,t);var u=(this.stats,t.total,0),c="";a(t.suite),t.on("suite",function(t){++u;var n=i.slug(t.fullTitle());c+='
\n',c+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=o(t.fn.toString());c+=t.title+".\n",c+="\n```js",c+=e+"\n",c+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(a(t.suite)),process.stdout.write(c)})}function o(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){o.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var o=n("./base");e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){o.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*o.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){u++;var t=u/a,n=s*t|0,o=s-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.progress=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}o.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){r.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,o(t))}),t.on("pass",function(t){console.log("ok %d %s",n,o(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,o(t)),console.log(e.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",o(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",o(t.fullTitle()),o(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",o(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",o(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function o(t){return t.replace(/'/g,"|'")}var r=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,s){var o,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return o="<"+t+(i.length?" "+i.join(" "):"")+r,s&&(o+=s+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){clearTimeout(this.timer)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(){o||(o=!0,r.emit("error",new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(s)return e();r.clearTimeout(),r.duration=new Date-a,s=!0,t(n)}}var s,o,r=this,i=this.timeout(),a=new Date,u=this.ctx;if(u&&u.runnable(this),this.async&&i&&(this.timer=setTimeout(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(u,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}else try{this.pending||this.fn.call(u),this.duration=new Date-a,t()}catch(c){t(c)}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(i.keys(global).concat(["errno"]))}var o=n("browser/events").EventEmitter,r=n("browser/debug")("runner"),i=(n("./test"),n("./utils"));t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this.total=this.grepTotal(this.suite),this},s.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){e._grep.test(t.fullTitle())&&n++}),n},s.prototype.globals=function(t){return 0==arguments.length?this._globals:(r("globals %j",t),i.forEach(t,function(t){this._globals.push(t)},this),this)},s.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=i.filter(i.keys(global),function(t){return!(~i.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed",this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=o[t];return s?(r.currentRunnable=s,r.emit("hook",s),s.on("error",function(t){r.failHook(s,t)}),void s.run(function(e){return s.removeAllListeners("error"),e?r.failHook(s,e):(r.emit("hook end",s),void n(++t))})):e()}var s=this.suite,o=s["_"+t],r=(s._timeout,this);process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return o.suite=i,i?void o.hook(t,function(t){return t?(o.suite=r,n(t)):void s(e.pop())}):(o.suite=r,n())}var o=this,r=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){return o.failures&&t._bail?e():(s=r.shift())?o._grep.test(s.fullTitle())?s.pending?(o.emit("pending",s),o.emit("test end",s),n()):(o.emit("test",o.test=s),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return s=o.test,t?(o.fail(s,t),o.emit("test end",s),o.hookUp("afterEach",n)):(s.state="passed",o.emit("pass",s),o.emit("test end",s),void o.hookUp("afterEach",n))})})):n():e()}var s,o=this,r=t.tests;this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void i.runSuite(e,n):s()}function s(){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e()})}var o=this.grepTotal(t),i=this,a=0;return r("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){i.runTests(t,n)})):e()},s.prototype.uncaught=function(t){r("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){var e=this,t=t||function(){};return r("start"),this.on("end",function(){r("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},s.prototype=new o,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return r("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(r("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},s.prototype.eachTest=function(t){return i.forEach(this.tests,t),i.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"==t[0]?void 0:"parent"==t?"#":e +},2)}}),t.register("utils.js",function(t,e,n){function s(t){return!~u.indexOf(t)}var o=n("browser/fs"),r=n("browser/path"),i=r.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,o=t.length;o>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,o=t.length;o>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n,s){for(var o=n,r=0,i=t.length;i>r;r++)o=e.call(s,o,t[r],r,t);return o},e.filter=function(t,e,n){for(var s=[],o=0,r=t.length;r>o;o++){var i=t[o];e.call(n,i,o,t)&&s.push(i)}return s},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),o.watchFile(t,n,function(n,s){s.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,s=e.length;s>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),s=e.slice(0,n),o=e.slice(++n);return t[s]=decodeURIComponent(o),t},{})}var s=new mocha.Suite("",new mocha.Context),o=mocha.utils,r={};mocha.setup=function(t){if("string"==typeof t?r.ui=t:r=t,ui=mocha.interfaces[r.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');r.timeout&&s.timeout(r.timeout),ui(s),s.emit("pre-require",window)},mocha.run=function(t){s.emit("run");var o=new mocha.Runner(s),i=r.reporter||mocha.reporters.HTML,a=(new i(o),n(window.location.search||""));return a.grep&&o.grep(new RegExp(a.grep)),r.ignoreLeaks&&(o.ignoreLeaks=!0),r.globals&&o.globals(r.globals),o.globals(["location"]),o.on("end",e),o.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.0.3/mocha.min.css b/ajax/libs/mocha/1.0.3/mocha.min.css new file mode 100644 index 000000000..03c469473 --- /dev/null +++ b/ajax/libs/mocha/1.0.3/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha h1,h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.0.3/mocha.min.js b/ajax/libs/mocha/1.0.3/mocha.min.js new file mode 100644 index 000000000..589b76496 --- /dev/null +++ b/ajax/libs/mocha/1.0.3/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",o=e+"/index.js";return t.modules[s]&&s||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),o=n.split("/");s.pop();for(var r=0;rr;r++)if(s[r]===e||s[r].listener&&s[r].listener===e){o=r;break}if(0>o)return this;s.splice(o,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var o=e.slice(),r=0,i=o.length;i>r;r++)o[r].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,o=s,r=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,r,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,o-l/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return this._runnable=t,this},e.prototype.timeout=function(t){return this._runnable.timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"==t?void 0:e},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.it=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(i,a))}}else{var r=s.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=s.create(e[0],t);e.unshift(o),n(),e.shift()},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var r=n("browser/path");e=t.exports=o,e.version="1.0.2",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(){var t=this.suite;this.files.forEach(function(e){e=r.resolve(e),t.emit("pre-require",global,e),t.emit("require",n(e),e),t.emit("post-require",global,e)})},o.prototype.growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";o(r,{title:"Failed",image:s("fail")})}else o(n.passes+" tests passed in "+n.duration+"ms",{title:"Passed",image:s("pass")})})},o.prototype.run=function(t){this.loadFiles();var n=this.suite,s=this.options,o=new e.Runner(n),r=new this._reporter(o);return o.ignoreLeaks=s.ignoreLeaks,s.grep&&o.grep(s.grep),s.globals&&o.globals(s.globals),s.growl&&this.growl(o,r),o.run(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},s=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new Date}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var s=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>s?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,s.push(t)}),t.on("end",function(){n.end=new Date,n.duration=new Date-n.start}),t.on("pending",function(){n.pending++}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return"\n"==t.value&&(t.value="\n"),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return l(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=a.isatty(1)&&a.isatty(2);e=t.exports=s,e.useColors=c,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var l=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:c?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=l("error title"," %s) %s:\n")+l("error message"," %s")+l("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),f=s.actual,p=s.expected;if("string"==typeof f&&"string"==typeof p){var h=Math.max(f.length,p.length);c=20>h?r(s,"Chars"):r(s,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return o(++e,g)+" | "+t}).join("\n")}c="\n"+l("diff removed","actual")+" "+l("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=l("error title"," %s) %s:\n%s")+l("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},s.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=l("bright fail"," ✖")+l("fail"," %d of %d %s failed")+l("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),s.list(this.failures),void console.error()):(e=l("bright pass"," ✔")+l("green"," %d %s complete")+l("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=l("pending"," •")+l("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=i.escape(o(t.fn.toString()));console.log("%s
%s
",e(),n)})}function o(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending","."))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow","."):r(t.speed,"."))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),c=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t){c.call(this,t);var e,n,s=this.stats,l=t.total,p=document.getElementById("mocha"),d=r(h),g=d.getElementsByTagName("li"),m=g[1].getElementsByTagName("em")[0],v=g[2].getElementsByTagName("em")[0],w=g[3].getElementsByTagName("em")[0],y=d.getElementsByTagName("canvas")[0],b=[p];return y.getContext&&(n=y.getContext("2d"),e=new f),p?(p.appendChild(d),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r('

%s

',t.title);b[0].appendChild(e),b.unshift(document.createElement("div")),e.appendChild(b[0])}}),t.on("suite end",function(t){t.root||b.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){var o=s.tests/l*100|0;e&&e.update(o).draw(n);var c=new Date-s.start;if(i(m,s.passes),i(v,s.failures),i(w,(c/1e3).toFixed(2)),"passed"==t.state)var f=r('

%e%ems

',t.speed,t.title,t.duration);else if(t.pending)var f=r('

%e

',t.title);else{var f=r('

%e

',t.title),p=t.err.stack||t.err.toString();~p.indexOf(t.err.message)||(p=t.err.message+"\n"+p),"[object Error]"==p&&(p=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(p+="\n("+t.err.sourceURL+":"+t.err.line+")"),f.appendChild(r('
%e
',p))}var h=f.getElementsByTagName("h2")[0];if(a(h,"click",function(){d.style.display="none"==d.style.display?"block":"none"}),!t.pending){var d=r("
%e
",u(t.fn.toString()));f.appendChild(d),d.style.display="none"}b[0].appendChild(f)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(r('
%s
',t))}function r(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return p(e[s++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function u(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}var c=n("./base"),l=n("../utils"),f=n("../browser/progress"),p=l.escape;e=t.exports=s;var h='
  • passes: 0
  • failures: 0
  • duration: 0s
'}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function s(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var s=[],r=[],u=[];t.on("test end",function(t){s.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=o(t);a.stats=n.stats,a.tests=s.map(i),a.failures=r.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function o(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var s=r(n,t[n]);e.files.push(s),e.hits+=s.hits,e.misses+=s.misses,e.sloc+=s.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;r.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:s.map(o),passes:i.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}o.call(this,t);var n=this,s=(this.stats,.75*o.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==l?s*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,o="";for(var r in t)"suite"!=r&&(r&&(n=" - ["+r+"](#"+i.slug(t[r].suite.fullTitle())+")\n"),r&&(o+=Array(e).join(" ")+n),o+=s(t[r],e));return--e,o}function a(t){var e=n(t,{});return s(e,0)}r.call(this,t);var u=(this.stats,t.total,0),c="";a(t.suite),t.on("suite",function(t){++u;var n=i.slug(t.fullTitle());c+='
\n',c+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=o(t.fn.toString());c+=t.title+".\n",c+="\n```js",c+=e+"\n",c+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(a(t.suite)),process.stdout.write(c)})}function o(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var r=n("./base"),i=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){o.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var o=n("./base");e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){o.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*o.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){u++;var t=u/a,n=s*t|0,o=s-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.progress=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}o.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){r.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,o(t))}),t.on("pass",function(t){console.log("ok %d %s",n,o(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,o(t)),console.log(e.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='%s']",o(t.fullTitle()))}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='%s' message='%s']",o(t.fullTitle()),o(e.message))}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='%s' message='pending']",o(t.fullTitle()))}),t.on("test end",function(t){console.log("##teamcity[testFinished name='%s' duration='%s']",o(t.fullTitle()),t.duration)}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='%s']",e.duration)})}function o(t){return t.replace(/'/g,"|'")}var r=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new Date).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,s){var o,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return o="<"+t+(i.length?" "+i.join(" "):"")+r,s&&(o+=s+""}var a=n("./base"),u=n("../utils"),c=u.escape;e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){clearTimeout(this.timer)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=setTimeout(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(){o||(o=!0,r.emit("error",new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(s)return e();r.clearTimeout(),r.duration=new Date-a,s=!0,t(n)}}var s,o,r=this,i=this.timeout(),a=new Date,u=this.ctx;if(u&&u.runnable(this),this.async&&i&&(this.timer=setTimeout(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(u,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}else try{this.pending||this.fn.call(u),this.duration=new Date-a,t()}catch(c){t(c)}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(i.keys(global).concat(["errno"]))}var o=n("browser/events").EventEmitter,r=n("browser/debug")("runner"),i=(n("./test"),n("./utils"));t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.grep=function(t){return r("grep %s",t),this._grep=t,this.total=this.grepTotal(this.suite),this},s.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){e._grep.test(t.fullTitle())&&n++}),n},s.prototype.globals=function(t){return 0==arguments.length?this._globals:(r("globals %j",t),i.forEach(t,function(t){this._globals.push(t)},this),this)},s.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=i.filter(i.keys(global),function(t){return!(~i.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed",this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=o[t];return s?(r.currentRunnable=s,r.emit("hook",s),s.on("error",function(t){r.failHook(s,t)}),void s.run(function(e){return s.removeAllListeners("error"),e?r.failHook(s,e):(r.emit("hook end",s),void n(++t))})):e()}var s=this.suite,o=s["_"+t],r=(s._timeout,this);process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return o.suite=i,i?void o.hook(t,function(t){return t?(o.suite=r,n(t)):void s(e.pop())}):(o.suite=r,n())}var o=this,r=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){return o.failures&&t._bail?e():(s=r.shift())?o._grep.test(s.fullTitle())?s.pending?(o.emit("pending",s),o.emit("test end",s),n()):(o.emit("test",o.test=s),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return s=o.test,t?(o.fail(s,t),o.emit("test end",s),o.hookUp("afterEach",n)):(s.state="passed",o.emit("pass",s),o.emit("test end",s),void o.hookUp("afterEach",n))})})):n():e()}var s,o=this,r=t.tests;this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void i.runSuite(e,n):s()}function s(){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e()})}var o=this.grepTotal(t),i=this,a=0;return r("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){i.runTests(t,n)})):e()},s.prototype.uncaught=function(t){r("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){var e=this,t=t||function(){};return r("start"),this.on("end",function(){r("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){r("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},s.prototype=new o,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return r("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(r("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},s.prototype.eachTest=function(t){return i.forEach(this.tests,t),i.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"==t[0]?void 0:"parent"==t?"#":e +},2)}}),t.register("utils.js",function(t,e,n){function s(t){return!~u.indexOf(t)}var o=n("browser/fs"),r=n("browser/path"),i=r.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,o=t.length;o>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,o=t.length;o>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n,s){for(var o=n,r=0,i=t.length;i>r;r++)o=e.call(s,o,t[r],r,t);return o},e.filter=function(t,e,n){for(var s=[],o=0,r=t.length;r>o;o++){var i=t[o];e.call(n,i,o,t)&&s.push(i)}return s},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),o.watchFile(t,n,function(n,s){s.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,s=e.length;s>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),s=e.slice(0,n),o=e.slice(++n);return t[s]=decodeURIComponent(o),t},{})}var s=new mocha.Suite("",new mocha.Context),o=mocha.utils,r={};mocha.setup=function(t){if("string"==typeof t?r.ui=t:r=t,ui=mocha.interfaces[r.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');r.timeout&&s.timeout(r.timeout),ui(s),s.emit("pre-require",window)},mocha.run=function(t){s.emit("run");var o=new mocha.Runner(s),i=r.reporter||mocha.reporters.HTML,a=(new i(o),n(window.location.search||""));return a.grep&&o.grep(new RegExp(a.grep)),r.ignoreLeaks&&(o.ignoreLeaks=!0),r.globals&&o.globals(r.globals),o.globals(["location"]),o.on("end",e),o.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.1.0/mocha.min.css b/ajax/libs/mocha/1.1.0/mocha.min.css new file mode 100644 index 000000000..32d94e79a --- /dev/null +++ b/ajax/libs/mocha/1.1.0/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.1.0/mocha.min.js b/ajax/libs/mocha/1.1.0/mocha.min.js new file mode 100644 index 000000000..3b0c56bc5 --- /dev/null +++ b/ajax/libs/mocha/1.1.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var s=0;ss;s++)if(o[s]===e||o[s].listener&&o[s].listener===e){r=s;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),s=0,i=r.length;i>s;s++)r[s].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,s=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,s,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,s,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,r-l/2+1,s+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return this._runnable=t,this},e.prototype.timeout=function(t){return this._runnable.timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"==t?void 0:e},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.type="hook"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.it=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var s;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var s=o.create(n[0],i);n.unshift(s),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var s=n("browser/path");e=t.exports=r,e.version="1.0.3",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(){var t=this.suite;this.files.forEach(function(e){e=s.resolve(e),t.emit("pre-require",global,e),t.emit("require",n(e),e),t.emit("post-require",global,e)})},r.prototype.growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var s=n.failures+" of "+t.total+" tests failed";r(s,{title:"Failed",image:o("fail")})}else r(n.passes+" tests passed in "+n.duration+"ms",{title:"Passed",image:o("pass")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(t):t,this},r.prototype.run=function(t){this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),s=new this._reporter(r);return r.ignoreLeaks=o.ignoreLeaks,o.grep&&r.grep(o.grep),o.globals&&r.globals(o.globals),o.growl&&this.growl(r,s),r.run(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new c}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new c,n.duration=new c-n.start}),t.on("pending",function(){n.pending++}))}function r(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return/^(\n+)$/.test(t.value)&&(t.value=Array(++RegExp.$1.length).join("")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=global.Date,l=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=o,e.useColors=l,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:l?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),o=t.err,i=o.message||"",a=o.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),l=o.actual,p=o.expected;if("string"==typeof l&&"string"==typeof p){var h=Math.max(l.length,p.length);c=20>h?s(o,"Chars"):s(o,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return r(++e,g)+" | "+t}).join("\n")}c="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=f("bright fail"," ✖")+f("fail"," %d of %d %s failed")+f("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(e=f("bright pass"," ✔")+f("green"," %d %s complete")+f("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=f("pending"," •")+f("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}s.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
',e()),++n,console.log("%s

%s

",e(),t.title),console.log("%s
",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
",e()),--n,console.log("%s
",e()),--n)}),t.on("pass",function(t){console.log("%s
%s
",e(),t.title);var n=i.escape(r(t.fn.toString()));console.log("%s
%s
",e(),n)})}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var s=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(s("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?s("bright yellow","."):s(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(s("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=n("./base"),s=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",a=i.readFileSync(o,"utf8"),u=e.compile(a,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:r}))})}function r(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),i=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t){c.call(this,t);var e,n,o=this.stats,p=t.total,g=document.getElementById("mocha"),m=s(d),v=m.getElementsByTagName("li"),w=v[1].getElementsByTagName("em")[0],b=v[2].getElementsByTagName("em")[0],y=v[3].getElementsByTagName("em")[0],x=m.getElementsByTagName("canvas")[0],k=s('
    '),E=[k];return x.getContext&&(n=x.getContext("2d"),e=new f),g?(g.appendChild(m),g.appendChild(k),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=location.origin+location.pathname+"?grep=^"+l.escapeRegexp(t.fullTitle()),n=s('
  • %s

  • ',e,t.title);E[0].appendChild(n),E.unshift(document.createElement("ul")),n.appendChild(E[0])}}),t.on("suite end",function(t){t.root||E.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){var r=o.tests/p*100|0;e&&e.update(r).draw(n);var c=new h-o.start;if(i(w,o.passes),i(b,o.failures),i(y,(c/1e3).toFixed(2)),"passed"==t.state)var l=s('
  • %e%ems

  • ',t.speed,t.title,t.duration);else if(t.pending)var l=s('
  • %e

  • ',t.title);else{var l=s('
  • %e

  • ',t.title),f=t.err.stack||t.err.toString();~f.indexOf(t.err.message)||(f=t.err.message+"\n"+f),"[object Error]"==f&&(f=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(f+="\n("+t.err.sourceURL+":"+t.err.line+")"),l.appendChild(s('
    %e
    ',f))}var d=l.getElementsByTagName("h2")[0];if(a(d,"click",function(){g.style.display="none"==g.style.display?"block":"none"}),!t.pending){var g=s("
    %e
    ",u(t.fn.toString()));l.appendChild(g),g.style.display="none"}E[0].appendChild(l)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(s('
    %s
    ',t))}function s(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return p(e[o++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function u(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"").replace(/^\s+/,"")}{var c=n("./base"),l=n("../utils"),f=n("../browser/progress"),p=l.escape,h=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o;var d='
    • passes: 0
    • failures: 0
    • duration: 0s
    '}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function o(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var o=[],s=[],u=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=r(t);a.stats=n.stats,a.tests=o.map(i),a.failures=s.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function r(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var o=s(n,t[n]);e.files.push(o),e.hits+=o.hits,e.misses+=o.misses,e.sloc+=o.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(r),failures:o.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t,null,2))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}r.call(this,t);var n=this,o=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),s.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");s.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){s.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var s in t)"suite"!=s&&(s&&(n=" - ["+s+"](#"+i.slug(t[s].suite.fullTitle())+")\n"),s&&(r+=Array(e).join(" ")+n),r+=o(t[s],e));return--e,r}function a(t){var e=n(t,{});return o(e,0)}s.call(this,t);var u=(this.stats,t.total,0),c="";a(t.suite),t.on("suite",function(t){++u;var n=i.slug(t.fullTitle());c+='\n',c+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=r(t.fn.toString());c+=t.title+".\n",c+="\n```js",c+=e+"\n",c+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(a(t.suite)),process.stdout.write(c)})}function r(t){t=t.replace(/^function *\(.*\) *{/,"").replace(/\s+\}$/,"");var e=t.match(/^\n?( *)/)[1].length,n=new RegExp("^ {"+e+"}","gm");return t=t.replace(n,"")}var s=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var r=n("./base");e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){r.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),s.hide()}),t.on("test end",function(){u++;var t=u/a,n=o*t|0,r=o-n;s.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.progress=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}r.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){s.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,r(t))}),t.on("pass",function(t){console.log("ok %d %s",n,r(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,r(t)),console.log(e.stack.replace(/^/gm," "))})}function r(t){return t.fullTitle().replace(/#/g,"")}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){s.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var s=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,i(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,s=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+s,o&&(r+=o+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}{var r=n("browser/events").EventEmitter,s=n("browser/debug")("runnable"),i=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){u(this.timer)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(){r||(r=!0,s.emit("error",new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e();s.clearTimeout(),s.duration=new i-c,o=!0,t(n)}}var o,r,s=this,u=this.timeout(),c=new i,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),s.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new i-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(i.keys(global).concat(["errno"]))}var r=n("browser/events").EventEmitter,s=n("browser/debug")("runner"),i=(n("./test"),n("./utils"));t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.grep=function(t){return s("grep %s",t),this._grep=t,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){e._grep.test(t.fullTitle())&&n++}),n},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(s("globals %j",t),i.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=i.filter(i.keys(global),function(t){return!(~i.indexOf(this._globals,t)||global.navigator&&"onerror"===t)},this);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=r[t];return o?(s.currentRunnable=o,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?s.failHook(o,e):(s.emit("hook end",o),void n(++t))})):e()}var o=this.suite,r=o["_"+t],s=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=s,n(t)):void o(e.pop())}):(r.suite=s,n())}var r=this,s=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return r.failures&&t._bail?e():(o=s.shift())?r._grep.test(o.fullTitle())?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n))})})):n():e()}var o,r=this,s=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void i.runSuite(e,n):o()}function o(){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e()})}var r=this.grepTotal(t),i=this,a=0;return s("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){i.runTests(t,n)})):e()},o.prototype.uncaught=function(t){s("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){var e=this,t=t||function(){};return s("start"),this.on("end",function(){s("end"),process.removeListener("uncaughtException",this.uncaught),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){s("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var r=n("browser/events").EventEmitter,s=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this +},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return i.forEach(this.tests,t),i.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"==t[0]?void 0:"parent"==t?"#":e},2)}}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var r=n("browser/fs"),s=n("browser/path"),i=s.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var r=n,s=0,i=t.length;i>s;s++)r=e.call(o,r,t[s],s,t);return r},e.filter=function(t,e,n){for(var o=[],r=0,s=t.length;s>r;r++){var i=t[r];e.call(n,i,r,t)&&o.push(i)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),r.watchFile(t,n,function(n,o){o.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,o=e.length;o>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return r.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),o=e.slice(0,n),r=e.slice(++n);return t[o]=decodeURIComponent(r),t},{})}var o=new mocha.Suite("",new mocha.Context),r=mocha.utils,s={};mocha.setup=function(t){if("string"==typeof t?s.ui=t:s=t,ui=mocha.interfaces[s.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');s.timeout&&o.timeout(s.timeout),ui(o),o.emit("pre-require",window)},mocha.run=function(t){o.emit("run");var r=new mocha.Runner(o),i=s.reporter||mocha.reporters.HTML,a=(new i(r),n(window.location.search||""));return a.grep&&r.grep(new RegExp(a.grep)),s.ignoreLeaks&&(r.ignoreLeaks=!0),s.globals&&r.globals(s.globals),r.globals(["location"]),r.on("end",e),r.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.10.0/mocha.min.css b/ajax/libs/mocha/1.10.0/mocha.min.css new file mode 100644 index 000000000..709fc7eed --- /dev/null +++ b/ajax/libs/mocha/1.10.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2F6FAD}#mocha code .string{color:#5890AD}#mocha code .keyword{color:#8A6343}#mocha code .number{color:#2F6FAD}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.10.0/mocha.min.js b/ajax/libs/mocha/1.10.0/mocha.min.js new file mode 100644 index 000000000..721c75b3f --- /dev/null +++ b/ajax/libs/mocha/1.10.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}function e(){for(var t=(new n).getTime();u.length&&(new n).getTime()-t<100;)u.shift()();i=u.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n==e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,r=e.length,i=o+r,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=o&&a+1>=r)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&r>a;if(h||d){!h||d&&f.newPos=o&&a+1>=r)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,o){var r=t[t.length-1];r&&r.added===n&&r.removed===o?t[t.length-1]={value:this.join(r.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var r=e.length,i=n.length,s=t.newPos,a=s-o;r>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t==e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var r=new o,i=new o(!0);i.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var s=new o(!0);s.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var a=new o;return a.tokenize=function(t){return t.split(/^/m)},{diffChars:function(t,e){return r.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffLines:function(t,e){return a.diff(t,e)},diffCss:function(t,e){return s.diff(t,e)},createPatch:function(t,e,n,o,r){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var o=l[l.length-2],r=e===l.length-2,i=e===l.length-3&&(n.added===!o.added||n.removed===!o.removed);/\n$/.test(n.value)||!r&&!i||t.push("\\ No newline at end of file")}var u=[];u.push("Index: "+t),u.push("==================================================================="),u.push("--- "+t+("undefined"==typeof o?"":" "+o)),u.push("+++ "+t+("undefined"==typeof r?"":" "+r));var l=a.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g"):r.removed&&e.push(""),e.push(n(r.value)),r.added?e.push(""):r.removed&&e.push("")}return e.join("")}}}();"undefined"!=typeof t&&(t.exports=e)}),t.register("browser/events.js",function(t,e){function n(t){return"[object Array]"=={}.toString.call(t)}function o(){}e.EventEmitter=o,o.prototype.on=function(t,e){return this.$events||(this.$events={}),this.$events[t]?n(this.$events[t])?this.$events[t].push(e):this.$events[t]=[this.$events[t],e]:this.$events[t]=e,this},o.prototype.addListener=o.prototype.on,o.prototype.once=function(t,e){function n(){o.removeListener(t,n),e.apply(this,arguments)}var o=this;return n.listener=e,this.on(t,n),this},o.prototype.removeListener=function(t,e){if(this.$events&&this.$events[t]){var o=this.$events[t];if(n(o)){for(var r=-1,i=0,s=o.length;s>i;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){r=i;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),i=0,s=r.length;s>i;i++)r[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,i=o,s=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,r-c/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.type="hook"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);i.grep(o.fullTitle())},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.it.only=function(e,n){var o=t.it(e,n);i.grep(o.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(s,a))}}else{var i=o.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var o=t.suite(e,n);i.grep(o.fullTitle())},t.test=function(t,n){var o=new r(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n);i.grep(o.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.suite.only=function(e,n){var o=t.suite(e,n);i.grep(o.fullTitle())},t.test=function(t,n){var o=new r(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n);i.grep(o.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var i=n("browser/path"),s=n("./utils");e=t.exports=r,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,o=this.suite,r=this.files.length;this.files.forEach(function(s){s=i.resolve(s),o.emit("pre-require",global,s,e),o.emit("require",n(s),s,e),o.emit("post-require",global,s,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";r(i,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),i=new this._reporter(r);return r.ignoreLeaks=!1!==o.ignoreLeaks,r.asyncOnly=o.asyncOnly,o.grep&&r.grep(o.grep,o.invert),o.globals&&r.globals(o.globals),o.growl&&this._growl(r,i),r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==s?Math.round(t/s)+" day":t>s?Math.round(t/s)+" days":t==i?Math.round(t/i)+" hour":t>i?Math.round(t/i)+" hours":t==r?Math.round(t/r)+" minute":t>r?Math.round(t/r)+" minutes":t==o?Math.round(t/o)+" second":t>o?Math.round(t/o)+" seconds":t+" ms"}var o=1e3,r=60*o,i=60*r,s=24*i;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new f}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new f,e.duration=new f-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e,n){return l["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?a("diff added",t.value):t.removed?a("diff removed",t.value):t.value}).join("")}function a(t,e){return e.split("\n").map(function(e){return h(t,e)}).join("\n")}var u=n("browser/tty"),l=n("browser/diff"),c=n("../ms"),f=global.Date,p=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,u.isatty(1)&&u.isatty(2));e=t.exports=o,e.useColors=p,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==r.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var h=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:p?r.stdout.getWindowSize?r.stdout.getWindowSize(1)[0]:u.getWindowSize()[1]:75},e.cursor={hide:function(){r.stdout.write("[?25l")},show:function(){r.stdout.write("[?25h")},deleteLine:function(){r.stdout.write("")},beginningOfLine:function(){r.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=h("error title"," %s) %s:\n")+h("error message"," %s")+h("error stack","\n%s\n"),o=t.err,r=o.message||"",a=o.stack||r,u=a.indexOf(r)+r.length,l=a.slice(0,u),c=o.actual,f=o.expected,p=!0;if(o.showDiff&&(p=!1,o.actual=c=JSON.stringify(c,null,2),o.expected=f=JSON.stringify(f,null,2)),"string"==typeof c&&"string"==typeof f){l=s(o,"Words",p);var d=l.split("\n");if(d.length>4){var g=String(d.length).length;l=d.map(function(t,e){return i(++e,g)+" | "+t}).join("\n")}l="\n"+h("diff removed","actual")+" "+h("diff added","expected")+"\n\n"+l+"\n",l=l.replace(/^/gm," "),n=h("error title"," %s) %s:\n%s")+h("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),l,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var n,r=this.stats;return console.log(),r.failures?(n=h("bright fail"," "+e.symbols.err)+h("fail"," %d of %d %s failed")+h("light",":"),console.error(n,r.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(n=h("bright pass"," ")+h("green"," %d %s complete")+h("light"," (%s)"),console.log(n,r.tests||0,t(r.tests),c(r.duration)),r.pending&&(n=h("pending"," ")+h("pending"," %d %s pending"),console.log(n,r.pending,t(r.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
    ',e()),++n,console.log("%s

    %s

    ",e(),i.escape(t.title)),console.log("%s
    ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
    ",e()),--n,console.log("%s
    ",e()),--n)}),t.on("pass",function(t){console.log("%s
    %s
    ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
    %s
    ",e(),n)})}var r=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){r.stdout.write("\n ")}),t.on("pending",function(){r.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++o%n==0&&r.stdout.write("\n "),r.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++o%n==0&&r.stdout.write("\n "),r.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",u=a.readFileSync(o,"utf8"),l=e.compile(u,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){r.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this.stats,v=(t.total,i(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],j=v.getElementsByTagName("canvas")[0],E=i('
      '),_=[E];if(e=e||document.getElementById("mocha"),j.getContext){var C=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=C,j.height*=C,o=j.getContext("2d"),o.scale(C,C),n=new p}return e?(l(b,"click",function(){a();var t=/pass/.test(E.className)?"":" pass";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&s("test pass")}),l(k,"click",function(){a();var t=/fail/.test(E.className)?"":" fail";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&s("test fail")}),e.appendChild(v),e.appendChild(E),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=i('
    • %s

    • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=m.tests/this.total*100|0;n&&n.update(e).draw(o);var r=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(r/1e3).toFixed(2)),"passed"==t.state)var s=i('
    • %e%ems ‣

    • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var s=i('
    • %e

    • ',t.title);else{var s=i('
    • %e ‣

    • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),s.appendChild(i('
      %e
      ',a))}if(!t.pending){var c=s.getElementsByTagName("h2")[0];l(c,"click",function(){p.style.display="none"==p.style.display?"block":"none"});var p=i("
      %e
      ",f.clean(t.fn.toString()));s.appendChild(p),p.style.display="none"}_[0]&&_[0].appendChild(s)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(i('
      %s
      ',t))}function i(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){r.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:o.map(i),passes:a.map(i)};r.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),i=t.total,l=r.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?o*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(o-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){r.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function a(t){var e=n(t,{});return o(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){r.stdout.write("# TOC\n"),r.stdout.write(a(t.suite)),r.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){s.call(this,t),t.on("start",function(){r.stdout.write(""),r.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length,o="["+n+"C",r="";i(o),i("_,------,"),i("\n"),i(o),r=e.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(o),r=e.tick?"_":"__";var s,a=e.tick?"~":"^";switch(t){case"pass":s="( ^ .^)";break;case"fail":s="( o .o)";break;default:s="( - .-)"}i(a+"|"+r+s+" "),i("\n"),i(o),r=e.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){i("["+t+"A")},o.prototype.cursorDown=function(t){i("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),i=Math.floor(3*Math.sin(o+2*n)+3),s=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*i+s+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=o*t|0,s=o-n;a.CR(),r.stdout.write(""),r.stdout.write(u("progress"," "+e.open)),r.stdout.write(Array(n).join(e.complete)),r.stdout.write(Array(s).join(e.incomplete)),r.stdout.write(u("progress",e.close)),e.verbose&&r.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.progress=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(u("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){r.stdout.write(e()+u("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+u("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ");a.CR(),console.log(n,t.title)}else{var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ")+u(t.speed,"(%dms)");a.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){a.CR(),console.log(e()+u("fail"," %d) %s"),++i,t.title)}),t.on("end",n.epilogue.bind(n))}function i(){}var s=n("./base"),a=s.cursor,u=s.color; +e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,r(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function r(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var i=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3},!1)),n.forEach(i),console.log("")})}function r(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return r="<"+t+(s.length?" "+s.join(" "):"")+i,o&&(r+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,r.prototype=u.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(t){r||(r=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(o)return e(n);i.clearTimeout(),i.duration=new u-a,o=!0,t(n)}}var o,r,i=this,s=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&s&&(this.timer=l(function(){n(new Error("timeout of "+s+"ms exceeded")),i.timedOut=!0},s)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function i(){}function s(t,e){return c(e,function(e){if(/^d+/.test(e))return!1;var n=c(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var a=n("browser/events").EventEmitter,u=n("browser/debug")("mocha:runner"),l=(n("./test"),n("./utils")),c=l.filter,f=(l.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=global.setImmediate||r.nextTick,i.prototype=a.prototype,o.prototype=new i,o.prototype.constructor=o,o.prototype.grep=function(t,e){return u("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=l.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=i[t];return o?(s.currentRunnable=o,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var r=o.error();return r&&s.fail(s.test,r),e?s.failHook(o,e):(s.emit("hook end",o),void n(++t))})):e()}var r=this.suite,i=r["_"+t],s=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(s){return r.suite=s,s?void r.hook(t,function(t){return t?(r.suite=i,n(t)):void o(e.pop())}):(r.suite=i,n())}var r=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(o=i.shift(),!o)return e();var s=r._grep.test(o.fullTitle());return r._invert&&(s=!s),s?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n))})})):n()}var o,r=this,i=t.tests.slice();this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[s++];return e?void i.runSuite(e,n):o()}function o(){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e()})}var r=this.grepTotal(t),i=this,s=0;return u("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){i.runTests(t,n)})):e()},o.prototype.uncaught=function(t){u("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return u("start"),this.on("end",function(){u("end"),r.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){u("finished running"),n.emit("end")}),r.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,r=0,i=t.length;i>r;r++)o=e(o,t[r],r,t);return o},e.filter=function(t,e){for(var n=[],o=0,r=t.length;r>o;o++){var i=t[o];e(i,o,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}});var n=window.Date,o=window.setTimeout,r=(window.setInterval,window.clearTimeout,window.clearInterval,{});r.exit=function(){},r.stdout={},global=window,r.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},r.on=function(t,e){"uncaughtException"==t&&(window.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))})};var i,s=window.Mocha=t("mocha"),a=window.mocha=new s({reporter:"html"}),u=[];s.Runner.immediately=function(t){u.push(t),i||(i=o(e,0))},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(window.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){s.utils.highlightTags("code"),t&&t()})}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.11.0/mocha.min.css b/ajax/libs/mocha/1.11.0/mocha.min.css new file mode 100644 index 000000000..709fc7eed --- /dev/null +++ b/ajax/libs/mocha/1.11.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2F6FAD}#mocha code .string{color:#5890AD}#mocha code .keyword{color:#8A6343}#mocha code .number{color:#2F6FAD}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.11.0/mocha.min.js b/ajax/libs/mocha/1.11.0/mocha.min.js new file mode 100644 index 000000000..721c75b3f --- /dev/null +++ b/ajax/libs/mocha/1.11.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}function e(){for(var t=(new n).getTime();u.length&&(new n).getTime()-t<100;)u.shift()();i=u.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n==e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,r=e.length,i=o+r,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=o&&a+1>=r)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&r>a;if(h||d){!h||d&&f.newPos=o&&a+1>=r)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,o){var r=t[t.length-1];r&&r.added===n&&r.removed===o?t[t.length-1]={value:this.join(r.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var r=e.length,i=n.length,s=t.newPos,a=s-o;r>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t==e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var r=new o,i=new o(!0);i.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var s=new o(!0);s.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var a=new o;return a.tokenize=function(t){return t.split(/^/m)},{diffChars:function(t,e){return r.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffLines:function(t,e){return a.diff(t,e)},diffCss:function(t,e){return s.diff(t,e)},createPatch:function(t,e,n,o,r){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var o=l[l.length-2],r=e===l.length-2,i=e===l.length-3&&(n.added===!o.added||n.removed===!o.removed);/\n$/.test(n.value)||!r&&!i||t.push("\\ No newline at end of file")}var u=[];u.push("Index: "+t),u.push("==================================================================="),u.push("--- "+t+("undefined"==typeof o?"":" "+o)),u.push("+++ "+t+("undefined"==typeof r?"":" "+r));var l=a.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g"):r.removed&&e.push(""),e.push(n(r.value)),r.added?e.push(""):r.removed&&e.push("")}return e.join("")}}}();"undefined"!=typeof t&&(t.exports=e)}),t.register("browser/events.js",function(t,e){function n(t){return"[object Array]"=={}.toString.call(t)}function o(){}e.EventEmitter=o,o.prototype.on=function(t,e){return this.$events||(this.$events={}),this.$events[t]?n(this.$events[t])?this.$events[t].push(e):this.$events[t]=[this.$events[t],e]:this.$events[t]=e,this},o.prototype.addListener=o.prototype.on,o.prototype.once=function(t,e){function n(){o.removeListener(t,n),e.apply(this,arguments)}var o=this;return n.listener=e,this.on(t,n),this},o.prototype.removeListener=function(t,e){if(this.$events&&this.$events[t]){var o=this.$events[t];if(n(o)){for(var r=-1,i=0,s=o.length;s>i;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){r=i;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),i=0,s=r.length;s>i;i++)r[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,i=o,s=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,r-c/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.type="hook"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);i.grep(o.fullTitle())},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.it.only=function(e,n){var o=t.it(e,n);i.grep(o.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(s,a))}}else{var i=o.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var o=t.suite(e,n);i.grep(o.fullTitle())},t.test=function(t,n){var o=new r(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n);i.grep(o.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.suite.only=function(e,n){var o=t.suite(e,n);i.grep(o.fullTitle())},t.test=function(t,n){var o=new r(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n);i.grep(o.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var i=n("browser/path"),s=n("./utils");e=t.exports=r,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,o=this.suite,r=this.files.length;this.files.forEach(function(s){s=i.resolve(s),o.emit("pre-require",global,s,e),o.emit("require",n(s),s,e),o.emit("post-require",global,s,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";r(i,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),i=new this._reporter(r);return r.ignoreLeaks=!1!==o.ignoreLeaks,r.asyncOnly=o.asyncOnly,o.grep&&r.grep(o.grep,o.invert),o.globals&&r.globals(o.globals),o.growl&&this._growl(r,i),r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==s?Math.round(t/s)+" day":t>s?Math.round(t/s)+" days":t==i?Math.round(t/i)+" hour":t>i?Math.round(t/i)+" hours":t==r?Math.round(t/r)+" minute":t>r?Math.round(t/r)+" minutes":t==o?Math.round(t/o)+" second":t>o?Math.round(t/o)+" seconds":t+" ms"}var o=1e3,r=60*o,i=60*r,s=24*i;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new f}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new f,e.duration=new f-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e,n){return l["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?a("diff added",t.value):t.removed?a("diff removed",t.value):t.value}).join("")}function a(t,e){return e.split("\n").map(function(e){return h(t,e)}).join("\n")}var u=n("browser/tty"),l=n("browser/diff"),c=n("../ms"),f=global.Date,p=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,u.isatty(1)&&u.isatty(2));e=t.exports=o,e.useColors=p,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==r.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var h=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:p?r.stdout.getWindowSize?r.stdout.getWindowSize(1)[0]:u.getWindowSize()[1]:75},e.cursor={hide:function(){r.stdout.write("[?25l")},show:function(){r.stdout.write("[?25h")},deleteLine:function(){r.stdout.write("")},beginningOfLine:function(){r.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=h("error title"," %s) %s:\n")+h("error message"," %s")+h("error stack","\n%s\n"),o=t.err,r=o.message||"",a=o.stack||r,u=a.indexOf(r)+r.length,l=a.slice(0,u),c=o.actual,f=o.expected,p=!0;if(o.showDiff&&(p=!1,o.actual=c=JSON.stringify(c,null,2),o.expected=f=JSON.stringify(f,null,2)),"string"==typeof c&&"string"==typeof f){l=s(o,"Words",p);var d=l.split("\n");if(d.length>4){var g=String(d.length).length;l=d.map(function(t,e){return i(++e,g)+" | "+t}).join("\n")}l="\n"+h("diff removed","actual")+" "+h("diff added","expected")+"\n\n"+l+"\n",l=l.replace(/^/gm," "),n=h("error title"," %s) %s:\n%s")+h("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),l,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var n,r=this.stats;return console.log(),r.failures?(n=h("bright fail"," "+e.symbols.err)+h("fail"," %d of %d %s failed")+h("light",":"),console.error(n,r.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(n=h("bright pass"," ")+h("green"," %d %s complete")+h("light"," (%s)"),console.log(n,r.tests||0,t(r.tests),c(r.duration)),r.pending&&(n=h("pending"," ")+h("pending"," %d %s pending"),console.log(n,r.pending,t(r.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
      ',e()),++n,console.log("%s

      %s

      ",e(),i.escape(t.title)),console.log("%s
      ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
      ",e()),--n,console.log("%s
      ",e()),--n)}),t.on("pass",function(t){console.log("%s
      %s
      ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
      %s
      ",e(),n)})}var r=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){r.stdout.write("\n ")}),t.on("pending",function(){r.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++o%n==0&&r.stdout.write("\n "),r.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++o%n==0&&r.stdout.write("\n "),r.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",u=a.readFileSync(o,"utf8"),l=e.compile(u,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){r.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this.stats,v=(t.total,i(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],j=v.getElementsByTagName("canvas")[0],E=i('
        '),_=[E];if(e=e||document.getElementById("mocha"),j.getContext){var C=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=C,j.height*=C,o=j.getContext("2d"),o.scale(C,C),n=new p}return e?(l(b,"click",function(){a();var t=/pass/.test(E.className)?"":" pass";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&s("test pass")}),l(k,"click",function(){a();var t=/fail/.test(E.className)?"":" fail";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&s("test fail")}),e.appendChild(v),e.appendChild(E),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=i('
      • %s

      • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=m.tests/this.total*100|0;n&&n.update(e).draw(o);var r=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(r/1e3).toFixed(2)),"passed"==t.state)var s=i('
      • %e%ems ‣

      • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var s=i('
      • %e

      • ',t.title);else{var s=i('
      • %e ‣

      • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),s.appendChild(i('
        %e
        ',a))}if(!t.pending){var c=s.getElementsByTagName("h2")[0];l(c,"click",function(){p.style.display="none"==p.style.display?"block":"none"});var p=i("
        %e
        ",f.clean(t.fn.toString()));s.appendChild(p),p.style.display="none"}_[0]&&_[0].appendChild(s)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(i('
        %s
        ',t))}function i(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){r.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:o.map(i),passes:a.map(i)};r.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),i=t.total,l=r.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?o*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(o-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){r.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function a(t){var e=n(t,{});return o(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){r.stdout.write("# TOC\n"),r.stdout.write(a(t.suite)),r.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){s.call(this,t),t.on("start",function(){r.stdout.write(""),r.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length,o="["+n+"C",r="";i(o),i("_,------,"),i("\n"),i(o),r=e.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(o),r=e.tick?"_":"__";var s,a=e.tick?"~":"^";switch(t){case"pass":s="( ^ .^)";break;case"fail":s="( o .o)";break;default:s="( - .-)"}i(a+"|"+r+s+" "),i("\n"),i(o),r=e.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){i("["+t+"A")},o.prototype.cursorDown=function(t){i("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),i=Math.floor(3*Math.sin(o+2*n)+3),s=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*i+s+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=o*t|0,s=o-n;a.CR(),r.stdout.write(""),r.stdout.write(u("progress"," "+e.open)),r.stdout.write(Array(n).join(e.complete)),r.stdout.write(Array(s).join(e.incomplete)),r.stdout.write(u("progress",e.close)),e.verbose&&r.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.progress=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(u("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){r.stdout.write(e()+u("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+u("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ");a.CR(),console.log(n,t.title)}else{var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ")+u(t.speed,"(%dms)");a.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){a.CR(),console.log(e()+u("fail"," %d) %s"),++i,t.title)}),t.on("end",n.epilogue.bind(n))}function i(){}var s=n("./base"),a=s.cursor,u=s.color; +e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,r(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function r(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var i=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3},!1)),n.forEach(i),console.log("")})}function r(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return r="<"+t+(s.length?" "+s.join(" "):"")+i,o&&(r+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,r.prototype=u.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(t){r||(r=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(o)return e(n);i.clearTimeout(),i.duration=new u-a,o=!0,t(n)}}var o,r,i=this,s=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&s&&(this.timer=l(function(){n(new Error("timeout of "+s+"ms exceeded")),i.timedOut=!0},s)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function i(){}function s(t,e){return c(e,function(e){if(/^d+/.test(e))return!1;var n=c(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var a=n("browser/events").EventEmitter,u=n("browser/debug")("mocha:runner"),l=(n("./test"),n("./utils")),c=l.filter,f=(l.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=global.setImmediate||r.nextTick,i.prototype=a.prototype,o.prototype=new i,o.prototype.constructor=o,o.prototype.grep=function(t,e){return u("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=l.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=i[t];return o?(s.currentRunnable=o,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var r=o.error();return r&&s.fail(s.test,r),e?s.failHook(o,e):(s.emit("hook end",o),void n(++t))})):e()}var r=this.suite,i=r["_"+t],s=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(s){return r.suite=s,s?void r.hook(t,function(t){return t?(r.suite=i,n(t)):void o(e.pop())}):(r.suite=i,n())}var r=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(o=i.shift(),!o)return e();var s=r._grep.test(o.fullTitle());return r._invert&&(s=!s),s?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n))})})):n()}var o,r=this,i=t.tests.slice();this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[s++];return e?void i.runSuite(e,n):o()}function o(){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e()})}var r=this.grepTotal(t),i=this,s=0;return u("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){i.runTests(t,n)})):e()},o.prototype.uncaught=function(t){u("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return u("start"),this.on("end",function(){u("end"),r.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){u("finished running"),n.emit("end")}),r.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,r=0,i=t.length;i>r;r++)o=e(o,t[r],r,t);return o},e.filter=function(t,e){for(var n=[],o=0,r=t.length;r>o;o++){var i=t[o];e(i,o,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}});var n=window.Date,o=window.setTimeout,r=(window.setInterval,window.clearTimeout,window.clearInterval,{});r.exit=function(){},r.stdout={},global=window,r.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},r.on=function(t,e){"uncaughtException"==t&&(window.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))})};var i,s=window.Mocha=t("mocha"),a=window.mocha=new s({reporter:"html"}),u=[];s.Runner.immediately=function(t){u.push(t),i||(i=o(e,0))},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(window.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){s.utils.highlightTags("code"),t&&t()})}}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.12.0/mocha.min.css b/ajax/libs/mocha/1.12.0/mocha.min.css new file mode 100644 index 000000000..d8371c260 --- /dev/null +++ b/ajax/libs/mocha/1.12.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2F6FAD}#mocha code .string{color:#5890AD}#mocha code .keyword{color:#8A6343}#mocha code .number{color:#2F6FAD}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.12.0/mocha.min.js b/ajax/libs/mocha/1.12.0/mocha.min.js new file mode 100644 index 000000000..0e23d2835 --- /dev/null +++ b/ajax/libs/mocha/1.12.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}function e(){for(var t=(new n).getTime();u.length&&(new n).getTime()-t<100;)u.shift()();i=u.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n==e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,r=e.length,i=o+r,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=o&&a+1>=r)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&r>a;if(h||d){!h||d&&f.newPos=o&&a+1>=r)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,o){var r=t[t.length-1];r&&r.added===n&&r.removed===o?t[t.length-1]={value:this.join(r.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var r=e.length,i=n.length,s=t.newPos,a=s-o;r>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t==e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var r=new o,i=new o(!0);i.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var s=new o(!0);s.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var a=new o;return a.tokenize=function(t){return t.split(/^/m)},{diffChars:function(t,e){return r.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffLines:function(t,e){return a.diff(t,e)},diffCss:function(t,e){return s.diff(t,e)},createPatch:function(t,e,n,o,r){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var o=l[l.length-2],r=e===l.length-2,i=e===l.length-3&&(n.added===!o.added||n.removed===!o.removed);/\n$/.test(n.value)||!r&&!i||t.push("\\ No newline at end of file")}var u=[];u.push("Index: "+t),u.push("==================================================================="),u.push("--- "+t+("undefined"==typeof o?"":" "+o)),u.push("+++ "+t+("undefined"==typeof r?"":" "+r));var l=a.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g"):r.removed&&e.push(""),e.push(n(r.value)),r.added?e.push(""):r.removed&&e.push("")}return e.join("")}}}();"undefined"!=typeof t&&(t.exports=e)}),t.register("browser/events.js",function(t,e){function n(t){return"[object Array]"=={}.toString.call(t)}function o(){}e.EventEmitter=o,o.prototype.on=function(t,e){return this.$events||(this.$events={}),this.$events[t]?n(this.$events[t])?this.$events[t].push(e):this.$events[t]=[this.$events[t],e]:this.$events[t]=e,this},o.prototype.addListener=o.prototype.on,o.prototype.once=function(t,e){function n(){o.removeListener(t,n),e.apply(this,arguments)}var o=this;return n.listener=e,this.on(t,n),this},o.prototype.removeListener=function(t,e){if(this.$events&&this.$events[t]){var o=this.$events[t];if(n(o)){for(var r=-1,i=0,s=o.length;s>i;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){r=i;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),i=0,s=r.length;s>i;i++)r[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,i=o,s=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,r-c/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.type="hook"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);i.grep(o.fullTitle())},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.it.only=function(e,n){var o=t.it(e,n);i.grep(o.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(s,a))}}else{var i=o.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var o=t.suite(e,n);i.grep(o.fullTitle())},t.test=function(t,n){var o=new r(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n);i.grep(o.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.suite.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.suite.only=function(e,n){var o=t.suite(e,n);i.grep(o.fullTitle())},t.test=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.test.only=function(e,n){var o=t.test(e,n);i.grep(o.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var i=n("browser/path"),s=n("./utils");e=t.exports=r,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,o=this.suite,r=this.files.length;this.files.forEach(function(s){s=i.resolve(s),o.emit("pre-require",global,s,e),o.emit("require",n(s),s,e),o.emit("post-require",global,s,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";r(i,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),i=new this._reporter(r);return r.ignoreLeaks=!1!==o.ignoreLeaks,r.asyncOnly=o.asyncOnly,o.grep&&r.grep(o.grep,o.invert),o.globals&&r.globals(o.globals),o.growl&&this._growl(r,i),r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==s?Math.round(t/s)+" day":t>s?Math.round(t/s)+" days":t==i?Math.round(t/i)+" hour":t>i?Math.round(t/i)+" hours":t==r?Math.round(t/r)+" minute":t>r?Math.round(t/r)+" minutes":t==o?Math.round(t/o)+" second":t>o?Math.round(t/o)+" seconds":t+" ms"}var o=1e3,r=60*o,i=60*r,s=24*i;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new h}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new h,e.duration=new h-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e,n){return f["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?a("diff added",t.value):t.removed?a("diff removed",t.value):t.value}).join("")}function a(t,e){return e.split("\n").map(function(e){return g(t,e)}).join("\n")}function u(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function l(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var c=n("browser/tty"),f=n("browser/diff"),p=n("../ms"),h=global.Date,d=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,c.isatty(1)&&c.isatty(2));e=t.exports=o,e.useColors=d,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==r.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var g=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:d?r.stdout.getWindowSize?r.stdout.getWindowSize(1)[0]:c.getWindowSize()[1]:75},e.cursor={hide:function(){r.stdout.write("[?25l")},show:function(){r.stdout.write("[?25h")},deleteLine:function(){r.stdout.write("")},beginningOfLine:function(){r.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=g("error title"," %s) %s:\n")+g("error message"," %s")+g("error stack","\n%s\n"),o=t.err,r=o.message||"",a=o.stack||r,c=a.indexOf(r)+r.length,f=a.slice(0,c),p=o.actual,h=o.expected,d=!0;if(o.uncaught&&(f="Uncaught "+f),o.showDiff&&l(p,h)&&(d=!1,o.actual=p=u(p),o.expected=h=u(h)),"string"==typeof p&&"string"==typeof h){f=s(o,"Words",d);var m=f.split("\n");if(m.length>4){var v=String(m.length).length;f=m.map(function(t,e){return i(++e,v)+" | "+t}).join("\n")}f="\n"+g("diff removed","actual")+" "+g("diff added","expected")+"\n\n"+f+"\n",f=f.replace(/^/gm," "),n=g("error title"," %s) %s:\n%s")+g("error stack","\n%s\n")}a=a.slice(c?c+1:c).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),f,a)})},o.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=g("bright pass"," ")+g("green"," %d passing")+g("light"," (%s)"),console.log(t,e.passes||0,p(e.duration)),e.pending&&(t=g("pending"," ")+g("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=g("fail"," %d failing"),console.error(t,e.failures),o.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
        ',e()),++n,console.log("%s

        %s

        ",e(),i.escape(t.title)),console.log("%s
        ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
        ",e()),--n,console.log("%s
        ",e()),--n)}),t.on("pass",function(t){console.log("%s
        %s
        ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
        %s
        ",e(),n)})}var r=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){r.stdout.write("\n ")}),t.on("pending",function(){r.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++o%n==0&&r.stdout.write("\n "),r.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++o%n==0&&r.stdout.write("\n "),r.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",u=a.readFileSync(o,"utf8"),l=e.compile(u,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){r.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this.stats,v=(t.total,i(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],j=v.getElementsByTagName("canvas")[0],E=i('
          '),_=[E];if(e=e||document.getElementById("mocha"),j.getContext){var C=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=C,j.height*=C,o=j.getContext("2d"),o.scale(C,C),n=new p}return e?(l(b,"click",function(){a();var t=/pass/.test(E.className)?"":" pass";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&s("test pass")}),l(k,"click",function(){a();var t=/fail/.test(E.className)?"":" fail";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&s("test fail")}),e.appendChild(v),e.appendChild(E),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=i('
        • %s

        • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=m.tests/this.total*100|0;n&&n.update(e).draw(o);var r=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(r/1e3).toFixed(2)),"passed"==t.state)var s=i('
        • %e%ems ‣

        • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var s=i('
        • %e

        • ',t.title);else{var s=i('
        • %e ‣

        • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),s.appendChild(i('
          %e
          ',a))}if(!t.pending){var c=s.getElementsByTagName("h2")[0];l(c,"click",function(){p.style.display="none"==p.style.display?"block":"none"});var p=i("
          %e
          ",f.clean(t.fn.toString()));s.appendChild(p),p.style.display="none"}_[0]&&_[0].appendChild(s)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(i('
          %s
          ',t))}function i(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){r.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:o.map(i),passes:a.map(i)};r.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),i=t.total,l=r.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?o*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(o-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){r.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function a(t){var e=n(t,{});return o(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){r.stdout.write("# TOC\n"),r.stdout.write(a(t.suite)),r.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){s.call(this,t),t.on("start",function(){r.stdout.write(""),r.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length,o="["+n+"C",r="";i(o),i("_,------,"),i("\n"),i(o),r=e.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(o),r=e.tick?"_":"__";var s,a=e.tick?"~":"^";switch(t){case"pass":s="( ^ .^)";break;case"fail":s="( o .o)";break;default:s="( - .-)"}i(a+"|"+r+s+" "),i("\n"),i(o),r=e.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){i("["+t+"A")},o.prototype.cursorDown=function(t){i("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),i=Math.floor(3*Math.sin(o+2*n)+3),s=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*i+s+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=o*t|0,s=o-n;a.CR(),r.stdout.write(""),r.stdout.write(u("progress"," "+e.open)),r.stdout.write(Array(n).join(e.complete)),r.stdout.write(Array(s).join(e.incomplete)),r.stdout.write(u("progress",e.close)),e.verbose&&r.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.progress=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(u("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){r.stdout.write(e()+u("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+u("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ");a.CR(),console.log(n,t.title)}else{var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ")+u(t.speed,"(%dms)");a.CR(),console.log(n,t.title,t.duration) +}}),t.on("fail",function(t){a.CR(),console.log(e()+u("fail"," %d) %s"),++i,t.title)}),t.on("end",n.epilogue.bind(n))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,r(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function r(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var i=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function r(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return r="<"+t+(s.length?" "+s.join(" "):"")+i,o&&(r+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,r.prototype=u.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},o.prototype.run=function(t){function e(t){r||(r=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(o)return e(n);i.clearTimeout(),i.duration=new u-a,o=!0,t(n)}}var o,r,i=this,s=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&s&&(this.timer=l(function(){n(new Error("timeout of "+s+"ms exceeded")),i.timedOut=!0},s)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function i(){}function s(t,e){return c(e,function(e){if(/^d+/.test(e))return!1;var n=c(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var a=n("browser/events").EventEmitter,u=n("browser/debug")("mocha:runner"),l=(n("./test"),n("./utils")),c=l.filter,f=(l.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=global.setImmediate||r.nextTick,i.prototype=a.prototype,o.prototype=new i,o.prototype.constructor=o,o.prototype.grep=function(t,e){return u("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=l.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=i[t];return o?s.failures&&r.bail()?e():(s.currentRunnable=o,o.ctx.currentTest=s.test,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var r=o.error();return r&&s.fail(s.test,r),e?s.failHook(o,e):(s.emit("hook end",o),delete o.ctx.currentTest,void n(++t))})):e()}var r=this.suite,i=r["_"+t],s=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(s){return r.suite=s,s?void r.hook(t,function(t){return t?(r.suite=i,n(t)):void o(e.pop())}):(r.suite=i,n())}var r=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(o=i.shift(),!o)return e();var s=r._grep.test(o.fullTitle());return r._invert&&(s=!s),s?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n))})})):n()}var o,r=this,i=t.tests.slice();this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[s++];return e?void i.runSuite(e,n):o()}function o(){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e()})}var r=this.grepTotal(t),i=this,s=0;return u("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){i.runTests(t,n)})):e()},o.prototype.uncaught=function(t){u("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return u("start"),this.on("end",function(){u("end"),r.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){u("finished running"),n.emit("end")}),r.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,r=0,i=t.length;i>r;r++)o=e(o,t[r],r,t);return o},e.filter=function(t,e){for(var n=[],o=0,r=t.length;r>o;o++){var i=t[o];e(i,o,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,o=global.setTimeout,r=(global.setInterval,global.clearTimeout,global.clearInterval,{});r.exit=function(){},r.stdout={},r.removeListener=function(t){"uncaughtException"==t&&(global.onerror=function(){})},r.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))})};var i,s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"}),u=[];s.Runner.immediately=function(t){u.push(t),i||(i=o(e,0))},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=r}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.14.0/mocha.min.css b/ajax/libs/mocha/1.14.0/mocha.min.css new file mode 100644 index 000000000..b40a8b863 --- /dev/null +++ b/ajax/libs/mocha/1.14.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2F6FAD}#mocha code .string{color:#5890AD}#mocha code .keyword{color:#8A6343}#mocha code .number{color:#2F6FAD}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.14.0/mocha.min.js b/ajax/libs/mocha/1.14.0/mocha.min.js new file mode 100644 index 000000000..3a856e814 --- /dev/null +++ b/ajax/libs/mocha/1.14.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}function e(){for(var t=(new n).getTime();u.length&&(new n).getTime()-t<100;)u.shift()();s=u.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var s=0;s/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,r=e.length,s=o+r,i=[{newPos:-1,components:[]}],a=this.extractCommon(i[0],n,e,0);if(i[0].newPos+1>=o&&a+1>=r)return i[0].components;for(var u=1;s>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=i[l-1],p=i[l+1];a=(p?p.newPos:0)-l,f&&(i[l-1]=void 0);var h=f&&f.newPos+1=0&&r>a;if(h||d){!h||d&&f.newPos=o&&a+1>=r)return c.components;i[l]=c}else i[l]=void 0}},pushComponent:function(t,e,n,o){var r=t[t.length-1];r&&r.added===n&&r.removed===o?t[t.length-1]={value:this.join(r.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var r=e.length,s=n.length,i=t.newPos,a=i-o;r>i+1&&s>a+1&&this.equals(e[i+1],n[a+1]);)i++,a++,this.pushComponent(t.components,e[i],void 0,void 0);return t.newPos=i,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var r=new o,s=new o(!0),i=new o;s.tokenize=i.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new o(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new o;return u.tokenize=function(t){return t.split(/^/m)},{Diff:o,diffChars:function(t,e){return r.diff(t,e)},diffWords:function(t,e){return s.diff(t,e)},diffWordsWithSpace:function(t,e){return i.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,o,r){function s(t){return t.map(function(t){return" "+t})}function i(t,e,n){var o=l[l.length-2],r=e===l.length-2,s=e===l.length-3&&(n.added!==o.added||n.removed!==o.removed);/\n$/.test(n.value)||!r&&!s||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof o?"":" "+o)),a.push("+++ "+t+("undefined"==typeof r?"":" "+r));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;i--){for(var l=o[i],c=0;c"):r.removed&&e.push(""),e.push(n(r.value)),r.added?e.push(""):r.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],o=0;os;s++)if(o[s]===e||o[s].listener&&o[s].listener===e){r=s;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),s=0,i=r.length;i>s;s++)r[s].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,s=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,s,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,s,i-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,r-c/2+1,s+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.type="hook"}function r(){}var s=n("./runnable");t.exports=o,r.prototype=s.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),s=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);return i.grep(o.fullTitle()),o},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var s=new r(t,n);return o.addTest(s),s},t.it.only=function(e,n){var o=t.it(e,n),r="^"+s.escapeRegexp(o.fullTitle())+"$";return i.grep(new RegExp(r)),o},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var s;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var s=o.create(n[0],i);n.unshift(s),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test"),s=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var o=t.suite(e,n);i.grep(o.fullTitle())},t.test=function(t,n){var o=new r(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n),r="^"+s.escapeRegexp(o.fullTitle())+"$";i.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),s=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.suite.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.suite.only=function(e,n){var o=t.suite(e,n);i.grep(o.fullTitle())},t.test=function(t,n){var o=e[0];if(o.pending)var n=null;var s=new r(t,n);return o.addTest(s),s},t.test.only=function(e,n){var o=t.test(e,n),r="^"+s.escapeRegexp(o.fullTitle())+"$";i.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow)}var s=n("browser/path"),i=n("./utils");e=t.exports=r,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(o){}if(!e)try{e=n(t)}catch(o){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(o){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,o=this.suite,r=this.files.length;this.files.forEach(function(i){i=s.resolve(i),o.emit("pre-require",global,i,e),o.emit("require",n(i),i,e),o.emit("post-require",global,i,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var s=n.failures+" of "+t.total+" tests failed";r(s,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),s=new this._reporter(r);return r.ignoreLeaks=!1!==o.ignoreLeaks,r.asyncOnly=o.asyncOnly,o.grep&&r.grep(o.grep,o.invert),o.globals&&r.globals(o.globals),o.growl&&this._growl(r,s),e.reporters.Base.useColors=o.useColors,r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*i;case"seconds":case"second":case"s":return n*s;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=i?Math.round(t/i)+"m":t>=s?Math.round(t/s)+"s":t+"ms"}function o(t){return r(t,u,"day")||r(t,a,"hour")||r(t,i,"minute")||r(t,s,"second")||t+" ms"}function r(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var s=1e3,i=60*s,a=60*i,u=24*a,l=365.25*u;t.exports=function(t,r){return r=r||{},"string"==typeof t?e(t):r.long?o(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new m}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new m,e.duration=new m-e.start}),t.on("pending",function(){e.pending++}))}function s(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function i(t,e){var n=u(t,"WordsWithSpace",e),o=n.split("\n");if(o.length>4){var r=String(o.length).length;n=o.map(function(t,e){return s(++e,r)+" | "+t}).join("\n")}return n="\n"+y("diff removed","actual")+" "+y("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?r+c("diff added",t):"-"===t[0]?r+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:r+t}function o(t){return null!=t}var r=" ";msg=d.createPatch("string",t.actual,t.expected);var s=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+s.map(n).filter(o).join("\n")}function u(t,e,n){var o=n?l(t.actual):t.actual,r=n?l(t.expected):t.expected;return d["diff"+e](o,r).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return y(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var h=n("browser/tty"),d=n("browser/diff"),g=n("../ms"),m=global.Date,v=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,h.isatty(1)&&h.isatty(2));e=t.exports=o,e.useColors=v||void 0!==r.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==r.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var y=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:v?r.stdout.getWindowSize?r.stdout.getWindowSize(1)[0]:h.getWindowSize()[1]:75},e.cursor={hide:function(){v&&r.stdout.write("[?25l")},show:function(){v&&r.stdout.write("[?25h")},deleteLine:function(){v&&r.stdout.write("")},beginningOfLine:function(){v&&r.stdout.write("")},CR:function(){v?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):r.stdout.write("\n")}},e.list=function(t){console.error(),t.forEach(function(t,n){var o=y("error title"," %s) %s:\n")+y("error message"," %s")+y("error stack","\n%s\n"),r=t.err,s=r.message||"",u=r.stack||s,l=u.indexOf(s)+s.length,c=u.slice(0,l),h=r.actual,d=r.expected,g=!0;if(r.uncaught&&(c="Uncaught "+c),r.showDiff&&p(h,d)&&(g=!1,r.actual=h=f(h),r.expected=d=f(d)),"string"==typeof h&&"string"==typeof d){o=y("error title"," %s) %s:\n%s")+y("error stack","\n%s\n");var m=s.match(/^([^:]+): expected/);c=m?"\n "+y("error message",m[1]):"",c+=e.inlineDiffs?i(r,g):a(r,g)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(o,n+1,t.fullTitle(),c,u)})},o.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=y("bright pass"," ")+y("green"," %d passing")+y("light"," (%s)"),console.log(t,e.passes||0,g(e.duration)),e.pending&&(t=y("pending"," ")+y("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=y("fail"," %d failing"),console.error(t,e.failures),o.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
          ',e()),++n,console.log("%s

          %s

          ",e(),s.escape(t.title)),console.log("%s
          ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
          ",e()),--n,console.log("%s
          ",e()),--n)}),t.on("pass",function(t){console.log("%s
          %s
          ",e(),s.escape(t.title));var n=s.escape(s.clean(t.fn.toString()));console.log("%s
          %s
          ",e(),n)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,.75*i.window.width|0),o=0;t.on("start",function(){r.stdout.write("\n ")}),t.on("pending",function(){r.stdout.write(a("pending",i.symbols.dot))}),t.on("pass",function(t){++o%n==0&&r.stdout.write("\n "),r.stdout.write("slow"==t.speed?a("bright yellow",i.symbols.dot):a(t.speed,i.symbols.dot))}),t.on("fail",function(){++o%n==0&&r.stdout.write("\n "),r.stdout.write(a("fail",i.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function s(){}var i=n("./base"),a=i.color;e=t.exports=o,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",u=a.readFileSync(o,"utf8"),l=e.compile(u,{filename:o}),c=this;i.call(this,t,!1),t.on("end",function(){r.stdout.write(l({cov:c.cov,coverageClass:s}))})}function s(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var i=n("./json-cov"),a=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this,v=this.stats,y=(t.total,s(g)),w=y.getElementsByTagName("li"),b=w[1].getElementsByTagName("em")[0],x=w[1].getElementsByTagName("a")[0],k=w[2].getElementsByTagName("em")[0],T=w[2].getElementsByTagName("a")[0],j=w[3].getElementsByTagName("em")[0],E=y.getElementsByTagName("canvas")[0],_=s('
            '),C=[_];if(e=e||document.getElementById("mocha"),E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,o=E.getContext("2d"),o.scale(S,S),n=new p}return e?(l(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&i("test pass")}),l(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&i("test fail")}),e.appendChild(y),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e=m.suiteURL(t),n=s('
          • %s

          • ',e,h(t.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}}),t.on("suite end",function(t){t.root||C.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=v.tests/this.total*100|0;n&&n.update(e).draw(o);var r=new d-v.start;if(u(b,v.passes),u(k,v.failures),u(j,(r/1e3).toFixed(2)),"passed"==t.state)var i=m.testURL(t),a=s('
          • %e%ems ‣

          • ',t.speed,t.title,t.duration,i);else if(t.pending)var a=s('
          • %e

          • ',t.title);else{var a=s('
          • %e ‣

          • ',t.title,encodeURIComponent(t.fullTitle())),c=t.err.stack||t.err.toString();~c.indexOf(t.err.message)||(c=t.err.message+"\n"+c),"[object Error]"==c&&(c=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(c+="\n("+t.err.sourceURL+":"+t.err.line+")"),a.appendChild(s('
            %e
            ',c))}if(!t.pending){var p=a.getElementsByTagName("h2")[0];l(p,"click",function(){h.style.display="none"==h.style.display?"block":"none"});var h=s("
            %e
            ",f.clean(t.fn.toString()));a.appendChild(h),h.style.display="none"}C[0]&&C[0].appendChild(a)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(s('
            %s
            ',t))}function s(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function i(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){r.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;i.call(this,t);var n=[],o=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:a.map(s)};r.stdout.write(JSON.stringify(t,null,2))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+u("runway",t)}i.call(this,t);var n=this,o=(this.stats,.75*i.window.width|0),s=t.total,l=r.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?o*++p/s|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(o-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function s(){}var i=n("./base"),a=i.cursor,u=i.color;e=t.exports=o,i.colors.plane=0,i.colors["plane crash"]=31,i.colors.runway=90,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){i.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){r.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+i.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function s(){}var i=n("./base"),a=i.cursor,u=i.color;e=t.exports=o,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var s in t)"suite"!=s&&(s&&(n=" - ["+s+"](#"+i.slug(t[s].suite.fullTitle())+")\n"),s&&(r+=Array(e).join(" ")+n),r+=o(t[s],e));return--e,r}function a(t){var e=n(t,{});return o(e,0)}s.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=i.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=i.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){r.stdout.write("# TOC\n"),r.stdout.write(a(t.suite)),r.stdout.write(l)})}var s=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){i.call(this,t),t.on("start",function(){r.stdout.write(""),r.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function s(){}var i=n("./base");e=t.exports=o,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){s("["+t.scoreboardWidth+"C"),s(e.join("")),s("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",o="";s(n),s("_,------,"),s("\n"),s(n),o=t.tick?" ":" ",s("_|"+o+"/\\_/\\ "),s("\n"),s(n),o=t.tick?"_":"__"; +var r=t.tick?"~":"^";s(r+"|"+o+this.face()+" "),s("\n"),s(n),o=t.tick?" ":" ",s(o+'"" "" '),s("\n"),this.cursorUp(this.numberOfLines)},o.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},o.prototype.cursorUp=function(t){s("["+t+"A")},o.prototype.cursorDown=function(t){s("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),s=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*s+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},i.prototype=a.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){i.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*i.window.width|0),s=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||i.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/s,n=o*t|0,i=o-n;a.CR(),r.stdout.write(""),r.stdout.write(u("progress"," "+e.open)),r.stdout.write(Array(n).join(e.complete)),r.stdout.write(Array(i).join(e.incomplete)),r.stdout.write(u("progress",e.close)),e.verbose&&r.stdout.write(u("progress"," "+l+" of "+s))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function s(){}var i=n("./base"),a=i.cursor,u=i.color;e=t.exports=o,i.colors.progress=90,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}i.call(this,t);var n=this,o=(this.stats,0),s=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(u("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){r.stdout.write(e()+u("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+u("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+u("checkmark"," "+i.symbols.ok)+u("pass"," %s ");a.CR(),console.log(n,t.title)}else{var n=e()+u("checkmark"," "+i.symbols.ok)+u("pass"," %s ")+u(t.speed,"(%dms)");a.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){a.CR(),console.log(e()+u("fail"," %d) %s"),++s,t.title)}),t.on("end",n.epilogue.bind(n))}function s(){}var i=n("./base"),a=i.cursor,u=i.color;e=t.exports=o,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){s.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,r(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function r(t){return t.fullTitle().replace(/#/g,"")}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(s),console.log("")})}function r(){}function s(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,a(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var r,s=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+s,o&&(r+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,r.prototype=u.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function r(){}var s=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=o,r.prototype=s.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},o.prototype.run=function(t){function e(t){r||(r=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new u-a,o=!0,t(n)}}var o,r,s=this,i=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&i&&(this.timer=l(function(){n(new Error("timeout of "+i+"ms exceeded")),s.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function s(){}function i(t,e){return c(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=c(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var a=n("browser/events").EventEmitter,u=n("browser/debug")("mocha:runner"),l=(n("./test"),n("./utils")),c=l.filter,f=(l.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=global.setImmediate||r.nextTick,s.prototype=a.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return u("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=l.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?i.failures&&r.bail()?e():(i.currentRunnable=o,o.ctx.currentTest=i.test,i.emit("hook",o),o.on("error",function(t){i.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var r=o.error();return r&&i.fail(i.test,r),e?i.failHook(o,e):(i.emit("hook end",o),delete o.ctx.currentTest,void n(++t))})):e()}var r=this.suite,s=r["_"+t],i=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=s,n(t)):void o(e.pop())}):(r.suite=s,n())}var r=this,s=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(o=s.shift(),!o)return e();var i=r._grep.test(o.fullTitle());return r._invert&&(i=!i),i?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n))})})):n()}var o,r=this,s=t.tests.slice();this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var r=this.grepTotal(t),s=this,i=0;return u("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){s.runTests(t,n)})):e()},o.prototype.uncaught=function(t){u("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return u("start"),this.on("end",function(){u("end"),r.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){u("finished running"),n.emit("end")}),r.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function r(){}var s=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=s.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){s.call(this,t,e),this.pending=!e,this.type="test"}function r(){}var s=n("./runnable");t.exports=o,r.prototype=s.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var s=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,r=0,s=t.length;s>r;r++)o=e(o,t[r],r,t);return o},e.filter=function(t,e){for(var n=[],o=0,r=t.length;r>o;o++){var s=t[o];e(s,o,t)&&n.push(s)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),s.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,o=global.setTimeout,r=(global.setInterval,global.clearTimeout,global.clearInterval,{});r.exit=function(){},r.stdout={},r.removeListener=function(t){"uncaughtException"==t&&(global.onerror=function(){})},r.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))})};var s,i=global.Mocha=t("mocha"),a=global.mocha=new i({reporter:"html"}),u=[];i.Runner.immediately=function(t){u.push(t),s||(s=o(e,0))},a.ui=function(t){return i.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=i.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),i.prototype.run.call(a,function(){global.document&&i.utils.highlightTags("code"),t&&t()})},i.process=r}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.15.0/mocha.min.css b/ajax/libs/mocha/1.15.0/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.15.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.15.0/mocha.min.js b/ajax/libs/mocha/1.15.0/mocha.min.js new file mode 100644 index 000000000..8d84ee13a --- /dev/null +++ b/ajax/libs/mocha/1.15.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}function e(){for(var t=(new n).getTime();u.length&&(new n).getTime()-t<100;)u.shift()();i=u.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,r=e.length,i=o+r,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=o&&a+1>=r)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&r>a;if(h||d){!h||d&&f.newPos=o&&a+1>=r)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,o){var r=t[t.length-1];r&&r.added===n&&r.removed===o?t[t.length-1]={value:this.join(r.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var r=e.length,i=n.length,s=t.newPos,a=s-o;r>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var r=new o,i=new o(!0),s=new o;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new o(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new o;return u.tokenize=function(t){return t.split(/^/m)},{Diff:o,diffChars:function(t,e){return r.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,o,r){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var o=l[l.length-2],r=e===l.length-2,i=e===l.length-3&&(n.added!==o.added||n.removed!==o.removed);/\n$/.test(n.value)||!r&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof o?"":" "+o)),a.push("+++ "+t+("undefined"==typeof r?"":" "+r));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=o[s],c=0;c"):r.removed&&e.push(""),e.push(n(r.value)),r.added?e.push(""):r.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],o=0;oi;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){r=i;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),i=0,s=r.length;s>i;i++)r[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,i=o,s=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,r-c/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.type="hook"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);return s.grep(o.fullTitle()),o},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.it.only=function(e,n){var o=t.it(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";return s.grep(new RegExp(r)),o},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(s,a))}}else{var i=o.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var o=t.suite(e,n);s.grep(o.fullTitle())},t.test=function(t,n){var o=new r(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";s.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.suite.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.suite.only=function(e,n){var o=t.suite(e,n);s.grep(o.fullTitle())},t.test=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.test.only=function(e,n){var o=t.test(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";s.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow)}var i=n("browser/path"),s=n("./utils");e=t.exports=r,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(o){}if(!e)try{e=n(t)}catch(o){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(o){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,o=this.suite,r=this.files.length;this.files.forEach(function(s){s=i.resolve(s),o.emit("pre-require",global,s,e),o.emit("require",n(s),s,e),o.emit("post-require",global,s,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";r(i,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),i=new this._reporter(r);return r.ignoreLeaks=!1!==o.ignoreLeaks,r.asyncOnly=o.asyncOnly,o.grep&&r.grep(o.grep,o.invert),o.globals&&r.globals(o.globals),o.growl&&this._growl(r,i),e.reporters.Base.useColors=o.useColors,r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function o(t){return r(t,u,"day")||r(t,a,"hour")||r(t,s,"minute")||r(t,i,"second")||t+" ms"}function r(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,r){return r=r||{},"string"==typeof t?e(t):r.long?o(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new m}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new m,e.duration=new m-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),o=n.split("\n");if(o.length>4){var r=String(o.length).length;n=o.map(function(t,e){return i(++e,r)+" | "+t}).join("\n")}return n="\n"+y("diff removed","actual")+" "+y("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?r+c("diff added",t):"-"===t[0]?r+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:r+t}function o(t){return null!=t}var r=" ";msg=d.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(o).join("\n")}function u(t,e,n){var o=n?l(t.actual):t.actual,r=n?l(t.expected):t.expected;return d["diff"+e](o,r).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return y(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var h=n("browser/tty"),d=n("browser/diff"),g=n("../ms"),m=global.Date,v=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,h.isatty(1)&&h.isatty(2));e=t.exports=o,e.useColors=v||void 0!==r.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==r.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var y=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:v?r.stdout.getWindowSize?r.stdout.getWindowSize(1)[0]:h.getWindowSize()[1]:75},e.cursor={hide:function(){v&&r.stdout.write("[?25l")},show:function(){v&&r.stdout.write("[?25h")},deleteLine:function(){v&&r.stdout.write("")},beginningOfLine:function(){v&&r.stdout.write("")},CR:function(){v?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):r.stdout.write("\n")}},e.list=function(t){console.error(),t.forEach(function(t,n){var o=y("error title"," %s) %s:\n")+y("error message"," %s")+y("error stack","\n%s\n"),r=t.err,i=r.message||"",u=r.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),h=r.actual,d=r.expected,g=!0;if(r.uncaught&&(c="Uncaught "+c),r.showDiff&&p(h,d)&&(g=!1,r.actual=h=f(h),r.expected=d=f(d)),"string"==typeof h&&"string"==typeof d){o=y("error title"," %s) %s:\n%s")+y("error stack","\n%s\n");var m=i.match(/^([^:]+): expected/);c=m?"\n "+y("error message",m[1]):"",c+=e.inlineDiffs?s(r,g):a(r,g)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(o,n+1,t.fullTitle(),c,u)})},o.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=y("bright pass"," ")+y("green"," %d passing")+y("light"," (%s)"),console.log(t,e.passes||0,g(e.duration)),e.pending&&(t=y("pending"," ")+y("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=y("fail"," %d failing"),console.error(t,e.failures),o.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
            ',e()),++n,console.log("%s

            %s

            ",e(),i.escape(t.title)),console.log("%s
            ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
            ",e()),--n,console.log("%s
            ",e()),--n)}),t.on("pass",function(t){console.log("%s
            %s
            ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
            %s
            ",e(),n)})}var r=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){r.stdout.write("\n ")}),t.on("pending",function(){r.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++o%n==0&&r.stdout.write("\n "),r.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++o%n==0&&r.stdout.write("\n "),r.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",u=a.readFileSync(o,"utf8"),l=e.compile(u,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){r.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this,v=this.stats,y=(t.total,i(g)),w=y.getElementsByTagName("li"),b=w[1].getElementsByTagName("em")[0],x=w[1].getElementsByTagName("a")[0],k=w[2].getElementsByTagName("em")[0],T=w[2].getElementsByTagName("a")[0],j=w[3].getElementsByTagName("em")[0],E=y.getElementsByTagName("canvas")[0],_=i('
              '),C=[_];if(e=e||document.getElementById("mocha"),E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,o=E.getContext("2d"),o.scale(S,S),n=new p}return e?(l(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test pass")}),l(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test fail")}),e.appendChild(y),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e=m.suiteURL(t),n=i('
            • %s

            • ',e,h(t.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}}),t.on("suite end",function(t){t.root||C.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=v.tests/this.total*100|0;n&&n.update(e).draw(o);var r=new d-v.start;if(u(b,v.passes),u(k,v.failures),u(j,(r/1e3).toFixed(2)),"passed"==t.state)var s=m.testURL(t),a=i('
            • %e%ems ‣

            • ',t.speed,t.title,t.duration,s);else if(t.pending)var a=i('
            • %e

            • ',t.title);else{var a=i('
            • %e ‣

            • ',t.title,encodeURIComponent(t.fullTitle())),c=t.err.stack||t.err.toString();~c.indexOf(t.err.message)||(c=t.err.message+"\n"+c),"[object Error]"==c&&(c=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(c+="\n("+t.err.sourceURL+":"+t.err.line+")"),a.appendChild(i('
              %e
              ',c))}if(!t.pending){var p=a.getElementsByTagName("h2")[0];l(p,"click",function(){h.style.display="none"==h.style.display?"block":"none"});var h=i("
              %e
              ",f.clean(t.fn.toString()));a.appendChild(h),h.style.display="none"}C[0]&&C[0].appendChild(a)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(i('
              %s
              ',t))}function i(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){r.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:o.map(i),passes:a.map(i)};r.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),i=t.total,l=r.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?o*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(o-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){r.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function a(t){var e=n(t,{});return o(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){r.stdout.write("# TOC\n"),r.stdout.write(a(t.suite)),r.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){s.call(this,t),t.on("start",function(){r.stdout.write(""),r.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",o="";i(n),i("_,------,"),i("\n"),i(n),o=t.tick?" ":" ",i("_|"+o+"/\\_/\\ "),i("\n"),i(n),o=t.tick?"_":"__"; +var r=t.tick?"~":"^";i(r+"|"+o+this.face()+" "),i("\n"),i(n),o=t.tick?" ":" ",i(o+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},o.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},o.prototype.cursorUp=function(t){i("["+t+"A")},o.prototype.cursorDown=function(t){i("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),i=Math.floor(3*Math.sin(o+2*n)+3),s=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*i+s+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=o*t|0,s=o-n;a.CR(),r.stdout.write(""),r.stdout.write(u("progress"," "+e.open)),r.stdout.write(Array(n).join(e.complete)),r.stdout.write(Array(s).join(e.incomplete)),r.stdout.write(u("progress",e.close)),e.verbose&&r.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.progress=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(u("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){r.stdout.write(e()+u("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+u("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ");a.CR(),console.log(n,t.title)}else{var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ")+u(t.speed,"(%dms)");a.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){a.CR(),console.log(e()+u("fail"," %d) %s"),++i,t.title)}),t.on("end",n.epilogue.bind(n))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,r(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function r(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function r(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return r="<"+t+(s.length?" "+s.join(" "):"")+i,o&&(r+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,r.prototype=u.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},o.prototype.run=function(t){function e(t){r||(r=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(o)return e(n);i.clearTimeout(),i.duration=new u-a,o=!0,t(n)}}var o,r,i=this,s=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&s&&(this.timer=l(function(){n(new Error("timeout of "+s+"ms exceeded")),i.timedOut=!0},s)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function i(){}function s(t,e){return c(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=c(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var a=n("browser/events").EventEmitter,u=n("browser/debug")("mocha:runner"),l=(n("./test"),n("./utils")),c=l.filter,f=(l.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=global.setImmediate||r.nextTick,i.prototype=a.prototype,o.prototype=new i,o.prototype.constructor=o,o.prototype.grep=function(t,e){return u("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=l.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=i[t];return o?s.failures&&r.bail()?e():(s.currentRunnable=o,o.ctx.currentTest=s.test,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(r){o.removeAllListeners("error");var i=o.error();return i&&s.fail(s.test,i),r?(s.failHook(o,r),e(r)):(s.emit("hook end",o),delete o.ctx.currentTest,void n(++t))})):e()}var r=this.suite,i=r["_"+t],s=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(s){return r.suite=s,s?void r.hook(t,function(t){if(t){var s=r.suite;return r.suite=i,n(t,s)}o(e.pop())}):(r.suite=i,n())}var r=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(t,o,r){var s=i.suite;i.suite=r?o.parent:o,i.suite?i.hookUp("afterEach",function(t,r){return i.suite=s,t?n(t,r,!0):void e(o)}):(i.suite=s,e(o))}function o(a,u){if(i.failures&&t._bail)return e();if(a)return n(a,u,!0);if(r=s.shift(),!r)return e();var l=i._grep.test(r.fullTitle());return i._invert&&(l=!l),l?r.pending?(i.emit("pending",r),i.emit("test end",r),o()):(i.emit("test",i.test=r),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return r=i.test,t?(i.fail(r,t),i.emit("test end",r),i.hookUp("afterEach",o)):(r.state="passed",i.emit("pass",r),i.emit("test end",r),void i.hookUp("afterEach",o))}))})):o()}var r,i=this,s=t.tests.slice();this.next=o,o()},o.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?o():o(e);var r=t.suites[s++];return r?void i.runSuite(r,n):o()}function o(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var r=this.grepTotal(t),i=this,s=0;return u("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?o():void i.runTests(t,n)})):e()},o.prototype.uncaught=function(t){u("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return u("start"),this.on("end",function(){u("end"),r.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){u("finished running"),n.emit("end")}),r.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,r=0,i=t.length;i>r;r++)o=e(o,t[r],r,t);return o},e.filter=function(t,e){for(var n=[],o=0,r=t.length;r>o;o++){var i=t[o];e(i,o,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,o=global.setTimeout,r=(global.setInterval,global.clearTimeout,global.clearInterval,{});r.exit=function(){},r.stdout={},r.removeListener=function(t){"uncaughtException"==t&&(global.onerror=function(){})},r.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))})};var i,s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"}),u=[];s.Runner.immediately=function(t){u.push(t),i||(i=o(e,0))},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=r}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.15.1/mocha.min.css b/ajax/libs/mocha/1.15.1/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.15.1/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.15.1/mocha.min.js b/ajax/libs/mocha/1.15.1/mocha.min.js new file mode 100644 index 000000000..50955c2a5 --- /dev/null +++ b/ajax/libs/mocha/1.15.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}function e(){for(var t=(new n).getTime();u.length&&(new n).getTime()-t<100;)u.shift()();i=u.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,r=e.length,i=o+r,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=o&&a+1>=r)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&r>a;if(h||d){!h||d&&f.newPos=o&&a+1>=r)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,o){var r=t[t.length-1];r&&r.added===n&&r.removed===o?t[t.length-1]={value:this.join(r.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var r=e.length,i=n.length,s=t.newPos,a=s-o;r>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var r=new o,i=new o(!0),s=new o;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new o(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new o;return u.tokenize=function(t){return t.split(/^/m)},{Diff:o,diffChars:function(t,e){return r.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,o,r){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var o=l[l.length-2],r=e===l.length-2,i=e===l.length-3&&(n.added!==o.added||n.removed!==o.removed);/\n$/.test(n.value)||!r&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof o?"":" "+o)),a.push("+++ "+t+("undefined"==typeof r?"":" "+r));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=o[s],c=0;c"):r.removed&&e.push(""),e.push(n(r.value)),r.added?e.push(""):r.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],o=0;oi;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){r=i;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),i=0,s=r.length;s>i;i++)r[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,i=o,s=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,r-c/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.type="hook"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);return s.grep(o.fullTitle()),o},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.it.only=function(e,n){var o=t.it(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";return s.grep(new RegExp(r)),o},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(s,a))}}else{var i=o.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var o=t.suite(e,n);s.grep(o.fullTitle())},t.test=function(t,n){var o=new r(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";s.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.suite.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.suite.only=function(e,n){var o=t.suite(e,n);s.grep(o.fullTitle())},t.test=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.test.only=function(e,n){var o=t.test(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";s.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow)}var i=n("browser/path"),s=n("./utils");e=t.exports=r,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(o){}if(!e)try{e=n(t)}catch(o){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(o){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,o=this.suite,r=this.files.length;this.files.forEach(function(s){s=i.resolve(s),o.emit("pre-require",global,s,e),o.emit("require",n(s),s,e),o.emit("post-require",global,s,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";r(i,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},r.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),i=new this._reporter(r);return r.ignoreLeaks=!1!==o.ignoreLeaks,r.asyncOnly=o.asyncOnly,o.grep&&r.grep(o.grep,o.invert),o.globals&&r.globals(o.globals),o.growl&&this._growl(r,i),e.reporters.Base.useColors=o.useColors,e.reporters.Base.inlineDiffs=o.useInlineDiffs,r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function o(t){return r(t,u,"day")||r(t,a,"hour")||r(t,s,"minute")||r(t,i,"second")||t+" ms"}function r(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,r){return r=r||{},"string"==typeof t?e(t):r.long?o(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new m}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new m,e.duration=new m-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),o=n.split("\n");if(o.length>4){var r=String(o.length).length;n=o.map(function(t,e){return i(++e,r)+" | "+t}).join("\n")}return n="\n"+y("diff removed","actual")+" "+y("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?r+c("diff added",t):"-"===t[0]?r+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:r+t}function o(t){return null!=t}var r=" ";msg=d.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(o).join("\n")}function u(t,e,n){var o=n?l(t.actual):t.actual,r=n?l(t.expected):t.expected;return d["diff"+e](o,r).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return y(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var h=n("browser/tty"),d=n("browser/diff"),g=n("../ms"),m=global.Date,v=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,h.isatty(1)&&h.isatty(2));e=t.exports=o,e.useColors=v||void 0!==r.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==r.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var y=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:v?r.stdout.getWindowSize?r.stdout.getWindowSize(1)[0]:h.getWindowSize()[1]:75},e.cursor={hide:function(){v&&r.stdout.write("[?25l")},show:function(){v&&r.stdout.write("[?25h")},deleteLine:function(){v&&r.stdout.write("")},beginningOfLine:function(){v&&r.stdout.write("")},CR:function(){v?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):r.stdout.write("\n")}},e.list=function(t){console.error(),t.forEach(function(t,n){var o=y("error title"," %s) %s:\n")+y("error message"," %s")+y("error stack","\n%s\n"),r=t.err,i=r.message||"",u=r.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),h=r.actual,d=r.expected,g=!0;if(r.uncaught&&(c="Uncaught "+c),r.showDiff&&p(h,d)&&(g=!1,r.actual=h=f(h),r.expected=d=f(d)),"string"==typeof h&&"string"==typeof d){o=y("error title"," %s) %s:\n%s")+y("error stack","\n%s\n");var m=i.match(/^([^:]+): expected/);c=m?"\n "+y("error message",m[1]):"",c+=e.inlineDiffs?s(r,g):a(r,g)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(o,n+1,t.fullTitle(),c,u)})},o.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=y("bright pass"," ")+y("green"," %d passing")+y("light"," (%s)"),console.log(t,e.passes||0,g(e.duration)),e.pending&&(t=y("pending"," ")+y("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=y("fail"," %d failing"),console.error(t,e.failures),o.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
              ',e()),++n,console.log("%s

              %s

              ",e(),i.escape(t.title)),console.log("%s
              ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
              ",e()),--n,console.log("%s
              ",e()),--n)}),t.on("pass",function(t){console.log("%s
              %s
              ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
              %s
              ",e(),n)})}var r=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){r.stdout.write("\n ")}),t.on("pending",function(){r.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++o%n==0&&r.stdout.write("\n "),r.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++o%n==0&&r.stdout.write("\n "),r.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",u=a.readFileSync(o,"utf8"),l=e.compile(u,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){r.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this,v=this.stats,y=(t.total,i(g)),w=y.getElementsByTagName("li"),b=w[1].getElementsByTagName("em")[0],x=w[1].getElementsByTagName("a")[0],k=w[2].getElementsByTagName("em")[0],T=w[2].getElementsByTagName("a")[0],j=w[3].getElementsByTagName("em")[0],E=y.getElementsByTagName("canvas")[0],_=i('
                '),C=[_];if(e=e||document.getElementById("mocha"),E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,o=E.getContext("2d"),o.scale(S,S),n=new p}return e?(l(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test pass")}),l(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test fail")}),e.appendChild(y),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e=m.suiteURL(t),n=i('
              • %s

              • ',e,h(t.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}}),t.on("suite end",function(t){t.root||C.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=v.tests/this.total*100|0;n&&n.update(e).draw(o);var r=new d-v.start;if(u(b,v.passes),u(k,v.failures),u(j,(r/1e3).toFixed(2)),"passed"==t.state)var s=m.testURL(t),a=i('
              • %e%ems ‣

              • ',t.speed,t.title,t.duration,s);else if(t.pending)var a=i('
              • %e

              • ',t.title);else{var a=i('
              • %e ‣

              • ',t.title,encodeURIComponent(t.fullTitle())),c=t.err.stack||t.err.toString();~c.indexOf(t.err.message)||(c=t.err.message+"\n"+c),"[object Error]"==c&&(c=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(c+="\n("+t.err.sourceURL+":"+t.err.line+")"),a.appendChild(i('
                %e
                ',c))}if(!t.pending){var p=a.getElementsByTagName("h2")[0];l(p,"click",function(){h.style.display="none"==h.style.display?"block":"none"});var h=i("
                %e
                ",f.clean(t.fn.toString()));a.appendChild(h),h.style.display="none"}C[0]&&C[0].appendChild(a)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(i('
                %s
                ',t))}function i(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){r.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:o.map(i),passes:a.map(i)};r.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),i=t.total,l=r.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?o*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(o-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){r.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function a(t){var e=n(t,{});return o(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){r.stdout.write("# TOC\n"),r.stdout.write(a(t.suite)),r.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){s.call(this,t),t.on("start",function(){r.stdout.write(""),r.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",o=""; +i(n),i("_,------,"),i("\n"),i(n),o=t.tick?" ":" ",i("_|"+o+"/\\_/\\ "),i("\n"),i(n),o=t.tick?"_":"__";var r=t.tick?"~":"^";i(r+"|"+o+this.face()+" "),i("\n"),i(n),o=t.tick?" ":" ",i(o+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},o.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},o.prototype.cursorUp=function(t){i("["+t+"A")},o.prototype.cursorDown=function(t){i("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),i=Math.floor(3*Math.sin(o+2*n)+3),s=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*i+s+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=o*t|0,s=o-n;a.CR(),r.stdout.write(""),r.stdout.write(u("progress"," "+e.open)),r.stdout.write(Array(n).join(e.complete)),r.stdout.write(Array(s).join(e.incomplete)),r.stdout.write(u("progress",e.close)),e.verbose&&r.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.progress=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(u("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){r.stdout.write(e()+u("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+u("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ");a.CR(),console.log(n,t.title)}else{var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ")+u(t.speed,"(%dms)");a.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){a.CR(),console.log(e()+u("fail"," %d) %s"),++i,t.title)}),t.on("end",n.epilogue.bind(n))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,r(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function r(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function r(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return r="<"+t+(s.length?" "+s.join(" "):"")+i,o&&(r+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,r.prototype=u.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},o.prototype.run=function(t){function e(t){r||(r=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(o)return e(n);i.clearTimeout(),i.duration=new u-a,o=!0,t(n)}}var o,r,i=this,s=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&s&&(this.timer=l(function(){n(new Error("timeout of "+s+"ms exceeded")),i.timedOut=!0},s)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function i(){}function s(t,e){return c(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=c(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var a=n("browser/events").EventEmitter,u=n("browser/debug")("mocha:runner"),l=(n("./test"),n("./utils")),c=l.filter,f=(l.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=global.setImmediate||r.nextTick,i.prototype=a.prototype,o.prototype=new i,o.prototype.constructor=o,o.prototype.grep=function(t,e){return u("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=l.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=i[t];return o?s.failures&&r.bail()?e():(s.currentRunnable=o,o.ctx.currentTest=s.test,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(r){o.removeAllListeners("error");var i=o.error();return i&&s.fail(s.test,i),r?(s.failHook(o,r),e(r)):(s.emit("hook end",o),delete o.ctx.currentTest,void n(++t))})):e()}var r=this.suite,i=r["_"+t],s=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(s){return r.suite=s,s?void r.hook(t,function(t){if(t){var s=r.suite;return r.suite=i,n(t,s)}o(e.pop())}):(r.suite=i,n())}var r=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(t,o,r){var s=i.suite;i.suite=r?o.parent:o,i.suite?i.hookUp("afterEach",function(t,r){return i.suite=s,t?n(t,r,!0):void e(o)}):(i.suite=s,e(o))}function o(a,u){if(i.failures&&t._bail)return e();if(a)return n(a,u,!0);if(r=s.shift(),!r)return e();var l=i._grep.test(r.fullTitle());return i._invert&&(l=!l),l?r.pending?(i.emit("pending",r),i.emit("test end",r),o()):(i.emit("test",i.test=r),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return r=i.test,t?(i.fail(r,t),i.emit("test end",r),i.hookUp("afterEach",o)):(r.state="passed",i.emit("pass",r),i.emit("test end",r),void i.hookUp("afterEach",o))}))})):o()}var r,i=this,s=t.tests.slice();this.next=o,o()},o.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?o():o(e);var r=t.suites[s++];return r?void i.runSuite(r,n):o()}function o(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var r=this.grepTotal(t),i=this,s=0;return u("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?o():void i.runTests(t,n)})):e()},o.prototype.uncaught=function(t){u("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return u("start"),this.on("end",function(){u("end"),r.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){u("finished running"),n.emit("end")}),r.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,r=0,i=t.length;i>r;r++)o=e(o,t[r],r,t);return o},e.filter=function(t,e){for(var n=[],o=0,r=t.length;r>o;o++){var i=t[o];e(i,o,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,o=global.setTimeout,r=(global.setInterval,global.clearTimeout,global.clearInterval,{});r.exit=function(){},r.stdout={},r.removeListener=function(t){"uncaughtException"==t&&(global.onerror=function(){})},r.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))})};var i,s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"}),u=[];s.Runner.immediately=function(t){u.push(t),i||(i=o(e,0))},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=r}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.16.0/mocha.min.css b/ajax/libs/mocha/1.16.0/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.16.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.16.0/mocha.min.js b/ajax/libs/mocha/1.16.0/mocha.min.js new file mode 100644 index 000000000..cb386bde1 --- /dev/null +++ b/ajax/libs/mocha/1.16.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}function e(){for(var t=(new n).getTime();l.length&&(new n).getTime()-t<100;)l.shift()();s=l.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,r=e.length,i=o+r,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=o&&a+1>=r)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&r>a;if(h||d){!h||d&&f.newPos=o&&a+1>=r)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,o){var r=t[t.length-1];r&&r.added===n&&r.removed===o?t[t.length-1]={value:this.join(r.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var r=e.length,i=n.length,s=t.newPos,a=s-o;r>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var r=new o,i=new o(!0),s=new o;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new o(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new o;return u.tokenize=function(t){return t.split(/^/m)},{Diff:o,diffChars:function(t,e){return r.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,o,r){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var o=l[l.length-2],r=e===l.length-2,i=e===l.length-3&&(n.added!==o.added||n.removed!==o.removed);/\n$/.test(n.value)||!r&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof o?"":" "+o)),a.push("+++ "+t+("undefined"==typeof r?"":" "+r));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=o[s],c=0;c"):r.removed&&e.push(""),e.push(n(r.value)),r.added?e.push(""):r.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],o=0;oi;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){r=i;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),i=0,s=r.length;s>i;i++)r[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,i=o,s=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,r-c/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.type="hook"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);return s.grep(o.fullTitle()),o},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.it.only=function(e,n){var o=t.it(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";return s.grep(new RegExp(r)),o},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(s,a))}}else{var i=o.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var o=t.suite(e,n);s.grep(o.fullTitle())},t.test=function(t,n){var o=new r(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";s.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.suite.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.suite.only=function(e,n){var o=t.suite(e,n);s.grep(o.fullTitle())},t.test=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.test.only=function(e,n){var o=t.test(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";s.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow)}var i=n("browser/path"),s=n("./utils");e=t.exports=r,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(o){}if(!e)try{e=n(t)}catch(o){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(o){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,o=this.suite,r=this.files.length;this.files.forEach(function(s){s=i.resolve(s),o.emit("pre-require",global,s,e),o.emit("require",n(s),s,e),o.emit("post-require",global,s,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";r(i,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},r.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),i=new this._reporter(r);return r.ignoreLeaks=!1!==o.ignoreLeaks,r.asyncOnly=o.asyncOnly,o.grep&&r.grep(o.grep,o.invert),o.globals&&r.globals(o.globals),o.growl&&this._growl(r,i),e.reporters.Base.useColors=o.useColors,e.reporters.Base.inlineDiffs=o.useInlineDiffs,r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function o(t){return r(t,u,"day")||r(t,a,"hour")||r(t,s,"minute")||r(t,i,"second")||t+" ms"}function r(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,r){return r=r||{},"string"==typeof t?e(t):r.long?o(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new m}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new m,e.duration=new m-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),o=n.split("\n");if(o.length>4){var r=String(o.length).length;n=o.map(function(t,e){return i(++e,r)+" | "+t}).join("\n")}return n="\n"+y("diff removed","actual")+" "+y("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?r+c("diff added",t):"-"===t[0]?r+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:r+t}function o(t){return null!=t}var r=" ";msg=d.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(o).join("\n")}function u(t,e,n){var o=n?l(t.actual):t.actual,r=n?l(t.expected):t.expected;return d["diff"+e](o,r).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return y(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var h=n("browser/tty"),d=n("browser/diff"),g=n("../ms"),m=global.Date,v=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,h.isatty(1)&&h.isatty(2));e=t.exports=o,e.useColors=v||void 0!==r.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==r.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var y=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:v?r.stdout.getWindowSize?r.stdout.getWindowSize(1)[0]:h.getWindowSize()[1]:75},e.cursor={hide:function(){v&&r.stdout.write("[?25l")},show:function(){v&&r.stdout.write("[?25h")},deleteLine:function(){v&&r.stdout.write("")},beginningOfLine:function(){v&&r.stdout.write("")},CR:function(){v?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):r.stdout.write("\n")}},e.list=function(t){console.error(),t.forEach(function(t,n){var o=y("error title"," %s) %s:\n")+y("error message"," %s")+y("error stack","\n%s\n"),r=t.err,i=r.message||"",u=r.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),h=r.actual,d=r.expected,g=!0;if(r.uncaught&&(c="Uncaught "+c),r.showDiff&&p(h,d)&&(g=!1,r.actual=h=f(h),r.expected=d=f(d)),"string"==typeof h&&"string"==typeof d){o=y("error title"," %s) %s:\n%s")+y("error stack","\n%s\n");var m=i.match(/^([^:]+): expected/);c=m?"\n "+y("error message",m[1]):"",c+=e.inlineDiffs?s(r,g):a(r,g)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(o,n+1,t.fullTitle(),c,u)})},o.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=y("bright pass"," ")+y("green"," %d passing")+y("light"," (%s)"),console.log(t,e.passes||0,g(e.duration)),e.pending&&(t=y("pending"," ")+y("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=y("fail"," %d failing"),console.error(t,e.failures),o.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                ',e()),++n,console.log("%s

                %s

                ",e(),i.escape(t.title)),console.log("%s
                ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                ",e()),--n,console.log("%s
                ",e()),--n)}),t.on("pass",function(t){console.log("%s
                %s
                ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                %s
                ",e(),n)})}var r=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){r.stdout.write("\n ")}),t.on("pending",function(){r.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++o%n==0&&r.stdout.write("\n "),r.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++o%n==0&&r.stdout.write("\n "),r.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",u=a.readFileSync(o,"utf8"),l=e.compile(u,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){r.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this,v=this.stats,y=(t.total,i(g)),w=y.getElementsByTagName("li"),b=w[1].getElementsByTagName("em")[0],x=w[1].getElementsByTagName("a")[0],k=w[2].getElementsByTagName("em")[0],T=w[2].getElementsByTagName("a")[0],j=w[3].getElementsByTagName("em")[0],E=y.getElementsByTagName("canvas")[0],_=i('
                  '),C=[_];if(e=e||document.getElementById("mocha"),E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,o=E.getContext("2d"),o.scale(S,S),n=new p}return e?(l(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test pass")}),l(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test fail")}),e.appendChild(y),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e=m.suiteURL(t),n=i('
                • %s

                • ',e,h(t.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}}),t.on("suite end",function(t){t.root||C.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=v.tests/this.total*100|0;n&&n.update(e).draw(o);var r=new d-v.start;if(u(b,v.passes),u(k,v.failures),u(j,(r/1e3).toFixed(2)),"passed"==t.state)var s=m.testURL(t),a=i('
                • %e%ems ‣

                • ',t.speed,t.title,t.duration,s);else if(t.pending)var a=i('
                • %e

                • ',t.title);else{var a=i('
                • %e ‣

                • ',t.title,encodeURIComponent(t.fullTitle())),c=t.err.stack||t.err.toString();~c.indexOf(t.err.message)||(c=t.err.message+"\n"+c),"[object Error]"==c&&(c=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(c+="\n("+t.err.sourceURL+":"+t.err.line+")"),a.appendChild(i('
                  %e
                  ',c))}if(!t.pending){var p=a.getElementsByTagName("h2")[0];l(p,"click",function(){h.style.display="none"==h.style.display?"block":"none"});var h=i("
                  %e
                  ",f.clean(t.fn.toString()));a.appendChild(h),h.style.display="none"}C[0]&&C[0].appendChild(a)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(i('
                  %s
                  ',t))}function i(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){r.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:o.map(i),passes:a.map(i)};r.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),i=t.total,l=r.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?o*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(o-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){r.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function a(t){var e=n(t,{});return o(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){r.stdout.write("# TOC\n"),r.stdout.write(a(t.suite)),r.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){s.call(this,t),t.on("start",function(){r.stdout.write(""),r.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",o=""; +i(n),i("_,------,"),i("\n"),i(n),o=t.tick?" ":" ",i("_|"+o+"/\\_/\\ "),i("\n"),i(n),o=t.tick?"_":"__";var r=t.tick?"~":"^";i(r+"|"+o+this.face()+" "),i("\n"),i(n),o=t.tick?" ":" ",i(o+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},o.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},o.prototype.cursorUp=function(t){i("["+t+"A")},o.prototype.cursorDown=function(t){i("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),i=Math.floor(3*Math.sin(o+2*n)+3),s=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*i+s+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=o*t|0,s=o-n;a.CR(),r.stdout.write(""),r.stdout.write(u("progress"," "+e.open)),r.stdout.write(Array(n).join(e.complete)),r.stdout.write(Array(s).join(e.incomplete)),r.stdout.write(u("progress",e.close)),e.verbose&&r.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.progress=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}s.call(this,t);var n=this,o=(this.stats,0),i=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(u("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){r.stdout.write(e()+u("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+u("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ");a.CR(),console.log(n,t.title)}else{var n=e()+u("checkmark"," "+s.symbols.ok)+u("pass"," %s ")+u(t.speed,"(%dms)");a.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){a.CR(),console.log(e()+u("fail"," %d) %s"),++i,t.title)}),t.on("end",n.epilogue.bind(n))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,r(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function r(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function r(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return r="<"+t+(s.length?" "+s.join(" "):"")+i,o&&(r+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,r.prototype=u.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},o.prototype.run=function(t){function e(t){r||(r=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(o)return e(n);i.clearTimeout(),i.duration=new u-a,o=!0,t(n)}}var o,r,i=this,s=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&s&&(this.timer=l(function(){n(new Error("timeout of "+s+"ms exceeded")),i.timedOut=!0},s)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function i(){}function s(t,e){return c(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=c(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var a=n("browser/events").EventEmitter,u=n("browser/debug")("mocha:runner"),l=(n("./test"),n("./utils")),c=l.filter,f=(l.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=global.setImmediate||r.nextTick,i.prototype=a.prototype,o.prototype=new i,o.prototype.constructor=o,o.prototype.grep=function(t,e){return u("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=l.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=i[t];return o?s.failures&&r.bail()?e():(s.currentRunnable=o,o.ctx.currentTest=s.test,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(r){o.removeAllListeners("error");var i=o.error();return i&&s.fail(s.test,i),r?(s.failHook(o,r),e(r)):(s.emit("hook end",o),delete o.ctx.currentTest,void n(++t))})):e()}var r=this.suite,i=r["_"+t],s=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(s){return r.suite=s,s?void r.hook(t,function(t){if(t){var s=r.suite;return r.suite=i,n(t,s)}o(e.pop())}):(r.suite=i,n())}var r=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(t,o,r){var s=i.suite;i.suite=r?o.parent:o,i.suite?i.hookUp("afterEach",function(t,r){return i.suite=s,t?n(t,r,!0):void e(o)}):(i.suite=s,e(o))}function o(a,u){if(i.failures&&t._bail)return e();if(a)return n(a,u,!0);if(r=s.shift(),!r)return e();var l=i._grep.test(r.fullTitle());return i._invert&&(l=!l),l?r.pending?(i.emit("pending",r),i.emit("test end",r),o()):(i.emit("test",i.test=r),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return r=i.test,t?(i.fail(r,t),i.emit("test end",r),i.hookUp("afterEach",o)):(r.state="passed",i.emit("pass",r),i.emit("test end",r),void i.hookUp("afterEach",o))}))})):o()}var r,i=this,s=t.tests.slice();this.next=o,o()},o.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?o():o(e);var r=t.suites[s++];return r?void i.runSuite(r,n):o()}function o(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var r=this.grepTotal(t),i=this,s=0;return u("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?o():void i.runTests(t,n)})):e()},o.prototype.uncaught=function(t){u("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return u("start"),this.on("end",function(){u("end"),r.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){u("finished running"),n.emit("end")}),r.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,r=0,i=t.length;i>r;r++)o=e(o,t[r],r,t);return o},e.filter=function(t,e){for(var n=[],o=0,r=t.length;r>o;o++){var i=t[o];e(i,o,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,o=global.setTimeout,r=(global.setInterval,global.clearTimeout,global.clearInterval,{});r.exit=function(){},r.stdout={};var i=[];r.removeListener=function(t,e){if("uncaughtException"==t){global.onerror=function(){};var n=i.indexOf(e);-1!=n&&i.splice(n,1)}},r.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))},i.push(e))};var s,a=global.Mocha=t("mocha"),u=global.mocha=new a({reporter:"html"}),l=[];a.Runner.immediately=function(t){l.push(t),s||(s=o(e,0))},u.throwError=function(t){throw i.forEach(function(e){e(t)}),t},u.ui=function(t){return a.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},u.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},u.run=function(t){u.options;u.globals("location");var e=a.utils.parseQuery(global.location.search||"");return e.grep&&u.grep(e.grep),e.invert&&u.invert(),a.prototype.run.call(u,function(){global.document&&a.utils.highlightTags("code"),t&&t()})},a.process=r}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.16.1/mocha.min.css b/ajax/libs/mocha/1.16.1/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.16.1/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.16.1/mocha.min.js b/ajax/libs/mocha/1.16.1/mocha.min.js new file mode 100644 index 000000000..4618cc488 --- /dev/null +++ b/ajax/libs/mocha/1.16.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new n).getTime();l.length&&(new n).getTime()-t<100;)l.shift()();u=l.length?r(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,o-c/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow)}var i=n("browser/path"),s=n("./utils");e=t.exports=o,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(r){}if(!e)try{e=n(t)}catch(r){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(r){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},o.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options,o=new e.Runner(n),i=new this._reporter(o);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new m}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new m,e.duration=new m-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return i(++e,o)+" | "+t}).join("\n")}return n="\n"+y("diff removed","actual")+" "+y("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?o+c("diff added",t):"-"===t[0]?o+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=d.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function u(t,e,n){var r=n?l(t.actual):t.actual,o=n?l(t.expected):t.expected;return d["diff"+e](r,o).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return y(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var h=n("browser/tty"),d=n("browser/diff"),g=n("../ms"),m=global.Date,v=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,h.isatty(1)&&h.isatty(2));e=t.exports=r,e.useColors=v||void 0!==o.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==o.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var y=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:v?o.stdout.getWindowSize?o.stdout.getWindowSize(1)[0]:h.getWindowSize()[1]:75},e.cursor={hide:function(){v&&o.stdout.write("[?25l")},show:function(){v&&o.stdout.write("[?25h")},deleteLine:function(){v&&o.stdout.write("")},beginningOfLine:function(){v&&o.stdout.write("")},CR:function(){v?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):o.stdout.write("\n")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=y("error title"," %s) %s:\n")+y("error message"," %s")+y("error stack","\n%s\n"),o=t.err,i=o.message||"",u=o.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),h=o.actual,d=o.expected,g=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&p(h,d)&&(g=!1,o.actual=h=f(h),o.expected=d=f(d)),"string"==typeof h&&"string"==typeof d){r=y("error title"," %s) %s:\n%s")+y("error stack","\n%s\n");var m=i.match(/^([^:]+): expected/);c=m?"\n "+y("error message",m[1]):"",c+=e.inlineDiffs?s(o,g):a(o,g)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,u)})},r.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=y("bright pass"," ")+y("green"," %d passing")+y("light"," (%s)"),console.log(t,e.passes||0,g(e.duration)),e.pending&&(t=y("pending"," ")+y("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=y("fail"," %d failing"),console.error(t,e.failures),r.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                  ',e()),++n,console.log("%s

                  %s

                  ",e(),i.escape(t.title)),console.log("%s
                  ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                  ",e()),--n,console.log("%s
                  ",e()),--n)}),t.on("pass",function(t){console.log("%s
                  %s
                  ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                  %s
                  ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){o.stdout.write("\n ")}),t.on("pending",function(){o.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&o.stdout.write("\n "),o.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&o.stdout.write("\n "),o.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){o.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t,e){c.call(this,t);var n,r,m=this,v=this.stats,y=(t.total,i(g)),w=y.getElementsByTagName("li"),b=w[1].getElementsByTagName("em")[0],x=w[1].getElementsByTagName("a")[0],k=w[2].getElementsByTagName("em")[0],T=w[2].getElementsByTagName("a")[0],j=w[3].getElementsByTagName("em")[0],E=y.getElementsByTagName("canvas")[0],_=i('
                    '),C=[_];if(e=e||document.getElementById("mocha"),E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,r=E.getContext("2d"),r.scale(S,S),n=new p}return e?(l(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test pass")}),l(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test fail")}),e.appendChild(y),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e=m.suiteURL(t),n=i('
                  • %s

                  • ',e,h(t.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}}),t.on("suite end",function(t){t.root||C.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=v.tests/this.total*100|0;n&&n.update(e).draw(r);var o=new d-v.start;if(u(b,v.passes),u(k,v.failures),u(j,(o/1e3).toFixed(2)),"passed"==t.state)var s=m.testURL(t),a=i('
                  • %e%ems ‣

                  • ',t.speed,t.title,t.duration,s);else if(t.pending)var a=i('
                  • %e

                  • ',t.title);else{var a=i('
                  • %e ‣

                  • ',t.title,encodeURIComponent(t.fullTitle())),c=t.err.stack||t.err.toString();~c.indexOf(t.err.message)||(c=t.err.message+"\n"+c),"[object Error]"==c&&(c=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(c+="\n("+t.err.sourceURL+":"+t.err.line+")"),a.appendChild(i('
                    %e
                    ',c))}if(!t.pending){var p=a.getElementsByTagName("h2")[0];l(p,"click",function(){h.style.display="none"==h.style.display?"block":"none"});var h=i("
                    %e
                    ",f.clean(t.fn.toString()));a.appendChild(h),h.style.display="none"}C[0]&&C[0].appendChild(a)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                    %s
                    ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return h(e[r++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){o.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:r.map(i),passes:a.map(i)};o.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),i=t.total,l=o.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){o.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){o.stdout.write("# TOC\n"),o.stdout.write(a(t.suite)),o.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){o.stdout.write(""),o.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r=""; +i(n),i("_,------,"),i("\n"),i(n),r=t.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(n),r=t.tick?"_":"__";var o=t.tick?"~":"^";i(o+"|"+r+this.face()+" "),i("\n"),i(n),r=t.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){i("["+t+"A")},r.prototype.cursorDown=function(t){i("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=r*t|0,s=r-n;a.CR(),o.stdout.write(""),o.stdout.write(u("progress"," "+e.open)),o.stdout.write(Array(n).join(e.complete)),o.stdout.write(Array(s).join(e.incomplete)),o.stdout.write(u("progress",e.close)),e.verbose&&o.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){l.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){o.stdout.write(a("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new p).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(s),o.stdout.write("")})}function i(){}function s(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;e.message=f(n.message),o.stdout.write(a("testcase",e,!1,a("failure",e,!1,u(n.stack))))}else o.stdout.write(t.pending?a("testcase",e,!1,a("skipped",{},!0)):a("testcase",e,!0))}function a(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+f(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var l=n("./base"),c=n("../utils"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,i.prototype=l.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){c(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},r.prototype.globals=function(t){this._allowedGlobals=t},r.prototype.run=function(t){function e(t){o||(o=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(r)return e(n);i.clearTimeout(),i.duration=new u-a,r=!0,t(n)}}var r,o,i=this,s=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&s&&(this.timer=l(function(){n(new Error("timeout of "+s+"ms exceeded")),i.timedOut=!0},s)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function i(){}function s(t,e){return c(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=c(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var a=n("browser/events").EventEmitter,u=n("browser/debug")("mocha:runner"),l=(n("./test"),n("./utils")),c=l.filter,f=(l.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=r,r.immediately=global.setImmediate||o.nextTick,i.prototype=a.prototype,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return u("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globalProps=function(){for(var t=l.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},r.prototype.hook=function(t,e){function n(t){var r=i[t];return r?s.failures&&o.bail()?e():(s.currentRunnable=r,r.ctx.currentTest=s.test,s.emit("hook",r),r.on("error",function(t){s.failHook(r,t)}),void r.run(function(o){r.removeAllListeners("error");var i=r.error();return i&&s.fail(s.test,i),o?(s.failHook(r,o),e(o)):(s.emit("hook end",r),delete r.ctx.currentTest,void n(++t))})):e()}var o=this.suite,i=o["_"+t],s=this;r.immediately(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},r.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return u("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){u("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return u("start"),this.on("end",function(){u("end"),o.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){u("finished running"),n.emit("end")}),o.on("uncaughtException",e),this},r.prototype.abort=function(){u("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,r=global.setTimeout,o=(global.setInterval,global.clearTimeout,global.clearInterval,{});o.exit=function(){},o.stdout={};var i=[];o.removeListener=function(t,e){if("uncaughtException"==t){global.onerror=function(){};var n=i.indexOf(e);-1!=n&&i.splice(n,1)}},o.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},i.push(e))};var s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"});a.suite.removeAllListeners("pre-require");var u,l=[];s.Runner.immediately=function(t){l.push(t),u||(u=r(e,0))},a.throwError=function(t){throw i.forEach(function(e){e(t)}),t},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=o}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.16.2/mocha.min.css b/ajax/libs/mocha/1.16.2/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.16.2/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.16.2/mocha.min.js b/ajax/libs/mocha/1.16.2/mocha.min.js new file mode 100644 index 000000000..c298a92eb --- /dev/null +++ b/ajax/libs/mocha/1.16.2/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}function e(){for(var t=(new n).getTime();l.length&&(new n).getTime()-t<100;)l.shift()();u=l.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,r=e.length,i=o+r,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=o&&a+1>=r)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&r>a;if(h||d){!h||d&&f.newPos=o&&a+1>=r)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,o){var r=t[t.length-1];r&&r.added===n&&r.removed===o?t[t.length-1]={value:this.join(r.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var r=e.length,i=n.length,s=t.newPos,a=s-o;r>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var r=new o,i=new o(!0),s=new o;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new o(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new o;return u.tokenize=function(t){return t.split(/^/m)},{Diff:o,diffChars:function(t,e){return r.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,o,r){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var o=l[l.length-2],r=e===l.length-2,i=e===l.length-3&&(n.added!==o.added||n.removed!==o.removed);/\n$/.test(n.value)||!r&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof o?"":" "+o)),a.push("+++ "+t+("undefined"==typeof r?"":" "+r));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=o[s],c=0;c"):r.removed&&e.push(""),e.push(n(r.value)),r.added?e.push(""):r.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],o=0;oi;i++)if(o[i]===e||o[i].listener&&o[i].listener===e){r=i;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),i=0,s=r.length;s>i;i++)r[i].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,i=o,s=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,r-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.type="hook"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);return s.grep(o.fullTitle()),o},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.it.only=function(e,n){var o=t.it(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";return s.grep(new RegExp(r)),o},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(s,a))}}else{var i=o.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var o=t.suite(e,n);s.grep(o.fullTitle())},t.test=function(t,n){var o=new r(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";s.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.suite.skip=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.suite.only=function(e,n){var o=t.suite(e,n);s.grep(o.fullTitle())},t.test=function(t,n){var o=e[0];if(o.pending)var n=null;var i=new r(t,n);return o.addTest(i),i},t.test.only=function(e,n){var o=t.test(e,n),r="^"+i.escapeRegexp(o.fullTitle())+"$";s.grep(new RegExp(r))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow)}var i=n("browser/path"),s=n("./utils");e=t.exports=r,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(o){}if(!e)try{e=n(t)}catch(o){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(o){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,o=this.suite,r=this.files.length;this.files.forEach(function(s){s=i.resolve(s),o.emit("pre-require",global,s,e),o.emit("require",n(s),s,e),o.emit("post-require",global,s,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";r(i,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},r.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),i=new this._reporter(r);return r.ignoreLeaks=!1!==o.ignoreLeaks,r.asyncOnly=o.asyncOnly,o.grep&&r.grep(o.grep,o.invert),o.globals&&r.globals(o.globals),o.growl&&this._growl(r,i),e.reporters.Base.useColors=o.useColors,e.reporters.Base.inlineDiffs=o.useInlineDiffs,r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function o(t){return r(t,u,"day")||r(t,a,"hour")||r(t,s,"minute")||r(t,i,"second")||t+" ms"}function r(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,r){return r=r||{},"string"==typeof t?e(t):r.long?o(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new m}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new m,e.duration=new m-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),o=n.split("\n");if(o.length>4){var r=String(o.length).length;n=o.map(function(t,e){return i(++e,r)+" | "+t}).join("\n")}return n="\n"+y("diff removed","actual")+" "+y("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?r+c("diff added",t):"-"===t[0]?r+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:r+t}function o(t){return null!=t}var r=" ";msg=d.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(o).join("\n")}function u(t,e,n){var o=n?l(t.actual):t.actual,r=n?l(t.expected):t.expected;return d["diff"+e](o,r).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return y(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var h=n("browser/tty"),d=n("browser/diff"),g=n("../ms"),m=global.Date,v=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,h.isatty(1)&&h.isatty(2));e=t.exports=o,e.useColors=v||void 0!==r.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==r.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var y=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:v?r.stdout.getWindowSize?r.stdout.getWindowSize(1)[0]:h.getWindowSize()[1]:75},e.cursor={hide:function(){v&&r.stdout.write("[?25l")},show:function(){v&&r.stdout.write("[?25h")},deleteLine:function(){v&&r.stdout.write("")},beginningOfLine:function(){v&&r.stdout.write("")},CR:function(){v?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):r.stdout.write("\n")}},e.list=function(t){console.error(),t.forEach(function(t,n){var o=y("error title"," %s) %s:\n")+y("error message"," %s")+y("error stack","\n%s\n"),r=t.err,i=r.message||"",u=r.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),h=r.actual,d=r.expected,g=!0;if(r.uncaught&&(c="Uncaught "+c),r.showDiff&&p(h,d)&&(g=!1,r.actual=h=f(h),r.expected=d=f(d)),"string"==typeof h&&"string"==typeof d){o=y("error title"," %s) %s:\n%s")+y("error stack","\n%s\n");var m=i.match(/^([^:]+): expected/);c=m?"\n "+y("error message",m[1]):"",c+=e.inlineDiffs?s(r,g):a(r,g)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(o,n+1,t.fullTitle(),c,u)})},o.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=y("bright pass"," ")+y("green"," %d passing")+y("light"," (%s)"),console.log(t,e.passes||0,g(e.duration)),e.pending&&(t=y("pending"," ")+y("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=y("fail"," %d failing"),console.error(t,e.failures),o.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                    ',e()),++n,console.log("%s

                    %s

                    ",e(),i.escape(t.title)),console.log("%s
                    ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                    ",e()),--n,console.log("%s
                    ",e()),--n)}),t.on("pass",function(t){console.log("%s
                    %s
                    ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                    %s
                    ",e(),n)})}var r=n("./base"),i=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),o=0;t.on("start",function(){r.stdout.write("\n ")}),t.on("pending",function(){r.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++o%n==0&&r.stdout.write("\n "),r.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++o%n==0&&r.stdout.write("\n "),r.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",u=a.readFileSync(o,"utf8"),l=e.compile(u,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){r.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this,v=this.stats,y=(t.total,i(g)),w=y.getElementsByTagName("li"),b=w[1].getElementsByTagName("em")[0],x=w[1].getElementsByTagName("a")[0],k=w[2].getElementsByTagName("em")[0],T=w[2].getElementsByTagName("a")[0],j=w[3].getElementsByTagName("em")[0],E=y.getElementsByTagName("canvas")[0],_=i('
                      '),C=[_];if(e=e||document.getElementById("mocha"),E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,o=E.getContext("2d"),o.scale(S,S),n=new p}return e?(l(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test pass")}),l(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test fail")}),e.appendChild(y),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e=m.suiteURL(t),n=i('
                    • %s

                    • ',e,h(t.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}}),t.on("suite end",function(t){t.root||C.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=v.tests/this.total*100|0;n&&n.update(e).draw(o);var r=new d-v.start;if(u(b,v.passes),u(k,v.failures),u(j,(r/1e3).toFixed(2)),"passed"==t.state)var s=m.testURL(t),a=i('
                    • %e%ems ‣

                    • ',t.speed,t.title,t.duration,s);else if(t.pending)var a=i('
                    • %e

                    • ',t.title);else{var a=i('
                    • %e ‣

                    • ',t.title,encodeURIComponent(t.fullTitle())),c=t.err.stack||t.err.toString();~c.indexOf(t.err.message)||(c=t.err.message+"\n"+c),"[object Error]"==c&&(c=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(c+="\n("+t.err.sourceURL+":"+t.err.line+")"),a.appendChild(i('
                      %e
                      ',c))}if(!t.pending){var p=a.getElementsByTagName("h2")[0];l(p,"click",function(){h.style.display="none"==h.style.display?"block":"none"});var h=i("
                      %e
                      ",f.clean(t.fn.toString()));a.appendChild(h),h.style.display="none"}C[0]&&C[0].appendChild(a)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(i('
                      %s
                      ',t))}function i(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){r.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:o.map(i),passes:a.map(i)};r.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,o=(this.stats,.75*s.window.width|0),i=t.total,l=r.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?o*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(o-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){r.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function a(t){var e=n(t,{});return o(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){r.stdout.write("# TOC\n"),r.stdout.write(a(t.suite)),r.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){s.call(this,t),t.on("start",function(){r.stdout.write(""),r.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",o=""; +i(n),i("_,------,"),i("\n"),i(n),o=t.tick?" ":" ",i("_|"+o+"/\\_/\\ "),i("\n"),i(n),o=t.tick?"_":"__";var r=t.tick?"~":"^";i(r+"|"+o+this.face()+" "),i("\n"),i(n),o=t.tick?" ":" ",i(o+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},o.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},o.prototype.cursorUp=function(t){i("["+t+"A")},o.prototype.cursorDown=function(t){i("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),i=Math.floor(3*Math.sin(o+2*n)+3),s=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*i+s+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){s.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=o*t|0,s=o-n;a.CR(),r.stdout.write(""),r.stdout.write(u("progress"," "+e.open)),r.stdout.write(Array(n).join(e.complete)),r.stdout.write(Array(s).join(e.incomplete)),r.stdout.write(u("progress",e.close)),e.verbose&&r.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=o,s.colors.progress=90,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}i.call(this,t);var n=this,o=(this.stats,0),r=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++r,t.title)}),t.on("end",n.epilogue.bind(n))}function r(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){i.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,r(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function r(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function r(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return r="<"+t+(s.length?" "+s.join(" "):"")+i,o&&(r+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,r.prototype=u.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},o.prototype.globals=function(t){this._allowedGlobals=t},o.prototype.run=function(t){function e(t){r||(r=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(o)return e(n);i.clearTimeout(),i.duration=new u-a,o=!0,t(n)}}var o,r,i=this,s=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&s&&(this.timer=l(function(){n(new Error("timeout of "+s+"ms exceeded")),i.timedOut=!0},s)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function i(){}function s(t,e){return c(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=c(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var a=n("browser/events").EventEmitter,u=n("browser/debug")("mocha:runner"),l=(n("./test"),n("./utils")),c=l.filter,f=(l.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=global.setImmediate||r.nextTick,i.prototype=a.prototype,o.prototype=new i,o.prototype.constructor=o,o.prototype.grep=function(t,e){return u("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=l.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=i[t];return o?s.failures&&r.bail()?e():(s.currentRunnable=o,o.ctx.currentTest=s.test,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(r){o.removeAllListeners("error");var i=o.error();return i&&s.fail(s.test,i),r?(s.failHook(o,r),e(r)):(s.emit("hook end",o),delete o.ctx.currentTest,void n(++t))})):e()}var r=this.suite,i=r["_"+t],s=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(s){return r.suite=s,s?void r.hook(t,function(t){if(t){var s=r.suite;return r.suite=i,n(t,s)}o(e.pop())}):(r.suite=i,n())}var r=this,i=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(t,o,r){var s=i.suite;i.suite=r?o.parent:o,i.suite?i.hookUp("afterEach",function(t,r){return i.suite=s,t?n(t,r,!0):void e(o)}):(i.suite=s,e(o))}function o(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(r=s.shift(),!r)return e();var l=i._grep.test(r.fullTitle());return i._invert&&(l=!l),l?r.pending?(i.emit("pending",r),i.emit("test end",r),o()):(i.emit("test",i.test=r),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return r=i.test,t?(i.fail(r,t),i.emit("test end",r),i.hookUp("afterEach",o)):(r.state="passed",i.emit("pass",r),i.emit("test end",r),void i.hookUp("afterEach",o))}))})):o()}var r,i=this,s=t.tests.slice();this.next=o,o()},o.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?o():o(e);if(i._abort)return o();var r=t.suites[s++];return r?void i.runSuite(r,n):o()}function o(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var r=this.grepTotal(t),i=this,s=0;return u("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?o():void i.runTests(t,n)})):e()},o.prototype.uncaught=function(t){u("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return u("start"),this.on("end",function(){u("end"),r.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){u("finished running"),n.emit("end")}),r.on("uncaughtException",e),this},o.prototype.abort=function(){u("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function r(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function r(){}var i=n("./runnable");t.exports=o,r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,r=0,i=t.length;i>r;r++)o=e(o,t[r],r,t);return o},e.filter=function(t,e){for(var n=[],o=0,r=t.length;r>o;o++){var i=t[o];e(i,o,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,o=global.setTimeout,r=(global.setInterval,global.clearTimeout,global.clearInterval,{});r.exit=function(){},r.stdout={};var i=[];r.removeListener=function(t,e){if("uncaughtException"==t){global.onerror=function(){};var n=s.utils.indexOf(i,e);-1!=n&&i.splice(n,1)}},r.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,o){return e(new Error(t+" ("+n+":"+o+")")),!0},i.push(e))};var s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"});a.suite.removeAllListeners("pre-require");var u,l=[];s.Runner.immediately=function(t){l.push(t),u||(u=o(e,0))},a.throwError=function(t){throw s.utils.forEach(i,function(e){e(t)}),t},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=r}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.17.0/mocha.min.css b/ajax/libs/mocha/1.17.0/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.17.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.17.0/mocha.min.js b/ajax/libs/mocha/1.17.0/mocha.min.js new file mode 100644 index 000000000..a94f19417 --- /dev/null +++ b/ajax/libs/mocha/1.17.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new n).getTime();l.length&&(new n).getTime()-t<100;)l.shift()();u=l.length?r(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,o-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow),this.suite.on("pre-require",function(t){e.afterEach=t.afterEach||t.teardown,e.after=t.after||t.suiteTeardown,e.beforeEach=t.beforeEach||t.setup,e.before=t.before||t.suiteSetup,e.describe=t.describe||t.suite,e.it=t.it||t.test,e.setup=t.setup||t.beforeEach,e.suiteSetup=t.suiteSetup||t.before,e.suiteTeardown=t.suiteTeardown||t.after,e.suite=t.suite||t.describe,e.teardown=t.teardown||t.afterEach,e.test=t.test||t.it})}var i=n("browser/path"),s=n("./utils");e=t.exports=o,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(r){}if(!e)try{e=n(t)}catch(r){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(r){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},o.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options,o=new e.Runner(n),i=new this._reporter(o);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new y}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new y,e.duration=new y-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return i(++e,o)+" | "+t}).join("\n")}return n="\n"+b("diff removed","actual")+" "+b("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?o+c("diff added",t):"-"===t[0]?o+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=g.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function u(t,e,n){var r=n?l(t.actual):t.actual,o=n?l(t.expected):t.expected;return g["diff"+e](r,o).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return b(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){if(e=e||[],-1!==v.indexOf(e,t))return t;var n;return"[object Array]"=={}.toString.call(t)?(e.push(t),n=v.map(t,function(t){return p(t,e)}),e.pop()):"object"==typeof t&&null!==t?(e.push(t),n={},v.forEach(v.keys(t).sort(),function(r){n[r]=p(t[r],e)}),e.pop()):n=t,n}function h(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var d=n("browser/tty"),g=n("browser/diff"),m=n("../ms"),v=n("../utils"),y=global.Date,w=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,d.isatty(1)&&d.isatty(2));e=t.exports=r,e.useColors=w||void 0!==o.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==o.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var b=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:w?o.stdout.getWindowSize?o.stdout.getWindowSize(1)[0]:d.getWindowSize()[1]:75},e.cursor={hide:function(){w&&o.stdout.write("[?25l")},show:function(){w&&o.stdout.write("[?25h")},deleteLine:function(){w&&o.stdout.write("")},beginningOfLine:function(){w&&o.stdout.write("")},CR:function(){w?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):o.stdout.write("\r")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=b("error title"," %s) %s:\n")+b("error message"," %s")+b("error stack","\n%s\n"),o=t.err,i=o.message||"",u=o.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),d=o.actual,g=o.expected,m=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&h(d,g)&&(m=!1,o.actual=d=f(p(d)),o.expected=g=f(p(g))),"string"==typeof d&&"string"==typeof g){r=b("error title"," %s) %s:\n%s")+b("error stack","\n%s\n");var v=i.match(/^([^:]+): expected/);c=v?"\n "+b("error message",v[1]):"",c+=e.inlineDiffs?s(o,m):a(o,m)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,u)})},r.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=b("bright pass"," ")+b("green"," %d passing")+b("light"," (%s)"),console.log(t,e.passes||0,m(e.duration)),e.pending&&(t=b("pending"," ")+b("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=b("fail"," %d failing"),console.error(t,e.failures),r.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                      ',e()),++n,console.log("%s

                      %s

                      ",e(),i.escape(t.title)),console.log("%s
                      ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                      ",e()),--n,console.log("%s
                      ",e()),--n)}),t.on("pass",function(t){console.log("%s
                      %s
                      ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                      %s
                      ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){o.stdout.write("\n ")}),t.on("pending",function(){o.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&o.stdout.write("\n "),o.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&o.stdout.write("\n "),o.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){o.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t,e){c.call(this,t);var n,r,m=this,v=this.stats,y=(t.total,i(g)),w=y.getElementsByTagName("li"),b=w[1].getElementsByTagName("em")[0],x=w[1].getElementsByTagName("a")[0],k=w[2].getElementsByTagName("em")[0],T=w[2].getElementsByTagName("a")[0],E=w[3].getElementsByTagName("em")[0],j=y.getElementsByTagName("canvas")[0],_=i('
                        '),C=[_];if(e=e||document.getElementById("mocha"),j.getContext){var S=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=S,j.height*=S,r=j.getContext("2d"),r.scale(S,S),n=new p}return e?(l(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test pass")}),l(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test fail")}),e.appendChild(y),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e=m.suiteURL(t),n=i('
                      • %s

                      • ',e,h(t.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}}),t.on("suite end",function(t){t.root||C.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=v.tests/this.total*100|0;n&&n.update(e).draw(r);var o=new d-v.start;if(u(b,v.passes),u(k,v.failures),u(E,(o/1e3).toFixed(2)),"passed"==t.state)var s=m.testURL(t),a=i('
                      • %e%ems ‣

                      • ',t.speed,t.title,t.duration,s);else if(t.pending)var a=i('
                      • %e

                      • ',t.title);else{var a=i('
                      • %e ‣

                      • ',t.title,encodeURIComponent(t.fullTitle())),c=t.err.stack||t.err.toString();~c.indexOf(t.err.message)||(c=t.err.message+"\n"+c),"[object Error]"==c&&(c=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(c+="\n("+t.err.sourceURL+":"+t.err.line+")"),a.appendChild(i('
                        %e
                        ',c))}if(!t.pending){var p=a.getElementsByTagName("h2")[0];l(p,"click",function(){h.style.display="none"==h.style.display?"block":"none"});var h=i("
                        %e
                        ",f.clean(t.fn.toString()));a.appendChild(h),h.style.display="none"}C[0]&&C[0].appendChild(a)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                        %s
                        ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return h(e[r++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){o.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:r.map(i),passes:a.map(i)};o.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),i=t.total,l=o.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){o.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){o.stdout.write("# TOC\n"),o.stdout.write(a(t.suite)),o.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){o.stdout.write(""),o.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r="";i(n),i("_,------,"),i("\n"),i(n),r=t.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(n),r=t.tick?"_":"__";var o=t.tick?"~":"^";i(o+"|"+r+this.face()+" "),i("\n"),i(n),r=t.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){i("["+t+"A")},r.prototype.cursorDown=function(t){i("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=r*t|0,s=r-n;a.CR(),o.stdout.write(""),o.stdout.write(u("progress"," "+e.open)),o.stdout.write(Array(n).join(e.complete)),o.stdout.write(Array(s).join(e.incomplete)),o.stdout.write(u("progress",e.close)),e.verbose&&o.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){u.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function o(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,o.prototype=u.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){c(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},r.prototype.globals=function(t){this._allowedGlobals=t},r.prototype.run=function(t){function e(t){o||(o=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(r)return e(n);i.clearTimeout(),i.duration=new u-a,r=!0,t(n)}}var r,o,i=this,s=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&s&&(this.timer=l(function(){n(new Error("timeout of "+s+"ms exceeded")),i.timedOut=!0},s)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function i(){}function s(t,e){return c(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=c(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var a=n("browser/events").EventEmitter,u=n("browser/debug")("mocha:runner"),l=(n("./test"),n("./utils")),c=l.filter,f=(l.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=r,r.immediately=global.setImmediate||o.nextTick,i.prototype=a.prototype,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return u("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globalProps=function(){for(var t=l.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},r.prototype.hook=function(t,e){function n(t){var r=i[t];return r?s.failures&&o.bail()?e():(s.currentRunnable=r,r.ctx.currentTest=s.test,s.emit("hook",r),r.on("error",function(t){s.failHook(r,t)}),void r.run(function(o){r.removeAllListeners("error");var i=r.error();return i&&s.fail(s.test,i),o?(s.failHook(r,o),e(o)):(s.emit("hook end",r),delete r.ctx.currentTest,void n(++t))})):e()}var o=this.suite,i=o["_"+t],s=this;r.immediately(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},r.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return u("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){u("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return u("start"),this.on("end",function(){u("end"),o.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){u("finished running"),n.emit("end")}),o.on("uncaughtException",e),this},r.prototype.abort=function(){u("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.map=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++)r.push(e.call(n,t[o],o));return r},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,r=global.setTimeout,o=(global.setInterval,global.clearTimeout,global.clearInterval,{});o.exit=function(){},o.stdout={};var i=[];o.removeListener=function(t,e){if("uncaughtException"==t){global.onerror=function(){};var n=s.utils.indexOf(i,e);-1!=n&&i.splice(n,1)}},o.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},i.push(e))};var s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"});a.suite.removeAllListeners("pre-require");var u,l=[];s.Runner.immediately=function(t){l.push(t),u||(u=r(e,0))},a.throwError=function(t){throw s.utils.forEach(i,function(e){e(t)}),t},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=o}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.17.1/mocha.min.css b/ajax/libs/mocha/1.17.1/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.17.1/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.17.1/mocha.min.js b/ajax/libs/mocha/1.17.1/mocha.min.js new file mode 100644 index 000000000..10245c5eb --- /dev/null +++ b/ajax/libs/mocha/1.17.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new n).getTime();l.length&&(new n).getTime()-t<100;)l.shift()();u=l.length?r(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,o-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow),this.suite.on("pre-require",function(t){e.afterEach=t.afterEach||t.teardown,e.after=t.after||t.suiteTeardown,e.beforeEach=t.beforeEach||t.setup,e.before=t.before||t.suiteSetup,e.describe=t.describe||t.suite,e.it=t.it||t.test,e.setup=t.setup||t.beforeEach,e.suiteSetup=t.suiteSetup||t.before,e.suiteTeardown=t.suiteTeardown||t.after,e.suite=t.suite||t.describe,e.teardown=t.teardown||t.afterEach,e.test=t.test||t.it})}var i=n("browser/path"),s=n("./utils");e=t.exports=o,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(r){}if(!e)try{e=n(t)}catch(r){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(r){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},o.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options,o=new e.Runner(n),i=new this._reporter(o);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new y}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new y,e.duration=new y-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return i(++e,o)+" | "+t}).join("\n")}return n="\n"+b("diff removed","actual")+" "+b("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?o+c("diff added",t):"-"===t[0]?o+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=g.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function u(t,e,n){var r=n?l(t.actual):t.actual,o=n?l(t.expected):t.expected;return g["diff"+e](r,o).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return b(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){if(e=e||[],-1!==v.indexOf(e,t))return t;var n;return"[object Array]"=={}.toString.call(t)?(e.push(t),n=v.map(t,function(t){return p(t,e)}),e.pop()):"object"==typeof t&&null!==t?(e.push(t),n={},v.forEach(v.keys(t).sort(),function(r){n[r]=p(t[r],e)}),e.pop()):n=t,n}function h(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var d=n("browser/tty"),g=n("browser/diff"),m=n("../ms"),v=n("../utils"),y=global.Date,w=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,d.isatty(1)&&d.isatty(2));e=t.exports=r,e.useColors=w||void 0!==o.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==o.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var b=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:w?o.stdout.getWindowSize?o.stdout.getWindowSize(1)[0]:d.getWindowSize()[1]:75},e.cursor={hide:function(){w&&o.stdout.write("[?25l")},show:function(){w&&o.stdout.write("[?25h")},deleteLine:function(){w&&o.stdout.write("")},beginningOfLine:function(){w&&o.stdout.write("")},CR:function(){w?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):o.stdout.write("\r")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=b("error title"," %s) %s:\n")+b("error message"," %s")+b("error stack","\n%s\n"),o=t.err,i=o.message||"",u=o.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),d=o.actual,g=o.expected,m=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&h(d,g)&&(m=!1,o.actual=d=f(p(d)),o.expected=g=f(p(g))),"string"==typeof d&&"string"==typeof g){r=b("error title"," %s) %s:\n%s")+b("error stack","\n%s\n");var v=i.match(/^([^:]+): expected/);c="\n "+b("error message",v?v[1]:c),c+=e.inlineDiffs?s(o,m):a(o,m)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,u)})},r.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=b("bright pass"," ")+b("green"," %d passing")+b("light"," (%s)"),console.log(t,e.passes||0,m(e.duration)),e.pending&&(t=b("pending"," ")+b("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=b("fail"," %d failing"),console.error(t,e.failures),r.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                        ',e()),++n,console.log("%s

                        %s

                        ",e(),i.escape(t.title)),console.log("%s
                        ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                        ",e()),--n,console.log("%s
                        ",e()),--n)}),t.on("pass",function(t){console.log("%s
                        %s
                        ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                        %s
                        ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){o.stdout.write("\n ")}),t.on("pending",function(){o.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&o.stdout.write("\n "),o.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&o.stdout.write("\n "),o.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){o.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t,e){c.call(this,t);var n,r,m=this,v=this.stats,y=(t.total,i(g)),w=y.getElementsByTagName("li"),b=w[1].getElementsByTagName("em")[0],x=w[1].getElementsByTagName("a")[0],k=w[2].getElementsByTagName("em")[0],T=w[2].getElementsByTagName("a")[0],E=w[3].getElementsByTagName("em")[0],j=y.getElementsByTagName("canvas")[0],_=i('
                          '),C=[_];if(e=e||document.getElementById("mocha"),j.getContext){var S=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=S,j.height*=S,r=j.getContext("2d"),r.scale(S,S),n=new p}return e?(l(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test pass")}),l(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test fail")}),e.appendChild(y),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e=m.suiteURL(t),n=i('
                        • %s

                        • ',e,h(t.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}}),t.on("suite end",function(t){t.root||C.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=v.tests/this.total*100|0;n&&n.update(e).draw(r);var o=new d-v.start;if(u(b,v.passes),u(k,v.failures),u(E,(o/1e3).toFixed(2)),"passed"==t.state)var s=m.testURL(t),a=i('
                        • %e%ems ‣

                        • ',t.speed,t.title,t.duration,s);else if(t.pending)var a=i('
                        • %e

                        • ',t.title);else{var a=i('
                        • %e ‣

                        • ',t.title,encodeURIComponent(t.fullTitle())),c=t.err.stack||t.err.toString();~c.indexOf(t.err.message)||(c=t.err.message+"\n"+c),"[object Error]"==c&&(c=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(c+="\n("+t.err.sourceURL+":"+t.err.line+")"),a.appendChild(i('
                          %e
                          ',c))}if(!t.pending){var p=a.getElementsByTagName("h2")[0];l(p,"click",function(){h.style.display="none"==h.style.display?"block":"none"});var h=i("
                          %e
                          ",f.clean(t.fn.toString()));a.appendChild(h),h.style.display="none"}C[0]&&C[0].appendChild(a)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                          %s
                          ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return h(e[r++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){o.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:r.map(i),passes:a.map(i)};o.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),i=t.total,l=o.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){o.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){o.stdout.write("# TOC\n"),o.stdout.write(a(t.suite)),o.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){o.stdout.write(""),o.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r="";i(n),i("_,------,"),i("\n"),i(n),r=t.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(n),r=t.tick?"_":"__";var o=t.tick?"~":"^";i(o+"|"+r+this.face()+" "),i("\n"),i(n),r=t.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){i("["+t+"A")},r.prototype.cursorDown=function(t){i("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=r*t|0,s=r-n;a.CR(),o.stdout.write(""),o.stdout.write(u("progress"," "+e.open)),o.stdout.write(Array(n).join(e.complete)),o.stdout.write(Array(s).join(e.incomplete)),o.stdout.write(u("progress",e.close)),e.verbose&&o.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){u.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function o(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,o.prototype=u.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){c(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},r.prototype.globals=function(t){this._allowedGlobals=t},r.prototype.run=function(t){function e(t){o||(o=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(r)return e(n);i.clearTimeout(),i.duration=new u-a,r=!0,t(n)}}var r,o,i=this,s=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&s&&(this.timer=l(function(){n(new Error("timeout of "+s+"ms exceeded")),i.timedOut=!0},s)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(a()))}function i(){}function s(t,e){return f(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=f(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}function a(){if("object"==typeof o&&"string"==typeof o.version){var t=o.version.split(".").reduce(function(t,e){return t<<8|e});if(2315>t)return["errno"]}return[]}var u=n("browser/events").EventEmitter,l=n("browser/debug")("mocha:runner"),c=(n("./test"),n("./utils")),f=c.filter,p=(c.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=r,r.immediately=global.setImmediate||o.nextTick,i.prototype=u.prototype,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return l("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globalProps=function(){for(var t=c.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},r.prototype.hook=function(t,e){function n(t){var r=i[t];return r?s.failures&&o.bail()?e():(s.currentRunnable=r,r.ctx.currentTest=s.test,s.emit("hook",r),r.on("error",function(t){s.failHook(r,t)}),void r.run(function(o){r.removeAllListeners("error");var i=r.error();return i&&s.fail(s.test,i),o?(s.failHook(r,o),e(o)):(s.emit("hook end",r),delete r.ctx.currentTest,void n(++t))})):e()}var o=this.suite,i=o["_"+t],s=this;r.immediately(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},r.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return l("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){l("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return l("start"),this.on("end",function(){l("end"),o.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){l("finished running"),n.emit("end")}),o.on("uncaughtException",e),this},r.prototype.abort=function(){l("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.map=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++)r.push(e.call(n,t[o],o));return r},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,r=global.setTimeout,o=(global.setInterval,global.clearTimeout,global.clearInterval,{});o.exit=function(){},o.stdout={};var i=[];o.removeListener=function(t,e){if("uncaughtException"==t){global.onerror=function(){};var n=s.utils.indexOf(i,e);-1!=n&&i.splice(n,1)}},o.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},i.push(e))};var s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"});a.suite.removeAllListeners("pre-require");var u,l=[];s.Runner.immediately=function(t){l.push(t),u||(u=r(e,0))},a.throwError=function(t){throw s.utils.forEach(i,function(e){e(t)}),t},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=o}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.18.0/mocha.min.css b/ajax/libs/mocha/1.18.0/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.18.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.18.0/mocha.min.js b/ajax/libs/mocha/1.18.0/mocha.min.js new file mode 100644 index 000000000..bc7daaf81 --- /dev/null +++ b/ajax/libs/mocha/1.18.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new n).getTime();l.length&&(new n).getTime()-t<100;)l.shift()();u=l.length?r(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,o-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow),this.suite.on("pre-require",function(t){e.afterEach=t.afterEach||t.teardown,e.after=t.after||t.suiteTeardown,e.beforeEach=t.beforeEach||t.setup,e.before=t.before||t.suiteSetup,e.describe=t.describe||t.suite,e.it=t.it||t.test,e.setup=t.setup||t.beforeEach,e.suiteSetup=t.suiteSetup||t.before,e.suiteTeardown=t.suiteTeardown||t.after,e.suite=t.suite||t.describe,e.teardown=t.teardown||t.afterEach,e.test=t.test||t.it})}var i=n("browser/path"),s=n("./utils");e=t.exports=o,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(r){}if(!e)try{e=n(t)}catch(r){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(r){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},o.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options,o=new e.Runner(n),i=new this._reporter(o);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new y}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new y,e.duration=new y-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return i(++e,o)+" | "+t}).join("\n")}return n="\n"+b("diff removed","actual")+" "+b("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?o+c("diff added",t):"-"===t[0]?o+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=g.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function u(t,e,n){var r=n?l(t.actual):t.actual,o=n?l(t.expected):t.expected;return g["diff"+e](r,o).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return b(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){if(e=e||[],-1!==v.indexOf(e,t))return t;var n;return"[object Array]"=={}.toString.call(t)?(e.push(t),n=v.map(t,function(t){return p(t,e)}),e.pop()):"object"==typeof t&&null!==t?(e.push(t),n={},v.forEach(v.keys(t).sort(),function(r){n[r]=p(t[r],e)}),e.pop()):n=t,n}function h(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var d=n("browser/tty"),g=n("browser/diff"),m=n("../ms"),v=n("../utils"),y=global.Date,w=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,d.isatty(1)&&d.isatty(2));e=t.exports=r,e.useColors=w||void 0!==o.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==o.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var b=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:w?o.stdout.getWindowSize?o.stdout.getWindowSize(1)[0]:d.getWindowSize()[1]:75},e.cursor={hide:function(){w&&o.stdout.write("[?25l")},show:function(){w&&o.stdout.write("[?25h")},deleteLine:function(){w&&o.stdout.write("")},beginningOfLine:function(){w&&o.stdout.write("")},CR:function(){w?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):o.stdout.write("\r")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=b("error title"," %s) %s:\n")+b("error message"," %s")+b("error stack","\n%s\n"),o=t.err,i=o.message||"",u=o.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),d=o.actual,g=o.expected,m=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&h(d,g)&&(m=!1,o.actual=d=f(p(d)),o.expected=g=f(p(g))),"string"==typeof d&&"string"==typeof g){r=b("error title"," %s) %s:\n%s")+b("error stack","\n%s\n");var v=i.match(/^([^:]+): expected/);c="\n "+b("error message",v?v[1]:c),c+=e.inlineDiffs?s(o,m):a(o,m)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,u)})},r.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=b("bright pass"," ")+b("green"," %d passing")+b("light"," (%s)"),console.log(t,e.passes||0,m(e.duration)),e.pending&&(t=b("pending"," ")+b("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=b("fail"," %d failing"),console.error(t,e.failures),r.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                          ',e()),++n,console.log("%s

                          %s

                          ",e(),i.escape(t.title)),console.log("%s
                          ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                          ",e()),--n,console.log("%s
                          ",e()),--n)}),t.on("pass",function(t){console.log("%s
                          %s
                          ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                          %s
                          ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){o.stdout.write("\n ")}),t.on("pending",function(){o.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&o.stdout.write("\n "),o.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&o.stdout.write("\n "),o.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){o.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t,e){c.call(this,t);var n,r,m=this,v=this.stats,y=(t.total,i(g)),w=y.getElementsByTagName("li"),b=w[1].getElementsByTagName("em")[0],x=w[1].getElementsByTagName("a")[0],k=w[2].getElementsByTagName("em")[0],T=w[2].getElementsByTagName("a")[0],E=w[3].getElementsByTagName("em")[0],j=y.getElementsByTagName("canvas")[0],_=i('
                            '),C=[_];if(e=e||document.getElementById("mocha"),j.getContext){var S=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=S,j.height*=S,r=j.getContext("2d"),r.scale(S,S),n=new p}return e?(l(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test pass")}),l(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test fail")}),e.appendChild(y),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e=m.suiteURL(t),n=i('
                          • %s

                          • ',e,h(t.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}}),t.on("suite end",function(t){t.root||C.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=v.tests/this.total*100|0;n&&n.update(e).draw(r);var o=new d-v.start;if(u(b,v.passes),u(k,v.failures),u(E,(o/1e3).toFixed(2)),"passed"==t.state)var s=m.testURL(t),a=i('
                          • %e%ems ‣

                          • ',t.speed,t.title,t.duration,s);else if(t.pending)var a=i('
                          • %e

                          • ',t.title);else{var a=i('
                          • %e ‣

                          • ',t.title,encodeURIComponent(t.fullTitle())),c=t.err.stack||t.err.toString();~c.indexOf(t.err.message)||(c=t.err.message+"\n"+c),"[object Error]"==c&&(c=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(c+="\n("+t.err.sourceURL+":"+t.err.line+")"),a.appendChild(i('
                            %e
                            ',c))}if(!t.pending){var p=a.getElementsByTagName("h2")[0];l(p,"click",function(){h.style.display="none"==h.style.display?"block":"none"});var h=i("
                            %e
                            ",f.clean(t.fn.toString()));a.appendChild(h),h.style.display="none"}C[0]&&C[0].appendChild(a)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                            %s
                            ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return h(e[r++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){o.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:r.map(i),passes:a.map(i)};o.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),i=t.total,l=o.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){o.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){o.stdout.write("# TOC\n"),o.stdout.write(a(t.suite)),o.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){o.stdout.write(""),o.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r="";i(n),i("_,------,"),i("\n"),i(n),r=t.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(n),r=t.tick?"_":"__";var o=t.tick?"~":"^";i(o+"|"+r+this.face()+" "),i("\n"),i(n),r=t.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){i("["+t+"A")},r.prototype.cursorDown=function(t){i("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=r*t|0,s=r-n;a.CR(),o.stdout.write(""),o.stdout.write(u("progress"," "+e.open)),o.stdout.write(Array(n).join(e.complete)),o.stdout.write(Array(s).join(e.incomplete)),o.stdout.write(u("progress",e.close)),e.verbose&&o.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){u.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function o(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,o.prototype=u.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){c(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},r.prototype.globals=function(t){this._allowedGlobals=t},r.prototype.run=function(t){function e(t){i||(i=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new u-a,o=!0,t(n)}}function r(t){var e=t.call(l);e&&"function"==typeof e.then?(s.resetTimeout(),e.then(function(){n()},n)):n()}var o,i,s=this,a=(this.timeout(),new u),l=this.ctx;if(l&&l.runnable(this),this.callback=n,this.async){this.resetTimeout();try{this.fn.call(l,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending?n():r(this.fn)}catch(c){n(c)}}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(a()))}function i(){}function s(t,e){return f(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=f(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}function a(){if("object"==typeof o&&"string"==typeof o.version){var t=o.version.split(".").reduce(function(t,e){return t<<8|e});if(2315>t)return["errno"]}return[]}var u=n("browser/events").EventEmitter,l=n("browser/debug")("mocha:runner"),c=(n("./test"),n("./utils")),f=c.filter,p=(c.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=r,r.immediately=global.setImmediate||o.nextTick,i.prototype=u.prototype,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return l("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globalProps=function(){for(var t=c.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},r.prototype.hook=function(t,e){function n(t){var r=i[t];return r?s.failures&&o.bail()?e():(s.currentRunnable=r,r.ctx.currentTest=s.test,s.emit("hook",r),r.on("error",function(t){s.failHook(r,t)}),void r.run(function(o){r.removeAllListeners("error");var i=r.error();return i&&s.fail(s.test,i),o?(s.failHook(r,o),e(o)):(s.emit("hook end",r),delete r.ctx.currentTest,void n(++t))})):e()}var o=this.suite,i=o["_"+t],s=this;r.immediately(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},r.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return l("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){l("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return l("start"),this.on("end",function(){l("end"),o.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){l("finished running"),n.emit("end")}),o.on("uncaughtException",e),this},r.prototype.abort=function(){l("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeAll.push(n),this.emit("beforeAll",n),this},r.prototype.afterAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterAll.push(n),this.emit("afterAll",n),this},r.prototype.beforeEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeEach.push(n),this.emit("beforeEach",n),this},r.prototype.afterEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterEach.push(n),this.emit("afterEach",n),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.map=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++)r.push(e.call(n,t[o],o));return r},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,r=global.setTimeout,o=(global.setInterval,global.clearTimeout,global.clearInterval,{});o.exit=function(){},o.stdout={};var i=[];o.removeListener=function(t,e){if("uncaughtException"==t){global.onerror=function(){};var n=s.utils.indexOf(i,e);-1!=n&&i.splice(n,1)}},o.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},i.push(e))};var s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"});a.suite.removeAllListeners("pre-require");var u,l=[];s.Runner.immediately=function(t){l.push(t),u||(u=r(e,0))},a.throwError=function(t){throw s.utils.forEach(i,function(e){e(t)}),t},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=o}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.18.1/mocha.min.css b/ajax/libs/mocha/1.18.1/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.18.1/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.18.1/mocha.min.js b/ajax/libs/mocha/1.18.1/mocha.min.js new file mode 100644 index 000000000..86a073863 --- /dev/null +++ b/ajax/libs/mocha/1.18.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new n).getTime();l.length&&(new n).getTime()-t<100;)l.shift()();u=l.length?r(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,o-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t,n){e[0].beforeEach(t,n)},t.teardown=function(t,n){e[0].afterEach(t,n)},t.suiteSetup=function(t,n){e[0].beforeAll(t,n)},t.suiteTeardown=function(t,n){e[0].afterAll(t,n)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow),this.suite.on("pre-require",function(t){e.afterEach=t.afterEach||t.teardown,e.after=t.after||t.suiteTeardown,e.beforeEach=t.beforeEach||t.setup,e.before=t.before||t.suiteSetup,e.describe=t.describe||t.suite,e.it=t.it||t.test,e.setup=t.setup||t.beforeEach,e.suiteSetup=t.suiteSetup||t.before,e.suiteTeardown=t.suiteTeardown||t.after,e.suite=t.suite||t.describe,e.teardown=t.teardown||t.afterEach,e.test=t.test||t.it})}var i=n("browser/path"),s=n("./utils");e=t.exports=o,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(r){}if(!e)try{e=n(t)}catch(r){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(r){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},o.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options;r.files=this.files;var o=new e.Runner(n),i=new this._reporter(o,r);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new y}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new y,e.duration=new y-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return i(++e,o)+" | "+t}).join("\n")}return n="\n"+b("diff removed","actual")+" "+b("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?o+c("diff added",t):"-"===t[0]?o+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=g.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function u(t,e,n){var r=n?l(t.actual):t.actual,o=n?l(t.expected):t.expected;return g["diff"+e](r,o).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return b(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){if(e=e||[],-1!==v.indexOf(e,t))return t;var n;return"[object Array]"=={}.toString.call(t)?(e.push(t),n=v.map(t,function(t){return p(t,e)}),e.pop()):"object"==typeof t&&null!==t?(e.push(t),n={},v.forEach(v.keys(t).sort(),function(r){n[r]=p(t[r],e)}),e.pop()):n=t,n}function h(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var d=n("browser/tty"),g=n("browser/diff"),m=n("../ms"),v=n("../utils"),y=global.Date,w=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,d.isatty(1)&&d.isatty(2));e=t.exports=r,e.useColors=w||void 0!==o.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==o.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var b=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:w?o.stdout.getWindowSize?o.stdout.getWindowSize(1)[0]:d.getWindowSize()[1]:75},e.cursor={hide:function(){w&&o.stdout.write("[?25l")},show:function(){w&&o.stdout.write("[?25h")},deleteLine:function(){w&&o.stdout.write("")},beginningOfLine:function(){w&&o.stdout.write("")},CR:function(){w?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):o.stdout.write("\r")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=b("error title"," %s) %s:\n")+b("error message"," %s")+b("error stack","\n%s\n"),o=t.err,i=o.message||"",u=o.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),d=o.actual,g=o.expected,m=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&h(d,g)&&(m=!1,o.actual=d=f(p(d)),o.expected=g=f(p(g))),"string"==typeof d&&"string"==typeof g){r=b("error title"," %s) %s:\n%s")+b("error stack","\n%s\n");var v=i.match(/^([^:]+): expected/);c="\n "+b("error message",v?v[1]:c),c+=e.inlineDiffs?s(o,m):a(o,m)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,u)})},r.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=b("bright pass"," ")+b("green"," %d passing")+b("light"," (%s)"),console.log(t,e.passes||0,m(e.duration)),e.pending&&(t=b("pending"," ")+b("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=b("fail"," %d failing"),console.error(t,e.failures),r.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                            ',e()),++n,console.log("%s

                            %s

                            ",e(),i.escape(t.title)),console.log("%s
                            ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                            ",e()),--n,console.log("%s
                            ",e()),--n)}),t.on("pass",function(t){console.log("%s
                            %s
                            ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                            %s
                            ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){o.stdout.write("\n ")}),t.on("pending",function(){o.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&o.stdout.write("\n "),o.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&o.stdout.write("\n "),o.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){o.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t,e){c.call(this,t);var n,r,m=this,v=this.stats,y=(t.total,i(g)),w=y.getElementsByTagName("li"),b=w[1].getElementsByTagName("em")[0],x=w[1].getElementsByTagName("a")[0],k=w[2].getElementsByTagName("em")[0],T=w[2].getElementsByTagName("a")[0],E=w[3].getElementsByTagName("em")[0],j=y.getElementsByTagName("canvas")[0],_=i('
                              '),C=[_];if(e=e||document.getElementById("mocha"),j.getContext){var S=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=S,j.height*=S,r=j.getContext("2d"),r.scale(S,S),n=new p}return e?(l(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test pass")}),l(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&s("test fail")}),e.appendChild(y),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e=m.suiteURL(t),n=i('
                            • %s

                            • ',e,h(t.title));C[0].appendChild(n),C.unshift(document.createElement("ul")),n.appendChild(C[0])}}),t.on("suite end",function(t){t.root||C.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=v.tests/this.total*100|0;n&&n.update(e).draw(r);var o=new d-v.start;if(u(b,v.passes),u(k,v.failures),u(E,(o/1e3).toFixed(2)),"passed"==t.state)var s=m.testURL(t),a=i('
                            • %e%ems ‣

                            • ',t.speed,t.title,t.duration,s);else if(t.pending)var a=i('
                            • %e

                            • ',t.title);else{var a=i('
                            • %e ‣

                            • ',t.title,encodeURIComponent(t.fullTitle())),c=t.err.stack||t.err.toString();~c.indexOf(t.err.message)||(c=t.err.message+"\n"+c),"[object Error]"==c&&(c=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(c+="\n("+t.err.sourceURL+":"+t.err.line+")"),a.appendChild(i('
                              %e
                              ',c))}if(!t.pending){var p=a.getElementsByTagName("h2")[0];l(p,"click",function(){h.style.display="none"==h.style.display?"block":"none"});var h=i("
                              %e
                              ",f.clean(t.fn.toString()));a.appendChild(h),h.style.display="none"}C[0]&&C[0].appendChild(a)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                              %s
                              ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return h(e[r++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){o.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:r.map(i),passes:a.map(i)};o.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),i=t.total,l=o.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){o.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){o.stdout.write("# TOC\n"),o.stdout.write(a(t.suite)),o.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){o.stdout.write(""),o.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r="";i(n),i("_,------,"),i("\n"),i(n),r=t.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(n),r=t.tick?"_":"__";var o=t.tick?"~":"^";i(o+"|"+r+this.face()+" "),i("\n"),i(n),r=t.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){i("["+t+"A")},r.prototype.cursorDown=function(t){i("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=r*t|0,s=r-n;a.CR(),o.stdout.write(""),o.stdout.write(u("progress"," "+e.open)),o.stdout.write(Array(n).join(e.complete)),o.stdout.write(Array(s).join(e.incomplete)),o.stdout.write(u("progress",e.close)),e.verbose&&o.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){u.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function o(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,o.prototype=u.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){c(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},r.prototype.globals=function(t){this._allowedGlobals=t},r.prototype.run=function(t){function e(t){i||(i=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new u-a,o=!0,t(n)}}function r(t){var e=t.call(l);e&&"function"==typeof e.then?(s.resetTimeout(),e.then(function(){n()},n)):n()}var o,i,s=this,a=(this.timeout(),new u),l=this.ctx;if(l&&l.runnable(this),this.callback=n,this.async){this.resetTimeout();try{this.fn.call(l,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending?n():r(this.fn)}catch(c){n(c)}}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(a()))}function i(){}function s(t,e){return f(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=f(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}function a(){if("object"==typeof o&&"string"==typeof o.version){var t=o.version.split(".").reduce(function(t,e){return t<<8|e});if(2315>t)return["errno"]}return[]}var u=n("browser/events").EventEmitter,l=n("browser/debug")("mocha:runner"),c=(n("./test"),n("./utils")),f=c.filter,p=(c.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=r,r.immediately=global.setImmediate||o.nextTick,i.prototype=u.prototype,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return l("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globalProps=function(){for(var t=c.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},r.prototype.hook=function(t,e){function n(t){var r=i[t];return r?s.failures&&o.bail()?e():(s.currentRunnable=r,r.ctx.currentTest=s.test,s.emit("hook",r),r.on("error",function(t){s.failHook(r,t)}),void r.run(function(o){r.removeAllListeners("error");var i=r.error();return i&&s.fail(s.test,i),o?(s.failHook(r,o),e(o)):(s.emit("hook end",r),delete r.ctx.currentTest,void n(++t))})):e()}var o=this.suite,i=o["_"+t],s=this;r.immediately(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},r.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return l("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){l("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return l("start"),this.on("end",function(){l("end"),o.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){l("finished running"),n.emit("end")}),o.on("uncaughtException",e),this},r.prototype.abort=function(){l("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeAll.push(n),this.emit("beforeAll",n),this},r.prototype.afterAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterAll.push(n),this.emit("afterAll",n),this},r.prototype.beforeEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeEach.push(n),this.emit("beforeEach",n),this},r.prototype.afterEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterEach.push(n),this.emit("afterEach",n),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.map=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++)r.push(e.call(n,t[o],o));return r},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,r=global.setTimeout,o=(global.setInterval,global.clearTimeout,global.clearInterval,{});o.exit=function(){},o.stdout={};var i=[];o.removeListener=function(t,e){if("uncaughtException"==t){global.onerror=function(){};var n=s.utils.indexOf(i,e);-1!=n&&i.splice(n,1)}},o.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},i.push(e))};var s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"});a.suite.removeAllListeners("pre-require");var u,l=[];s.Runner.immediately=function(t){l.push(t),u||(u=r(e,0))},a.throwError=function(t){throw s.utils.forEach(i,function(e){e(t)}),t},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=o}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.19.0/mocha.min.css b/ajax/libs/mocha/1.19.0/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.19.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.19.0/mocha.min.js b/ajax/libs/mocha/1.19.0/mocha.min.js new file mode 100644 index 000000000..bc0a52362 --- /dev/null +++ b/ajax/libs/mocha/1.19.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new n).getTime();l.length&&(new n).getTime()-t<100;)l.shift()();u=l.length?r(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,o-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t,n){e[0].beforeEach(t,n)},t.teardown=function(t,n){e[0].afterEach(t,n)},t.suiteSetup=function(t,n){e[0].beforeAll(t,n)},t.suiteTeardown=function(t,n){e[0].afterAll(t,n)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow),this.suite.on("pre-require",function(t){e.afterEach=t.afterEach||t.teardown,e.after=t.after||t.suiteTeardown,e.beforeEach=t.beforeEach||t.setup,e.before=t.before||t.suiteSetup,e.describe=t.describe||t.suite,e.it=t.it||t.test,e.setup=t.setup||t.beforeEach,e.suiteSetup=t.suiteSetup||t.before,e.suiteTeardown=t.suiteTeardown||t.after,e.suite=t.suite||t.describe,e.teardown=t.teardown||t.afterEach,e.test=t.test||t.it})}var i=n("browser/path"),s=n("./utils");e=t.exports=o,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(r){}if(!e)try{e=n(t)}catch(r){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(r){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},o.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options;r.files=this.files;var o=new e.Runner(n),i=new this._reporter(o,r);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new y}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new y,e.duration=new y-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return i(++e,o)+" | "+t}).join("\n")}return n="\n"+b("diff removed","actual")+" "+b("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?o+c("diff added",t):"-"===t[0]?o+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=g.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function u(t,e,n){var r=n?l(t.actual):t.actual,o=n?l(t.expected):t.expected;return g["diff"+e](r,o).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return b(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){if(e=e||[],-1!==v.indexOf(e,t))return t;var n;return"[object Array]"=={}.toString.call(t)?(e.push(t),n=v.map(t,function(t){return p(t,e)}),e.pop()):"object"==typeof t&&null!==t?(e.push(t),n={},v.forEach(v.keys(t).sort(),function(r){n[r]=p(t[r],e)}),e.pop()):n=t,n}function h(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var d=n("browser/tty"),g=n("browser/diff"),m=n("../ms"),v=n("../utils"),y=global.Date,w=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,d.isatty(1)&&d.isatty(2));e=t.exports=r,e.useColors=w||void 0!==o.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==o.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var b=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:w?o.stdout.getWindowSize?o.stdout.getWindowSize(1)[0]:d.getWindowSize()[1]:75},e.cursor={hide:function(){w&&o.stdout.write("[?25l")},show:function(){w&&o.stdout.write("[?25h")},deleteLine:function(){w&&o.stdout.write("")},beginningOfLine:function(){w&&o.stdout.write("")},CR:function(){w?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):o.stdout.write("\r")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=b("error title"," %s) %s:\n")+b("error message"," %s")+b("error stack","\n%s\n"),o=t.err,i=o.message||"",u=o.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),d=o.actual,g=o.expected,m=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&h(d,g)&&(m=!1,o.actual=d=f(p(d)),o.expected=g=f(p(g))),"string"==typeof d&&"string"==typeof g){r=b("error title"," %s) %s:\n%s")+b("error stack","\n%s\n");var v=i.match(/^([^:]+): expected/);c="\n "+b("error message",v?v[1]:c),c+=e.inlineDiffs?s(o,m):a(o,m)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,u)})},r.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=b("bright pass"," ")+b("green"," %d passing")+b("light"," (%s)"),console.log(t,e.passes||0,m(e.duration)),e.pending&&(t=b("pending"," ")+b("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=b("fail"," %d failing"),console.error(t,e.failures),r.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                              ',e()),++n,console.log("%s

                              %s

                              ",e(),i.escape(t.title)),console.log("%s
                              ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                              ",e()),--n,console.log("%s
                              ",e()),--n)}),t.on("pass",function(t){console.log("%s
                              %s
                              ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                              %s
                              ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){o.stdout.write("\n ")}),t.on("pending",function(){o.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&o.stdout.write("\n "),o.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&o.stdout.write("\n "),o.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){o.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t){c.call(this,t);var e,n,r=this,m=this.stats,v=(t.total,i(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],E=v.getElementsByTagName("canvas")[0],j=i('
                                '),_=[j],C=document.getElementById("mocha");if(E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,n=E.getContext("2d"),n.scale(S,S),e=new p}return C?(l(b,"click",function(){a();var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&s("test pass")}),l(k,"click",function(){a();var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&s("test fail")}),C.appendChild(v),C.appendChild(j),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r.suiteURL(t),n=i('
                              • %s

                              • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var o=m.tests/this.total*100|0;e&&e.update(o).draw(n);var s=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(s/1e3).toFixed(2)),"passed"==t.state)var a=r.testURL(t),c=i('
                              • %e%ems ‣

                              • ',t.speed,t.title,t.duration,a);else if(t.pending)var c=i('
                              • %e

                              • ',t.title);else{var c=i('
                              • %e ‣

                              • ',t.title,encodeURIComponent(t.fullTitle())),p=t.err.stack||t.err.toString();~p.indexOf(t.err.message)||(p=t.err.message+"\n"+p),"[object Error]"==p&&(p=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(p+="\n("+t.err.sourceURL+":"+t.err.line+")"),c.appendChild(i('
                                %e
                                ',p))}if(!t.pending){var h=c.getElementsByTagName("h2")[0];l(h,"click",function(){g.style.display="none"==g.style.display?"block":"none"});var g=i("
                                %e
                                ",f.clean(t.fn.toString()));c.appendChild(g),g.style.display="none"}_[0]&&_[0].appendChild(c)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                                %s
                                ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return h(e[r++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){o.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:r.map(i),passes:a.map(i)};o.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),i=t.total,l=o.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){o.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){o.stdout.write("# TOC\n"),o.stdout.write(a(t.suite)),o.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){o.stdout.write(""),o.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r="";i(n),i("_,------,"),i("\n"),i(n),r=t.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(n),r=t.tick?"_":"__";var o=t.tick?"~":"^";i(o+"|"+r+this.face()+" "),i("\n"),i(n),r=t.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){i("["+t+"A")},r.prototype.cursorDown=function(t){i("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=r*t|0,s=r-n;a.CR(),o.stdout.write(""),o.stdout.write(u("progress"," "+e.open)),o.stdout.write(Array(n).join(e.complete)),o.stdout.write(Array(s).join(e.incomplete)),o.stdout.write(u("progress",e.close)),e.verbose&&o.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){u.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function o(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,o.prototype=u.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){c(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},r.prototype.globals=function(t){this._allowedGlobals=t},r.prototype.run=function(t){function e(t){i||(i=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new u-a,o=!0,t(n)}}function r(t){var e=t.call(l);e&&"function"==typeof e.then?(s.resetTimeout(),e.then(function(){n()},n)):n()}var o,i,s=this,a=(this.timeout(),new u),l=this.ctx;if(l&&l.runnable(this),this.callback=n,this.async){this.resetTimeout();try{this.fn.call(l,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending?n():r(this.fn)}catch(c){n(c)}}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(a()))}function i(){}function s(t,e){return f(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=f(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}function a(){if("object"==typeof o&&"string"==typeof o.version){var t=o.version.split(".").reduce(function(t,e){return t<<8|e});if(2315>t)return["errno"]}return[]}var u=n("browser/events").EventEmitter,l=n("browser/debug")("mocha:runner"),c=(n("./test"),n("./utils")),f=c.filter,p=(c.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=r,r.immediately=global.setImmediate||o.nextTick,i.prototype=u.prototype,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return l("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globalProps=function(){for(var t=c.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},r.prototype.hook=function(t,e){function n(t){var r=i[t];return r?s.failures&&o.bail()?e():(s.currentRunnable=r,r.ctx.currentTest=s.test,s.emit("hook",r),r.on("error",function(t){s.failHook(r,t)}),void r.run(function(o){r.removeAllListeners("error");var i=r.error();return i&&s.fail(s.test,i),o?(s.failHook(r,o),e(o)):(s.emit("hook end",r),delete r.ctx.currentTest,void n(++t))})):e()}var o=this.suite,i=o["_"+t],s=this;r.immediately(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},r.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return l("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){l("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return l("start"),this.on("end",function(){l("end"),o.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){l("finished running"),n.emit("end")}),o.on("uncaughtException",e),this},r.prototype.abort=function(){l("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t;var n=function(){};n.prototype=e,this.ctx=new n,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeAll.push(n),this.emit("beforeAll",n),this},r.prototype.afterAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterAll.push(n),this.emit("afterAll",n),this},r.prototype.beforeEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeEach.push(n),this.emit("beforeEach",n),this},r.prototype.afterEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterEach.push(n),this.emit("afterEach",n),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.map=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++)r.push(e.call(n,t[o],o));return r},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,r=global.setTimeout,o=(global.setInterval,global.clearTimeout,global.clearInterval,{});o.exit=function(){},o.stdout={};var i=[];o.removeListener=function(t,e){if("uncaughtException"==t){global.onerror=function(){};var n=s.utils.indexOf(i,e);-1!=n&&i.splice(n,1)}},o.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},i.push(e))};var s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"});a.suite.removeAllListeners("pre-require");var u,l=[];s.Runner.immediately=function(t){l.push(t),u||(u=r(e,0))},a.throwError=function(t){throw s.utils.forEach(i,function(e){e(t)}),t},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=o}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.2.0/mocha.min.css b/ajax/libs/mocha/1.2.0/mocha.min.css new file mode 100644 index 000000000..32d94e79a --- /dev/null +++ b/ajax/libs/mocha/1.2.0/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.2.0/mocha.min.js b/ajax/libs/mocha/1.2.0/mocha.min.js new file mode 100644 index 000000000..476888ae4 --- /dev/null +++ b/ajax/libs/mocha/1.2.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var s=0;ss;s++)if(o[s]===e||o[s].listener&&o[s].listener===e){r=s;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),s=0,i=r.length;i>s;s++)r[s].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,s=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,s,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,s,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,r-l/2+1,s+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return this._runnable=t,this},e.prototype.timeout=function(t){return this._runnable.timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"==t?void 0:e},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.type="hook"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.it=t.specify=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var s;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var s=o.create(n[0],i);n.unshift(s),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var s=n("browser/path");e=t.exports=r,e.version="1.2.0",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(){var t=this.suite;this.files.forEach(function(e){e=s.resolve(e),t.emit("pre-require",global,e),t.emit("require",n(e),e),t.emit("post-require",global,e)})},r.prototype.growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var s=n.failures+" of "+t.total+" tests failed";r(s,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(t):t,this},r.prototype.run=function(t){this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),s=new this._reporter(r);return r.ignoreLeaks=o.ignoreLeaks,o.grep&&r.grep(o.grep),o.globals&&r.globals(o.globals),o.growl&&this.growl(r,s),r.run(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new c}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new c,n.duration=new c-n.start}),t.on("pending",function(){n.pending++}))}function r(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return/^(\n+)$/.test(t.value)&&(t.value=Array(++RegExp.$1.length).join("")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=global.Date,l=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=o,e.useColors=l,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:l?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),o=t.err,i=o.message||"",a=o.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),l=o.actual,p=o.expected;if("string"==typeof l&&"string"==typeof p){var h=Math.max(l.length,p.length);c=20>h?s(o,"Chars"):s(o,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return r(++e,g)+" | "+t}).join("\n")}c="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=f("bright fail"," ✖")+f("fail"," %d of %d %s failed")+f("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(e=f("bright pass"," ✔")+f("green"," %d %s complete")+f("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=f("pending"," •")+f("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                ',e()),++n,console.log("%s

                                %s

                                ",e(),t.title),console.log("%s
                                ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                ",e()),--n,console.log("%s
                                ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                %s
                                ",e(),t.title);var n=s.escape(s.clean(t.fn.toString()));console.log("%s
                                %s
                                ",e(),n)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(s("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?s("bright yellow","."):s(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(s("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=n("./base"),s=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",a=i.readFileSync(o,"utf8"),u=e.compile(a,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:r}))})}function r(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),i=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t){u.call(this,t);var e,n,o=this.stats,f=t.total,d=document.getElementById("mocha"),g=s(h),m=g.getElementsByTagName("li"),v=m[1].getElementsByTagName("em")[0],w=m[2].getElementsByTagName("em")[0],b=m[3].getElementsByTagName("em")[0],y=g.getElementsByTagName("canvas")[0],x=s('
                                  '),k=[x];return y.getContext&&(n=y.getContext("2d"),e=new l),d?(d.appendChild(g),d.appendChild(x),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=location.protocol+"//"+location.host+location.pathname+"?grep=^"+c.escapeRegexp(t.fullTitle()),n=s('
                                • %s

                                • ',e,t.title);k[0].appendChild(n),k.unshift(document.createElement("ul")),n.appendChild(k[0])}}),t.on("suite end",function(t){t.root||k.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){var r=o.tests/f*100|0;e&&e.update(r).draw(n);var u=new p-o.start;if(i(v,o.passes),i(w,o.failures),i(b,(u/1e3).toFixed(2)),"passed"==t.state)var l=s('
                                • %e%ems

                                • ',t.speed,t.title,t.duration);else if(t.pending)var l=s('
                                • %e

                                • ',t.title);else{var l=s('
                                • %e

                                • ',t.title),h=t.err.stack||t.err.toString();~h.indexOf(t.err.message)||(h=t.err.message+"\n"+h),"[object Error]"==h&&(h=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(h+="\n("+t.err.sourceURL+":"+t.err.line+")"),l.appendChild(s('
                                  %e
                                  ',h))}var d=l.getElementsByTagName("h2")[0];if(a(d,"click",function(){g.style.display="none"==g.style.display?"block":"none"}),!t.pending){var g=s("
                                  %e
                                  ",c.clean(t.fn.toString()));l.appendChild(g),g.style.display="none"}k[0].appendChild(l)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(s('
                                  %s
                                  ',t))}function s(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return f(e[o++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var u=n("./base"),c=n("../utils"),l=n("../browser/progress"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o;var h='
                                  • passes: 0
                                  • failures: 0
                                  • duration: 0s
                                  '}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function o(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var o=[],s=[],u=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=r(t);a.stats=n.stats,a.tests=o.map(i),a.failures=s.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function r(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var o=s(n,t[n]);e.files.push(o),e.hits+=o.hits,e.misses+=o.misses,e.sloc+=o.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(r),failures:o.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t,null,2))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}r.call(this,t);var n=this,o=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),s.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");s.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){s.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function i(t){var e=n(t,{});return o(e,0)}r.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=s.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=s.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var r=n("./base");e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){s.call(this,t);{var e=this,n=(this.stats,.75*s.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){s.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){s.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){r("["+t.scoreboardWidth+"C"),r(e.join("")),r("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(o){switch(r("["+n+"C"),o){case 0:r("_,------,"),r("\n");break;case 1:var s=e.tick?" ":" ";r("_|"+s+"/\\_/\\"),r("\n");break;case 2:var i,s=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}r(a+"|"+s+i),r("\n");break;case 3:var s=e.tick?" ":" ";r(s+'"" ""'),r("\n")}}),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){r("["+t+"A")},o.prototype.cursorDown=function(t){r("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),s=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*s+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){r.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),s.hide()}),t.on("test end",function(){u++;var t=u/a,n=o*t|0,r=o-n;s.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.progress=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}r.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){s.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,r(t))}),t.on("pass",function(t){console.log("ok %d %s",n,r(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,r(t)),console.log(e.stack.replace(/^/gm," "))})}function r(t){return t.fullTitle().replace(/#/g,"")}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){s.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var s=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,i(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,s=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+s,o&&(r+=o+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}{var r=n("browser/events").EventEmitter,s=n("browser/debug")("runnable"),i=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){u(this.timer)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(){r||(r=!0,s.emit("error",new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e();s.clearTimeout(),s.duration=new i-c,o=!0,t(n)}}var o,r,s=this,u=this.timeout(),c=new i,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),s.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new i-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function r(t){return u(c(global),function(e){var n=u(t,function(t){return 0==e.indexOf(t.split("*")[0])});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){e._grep.test(t.fullTitle())&&n++}),n},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r(this._globals);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=r[t];return o?(s.currentRunnable=o,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){return o.removeAllListeners("error"),e?s.failHook(o,e):(s.emit("hook end",o),void n(++t))})):e()}var o=this.suite,r=o["_"+t],s=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=s,n(t)):void o(e.pop())}):(r.suite=s,n())}var r=this,s=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return r.failures&&t._bail?e():(o=s.shift())?r._grep.test(o.fullTitle())?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n))})})):n():e()}var o,r=this,s=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var r=this.grepTotal(t),s=this,a=0;return i("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){s.runTests(t,n)})):e()},o.prototype.uncaught=function(t){i("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end") +},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var r=n("browser/events").EventEmitter,s=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return i.forEach(this.tests,t),i.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"==t[0]?void 0:"parent"==t?"#":e},2)}}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var r=n("browser/fs"),s=n("browser/path"),i=s.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var r=n,s=0,i=t.length;i>s;s++)r=e.call(o,r,t[s],s,t);return r},e.filter=function(t,e,n){for(var o=[],r=0,s=t.length;s>r;r++){var i=t[r];e.call(n,i,r,t)&&o.push(i)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),r.watchFile(t,n,function(n,o){o.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,o=e.length;o>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return r.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),o=e.slice(0,n),r=e.slice(++n);return t[o]=decodeURIComponent(r),t},{})}var o=new mocha.Suite("",new mocha.Context),r=mocha.utils,s={};mocha.setup=function(t){if("string"==typeof t?s.ui=t:s=t,ui=mocha.interfaces[s.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');s.timeout&&o.timeout(s.timeout),ui(o),o.emit("pre-require",window)},mocha.run=function(t){o.emit("run");var r=new mocha.Runner(o),i=s.reporter||mocha.reporters.HTML,a=(new i(r),n(window.location.search||""));return a.grep&&r.grep(new RegExp(a.grep)),s.ignoreLeaks&&(r.ignoreLeaks=!0),s.globals&&r.globals(s.globals),r.globals(["location"]),r.on("end",e),r.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.2.1/mocha.min.css b/ajax/libs/mocha/1.2.1/mocha.min.css new file mode 100644 index 000000000..32d94e79a --- /dev/null +++ b/ajax/libs/mocha/1.2.1/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.2.1/mocha.min.js b/ajax/libs/mocha/1.2.1/mocha.min.js new file mode 100644 index 000000000..a6f9a7ea6 --- /dev/null +++ b/ajax/libs/mocha/1.2.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var s=0;ss;s++)if(o[s]===e||o[s].listener&&o[s].listener===e){r=s;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),s=0,i=r.length;i>s;s++)r[s].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,s=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,s,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,s,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,r-l/2+1,s+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.type="hook"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.it=t.specify=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var s;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var s=o.create(n[0],i);n.unshift(s),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var s=n("browser/path");e=t.exports=r,e.version="1.2.1",e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(){var t=this.suite;this.files.forEach(function(e){e=s.resolve(e),t.emit("pre-require",global,e),t.emit("require",n(e),e),t.emit("post-require",global,e)})},r.prototype.growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var s=n.failures+" of "+t.total+" tests failed";r(s,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(t):t,this},r.prototype.run=function(t){this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),s=new this._reporter(r);return r.ignoreLeaks=o.ignoreLeaks,o.grep&&r.grep(o.grep),o.globals&&r.globals(o.globals),o.growl&&this.growl(r,s),r.run(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new c}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new c,n.duration=new c-n.start}),t.on("pending",function(){n.pending++}))}function r(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return/^(\n+)$/.test(t.value)&&(t.value=Array(++RegExp.$1.length).join("")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=global.Date,l=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=o,e.useColors=l,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:l?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),o=t.err,i=o.message||"",a=o.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),l=o.actual,p=o.expected;if("string"==typeof l&&"string"==typeof p){var h=Math.max(l.length,p.length);c=20>h?s(o,"Chars"):s(o,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return r(++e,g)+" | "+t}).join("\n")}c="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=f("bright fail"," ✖")+f("fail"," %d of %d %s failed")+f("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(e=f("bright pass"," ✔")+f("green"," %d %s complete")+f("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=f("pending"," •")+f("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                  ',e()),++n,console.log("%s

                                  %s

                                  ",e(),t.title),console.log("%s
                                  ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                  ",e()),--n,console.log("%s
                                  ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                  %s
                                  ",e(),t.title);var n=s.escape(s.clean(t.fn.toString()));console.log("%s
                                  %s
                                  ",e(),n)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(s("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?s("bright yellow","."):s(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(s("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=n("./base"),s=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",a=i.readFileSync(o,"utf8"),u=e.compile(a,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:r}))})}function r(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),i=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t){u.call(this,t);var e,n,o=this.stats,f=t.total,d=document.getElementById("mocha"),g=s(h),m=g.getElementsByTagName("li"),v=m[1].getElementsByTagName("em")[0],w=m[2].getElementsByTagName("em")[0],b=m[3].getElementsByTagName("em")[0],y=g.getElementsByTagName("canvas")[0],x=s('
                                    '),k=[x];return y.getContext&&(n=y.getContext("2d"),e=new l),d?(d.appendChild(g),d.appendChild(x),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=location.protocol+"//"+location.host+location.pathname+"?grep=^"+c.escapeRegexp(t.fullTitle()),n=s('
                                  • %s

                                  • ',e,t.title);k[0].appendChild(n),k.unshift(document.createElement("ul")),n.appendChild(k[0])}}),t.on("suite end",function(t){t.root||k.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){var r=o.tests/f*100|0;e&&e.update(r).draw(n);var u=new p-o.start;if(i(v,o.passes),i(w,o.failures),i(b,(u/1e3).toFixed(2)),"passed"==t.state)var l=s('
                                  • %e%ems

                                  • ',t.speed,t.title,t.duration);else if(t.pending)var l=s('
                                  • %e

                                  • ',t.title);else{var l=s('
                                  • %e

                                  • ',t.title),h=t.err.stack||t.err.toString();~h.indexOf(t.err.message)||(h=t.err.message+"\n"+h),"[object Error]"==h&&(h=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(h+="\n("+t.err.sourceURL+":"+t.err.line+")"),l.appendChild(s('
                                    %e
                                    ',h))}var d=l.getElementsByTagName("h2")[0];if(a(d,"click",function(){g.style.display="none"==g.style.display?"block":"none"}),!t.pending){var g=s("
                                    %e
                                    ",c.clean(t.fn.toString()));l.appendChild(g),g.style.display="none"}k[0].appendChild(l)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(s('
                                    %s
                                    ',t))}function s(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return f(e[o++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var u=n("./base"),c=n("../utils"),l=n("../browser/progress"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o;var h='
                                    • passes: 0
                                    • failures: 0
                                    • duration: 0s
                                    '}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function o(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var o=[],s=[],u=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=r(t);a.stats=n.stats,a.tests=o.map(i),a.failures=s.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function r(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var o=s(n,t[n]);e.files.push(o),e.hits+=o.hits,e.misses+=o.misses,e.sloc+=o.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(r),failures:o.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t,null,2))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}r.call(this,t);var n=this,o=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),s.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");s.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){s.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function i(t){var e=n(t,{});return o(e,0)}r.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=s.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=s.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var r=n("./base");e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){s.call(this,t);{var e=this,n=(this.stats,.75*s.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){s.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){s.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){r("["+t.scoreboardWidth+"C"),r(e.join("")),r("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(o){switch(r("["+n+"C"),o){case 0:r("_,------,"),r("\n");break;case 1:var s=e.tick?" ":" ";r("_|"+s+"/\\_/\\ "),r("\n");break;case 2:var i,s=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}r(a+"|"+s+i+" "),r("\n");break;case 3:var s=e.tick?" ":" ";r(s+'"" "" '),r("\n")}}),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){r("["+t+"A")},o.prototype.cursorDown=function(t){r("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),s=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*s+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){r.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),s.hide()}),t.on("test end",function(){u++;var t=u/a,n=o*t|0,r=o-n;s.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.progress=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}r.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){s.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,r(t))}),t.on("pass",function(t){console.log("ok %d %s",n,r(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,r(t)),console.log(e.stack.replace(/^/gm," "))})}function r(t){return t.fullTitle().replace(/#/g,"")}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){s.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var s=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,i(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,s=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+s,o&&(r+=o+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}{var r=n("browser/events").EventEmitter,s=n("browser/debug")("runnable"),i=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){u(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(){r||(r=!0,s.emit("error",new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e();s.clearTimeout(),s.duration=new i-c,o=!0,t(n)}}var o,r,s=this,u=this.timeout(),c=new i,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),s.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new i-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function r(t){return u(c(global),function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){e._grep.test(t.fullTitle())&&n++}),n},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r(this._globals);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=r[t];return o?(s.currentRunnable=o,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var r=o.error();return r&&s.fail(s.test,r),e?s.failHook(o,e):(s.emit("hook end",o),void n(++t))})):e()}var o=this.suite,r=o["_"+t],s=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=s,n(t)):void o(e.pop())}):(r.suite=s,n())}var r=this,s=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return r.failures&&t._bail?e():(o=s.shift())?r._grep.test(o.fullTitle())?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n))})})):n():e()}var o,r=this,s=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void s.runSuite(e,n):o() +}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var r=this.grepTotal(t),s=this,a=0;return i("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){s.runTests(t,n)})):e()},o.prototype.uncaught=function(t){i("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var r=n("browser/events").EventEmitter,s=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return i.forEach(this.tests,t),i.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var r=n("browser/fs"),s=n("browser/path"),i=s.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var r=n,s=0,i=t.length;i>s;s++)r=e.call(o,r,t[s],s,t);return r},e.filter=function(t,e,n){for(var o=[],r=0,s=t.length;s>r;r++){var i=t[r];e.call(n,i,r,t)&&o.push(i)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),r.watchFile(t,n,function(n,o){o.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,o=e.length;o>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),o=e.slice(0,n),r=e.slice(++n);return t[o]=decodeURIComponent(r),t},{})}var o=mocha.utils,r={};mocha.suite=new mocha.Suite("",new mocha.Context),mocha.setup=function(t){if("string"==typeof t?r.ui=t:r=t,ui=mocha.interfaces[r.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');r.timeout&&mocha.suite.timeout(r.timeout),ui(mocha.suite),mocha.suite.emit("pre-require",window)},mocha.run=function(t){mocha.suite.emit("run");var o=new mocha.Runner(mocha.suite),s=r.reporter||mocha.reporters.HTML,i=(new s(o),n(window.location.search||""));return i.grep&&o.grep(new RegExp(i.grep)),r.ignoreLeaks&&(o.ignoreLeaks=!0),r.globals&&o.globals(r.globals),o.globals(["location"]),o.on("end",e),o.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.2.2/mocha.min.css b/ajax/libs/mocha/1.2.2/mocha.min.css new file mode 100644 index 000000000..32d94e79a --- /dev/null +++ b/ajax/libs/mocha/1.2.2/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.2.2/mocha.min.js b/ajax/libs/mocha/1.2.2/mocha.min.js new file mode 100644 index 000000000..35d0bdf81 --- /dev/null +++ b/ajax/libs/mocha/1.2.2/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var s=0;ss;s++)if(o[s]===e||o[s].listener&&o[s].listener===e){r=s;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),s=0,i=r.length;i>s;s++)r[s].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,s=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,s,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,s,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,r-l/2+1,s+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.type="hook"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.it=t.specify=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var s;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var s=o.create(n[0],i);n.unshift(s),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var s=n("browser/path");e=t.exports=r,e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(){var t=this.suite;this.files.forEach(function(e){e=s.resolve(e),t.emit("pre-require",global,e),t.emit("require",n(e),e),t.emit("post-require",global,e)})},r.prototype.growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var s=n.failures+" of "+t.total+" tests failed";r(s,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(t):t,this},r.prototype.run=function(t){this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),s=new this._reporter(r);return r.ignoreLeaks=o.ignoreLeaks,o.grep&&r.grep(o.grep),o.globals&&r.globals(o.globals),o.growl&&this.growl(r,s),r.run(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new c}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new c,n.duration=new c-n.start}),t.on("pending",function(){n.pending++}))}function r(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return/^(\n+)$/.test(t.value)&&(t.value=Array(++RegExp.$1.length).join("")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=global.Date,l=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=o,e.useColors=l,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:l?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),o=t.err,i=o.message||"",a=o.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),l=o.actual,p=o.expected;if("string"==typeof l&&"string"==typeof p){var h=Math.max(l.length,p.length);c=20>h?s(o,"Chars"):s(o,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return r(++e,g)+" | "+t}).join("\n")}c="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=f("bright fail"," ✖")+f("fail"," %d of %d %s failed")+f("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(e=f("bright pass"," ✔")+f("green"," %d %s complete")+f("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=f("pending"," •")+f("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                    ',e()),++n,console.log("%s

                                    %s

                                    ",e(),t.title),console.log("%s
                                    ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                    ",e()),--n,console.log("%s
                                    ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                    %s
                                    ",e(),t.title);var n=s.escape(s.clean(t.fn.toString()));console.log("%s
                                    %s
                                    ",e(),n)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(s("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?s("bright yellow","."):s(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(s("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=n("./base"),s=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",a=i.readFileSync(o,"utf8"),u=e.compile(a,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:r}))})}function r(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),i=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t){u.call(this,t);var e,n,o=this.stats,f=t.total,d=document.getElementById("mocha"),g=s(h),m=g.getElementsByTagName("li"),v=m[1].getElementsByTagName("em")[0],w=m[2].getElementsByTagName("em")[0],b=m[3].getElementsByTagName("em")[0],y=g.getElementsByTagName("canvas")[0],x=s('
                                      '),k=[x];return y.getContext&&(n=y.getContext("2d"),e=new l),d?(d.appendChild(g),d.appendChild(x),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=location.protocol+"//"+location.host+location.pathname+"?grep=^"+c.escapeRegexp(t.fullTitle()),n=s('
                                    • %s

                                    • ',e,t.title);k[0].appendChild(n),k.unshift(document.createElement("ul")),n.appendChild(k[0])}}),t.on("suite end",function(t){t.root||k.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){var r=o.tests/f*100|0;e&&e.update(r).draw(n);var u=new p-o.start;if(i(v,o.passes),i(w,o.failures),i(b,(u/1e3).toFixed(2)),"passed"==t.state)var l=s('
                                    • %e%ems

                                    • ',t.speed,t.title,t.duration);else if(t.pending)var l=s('
                                    • %e

                                    • ',t.title);else{var l=s('
                                    • %e

                                    • ',t.title),h=t.err.stack||t.err.toString();~h.indexOf(t.err.message)||(h=t.err.message+"\n"+h),"[object Error]"==h&&(h=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(h+="\n("+t.err.sourceURL+":"+t.err.line+")"),l.appendChild(s('
                                      %e
                                      ',h))}var d=l.getElementsByTagName("h2")[0];if(a(d,"click",function(){g.style.display="none"==g.style.display?"block":"none"}),!t.pending){var g=s("
                                      %e
                                      ",c.clean(t.fn.toString()));l.appendChild(g),g.style.display="none"}k[0].appendChild(l)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(s('
                                      %s
                                      ',t))}function s(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return f(e[o++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var u=n("./base"),c=n("../utils"),l=n("../browser/progress"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o;var h='
                                      • passes: 0
                                      • failures: 0
                                      • duration: 0s
                                      '}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.XUnit=n("./xunit"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function o(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var o=[],s=[],u=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=r(t);a.stats=n.stats,a.tests=o.map(i),a.failures=s.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function r(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var o=s(n,t[n]);e.files.push(o),e.hits+=o.hits,e.misses+=o.misses,e.sloc+=o.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(r),failures:o.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t,null,2))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}r.call(this,t);var n=this,o=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),s.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");s.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){s.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function i(t){var e=n(t,{});return o(e,0)}r.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=s.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=s.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var r=n("./base");e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){s.call(this,t);{var e=this,n=(this.stats,.75*s.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){s.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){s.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){r("["+t.scoreboardWidth+"C"),r(e.join("")),r("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(o){switch(r("["+n+"C"),o){case 0:r("_,------,"),r("\n");break;case 1:var s=e.tick?" ":" ";r("_|"+s+"/\\_/\\ "),r("\n");break;case 2:var i,s=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}r(a+"|"+s+i+" "),r("\n");break;case 3:var s=e.tick?" ":" ";r(s+'"" "" '),r("\n")}}),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){r("["+t+"A")},o.prototype.cursorDown=function(t){r("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),s=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*s+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){r.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),s.hide()}),t.on("test end",function(){u++;var t=u/a,n=o*t|0,r=o-n;s.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.progress=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}r.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){s.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,r(t))}),t.on("pass",function(t){console.log("ok %d %s",n,r(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,r(t)),console.log(e.stack.replace(/^/gm," "))})}function r(t){return t.fullTitle().replace(/#/g,"")}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){s.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var s=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,i(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,s=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+s,o&&(r+=o+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}{var r=n("browser/events").EventEmitter,s=n("browser/debug")("runnable"),i=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){u(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(){r||(r=!0,s.emit("error",new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e();s.clearTimeout(),s.duration=new i-c,o=!0,t(n)}}var o,r,s=this,u=this.timeout(),c=new i,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),s.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new i-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function r(t){return u(c(global),function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t){return i("grep %s",t),this._grep=t,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){e._grep.test(t.fullTitle())&&n++}),n},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r(this._globals);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=r[t];return o?(s.currentRunnable=o,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var r=o.error();return r&&s.fail(s.test,r),e?s.failHook(o,e):(s.emit("hook end",o),void n(++t))})):e()}var o=this.suite,r=o["_"+t],s=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=s,n(t)):void o(e.pop())}):(r.suite=s,n())}var r=this,s=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){return r.failures&&t._bail?e():(o=s.shift())?r._grep.test(o.fullTitle())?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n))})})):n():e()}var o,r=this,s=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e() +})}var r=this.grepTotal(t),s=this,a=0;return i("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){s.runTests(t,n)})):e()},o.prototype.uncaught=function(t){i("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var r=n("browser/events").EventEmitter,s=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return i.forEach(this.tests,t),i.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var r=n("browser/fs"),s=n("browser/path"),i=s.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var r=n,s=0,i=t.length;i>s;s++)r=e.call(o,r,t[s],s,t);return r},e.filter=function(t,e,n){for(var o=[],r=0,s=t.length;s>r;r++){var i=t[r];e.call(n,i,r,t)&&o.push(i)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),r.watchFile(t,n,function(n,o){o.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,o=e.length;o>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),o=e.slice(0,n),r=e.slice(++n);return t[o]=decodeURIComponent(r),t},{})}var o=mocha.utils,r={};mocha.suite=new mocha.Suite("",new mocha.Context),mocha.setup=function(t){if("string"==typeof t?r.ui=t:r=t,ui=mocha.interfaces[r.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');r.timeout&&mocha.suite.timeout(r.timeout),ui(mocha.suite),mocha.suite.emit("pre-require",window)},mocha.run=function(t){mocha.suite.emit("run");var o=new mocha.Runner(mocha.suite),s=r.reporter||mocha.reporters.HTML,i=(new s(o),n(window.location.search||""));return i.grep&&o.grep(new RegExp(i.grep)),r.ignoreLeaks&&(o.ignoreLeaks=!0),r.globals&&o.globals(r.globals),o.globals(["location"]),o.on("end",e),o.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.20.0/mocha.min.css b/ajax/libs/mocha/1.20.0/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.20.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.20.0/mocha.min.js b/ajax/libs/mocha/1.20.0/mocha.min.js new file mode 100644 index 000000000..bc0a52362 --- /dev/null +++ b/ajax/libs/mocha/1.20.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new n).getTime();l.length&&(new n).getTime()-t<100;)l.shift()();u=l.length?r(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,o-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t,n){e[0].beforeEach(t,n)},t.teardown=function(t,n){e[0].afterEach(t,n)},t.suiteSetup=function(t,n){e[0].beforeAll(t,n)},t.suiteTeardown=function(t,n){e[0].afterAll(t,n)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow),this.suite.on("pre-require",function(t){e.afterEach=t.afterEach||t.teardown,e.after=t.after||t.suiteTeardown,e.beforeEach=t.beforeEach||t.setup,e.before=t.before||t.suiteSetup,e.describe=t.describe||t.suite,e.it=t.it||t.test,e.setup=t.setup||t.beforeEach,e.suiteSetup=t.suiteSetup||t.before,e.suiteTeardown=t.suiteTeardown||t.after,e.suite=t.suite||t.describe,e.teardown=t.teardown||t.afterEach,e.test=t.test||t.it})}var i=n("browser/path"),s=n("./utils");e=t.exports=o,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(r){}if(!e)try{e=n(t)}catch(r){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(r){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},o.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options;r.files=this.files;var o=new e.Runner(n),i=new this._reporter(o,r);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new y}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new y,e.duration=new y-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return i(++e,o)+" | "+t}).join("\n")}return n="\n"+b("diff removed","actual")+" "+b("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?o+c("diff added",t):"-"===t[0]?o+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=g.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function u(t,e,n){var r=n?l(t.actual):t.actual,o=n?l(t.expected):t.expected;return g["diff"+e](r,o).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return b(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){if(e=e||[],-1!==v.indexOf(e,t))return t;var n;return"[object Array]"=={}.toString.call(t)?(e.push(t),n=v.map(t,function(t){return p(t,e)}),e.pop()):"object"==typeof t&&null!==t?(e.push(t),n={},v.forEach(v.keys(t).sort(),function(r){n[r]=p(t[r],e)}),e.pop()):n=t,n}function h(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var d=n("browser/tty"),g=n("browser/diff"),m=n("../ms"),v=n("../utils"),y=global.Date,w=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,d.isatty(1)&&d.isatty(2));e=t.exports=r,e.useColors=w||void 0!==o.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==o.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var b=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:w?o.stdout.getWindowSize?o.stdout.getWindowSize(1)[0]:d.getWindowSize()[1]:75},e.cursor={hide:function(){w&&o.stdout.write("[?25l")},show:function(){w&&o.stdout.write("[?25h")},deleteLine:function(){w&&o.stdout.write("")},beginningOfLine:function(){w&&o.stdout.write("")},CR:function(){w?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):o.stdout.write("\r")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=b("error title"," %s) %s:\n")+b("error message"," %s")+b("error stack","\n%s\n"),o=t.err,i=o.message||"",u=o.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),d=o.actual,g=o.expected,m=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&h(d,g)&&(m=!1,o.actual=d=f(p(d)),o.expected=g=f(p(g))),"string"==typeof d&&"string"==typeof g){r=b("error title"," %s) %s:\n%s")+b("error stack","\n%s\n");var v=i.match(/^([^:]+): expected/);c="\n "+b("error message",v?v[1]:c),c+=e.inlineDiffs?s(o,m):a(o,m)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,u)})},r.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=b("bright pass"," ")+b("green"," %d passing")+b("light"," (%s)"),console.log(t,e.passes||0,m(e.duration)),e.pending&&(t=b("pending"," ")+b("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=b("fail"," %d failing"),console.error(t,e.failures),r.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                      ',e()),++n,console.log("%s

                                      %s

                                      ",e(),i.escape(t.title)),console.log("%s
                                      ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                      ",e()),--n,console.log("%s
                                      ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                      %s
                                      ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                                      %s
                                      ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){o.stdout.write("\n ")}),t.on("pending",function(){o.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&o.stdout.write("\n "),o.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&o.stdout.write("\n "),o.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){o.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t){c.call(this,t);var e,n,r=this,m=this.stats,v=(t.total,i(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],E=v.getElementsByTagName("canvas")[0],j=i('
                                        '),_=[j],C=document.getElementById("mocha");if(E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,n=E.getContext("2d"),n.scale(S,S),e=new p}return C?(l(b,"click",function(){a();var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&s("test pass")}),l(k,"click",function(){a();var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&s("test fail")}),C.appendChild(v),C.appendChild(j),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r.suiteURL(t),n=i('
                                      • %s

                                      • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var o=m.tests/this.total*100|0;e&&e.update(o).draw(n);var s=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(s/1e3).toFixed(2)),"passed"==t.state)var a=r.testURL(t),c=i('
                                      • %e%ems ‣

                                      • ',t.speed,t.title,t.duration,a);else if(t.pending)var c=i('
                                      • %e

                                      • ',t.title);else{var c=i('
                                      • %e ‣

                                      • ',t.title,encodeURIComponent(t.fullTitle())),p=t.err.stack||t.err.toString();~p.indexOf(t.err.message)||(p=t.err.message+"\n"+p),"[object Error]"==p&&(p=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(p+="\n("+t.err.sourceURL+":"+t.err.line+")"),c.appendChild(i('
                                        %e
                                        ',p))}if(!t.pending){var h=c.getElementsByTagName("h2")[0];l(h,"click",function(){g.style.display="none"==g.style.display?"block":"none"});var g=i("
                                        %e
                                        ",f.clean(t.fn.toString()));c.appendChild(g),g.style.display="none"}_[0]&&_[0].appendChild(c)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                                        %s
                                        ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return h(e[r++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){o.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:r.map(i),passes:a.map(i)};o.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),i=t.total,l=o.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){o.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){o.stdout.write("# TOC\n"),o.stdout.write(a(t.suite)),o.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){o.stdout.write(""),o.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r="";i(n),i("_,------,"),i("\n"),i(n),r=t.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(n),r=t.tick?"_":"__";var o=t.tick?"~":"^";i(o+"|"+r+this.face()+" "),i("\n"),i(n),r=t.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){i("["+t+"A")},r.prototype.cursorDown=function(t){i("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=r*t|0,s=r-n;a.CR(),o.stdout.write(""),o.stdout.write(u("progress"," "+e.open)),o.stdout.write(Array(n).join(e.complete)),o.stdout.write(Array(s).join(e.incomplete)),o.stdout.write(u("progress",e.close)),e.verbose&&o.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){u.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function o(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,o.prototype=u.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){c(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},r.prototype.globals=function(t){this._allowedGlobals=t},r.prototype.run=function(t){function e(t){i||(i=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new u-a,o=!0,t(n)}}function r(t){var e=t.call(l);e&&"function"==typeof e.then?(s.resetTimeout(),e.then(function(){n()},n)):n()}var o,i,s=this,a=(this.timeout(),new u),l=this.ctx;if(l&&l.runnable(this),this.callback=n,this.async){this.resetTimeout();try{this.fn.call(l,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending?n():r(this.fn)}catch(c){n(c)}}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(a()))}function i(){}function s(t,e){return f(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=f(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}function a(){if("object"==typeof o&&"string"==typeof o.version){var t=o.version.split(".").reduce(function(t,e){return t<<8|e});if(2315>t)return["errno"]}return[]}var u=n("browser/events").EventEmitter,l=n("browser/debug")("mocha:runner"),c=(n("./test"),n("./utils")),f=c.filter,p=(c.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=r,r.immediately=global.setImmediate||o.nextTick,i.prototype=u.prototype,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return l("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globalProps=function(){for(var t=c.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},r.prototype.hook=function(t,e){function n(t){var r=i[t];return r?s.failures&&o.bail()?e():(s.currentRunnable=r,r.ctx.currentTest=s.test,s.emit("hook",r),r.on("error",function(t){s.failHook(r,t)}),void r.run(function(o){r.removeAllListeners("error");var i=r.error();return i&&s.fail(s.test,i),o?(s.failHook(r,o),e(o)):(s.emit("hook end",r),delete r.ctx.currentTest,void n(++t))})):e()}var o=this.suite,i=o["_"+t],s=this;r.immediately(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},r.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return l("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){l("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return l("start"),this.on("end",function(){l("end"),o.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){l("finished running"),n.emit("end")}),o.on("uncaughtException",e),this},r.prototype.abort=function(){l("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t;var n=function(){};n.prototype=e,this.ctx=new n,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeAll.push(n),this.emit("beforeAll",n),this},r.prototype.afterAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterAll.push(n),this.emit("afterAll",n),this},r.prototype.beforeEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeEach.push(n),this.emit("beforeEach",n),this},r.prototype.afterEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterEach.push(n),this.emit("afterEach",n),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.map=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++)r.push(e.call(n,t[o],o));return r},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,r=global.setTimeout,o=(global.setInterval,global.clearTimeout,global.clearInterval,{});o.exit=function(){},o.stdout={};var i=[];o.removeListener=function(t,e){if("uncaughtException"==t){global.onerror=function(){};var n=s.utils.indexOf(i,e);-1!=n&&i.splice(n,1)}},o.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},i.push(e))};var s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"});a.suite.removeAllListeners("pre-require");var u,l=[];s.Runner.immediately=function(t){l.push(t),u||(u=r(e,0))},a.throwError=function(t){throw s.utils.forEach(i,function(e){e(t)}),t},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=o}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.20.1/mocha.min.css b/ajax/libs/mocha/1.20.1/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.20.1/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.20.1/mocha.min.js b/ajax/libs/mocha/1.20.1/mocha.min.js new file mode 100644 index 000000000..bc0a52362 --- /dev/null +++ b/ajax/libs/mocha/1.20.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new n).getTime();l.length&&(new n).getTime()-t<100;)l.shift()();u=l.length?r(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,o-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t,n){e[0].beforeEach(t,n)},t.teardown=function(t,n){e[0].afterEach(t,n)},t.suiteSetup=function(t,n){e[0].beforeAll(t,n)},t.suiteTeardown=function(t,n){e[0].afterAll(t,n)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow),this.suite.on("pre-require",function(t){e.afterEach=t.afterEach||t.teardown,e.after=t.after||t.suiteTeardown,e.beforeEach=t.beforeEach||t.setup,e.before=t.before||t.suiteSetup,e.describe=t.describe||t.suite,e.it=t.it||t.test,e.setup=t.setup||t.beforeEach,e.suiteSetup=t.suiteSetup||t.before,e.suiteTeardown=t.suiteTeardown||t.after,e.suite=t.suite||t.describe,e.teardown=t.teardown||t.afterEach,e.test=t.test||t.it})}var i=n("browser/path"),s=n("./utils");e=t.exports=o,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(r){}if(!e)try{e=n(t)}catch(r){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(r){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},o.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options;r.files=this.files;var o=new e.Runner(n),i=new this._reporter(o,r);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new y}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new y,e.duration=new y-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return i(++e,o)+" | "+t}).join("\n")}return n="\n"+b("diff removed","actual")+" "+b("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?o+c("diff added",t):"-"===t[0]?o+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=g.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function u(t,e,n){var r=n?l(t.actual):t.actual,o=n?l(t.expected):t.expected;return g["diff"+e](r,o).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return b(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){if(e=e||[],-1!==v.indexOf(e,t))return t;var n;return"[object Array]"=={}.toString.call(t)?(e.push(t),n=v.map(t,function(t){return p(t,e)}),e.pop()):"object"==typeof t&&null!==t?(e.push(t),n={},v.forEach(v.keys(t).sort(),function(r){n[r]=p(t[r],e)}),e.pop()):n=t,n}function h(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var d=n("browser/tty"),g=n("browser/diff"),m=n("../ms"),v=n("../utils"),y=global.Date,w=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,d.isatty(1)&&d.isatty(2));e=t.exports=r,e.useColors=w||void 0!==o.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==o.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var b=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:w?o.stdout.getWindowSize?o.stdout.getWindowSize(1)[0]:d.getWindowSize()[1]:75},e.cursor={hide:function(){w&&o.stdout.write("[?25l")},show:function(){w&&o.stdout.write("[?25h")},deleteLine:function(){w&&o.stdout.write("")},beginningOfLine:function(){w&&o.stdout.write("")},CR:function(){w?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):o.stdout.write("\r")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=b("error title"," %s) %s:\n")+b("error message"," %s")+b("error stack","\n%s\n"),o=t.err,i=o.message||"",u=o.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),d=o.actual,g=o.expected,m=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&h(d,g)&&(m=!1,o.actual=d=f(p(d)),o.expected=g=f(p(g))),"string"==typeof d&&"string"==typeof g){r=b("error title"," %s) %s:\n%s")+b("error stack","\n%s\n");var v=i.match(/^([^:]+): expected/);c="\n "+b("error message",v?v[1]:c),c+=e.inlineDiffs?s(o,m):a(o,m)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,u)})},r.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=b("bright pass"," ")+b("green"," %d passing")+b("light"," (%s)"),console.log(t,e.passes||0,m(e.duration)),e.pending&&(t=b("pending"," ")+b("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=b("fail"," %d failing"),console.error(t,e.failures),r.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                        ',e()),++n,console.log("%s

                                        %s

                                        ",e(),i.escape(t.title)),console.log("%s
                                        ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                        ",e()),--n,console.log("%s
                                        ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                        %s
                                        ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                                        %s
                                        ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){o.stdout.write("\n ")}),t.on("pending",function(){o.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&o.stdout.write("\n "),o.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&o.stdout.write("\n "),o.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){o.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t){c.call(this,t);var e,n,r=this,m=this.stats,v=(t.total,i(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],E=v.getElementsByTagName("canvas")[0],j=i('
                                          '),_=[j],C=document.getElementById("mocha");if(E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,n=E.getContext("2d"),n.scale(S,S),e=new p}return C?(l(b,"click",function(){a();var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&s("test pass")}),l(k,"click",function(){a();var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&s("test fail")}),C.appendChild(v),C.appendChild(j),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r.suiteURL(t),n=i('
                                        • %s

                                        • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var o=m.tests/this.total*100|0;e&&e.update(o).draw(n);var s=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(s/1e3).toFixed(2)),"passed"==t.state)var a=r.testURL(t),c=i('
                                        • %e%ems ‣

                                        • ',t.speed,t.title,t.duration,a);else if(t.pending)var c=i('
                                        • %e

                                        • ',t.title);else{var c=i('
                                        • %e ‣

                                        • ',t.title,encodeURIComponent(t.fullTitle())),p=t.err.stack||t.err.toString();~p.indexOf(t.err.message)||(p=t.err.message+"\n"+p),"[object Error]"==p&&(p=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(p+="\n("+t.err.sourceURL+":"+t.err.line+")"),c.appendChild(i('
                                          %e
                                          ',p))}if(!t.pending){var h=c.getElementsByTagName("h2")[0];l(h,"click",function(){g.style.display="none"==g.style.display?"block":"none"});var g=i("
                                          %e
                                          ",f.clean(t.fn.toString()));c.appendChild(g),g.style.display="none"}_[0]&&_[0].appendChild(c)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                                          %s
                                          ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return h(e[r++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){o.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:r.map(i),passes:a.map(i)};o.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),i=t.total,l=o.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){o.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){o.stdout.write("# TOC\n"),o.stdout.write(a(t.suite)),o.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){o.stdout.write(""),o.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r="";i(n),i("_,------,"),i("\n"),i(n),r=t.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(n),r=t.tick?"_":"__";var o=t.tick?"~":"^";i(o+"|"+r+this.face()+" "),i("\n"),i(n),r=t.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){i("["+t+"A")},r.prototype.cursorDown=function(t){i("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=r*t|0,s=r-n;a.CR(),o.stdout.write(""),o.stdout.write(u("progress"," "+e.open)),o.stdout.write(Array(n).join(e.complete)),o.stdout.write(Array(s).join(e.incomplete)),o.stdout.write(u("progress",e.close)),e.verbose&&o.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){u.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function o(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,o.prototype=u.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){c(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},r.prototype.globals=function(t){this._allowedGlobals=t},r.prototype.run=function(t){function e(t){i||(i=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new u-a,o=!0,t(n)}}function r(t){var e=t.call(l);e&&"function"==typeof e.then?(s.resetTimeout(),e.then(function(){n()},n)):n()}var o,i,s=this,a=(this.timeout(),new u),l=this.ctx;if(l&&l.runnable(this),this.callback=n,this.async){this.resetTimeout();try{this.fn.call(l,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending?n():r(this.fn)}catch(c){n(c)}}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(a()))}function i(){}function s(t,e){return f(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=f(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}function a(){if("object"==typeof o&&"string"==typeof o.version){var t=o.version.split(".").reduce(function(t,e){return t<<8|e});if(2315>t)return["errno"]}return[]}var u=n("browser/events").EventEmitter,l=n("browser/debug")("mocha:runner"),c=(n("./test"),n("./utils")),f=c.filter,p=(c.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=r,r.immediately=global.setImmediate||o.nextTick,i.prototype=u.prototype,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return l("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globalProps=function(){for(var t=c.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},r.prototype.hook=function(t,e){function n(t){var r=i[t];return r?s.failures&&o.bail()?e():(s.currentRunnable=r,r.ctx.currentTest=s.test,s.emit("hook",r),r.on("error",function(t){s.failHook(r,t)}),void r.run(function(o){r.removeAllListeners("error");var i=r.error();return i&&s.fail(s.test,i),o?(s.failHook(r,o),e(o)):(s.emit("hook end",r),delete r.ctx.currentTest,void n(++t))})):e()}var o=this.suite,i=o["_"+t],s=this;r.immediately(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},r.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return l("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){l("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return l("start"),this.on("end",function(){l("end"),o.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){l("finished running"),n.emit("end")}),o.on("uncaughtException",e),this},r.prototype.abort=function(){l("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t;var n=function(){};n.prototype=e,this.ctx=new n,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeAll.push(n),this.emit("beforeAll",n),this},r.prototype.afterAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterAll.push(n),this.emit("afterAll",n),this},r.prototype.beforeEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeEach.push(n),this.emit("beforeEach",n),this},r.prototype.afterEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterEach.push(n),this.emit("afterEach",n),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.map=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++)r.push(e.call(n,t[o],o));return r},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,r=global.setTimeout,o=(global.setInterval,global.clearTimeout,global.clearInterval,{});o.exit=function(){},o.stdout={};var i=[];o.removeListener=function(t,e){if("uncaughtException"==t){global.onerror=function(){};var n=s.utils.indexOf(i,e);-1!=n&&i.splice(n,1)}},o.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},i.push(e))};var s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"});a.suite.removeAllListeners("pre-require");var u,l=[];s.Runner.immediately=function(t){l.push(t),u||(u=r(e,0))},a.throwError=function(t){throw s.utils.forEach(i,function(e){e(t)}),t},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=o}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.21.0/mocha.min.css b/ajax/libs/mocha/1.21.0/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.21.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.21.0/mocha.min.js b/ajax/libs/mocha/1.21.0/mocha.min.js new file mode 100644 index 000000000..bc0a52362 --- /dev/null +++ b/ajax/libs/mocha/1.21.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new n).getTime();l.length&&(new n).getTime()-t<100;)l.shift()();u=l.length?r(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,o-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in global?[global.innerHeight,global.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);return e.unshift(n),n},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t,n){e[0].beforeEach(t,n)},t.teardown=function(t,n){e[0].afterEach(t,n)},t.suiteSetup=function(t,n){e[0].beforeAll(t,n)},t.suiteTeardown=function(t,n){e[0].afterAll(t,n)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),t.slow&&this.slow(t.slow),this.suite.on("pre-require",function(t){e.afterEach=t.afterEach||t.teardown,e.after=t.after||t.suiteTeardown,e.beforeEach=t.beforeEach||t.setup,e.before=t.before||t.suiteSetup,e.describe=t.describe||t.suite,e.it=t.it||t.test,e.setup=t.setup||t.beforeEach,e.suiteSetup=t.suiteSetup||t.before,e.suiteTeardown=t.suiteTeardown||t.after,e.suite=t.suite||t.describe,e.teardown=t.teardown||t.afterEach,e.test=t.test||t.it})}var i=n("browser/path"),s=n("./utils");e=t.exports=o,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";var e;try{e=n("./reporters/"+t)}catch(r){}if(!e)try{e=n(t)}catch(r){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=n(t)}catch(r){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},o.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options;r.files=this.files;var o=new e.Runner(n),i=new this._reporter(o,r);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new y}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new y,e.duration=new y-e.start}),t.on("pending",function(){e.pending++}))}function i(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){var n=u(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return i(++e,o)+" | "+t}).join("\n")}return n="\n"+b("diff removed","actual")+" "+b("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function a(t,e){function n(t){return e&&(t=l(t)),"+"===t[0]?o+c("diff added",t):"-"===t[0]?o+c("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=g.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+c("diff added","+ expected")+" "+c("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function u(t,e,n){var r=n?l(t.actual):t.actual,o=n?l(t.expected):t.expected;return g["diff"+e](r,o).map(function(t){return t.added?c("diff added",t.value):t.removed?c("diff removed",t.value):t.value}).join("")}function l(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function c(t,e){return e.split("\n").map(function(e){return b(t,e)}).join("\n")}function f(t){return t instanceof RegExp?t.toString():JSON.stringify(t,null,2)}function p(t,e){if(e=e||[],-1!==v.indexOf(e,t))return t;var n;return"[object Array]"=={}.toString.call(t)?(e.push(t),n=v.map(t,function(t){return p(t,e)}),e.pop()):"object"==typeof t&&null!==t?(e.push(t),n={},v.forEach(v.keys(t).sort(),function(r){n[r]=p(t[r],e)}),e.pop()):n=t,n}function h(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var d=n("browser/tty"),g=n("browser/diff"),m=n("../ms"),v=n("../utils"),y=global.Date,w=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,d.isatty(1)&&d.isatty(2));e=t.exports=r,e.useColors=w||void 0!==o.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==o.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var b=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:w?o.stdout.getWindowSize?o.stdout.getWindowSize(1)[0]:d.getWindowSize()[1]:75},e.cursor={hide:function(){w&&o.stdout.write("[?25l")},show:function(){w&&o.stdout.write("[?25h")},deleteLine:function(){w&&o.stdout.write("")},beginningOfLine:function(){w&&o.stdout.write("")},CR:function(){w?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):o.stdout.write("\r")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=b("error title"," %s) %s:\n")+b("error message"," %s")+b("error stack","\n%s\n"),o=t.err,i=o.message||"",u=o.stack||i,l=u.indexOf(i)+i.length,c=u.slice(0,l),d=o.actual,g=o.expected,m=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&h(d,g)&&(m=!1,o.actual=d=f(p(d)),o.expected=g=f(p(g))),"string"==typeof d&&"string"==typeof g){r=b("error title"," %s) %s:\n%s")+b("error stack","\n%s\n");var v=i.match(/^([^:]+): expected/);c="\n "+b("error message",v?v[1]:c),c+=e.inlineDiffs?s(o,m):a(o,m)}u=u.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,u)})},r.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=b("bright pass"," ")+b("green"," %d passing")+b("light"," (%s)"),console.log(t,e.passes||0,m(e.duration)),e.pending&&(t=b("pending"," ")+b("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=b("fail"," %d failing"),console.error(t,e.failures),r.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                          ',e()),++n,console.log("%s

                                          %s

                                          ",e(),i.escape(t.title)),console.log("%s
                                          ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                          ",e()),--n,console.log("%s
                                          ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                          %s
                                          ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                                          %s
                                          ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=0;t.on("start",function(){o.stdout.write("\n ")}),t.on("pending",function(){o.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&o.stdout.write("\n "),o.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&o.stdout.write("\n "),o.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function i(){}var s=n("./base"),a=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){o.stdout.write(l({cov:c.cov,coverageClass:i}))})}function i(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t){c.call(this,t);var e,n,r=this,m=this.stats,v=(t.total,i(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],E=v.getElementsByTagName("canvas")[0],j=i('
                                            '),_=[j],C=document.getElementById("mocha");if(E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,n=E.getContext("2d"),n.scale(S,S),e=new p}return C?(l(b,"click",function(){a();var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&s("test pass")}),l(k,"click",function(){a();var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&s("test fail")}),C.appendChild(v),C.appendChild(j),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r.suiteURL(t),n=i('
                                          • %s

                                          • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var o=m.tests/this.total*100|0;e&&e.update(o).draw(n);var s=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(s/1e3).toFixed(2)),"passed"==t.state)var a=r.testURL(t),c=i('
                                          • %e%ems ‣

                                          • ',t.speed,t.title,t.duration,a);else if(t.pending)var c=i('
                                          • %e

                                          • ',t.title);else{var c=i('
                                          • %e ‣

                                          • ',t.title,encodeURIComponent(t.fullTitle())),p=t.err.stack||t.err.toString();~p.indexOf(t.err.message)||(p=t.err.message+"\n"+p),"[object Error]"==p&&(p=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(p+="\n("+t.err.sourceURL+":"+t.err.line+")"),c.appendChild(i('
                                            %e
                                            ',p))}if(!t.pending){var h=c.getElementsByTagName("h2")[0];l(h,"click",function(){g.style.display="none"==g.style.display?"block":"none"});var g=i("
                                            %e
                                            ",f.clean(t.fn.toString()));c.appendChild(g),g.style.display="none"}_[0]&&_[0].appendChild(c)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                                            %s
                                            ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return h(e[r++])}}),n.firstChild}function s(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function a(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var u=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",i(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",i(t)]))}),t.on("end",function(){o.stdout.write(JSON.stringify(["end",e.stats]))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(i),failures:r.map(i),passes:a.map(i)};o.stdout.write(JSON.stringify(t,null,2))})}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),i=t.total,l=o.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/i|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){o.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}i.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){o.stdout.write("# TOC\n"),o.stdout.write(a(t.suite)),o.stdout.write(l)})}var i=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){o.stdout.write(""),o.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function i(){}var s=n("./base");e=t.exports=r,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){i("["+t.scoreboardWidth+"C"),i(e.join("")),i("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r="";i(n),i("_,------,"),i("\n"),i(n),r=t.tick?" ":" ",i("_|"+r+"/\\_/\\ "),i("\n"),i(n),r=t.tick?"_":"__";var o=t.tick?"~":"^";i(o+"|"+r+this.face()+" "),i("\n"),i(n),r=t.tick?" ":" ",i(r+'"" "" '),i("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){i("["+t+"A")},r.prototype.cursorDown=function(t){i("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),i=t.total,l=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/i,n=r*t|0,s=r-n;a.CR(),o.stdout.write(""),o.stdout.write(u("progress"," "+e.open)),o.stdout.write(Array(n).join(e.complete)),o.stdout.write(Array(s).join(e.incomplete)),o.stdout.write(u("progress",e.close)),e.verbose&&o.stdout.write(u("progress"," "+l+" of "+i))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function i(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,i.prototype=s.prototype,r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){u.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new f).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(i),console.log("")})}function o(){}function i(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,a(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var u=n("./base"),l=n("../utils"),c=l.escape,f=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,o.prototype=u.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),f=(global.clearInterval,Object.prototype.toString);t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._slow=t,this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){c(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this.clearTimeout(),this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e)},r.prototype.globals=function(t){this._allowedGlobals=t},r.prototype.run=function(t){function e(t){i||(i=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new u-a,o=!0,t(n)}}function r(t){var e=t.call(l);e&&"function"==typeof e.then?(s.resetTimeout(),e.then(function(){n()},n)):n()}var o,i,s=this,a=(this.timeout(),new u),l=this.ctx;if(l&&l.runnable(this),this.callback=n,this.async){this.resetTimeout();try{this.fn.call(l,function(t){return t instanceof Error||"[object Error]"===f.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending?n():r(this.fn)}catch(c){n(c)}}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(a()))}function i(){}function s(t,e){return f(e,function(e){if(/^d+/.test(e))return!1;if(global.navigator&&/^getInterface/.test(e))return!1;if(global.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var n=f(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}function a(){if("object"==typeof o&&"string"==typeof o.version){var t=o.version.split(".").reduce(function(t,e){return t<<8|e});if(2315>t)return["errno"]}return[]}var u=n("browser/events").EventEmitter,l=n("browser/debug")("mocha:runner"),c=(n("./test"),n("./utils")),f=c.filter,p=(c.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=r,r.immediately=global.setImmediate||o.nextTick,i.prototype=u.prototype,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return l("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globalProps=function(){for(var t=c.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},r.prototype.hook=function(t,e){function n(t){var r=i[t];return r?s.failures&&o.bail()?e():(s.currentRunnable=r,r.ctx.currentTest=s.test,s.emit("hook",r),r.on("error",function(t){s.failHook(r,t)}),void r.run(function(o){r.removeAllListeners("error");var i=r.error();return i&&s.fail(s.test,i),o?(s.failHook(r,o),e(o)):(s.emit("hook end",r),delete r.ctx.currentTest,void n(++t))})):e()}var o=this.suite,i=o["_"+t],s=this;r.immediately(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},r.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return l("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){l("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return l("start"),this.on("end",function(){l("end"),o.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){l("finished running"),n.emit("end")}),o.on("uncaughtException",e),this},r.prototype.abort=function(){l("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t;var n=function(){};n.prototype=e,this.ctx=new n,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeAll.push(n),this.emit("beforeAll",n),this},r.prototype.afterAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterAll.push(n),this.emit("afterAll",n),this},r.prototype.beforeEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeEach.push(n),this.emit("beforeEach",n),this},r.prototype.afterEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.slow(this.slow()),n.ctx=this.ctx,this._afterEach.push(n),this.emit("afterEach",n),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.map=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++)r.push(e.call(n,t[o],o));return r},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),global=function(){return this}();var n=global.Date,r=global.setTimeout,o=(global.setInterval,global.clearTimeout,global.clearInterval,{});o.exit=function(){},o.stdout={};var i=[];o.removeListener=function(t,e){if("uncaughtException"==t){global.onerror=function(){};var n=s.utils.indexOf(i,e);-1!=n&&i.splice(n,1)}},o.on=function(t,e){"uncaughtException"==t&&(global.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},i.push(e))};var s=global.Mocha=t("mocha"),a=global.mocha=new s({reporter:"html"});a.suite.removeAllListeners("pre-require");var u,l=[];s.Runner.immediately=function(t){l.push(t),u||(u=r(e,0))},a.throwError=function(t){throw s.utils.forEach(i,function(e){e(t)}),t},a.ui=function(t){return s.prototype.ui.call(this,t),this.suite.emit("pre-require",global,null,this),this},a.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},a.run=function(t){a.options;a.globals("location");var e=s.utils.parseQuery(global.location.search||"");return e.grep&&a.grep(e.grep),e.invert&&a.invert(),s.prototype.run.call(a,function(){global.document&&s.utils.highlightTags("code"),t&&t()})},s.process=o}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.21.1/mocha.min.css b/ajax/libs/mocha/1.21.1/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.21.1/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.21.1/mocha.min.js b/ajax/libs/mocha/1.21.1/mocha.min.js new file mode 100644 index 000000000..9c4fa5dc5 --- /dev/null +++ b/ajax/libs/mocha/1.21.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new r).getTime();f.length&&(new r).getTime()-t<100;)f.shift()();c=f.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,o-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in n?[n.innerHeight,n.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return 0===arguments.length?this.runnable().timeout():(this.runnable().timeout(t),this)},e.prototype.enableTimeouts=function(t){return this.runnable().enableTimeouts(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.describe=t.context=function(t,o){var i=r.create(e[0],t);return i.file=n,e.unshift(i),o.call(i),e.shift(),i},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,r){var i=e[0];if(i.pending)var r=null;var s=new o(t,r);return s.file=n,i.addTest(s),s},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t,i){var s;for(var a in t)if("function"==typeof t[a]){var u=t[a];switch(a){case"before":n[0].beforeAll(u);break;case"after":n[0].afterAll(u);break;case"beforeEach":n[0].beforeEach(u);break;case"afterEach":n[0].afterEach(u);break;default:var l=new o(a,u);l.file=i,n[0].addTest(l)}}else{var s=r.create(n[0],a);n.unshift(s),e(t[a]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.suite=function(t){e.length>1&&e.shift();var o=r.create(e[0],t);return o.file=n,e.unshift(o),o},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,r){var i=new o(t,r);return i.file=n,e[0].addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t,n){e[0].beforeEach(t,n)},t.teardown=function(t,n){e[0].afterEach(t,n)},t.suiteSetup=function(t,n){e[0].beforeAll(t,n)},t.suiteTeardown=function(t,n){e[0].afterAll(t,n)},t.suite=function(t,o){var i=r.create(e[0],t);return i.file=n,e.unshift(i),o.call(i),e.shift(),i},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,r){var i=e[0];if(i.pending)var r=null;var s=new o(t,r);return s.file=n,i.addTest(s),s},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,r){function o(t){return __dirname+"/../images/"+t+".png"}function s(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),null!==t.enableTimeouts&&this.enableTimeouts(t.enableTimeouts),t.slow&&this.slow(t.slow),this.suite.on("pre-require",function(t){e.afterEach=t.afterEach||t.teardown,e.after=t.after||t.suiteTeardown,e.beforeEach=t.beforeEach||t.setup,e.before=t.before||t.suiteSetup,e.describe=t.describe||t.suite,e.it=t.it||t.test,e.setup=t.setup||t.beforeEach,e.suiteSetup=t.suiteSetup||t.before,e.suiteTeardown=t.suiteTeardown||t.after,e.suite=t.suite||t.describe,e.teardown=t.teardown||t.afterEach,e.test=t.test||t.it})}var a=r("browser/path"),u=r("./utils"),l=a.join,c=i.cwd();t.paths.push(c,l(c,"node_modules")),e=t.exports=s,e.utils=u,e.interfaces=r("./interfaces"),e.reporters=r("./reporters"),e.Runnable=r("./runnable"),e.Context=r("./context"),e.Runner=r("./runner"),e.Suite=r("./suite"),e.Hook=r("./hook"),e.Test=r("./test"),s.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},s.prototype.addFile=function(t){return this.files.push(t),this},s.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"spec";var e;try{e=r("./reporters/"+t)}catch(n){}if(!e)try{e=r(t)}catch(n){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},s.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=r(t)}catch(n){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},s.prototype.loadFiles=function(t){var e=this,o=this.suite,i=this.files.length;this.files.forEach(function(s){s=a.resolve(s),o.emit("pre-require",n,s,e),o.emit("require",r(s),s,e),o.emit("post-require",n,s,e),--i||t&&t()})},s.prototype._growl=function(t,e){var n=r("growl");t.on("end",function(){var r=e.stats;if(r.failures){var i=r.failures+" of "+t.total+" tests failed";n(i,{name:"mocha",title:"Failed",image:o("error")})}else n(r.passes+" tests passed in "+r.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},s.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(u.escapeRegexp(t)):t,this},s.prototype.invert=function(){return this.options.invert=!0,this},s.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},s.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},s.prototype.growl=function(){return this.options.growl=!0,this},s.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},s.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},s.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},s.prototype.timeout=function(t){return this.suite.timeout(t),this},s.prototype.slow=function(t){return this.suite.slow(t),this},s.prototype.enableTimeouts=function(t){return this.suite.enableTimeouts(arguments.length&&void 0!==t?t:!0),this},s.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},s.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options;r.files=this.files;var o=new e.Runner(n),i=new this._reporter(o,r);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,r){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new v}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new v,e.duration=new v-e.start}),t.on("pending",function(){e.pending++}))}function s(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function a(t,e){var n=l(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return s(++e,o)+" | "+t}).join("\n")}return n="\n"+w("diff removed","actual")+" "+w("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function u(t,e){function n(t){return e&&(t=c(t)),"+"===t[0]?o+f("diff added",t):"-"===t[0]?o+f("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=d.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+f("diff added","+ expected")+" "+f("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function l(t,e,n){var r=n?c(t.actual):t.actual,o=n?c(t.expected):t.expected;return d["diff"+e](r,o).map(function(t){return t.added?f("diff added",t.value):t.removed?f("diff removed",t.value):t.value}).join("")}function c(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function f(t,e){return e.split("\n").map(function(e){return w(t,e)}).join("\n")}function p(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var h=r("browser/tty"),d=r("browser/diff"),g=r("../ms"),m=r("../utils"),v=n.Date,y=(n.setTimeout,n.setInterval,n.clearTimeout,n.clearInterval,h.isatty(1)&&h.isatty(2));e=t.exports=o,e.useColors=y||void 0!==i.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==i.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var w=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:y?i.stdout.getWindowSize?i.stdout.getWindowSize(1)[0]:h.getWindowSize()[1]:75},e.cursor={hide:function(){y&&i.stdout.write("[?25l")},show:function(){y&&i.stdout.write("[?25h")},deleteLine:function(){y&&i.stdout.write("")},beginningOfLine:function(){y&&i.stdout.write("")},CR:function(){y?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):i.stdout.write("\r")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=w("error title"," %s) %s:\n")+w("error message"," %s")+w("error stack","\n%s\n"),o=t.err,i=o.message||"",s=o.stack||i,l=s.indexOf(i)+i.length,c=s.slice(0,l),f=o.actual,h=o.expected,d=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&p(f,h)&&(d=!1,o.actual=f=m.stringify(f),o.expected=h=m.stringify(h)),"string"==typeof f&&"string"==typeof h){r=w("error title"," %s) %s:\n%s")+w("error stack","\n%s\n");var g=i.match(/^([^:]+): expected/);c="\n "+w("error message",g?g[1]:c),c+=e.inlineDiffs?a(o,d):u(o,d)}s=s.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,s)})},o.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=w("bright pass"," ")+w("green"," %d passing")+w("light"," (%s)"),console.log(t,e.passes||0,g(e.duration)),e.pending&&(t=w("pending"," ")+w("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=w("fail"," %d failing"),console.error(t,e.failures),o.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                            ',e()),++n,console.log("%s

                                            %s

                                            ",e(),i.escape(t.title)),console.log("%s
                                            ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                            ",e()),--n,console.log("%s
                                            ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                            %s
                                            ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                                            %s
                                            ",e(),n)}),t.on("fail",function(t,n){console.log('%s
                                            %s
                                            ',e(),i.escape(t.title));var r=i.escape(i.clean(t.fn.toString()));console.log('%s
                                            %s
                                            ',e(),r),console.log('%s
                                            %s
                                            ',e(),i.escape(n))})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=-1;t.on("start",function(){i.stdout.write("\n ")}),t.on("pending",function(){++r%n==0&&i.stdout.write("\n "),i.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&i.stdout.write("\n "),i.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&i.stdout.write("\n "),i.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function o(){}var s=n("./base"),a=s.color;e=t.exports=r,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){i.stdout.write(l({cov:c.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,r){function o(t){f.call(this,t);var e,n,r=this,o=this.stats,v=(t.total,s(m)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],T=y[2].getElementsByTagName("a")[0],k=y[3].getElementsByTagName("em")[0],E=v.getElementsByTagName("canvas")[0],j=s('
                                              '),_=[j],C=document.getElementById("mocha");if(E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,n=E.getContext("2d"),n.scale(S,S),e=new h}return C?(c(b,"click",function(){u();var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&a("test pass")}),c(T,"click",function(){u();var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&a("test fail")}),C.appendChild(v),C.appendChild(j),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r.suiteURL(t),n=s('
                                            • %s

                                            • ',e,d(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var i=o.tests/this.total*100|0;e&&e.update(i).draw(n);var a=new g-o.start;if(l(w,o.passes),l(x,o.failures),l(k,(a/1e3).toFixed(2)),"passed"==t.state)var u=r.testURL(t),f=s('
                                            • %e%ems ‣

                                            • ',t.speed,t.title,t.duration,u);else if(t.pending)var f=s('
                                            • %e

                                            • ',t.title);else{var f=s('
                                            • %e ‣

                                            • ',t.title,encodeURIComponent(t.fullTitle())),h=t.err.stack||t.err.toString();~h.indexOf(t.err.message)||(h=t.err.message+"\n"+h),"[object Error]"==h&&(h=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(h+="\n("+t.err.sourceURL+":"+t.err.line+")"),f.appendChild(s('
                                              %e
                                              ',h))}if(!t.pending){var d=f.getElementsByTagName("h2")[0];c(d,"click",function(){m.style.display="none"==m.style.display?"block":"none"});var m=s("
                                              %e
                                              ",p.clean(t.fn.toString()));f.appendChild(m),m.style.display="none"}_[0]&&_[0].appendChild(f)})):i("#mocha div missing, add it to your document")}function i(t){document.body.appendChild(s('
                                              %s
                                              ',t))}function s(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return d(e[r++])}}),n.firstChild}function a(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function a(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function u(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var l=r("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){i.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:r.map(o),passes:a.map(o)};i.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration,err:t.err}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),o=t.total,l=i.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/o|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function o(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){i.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function o(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}o.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){i.stdout.write("# TOC\n"),i.stdout.write(a(t.suite)),i.stdout.write(l)})}var o=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){i.stdout.write(""),i.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function o(){}var s=n("./base");e=t.exports=r,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0 +}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){o("["+t.scoreboardWidth+"C"),o(e.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r="";o(n),o("_,------,"),o("\n"),o(n),r=t.tick?" ":" ",o("_|"+r+"/\\_/\\ "),o("\n"),o(n),r=t.tick?"_":"__";var i=t.tick?"~":"^";o(i+"|"+r+this.face()+" "),o("\n"),o(n),r=t.tick?" ":" ",o(r+'"" "" '),o("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){o("["+t+"A")},r.prototype.cursorDown=function(t){o("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),o=t.total,l=0,c=(Math.max,-1);e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/o,n=r*t|0,s=r-n;(c!==n||e.verbose)&&(c=n,a.CR(),i.stdout.write(""),i.stdout.write(u("progress"," "+e.open)),i.stdout.write(Array(n).join(e.complete)),i.stdout.write(Array(s).join(e.incomplete)),i.stdout.write(u("progress",e.close)),e.verbose&&i.stdout.write(u("progress"," "+l+" of "+o)))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function o(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,r){function o(t){l.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(a("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new p).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(s),console.log("")})}function i(){}function s(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;console.log(a("testcase",e,!1,a("failure",{},!1,u(f(n.message)+"\n"+n.stack))))}else console.log(t.pending?a("testcase",e,!1,a("skipped",{},!0)):a("testcase",e,!0))}function a(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+f(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var l=r("./base"),c=r("../utils"),f=c.escape,p=n.Date;n.setTimeout,n.setInterval,n.clearTimeout,n.clearInterval}e=t.exports=o,i.prototype=l.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,r){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this._enableTimeouts=!0,this.timedOut=!1}function i(){}var s=r("browser/events").EventEmitter,a=r("browser/debug")("mocha:runnable"),u=r("./ms"),l=n.Date,c=n.setTimeout,f=(n.setInterval,n.clearTimeout),p=(n.clearInterval,Object.prototype.toString);t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=u(t)),a("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=u(t)),a("timeout %d",t),this._slow=t,this)},o.prototype.enableTimeouts=function(t){return 0===arguments.length?this._enableTimeouts:(a("enableTimeouts %s",t),this._enableTimeouts=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){f(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this._enableTimeouts&&(this.clearTimeout(),this.timer=c(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.globals=function(t){this._allowedGlobals=t},o.prototype.run=function(t){function e(t){i||(i=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){var r=s.timeout();if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new l-a,o=!0,!n&&s.duration>r&&s._enableTimeouts&&(n=new Error("timeout of "+r+"ms exceeded")),t(n)}}function r(t){var e=t.call(u);e&&"function"==typeof e.then?(s.resetTimeout(),e.then(function(){n()},function(t){n(t||new Error("Promise rejected with no or falsy reason"))})):n()}var o,i,s=this,a=new l,u=this.ctx;if(u&&u.runnable(this),this.callback=n,this.async){this.resetTimeout();try{this.fn.call(u,function(t){return t instanceof Error||"[object Error]"===p.call(t)?n(t):null!=t?n("[object Object]"===Object.prototype.toString.call(t)?new Error("done() invoked with non-Error: "+JSON.stringify(t)):new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending?n():r(this.fn)}catch(c){n(c)}}}}),t.register("runner.js",function(t,e,r){function o(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(u()))}function s(){}function a(t,e){return p(e,function(e){if(/^d+/.test(e))return!1;if(n.navigator&&/^getInterface/.test(e))return!1;if(n.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var r=p(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==r.length&&(!n.navigator||"onerror"!==e)})}function u(){if("object"==typeof i&&"string"==typeof i.version){var t=i.version.split(".").reduce(function(t,e){return t<<8|e});if(2315>t)return["errno"]}return[]}var l=r("browser/events").EventEmitter,c=r("browser/debug")("mocha:runner"),f=(r("./test"),r("./utils")),p=f.filter,h=(f.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=n.setImmediate||i.nextTick,s.prototype=l.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return c("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},o.prototype.globalProps=function(){for(var t=f.keys(n),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=i[t];return o?s.failures&&r.bail()?e():(s.currentRunnable=o,o.ctx.currentTest=s.test,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(r){o.removeAllListeners("error");var i=o.error();return i&&s.fail(s.test,i),r?(s.failHook(o,r),e(r)):(s.emit("hook end",o),delete o.ctx.currentTest,void n(++t))})):e()}var r=this.suite,i=r["_"+t],s=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},o.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},o.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return c("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},o.prototype.uncaught=function(t){t?c("uncaught exception %s",t.message):(c("uncaught undefined exception"),t=new Error("Catched undefined error, did you throw without specifying what?"));var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return c("start"),this.on("end",function(){c("end"),i.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){c("finished running"),n.emit("end")}),i.on("uncaughtException",e),this},o.prototype.abort=function(){c("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t;var n=function(){};n.prototype=e,this.ctx=new n,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._enableTimeouts=!0,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.enableTimeouts(this.enableTimeouts()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.enableTimeouts=function(t){return 0===arguments.length?this._enableTimeouts:(s("enableTimeouts %s",t),this._enableTimeouts=t,this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeAll.push(n),this.emit("beforeAll",n),this},r.prototype.afterAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._afterAll.push(n),this.emit("afterAll",n),this},r.prototype.beforeEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeEach.push(n),this.emit("beforeEach",n),this},r.prototype.afterEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._afterEach.push(n),this.emit("afterEach",n),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.enableTimeouts(this.enableTimeouts()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.enableTimeouts(this.enableTimeouts()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew[ \t]+(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.map=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++)r.push(e.call(n,t[o],o));return r},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtime *{?/,"").replace(/\s+\}$/,"");var n=t.match(/^\n?( *)/)[1].length,r=t.match(/^\n?(\t*)/)[1].length,o=new RegExp("^\n?"+(r?" ":" ")+"{"+(r?r:n)+"}","gm");return t=t.replace(o,""),e.trim(t)},e.escapeRegexp=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},e.trim=function(t){return t.replace(/^\s+|\s+$/g,"")},e.parseQuery=function(t){return e.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),r=e.slice(0,n),o=e.slice(++n);return t[r]=decodeURIComponent(o),t},{})},e.highlightTags=function(t){for(var e=document.getElementsByTagName(t),n=0,r=e.length;r>n;++n)e[n].innerHTML=o(e[n].innerHTML)},e.stringify=function(t){return t instanceof RegExp?t.toString():JSON.stringify(e.canonicalize(t),null,2).replace(/,(\n|$)/g,"$1")},e.canonicalize=function(t,n){if(n=n||[],-1!==e.indexOf(n,t))return"[Circular]";var r;return"[object Array]"==={}.toString.call(t)?(n.push(t),r=e.map(t,function(t){return e.canonicalize(t,n)}),n.pop()):"object"==typeof t&&null!==t?(n.push(t),r={},e.forEach(e.keys(t).sort(),function(o){r[o]=e.canonicalize(t[o],n)}),n.pop()):r=t,r}});var n=function(){return this}(),r=n.Date,o=n.setTimeout,i=(n.setInterval,n.clearTimeout,n.clearInterval,{});i.exit=function(){},i.stdout={};var s=[],a=n.onerror;i.removeListener=function(t,e){if("uncaughtException"==t){n.onerror=a?a:function(){};var r=u.utils.indexOf(s,e);-1!=r&&s.splice(r,1)}},i.on=function(t,e){"uncaughtException"==t&&(n.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},s.push(e))};var u=n.Mocha=t("mocha"),l=n.mocha=new u({reporter:"html"});l.suite.removeAllListeners("pre-require");var c,f=[];u.Runner.immediately=function(t){f.push(t),c||(c=o(e,0))},l.throwError=function(t){throw u.utils.forEach(s,function(e){e(t)}),t},l.ui=function(t){return u.prototype.ui.call(this,t),this.suite.emit("pre-require",n,null,this),this},l.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},l.run=function(t){l.options;l.globals("location");var e=u.utils.parseQuery(n.location.search||"");return e.grep&&l.grep(e.grep),e.invert&&l.invert(),u.prototype.run.call(l,function(e){n.document&&u.utils.highlightTags("code"),t&&t(e)})},u.process=i}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.21.2/mocha.min.css b/ajax/libs/mocha/1.21.2/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.21.2/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.21.2/mocha.min.js b/ajax/libs/mocha/1.21.2/mocha.min.js new file mode 100644 index 000000000..714596e13 --- /dev/null +++ b/ajax/libs/mocha/1.21.2/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new r).getTime();f.length&&(new r).getTime()-t<100;)f.shift()();c=f.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,o-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in n?[n.innerHeight,n.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return 0===arguments.length?this.runnable().timeout():(this.runnable().timeout(t),this)},e.prototype.enableTimeouts=function(t){return this.runnable().enableTimeouts(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.describe=t.context=function(t,o){var i=r.create(e[0],t);return i.file=n,e.unshift(i),o.call(i),e.shift(),i},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,r){var i=e[0];if(i.pending)var r=null;var s=new o(t,r);return s.file=n,i.addTest(s),s},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t,i){var s;for(var a in t)if("function"==typeof t[a]){var u=t[a];switch(a){case"before":n[0].beforeAll(u);break;case"after":n[0].afterAll(u);break;case"beforeEach":n[0].beforeEach(u);break;case"afterEach":n[0].afterEach(u);break;default:var l=new o(a,u);l.file=i,n[0].addTest(l)}}else{var s=r.create(n[0],a);n.unshift(s),e(t[a]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.suite=function(t){e.length>1&&e.shift();var o=r.create(e[0],t);return o.file=n,e.unshift(o),o},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,r){var i=new o(t,r);return i.file=n,e[0].addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t,n){e[0].beforeEach(t,n)},t.teardown=function(t,n){e[0].afterEach(t,n)},t.suiteSetup=function(t,n){e[0].beforeAll(t,n)},t.suiteTeardown=function(t,n){e[0].afterAll(t,n)},t.suite=function(t,o){var i=r.create(e[0],t);return i.file=n,e.unshift(i),o.call(i),e.shift(),i},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,r){var i=e[0];if(i.pending)var r=null;var s=new o(t,r);return s.file=n,i.addTest(s),s},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,r){function o(t){return __dirname+"/../images/"+t+".png"}function i(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),null!==t.enableTimeouts&&this.enableTimeouts(t.enableTimeouts),t.slow&&this.slow(t.slow),this.suite.on("pre-require",function(t){e.afterEach=t.afterEach||t.teardown,e.after=t.after||t.suiteTeardown,e.beforeEach=t.beforeEach||t.setup,e.before=t.before||t.suiteSetup,e.describe=t.describe||t.suite,e.it=t.it||t.test,e.setup=t.setup||t.beforeEach,e.suiteSetup=t.suiteSetup||t.before,e.suiteTeardown=t.suiteTeardown||t.after,e.suite=t.suite||t.describe,e.teardown=t.teardown||t.afterEach,e.test=t.test||t.it})}var s=r("browser/path"),a=r("./utils");e=t.exports=i,e.utils=a,e.interfaces=r("./interfaces"),e.reporters=r("./reporters"),e.Runnable=r("./runnable"),e.Context=r("./context"),e.Runner=r("./runner"),e.Suite=r("./suite"),e.Hook=r("./hook"),e.Test=r("./test"),i.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},i.prototype.addFile=function(t){return this.files.push(t),this},i.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"spec";var e;try{e=r("./reporters/"+t)}catch(n){}if(!e)try{e=r(t)}catch(n){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},i.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=r(t)}catch(n){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},i.prototype.loadFiles=function(t){var e=this,o=this.suite,i=this.files.length;this.files.forEach(function(a){a=s.resolve(a),o.emit("pre-require",n,a,e),o.emit("require",r(a),a,e),o.emit("post-require",n,a,e),--i||t&&t()})},i.prototype._growl=function(t,e){var n=r("growl");t.on("end",function(){var r=e.stats;if(r.failures){var i=r.failures+" of "+t.total+" tests failed";n(i,{name:"mocha",title:"Failed",image:o("error")})}else n(r.passes+" tests passed in "+r.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},i.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(a.escapeRegexp(t)):t,this},i.prototype.invert=function(){return this.options.invert=!0,this},i.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},i.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},i.prototype.growl=function(){return this.options.growl=!0,this},i.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},i.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},i.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},i.prototype.timeout=function(t){return this.suite.timeout(t),this},i.prototype.slow=function(t){return this.suite.slow(t),this},i.prototype.enableTimeouts=function(t){return this.suite.enableTimeouts(arguments.length&&void 0!==t?t:!0),this},i.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},i.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options;r.files=this.files;var o=new e.Runner(n),i=new this._reporter(o,r);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,r){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new v}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new v,e.duration=new v-e.start}),t.on("pending",function(){e.pending++}))}function s(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function a(t,e){var n=l(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return s(++e,o)+" | "+t}).join("\n")}return n="\n"+w("diff removed","actual")+" "+w("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function u(t,e){function n(t){return e&&(t=c(t)),"+"===t[0]?o+f("diff added",t):"-"===t[0]?o+f("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=d.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+f("diff added","+ expected")+" "+f("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function l(t,e,n){var r=n?c(t.actual):t.actual,o=n?c(t.expected):t.expected;return d["diff"+e](r,o).map(function(t){return t.added?f("diff added",t.value):t.removed?f("diff removed",t.value):t.value}).join("")}function c(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function f(t,e){return e.split("\n").map(function(e){return w(t,e)}).join("\n")}function p(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var h=r("browser/tty"),d=r("browser/diff"),g=r("../ms"),m=r("../utils"),v=n.Date,y=(n.setTimeout,n.setInterval,n.clearTimeout,n.clearInterval,h.isatty(1)&&h.isatty(2));e=t.exports=o,e.useColors=y||void 0!==i.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==i.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var w=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:y?i.stdout.getWindowSize?i.stdout.getWindowSize(1)[0]:h.getWindowSize()[1]:75},e.cursor={hide:function(){y&&i.stdout.write("[?25l")},show:function(){y&&i.stdout.write("[?25h")},deleteLine:function(){y&&i.stdout.write("")},beginningOfLine:function(){y&&i.stdout.write("")},CR:function(){y?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):i.stdout.write("\r")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=w("error title"," %s) %s:\n")+w("error message"," %s")+w("error stack","\n%s\n"),o=t.err,i=o.message||"",s=o.stack||i,l=s.indexOf(i)+i.length,c=s.slice(0,l),f=o.actual,h=o.expected,d=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&p(f,h)&&(d=!1,o.actual=f=m.stringify(f),o.expected=h=m.stringify(h)),"string"==typeof f&&"string"==typeof h){r=w("error title"," %s) %s:\n%s")+w("error stack","\n%s\n");var g=i.match(/^([^:]+): expected/);c="\n "+w("error message",g?g[1]:c),c+=e.inlineDiffs?a(o,d):u(o,d)}s=s.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,s)})},o.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=w("bright pass"," ")+w("green"," %d passing")+w("light"," (%s)"),console.log(t,e.passes||0,g(e.duration)),e.pending&&(t=w("pending"," ")+w("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=w("fail"," %d failing"),console.error(t,e.failures),o.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                              ',e()),++n,console.log("%s

                                              %s

                                              ",e(),i.escape(t.title)),console.log("%s
                                              ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                              ",e()),--n,console.log("%s
                                              ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                              %s
                                              ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                                              %s
                                              ",e(),n)}),t.on("fail",function(t,n){console.log('%s
                                              %s
                                              ',e(),i.escape(t.title));var r=i.escape(i.clean(t.fn.toString()));console.log('%s
                                              %s
                                              ',e(),r),console.log('%s
                                              %s
                                              ',e(),i.escape(n))})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=-1;t.on("start",function(){i.stdout.write("\n ")}),t.on("pending",function(){++r%n==0&&i.stdout.write("\n "),i.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&i.stdout.write("\n "),i.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&i.stdout.write("\n "),i.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function o(){}var s=n("./base"),a=s.color;e=t.exports=r,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){i.stdout.write(l({cov:c.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,r){function o(t){f.call(this,t);var e,n,r=this,o=this.stats,v=(t.total,s(m)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],T=y[2].getElementsByTagName("a")[0],k=y[3].getElementsByTagName("em")[0],E=v.getElementsByTagName("canvas")[0],j=s('
                                                '),_=[j],C=document.getElementById("mocha");if(E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,n=E.getContext("2d"),n.scale(S,S),e=new h}return C?(c(b,"click",function(){u();var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&a("test pass")}),c(T,"click",function(){u();var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&a("test fail")}),C.appendChild(v),C.appendChild(j),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r.suiteURL(t),n=s('
                                              • %s

                                              • ',e,d(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var i=o.tests/this.total*100|0;e&&e.update(i).draw(n);var a=new g-o.start;if(l(w,o.passes),l(x,o.failures),l(k,(a/1e3).toFixed(2)),"passed"==t.state)var u=r.testURL(t),f=s('
                                              • %e%ems ‣

                                              • ',t.speed,t.title,t.duration,u);else if(t.pending)var f=s('
                                              • %e

                                              • ',t.title);else{var f=s('
                                              • %e ‣

                                              • ',t.title,encodeURIComponent(t.fullTitle())),h=t.err.stack||t.err.toString();~h.indexOf(t.err.message)||(h=t.err.message+"\n"+h),"[object Error]"==h&&(h=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(h+="\n("+t.err.sourceURL+":"+t.err.line+")"),f.appendChild(s('
                                                %e
                                                ',h))}if(!t.pending){var d=f.getElementsByTagName("h2")[0];c(d,"click",function(){m.style.display="none"==m.style.display?"block":"none"});var m=s("
                                                %e
                                                ",p.clean(t.fn.toString()));f.appendChild(m),m.style.display="none"}_[0]&&_[0].appendChild(f)})):i("#mocha div missing, add it to your document")}function i(t){document.body.appendChild(s('
                                                %s
                                                ',t))}function s(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return d(e[r++])}}),n.firstChild}function a(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function a(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function u(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var l=r("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){i.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:r.map(o),passes:a.map(o)};i.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration,err:t.err}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),o=t.total,l=i.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/o|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function o(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){i.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function o(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}o.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){i.stdout.write("# TOC\n"),i.stdout.write(a(t.suite)),i.stdout.write(l)})}var o=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){i.stdout.write(""),i.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function o(){}var s=n("./base");e=t.exports=r,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw() +}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){o("["+t.scoreboardWidth+"C"),o(e.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r="";o(n),o("_,------,"),o("\n"),o(n),r=t.tick?" ":" ",o("_|"+r+"/\\_/\\ "),o("\n"),o(n),r=t.tick?"_":"__";var i=t.tick?"~":"^";o(i+"|"+r+this.face()+" "),o("\n"),o(n),r=t.tick?" ":" ",o(r+'"" "" '),o("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){o("["+t+"A")},r.prototype.cursorDown=function(t){o("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),o=t.total,l=0,c=(Math.max,-1);e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/o,n=r*t|0,s=r-n;(c!==n||e.verbose)&&(c=n,a.CR(),i.stdout.write(""),i.stdout.write(u("progress"," "+e.open)),i.stdout.write(Array(n).join(e.complete)),i.stdout.write(Array(s).join(e.incomplete)),i.stdout.write(u("progress",e.close)),e.verbose&&i.stdout.write(u("progress"," "+l+" of "+o)))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function o(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,r){function o(t){l.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(a("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new p).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(s),console.log("")})}function i(){}function s(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;console.log(a("testcase",e,!1,a("failure",{},!1,u(f(n.message)+"\n"+n.stack))))}else console.log(t.pending?a("testcase",e,!1,a("skipped",{},!0)):a("testcase",e,!0))}function a(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+f(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var l=r("./base"),c=r("../utils"),f=c.escape,p=n.Date;n.setTimeout,n.setInterval,n.clearTimeout,n.clearInterval}e=t.exports=o,i.prototype=l.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,r){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this._enableTimeouts=!0,this.timedOut=!1}function i(){}var s=r("browser/events").EventEmitter,a=r("browser/debug")("mocha:runnable"),u=r("./ms"),l=n.Date,c=n.setTimeout,f=(n.setInterval,n.clearTimeout),p=(n.clearInterval,Object.prototype.toString);t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=u(t)),a("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=u(t)),a("timeout %d",t),this._slow=t,this)},o.prototype.enableTimeouts=function(t){return 0===arguments.length?this._enableTimeouts:(a("enableTimeouts %s",t),this._enableTimeouts=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){f(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this._enableTimeouts&&(this.clearTimeout(),this.timer=c(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.globals=function(t){this._allowedGlobals=t},o.prototype.run=function(t){function e(t){i||(i=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){var r=s.timeout();if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new l-a,o=!0,!n&&s.duration>r&&s._enableTimeouts&&(n=new Error("timeout of "+r+"ms exceeded")),t(n)}}function r(t){var e=t.call(u);e&&"function"==typeof e.then?(s.resetTimeout(),e.then(function(){n()},function(t){n(t||new Error("Promise rejected with no or falsy reason"))})):n()}var o,i,s=this,a=new l,u=this.ctx;if(u&&u.runnable(this),this.callback=n,this.async){this.resetTimeout();try{this.fn.call(u,function(t){return t instanceof Error||"[object Error]"===p.call(t)?n(t):null!=t?n("[object Object]"===Object.prototype.toString.call(t)?new Error("done() invoked with non-Error: "+JSON.stringify(t)):new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending?n():r(this.fn)}catch(c){n(c)}}}}),t.register("runner.js",function(t,e,r){function o(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(u()))}function s(){}function a(t,e){return p(e,function(e){if(/^d+/.test(e))return!1;if(n.navigator&&/^getInterface/.test(e))return!1;if(n.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var r=p(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==r.length&&(!n.navigator||"onerror"!==e)})}function u(){if("object"==typeof i&&"string"==typeof i.version){var t=i.version.split(".").reduce(function(t,e){return t<<8|e});if(2315>t)return["errno"]}return[]}var l=r("browser/events").EventEmitter,c=r("browser/debug")("mocha:runner"),f=(r("./test"),r("./utils")),p=f.filter,h=(f.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=n.setImmediate||i.nextTick,s.prototype=l.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return c("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},o.prototype.globalProps=function(){for(var t=f.keys(n),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=i[t];return o?s.failures&&r.bail()?e():(s.currentRunnable=o,o.ctx.currentTest=s.test,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(r){o.removeAllListeners("error");var i=o.error();return i&&s.fail(s.test,i),r?(s.failHook(o,r),e(r)):(s.emit("hook end",o),delete o.ctx.currentTest,void n(++t))})):e()}var r=this.suite,i=r["_"+t],s=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},o.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},o.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return c("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},o.prototype.uncaught=function(t){t?c("uncaught exception %s",t.message):(c("uncaught undefined exception"),t=new Error("Catched undefined error, did you throw without specifying what?"));var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return c("start"),this.on("end",function(){c("end"),i.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){c("finished running"),n.emit("end")}),i.on("uncaughtException",e),this},o.prototype.abort=function(){c("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t;var n=function(){};n.prototype=e,this.ctx=new n,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._enableTimeouts=!0,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.enableTimeouts(this.enableTimeouts()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.enableTimeouts=function(t){return 0===arguments.length?this._enableTimeouts:(s("enableTimeouts %s",t),this._enableTimeouts=t,this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeAll.push(n),this.emit("beforeAll",n),this},r.prototype.afterAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._afterAll.push(n),this.emit("afterAll",n),this},r.prototype.beforeEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeEach.push(n),this.emit("beforeEach",n),this},r.prototype.afterEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._afterEach.push(n),this.emit("afterEach",n),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.enableTimeouts(this.enableTimeouts()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.enableTimeouts(this.enableTimeouts()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew[ \t]+(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.map=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++)r.push(e.call(n,t[o],o));return r},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtime *{?/,"").replace(/\s+\}$/,"");var n=t.match(/^\n?( *)/)[1].length,r=t.match(/^\n?(\t*)/)[1].length,o=new RegExp("^\n?"+(r?" ":" ")+"{"+(r?r:n)+"}","gm");return t=t.replace(o,""),e.trim(t)},e.escapeRegexp=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},e.trim=function(t){return t.replace(/^\s+|\s+$/g,"")},e.parseQuery=function(t){return e.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),r=e.slice(0,n),o=e.slice(++n);return t[r]=decodeURIComponent(o),t},{})},e.highlightTags=function(t){for(var e=document.getElementsByTagName(t),n=0,r=e.length;r>n;++n)e[n].innerHTML=o(e[n].innerHTML)},e.stringify=function(t){return t instanceof RegExp?t.toString():JSON.stringify(e.canonicalize(t),null,2).replace(/,(\n|$)/g,"$1")},e.canonicalize=function(t,n){if(n=n||[],-1!==e.indexOf(n,t))return"[Circular]";var r;return"[object Array]"==={}.toString.call(t)?(n.push(t),r=e.map(t,function(t){return e.canonicalize(t,n)}),n.pop()):"object"==typeof t&&null!==t?(n.push(t),r={},e.forEach(e.keys(t).sort(),function(o){r[o]=e.canonicalize(t[o],n)}),n.pop()):r=t,r}});var n=function(){return this}(),r=n.Date,o=n.setTimeout,i=(n.setInterval,n.clearTimeout,n.clearInterval,{});i.exit=function(){},i.stdout={};var s=[],a=n.onerror;i.removeListener=function(t,e){if("uncaughtException"==t){n.onerror=a?a:function(){};var r=u.utils.indexOf(s,e);-1!=r&&s.splice(r,1)}},i.on=function(t,e){"uncaughtException"==t&&(n.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},s.push(e))};var u=n.Mocha=t("mocha"),l=n.mocha=new u({reporter:"html"});l.suite.removeAllListeners("pre-require");var c,f=[];u.Runner.immediately=function(t){f.push(t),c||(c=o(e,0))},l.throwError=function(t){throw u.utils.forEach(s,function(e){e(t)}),t},l.ui=function(t){return u.prototype.ui.call(this,t),this.suite.emit("pre-require",n,null,this),this},l.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},l.run=function(t){l.options;l.globals("location");var e=u.utils.parseQuery(n.location.search||"");return e.grep&&l.grep(e.grep),e.invert&&l.invert(),u.prototype.run.call(l,function(e){n.document&&u.utils.highlightTags("code"),t&&t(e)})},u.process=i}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.21.3/mocha.min.css b/ajax/libs/mocha/1.21.3/mocha.min.css new file mode 100644 index 000000000..ee35e3a61 --- /dev/null +++ b/ajax/libs/mocha/1.21.3/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{margin:0}#mocha{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;margin:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha .hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial,sans-serif}#mocha .test.pass.medium .duration{background:#c09853}#mocha .test.pass.slow .duration{background:#b94a48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;max-width:85%;max-width:calc(100% - 42px);word-wrap:break-word;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee;border-radius:3px}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail,#mocha-report.pending .test.fail,#mocha-report.pending .test.pass{display:none}#mocha-report.pending .test.pass.pending{display:block}#mocha-error{color:#c00;font-size:1.5em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888;z-index:1}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}#mocha code .comment{color:#ddd}#mocha code .init{color:#2f6fad}#mocha code .string{color:#5890ad}#mocha code .keyword{color:#8a6343}#mocha code .number{color:#2f6fad}@media screen and (max-device-width:480px){#mocha{margin:60px 0}#mocha #stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.21.3/mocha.min.js b/ajax/libs/mocha/1.21.3/mocha.min.js new file mode 100644 index 000000000..c5ea202c9 --- /dev/null +++ b/ajax/libs/mocha/1.21.3/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}function e(){for(var t=(new r).getTime();f.length&&(new r).getTime()-t<100;)f.shift()();c=f.length?o(e,0):null}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;i/g,">"),e=e.replace(/"/g,""")}var r=function(t){this.ignoreWhitespace=t};r.prototype={diff:function(e,n){if(n===e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var r=n.length,o=e.length,i=r+o,s=[{newPos:-1,components:[]}],a=this.extractCommon(s[0],n,e,0);if(s[0].newPos+1>=r&&a+1>=o)return s[0].components;for(var u=1;i>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,f=s[l-1],p=s[l+1];a=(p?p.newPos:0)-l,f&&(s[l-1]=void 0);var h=f&&f.newPos+1=0&&o>a;if(h||d){!h||d&&f.newPos=r&&a+1>=o)return c.components;s[l]=c}else s[l]=void 0}},pushComponent:function(t,e,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={value:this.join(o.value,e),added:n,removed:r}:t.push({value:e,added:n,removed:r})},extractCommon:function(t,e,n,r){for(var o=e.length,i=n.length,s=t.newPos,a=s-r;o>s+1&&i>a+1&&this.equals(e[s+1],n[a+1]);)s++,a++,this.pushComponent(t.components,e[s],void 0,void 0);return t.newPos=s,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t===e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var o=new r,i=new r(!0),s=new r;i.tokenize=s.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var a=new r(!0);a.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var u=new r;return u.tokenize=function(t){return t.split(/^/m)},{Diff:r,diffChars:function(t,e){return o.diff(t,e)},diffWords:function(t,e){return i.diff(t,e)},diffWordsWithSpace:function(t,e){return s.diff(t,e)},diffLines:function(t,e){return u.diff(t,e)},diffCss:function(t,e){return a.diff(t,e)},createPatch:function(t,e,n,r,o){function i(t){return t.map(function(t){return" "+t})}function s(t,e,n){var r=l[l.length-2],o=e===l.length-2,i=e===l.length-3&&(n.added!==r.added||n.removed!==r.removed);/\n$/.test(n.value)||!o&&!i||t.push("\\ No newline at end of file")}var a=[];a.push("Index: "+t),a.push("==================================================================="),a.push("--- "+t+("undefined"==typeof r?"":" "+r)),a.push("+++ "+t+("undefined"==typeof o?"":" "+o));var l=u.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,f=0,p=[],h=1,d=1,g=0;g=0;s--){for(var l=r[s],c=0;c"):o.removed&&e.push(""),e.push(n(o.value)),o.added?e.push(""):o.removed&&e.push("")}return e.join("")},convertChangesToDMP:function(t){for(var e,n=[],r=0;ri;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){try{var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;t.fillText(l,o-c/2+1,i+a/2-1)}catch(f){}return this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return"innerHeight"in n?[n.innerHeight,n.innerWidth]:[640,480]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return 0===arguments.length?this.runnable().timeout():(this.runnable().timeout(t),this)},e.prototype.enableTimeouts=function(t){return this.runnable().enableTimeouts(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.type="hook"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.describe=t.context=function(t,o){var i=r.create(e[0],t);return i.file=n,e.unshift(i),o.call(i),e.shift(),i},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);return s.grep(r.fullTitle()),r},t.it=t.specify=function(t,r){var i=e[0];if(i.pending)var r=null;var s=new o(t,r);return s.file=n,i.addTest(s),s},t.it.only=function(e,n){var r=t.it(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";return s.grep(new RegExp(o)),r},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t,i){var s;for(var a in t)if("function"==typeof t[a]){var u=t[a];switch(a){case"before":n[0].beforeAll(u);break;case"after":n[0].afterAll(u);break;case"beforeEach":n[0].beforeEach(u);break;case"afterEach":n[0].afterEach(u);break;default:var l=new o(a,u);l.file=i,n[0].addTest(l)}}else{var s=r.create(n[0],a);n.unshift(s),e(t[a]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.before=function(t,n){e[0].beforeAll(t,n)},t.after=function(t,n){e[0].afterAll(t,n)},t.beforeEach=function(t,n){e[0].beforeEach(t,n)},t.afterEach=function(t,n){e[0].afterEach(t,n)},t.suite=function(t){e.length>1&&e.shift();var o=r.create(e[0],t);return o.file=n,e.unshift(o),o},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,r){var i=new o(t,r);return i.file=n,e[0].addTest(i),i},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test"),i=n("../utils");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,s){t.setup=function(t,n){e[0].beforeEach(t,n)},t.teardown=function(t,n){e[0].afterEach(t,n)},t.suiteSetup=function(t,n){e[0].beforeAll(t,n)},t.suiteTeardown=function(t,n){e[0].afterAll(t,n)},t.suite=function(t,o){var i=r.create(e[0],t);return i.file=n,e.unshift(i),o.call(i),e.shift(),i},t.suite.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.suite.only=function(e,n){var r=t.suite(e,n);s.grep(r.fullTitle())},t.test=function(t,r){var i=e[0];if(i.pending)var r=null;var s=new o(t,r);return s.file=n,i.addTest(s),s},t.test.only=function(e,n){var r=t.test(e,n),o="^"+i.escapeRegexp(r.fullTitle())+"$";s.grep(new RegExp(o))},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,r){function o(t){return __dirname+"/../images/"+t+".png"}function s(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),null!=t.timeout&&this.timeout(t.timeout),this.useColors(t.useColors),null!==t.enableTimeouts&&this.enableTimeouts(t.enableTimeouts),t.slow&&this.slow(t.slow),this.suite.on("pre-require",function(t){e.afterEach=t.afterEach||t.teardown,e.after=t.after||t.suiteTeardown,e.beforeEach=t.beforeEach||t.setup,e.before=t.before||t.suiteSetup,e.describe=t.describe||t.suite,e.it=t.it||t.test,e.setup=t.setup||t.beforeEach,e.suiteSetup=t.suiteSetup||t.before,e.suiteTeardown=t.suiteTeardown||t.after,e.suite=t.suite||t.describe,e.teardown=t.teardown||t.afterEach,e.test=t.test||t.it})}var a=r("browser/path"),u=r("./utils");if(e=t.exports=s,"undefined"!=typeof i&&"function"==typeof i.cwd){var l=a.join,c=i.cwd();t.paths.push(c,l(c,"node_modules"))}e.utils=u,e.interfaces=r("./interfaces"),e.reporters=r("./reporters"),e.Runnable=r("./runnable"),e.Context=r("./context"),e.Runner=r("./runner"),e.Suite=r("./suite"),e.Hook=r("./hook"),e.Test=r("./test"),s.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},s.prototype.addFile=function(t){return this.files.push(t),this},s.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"spec";var e;try{e=r("./reporters/"+t)}catch(n){}if(!e)try{e=r(t)}catch(n){}if(e||"teamcity"!==t||console.warn("The Teamcity reporter was moved to a package named mocha-teamcity-reporter (https://npmjs.org/package/mocha-teamcity-reporter)."),!e)throw new Error('invalid reporter "'+t+'"');this._reporter=e}return this},s.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)try{this._ui=r(t)}catch(n){}if(!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},s.prototype.loadFiles=function(t){var e=this,o=this.suite,i=this.files.length;this.files.forEach(function(s){s=a.resolve(s),o.emit("pre-require",n,s,e),o.emit("require",r(s),s,e),o.emit("post-require",n,s,e),--i||t&&t()})},s.prototype._growl=function(t,e){var n=r("growl");t.on("end",function(){var r=e.stats;if(r.failures){var i=r.failures+" of "+t.total+" tests failed";n(i,{name:"mocha",title:"Failed",image:o("error")})}else n(r.passes+" tests passed in "+r.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},s.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(u.escapeRegexp(t)):t,this},s.prototype.invert=function(){return this.options.invert=!0,this},s.prototype.ignoreLeaks=function(t){return this.options.ignoreLeaks=!!t,this},s.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},s.prototype.growl=function(){return this.options.growl=!0,this},s.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},s.prototype.useColors=function(t){return this.options.useColors=arguments.length&&void 0!=t?t:!0,this},s.prototype.useInlineDiffs=function(t){return this.options.useInlineDiffs=arguments.length&&void 0!=t?t:!1,this},s.prototype.timeout=function(t){return this.suite.timeout(t),this},s.prototype.slow=function(t){return this.suite.slow(t),this},s.prototype.enableTimeouts=function(t){return this.suite.enableTimeouts(arguments.length&&void 0!==t?t:!0),this},s.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},s.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,r=this.options;r.files=this.files;var o=new e.Runner(n),i=new this._reporter(o,r);return o.ignoreLeaks=!1!==r.ignoreLeaks,o.asyncOnly=r.asyncOnly,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),e.reporters.Base.useColors=r.useColors,e.reporters.Base.inlineDiffs=r.useInlineDiffs,o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"y":return n*l;case"days":case"day":case"d":return n*u;case"hours":case"hour":case"h":return n*a;case"minutes":case"minute":case"m":return n*s;case"seconds":case"second":case"s":return n*i;case"ms":return n}}}function n(t){return t>=u?Math.round(t/u)+"d":t>=a?Math.round(t/a)+"h":t>=s?Math.round(t/s)+"m":t>=i?Math.round(t/i)+"s":t+"ms"}function r(t){return o(t,u,"day")||o(t,a,"hour")||o(t,s,"minute")||o(t,i,"second")||t+" ms"}function o(t,e,n){return e>t?void 0:1.5*e>t?Math.floor(t/e)+" "+n:Math.ceil(t/e)+" "+n+"s"}var i=1e3,s=60*i,a=60*s,u=24*a,l=365.25*u;t.exports=function(t,o){return o=o||{},"string"==typeof t?e(t):o.long?r(t):n(t)}}),t.register("reporters/base.js",function(t,e,r){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new v}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,r){e.failures=e.failures||0,e.failures++,t.err=r,n.push(t)}),t.on("end",function(){e.end=new v,e.duration=new v-e.start}),t.on("pending",function(){e.pending++}))}function s(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function a(t,e){var n=l(t,"WordsWithSpace",e),r=n.split("\n");if(r.length>4){var o=String(r.length).length;n=r.map(function(t,e){return s(++e,o)+" | "+t}).join("\n")}return n="\n"+w("diff removed","actual")+" "+w("diff added","expected")+"\n\n"+n+"\n",n=n.replace(/^/gm," ")}function u(t,e){function n(t){return e&&(t=c(t)),"+"===t[0]?o+f("diff added",t):"-"===t[0]?o+f("diff removed",t):t.match(/\@\@/)?null:t.match(/\\ No newline/)?null:o+t}function r(t){return null!=t}var o=" ";msg=d.createPatch("string",t.actual,t.expected);var i=msg.split("\n").splice(4);return"\n "+f("diff added","+ expected")+" "+f("diff removed","- actual")+"\n\n"+i.map(n).filter(r).join("\n")}function l(t,e,n){var r=n?c(t.actual):t.actual,o=n?c(t.expected):t.expected;return d["diff"+e](r,o).map(function(t){return t.added?f("diff added",t.value):t.removed?f("diff removed",t.value):t.value}).join("")}function c(t){return t.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")}function f(t,e){return e.split("\n").map(function(e){return w(t,e)}).join("\n")}function p(t,e){return t=Object.prototype.toString.call(t),e=Object.prototype.toString.call(e),t==e}var h=r("browser/tty"),d=r("browser/diff"),g=r("../ms"),m=r("../utils"),v=n.Date,y=(n.setTimeout,n.setInterval,n.clearTimeout,n.clearInterval,h.isatty(1)&&h.isatty(2));e=t.exports=o,e.useColors=y||void 0!==i.env.MOCHA_COLORS,e.inlineDiffs=!1,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==i.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var w=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:y?i.stdout.getWindowSize?i.stdout.getWindowSize(1)[0]:h.getWindowSize()[1]:75},e.cursor={hide:function(){y&&i.stdout.write("[?25l")},show:function(){y&&i.stdout.write("[?25h")},deleteLine:function(){y&&i.stdout.write("")},beginningOfLine:function(){y&&i.stdout.write("")},CR:function(){y?(e.cursor.deleteLine(),e.cursor.beginningOfLine()):i.stdout.write("\r")}},e.list=function(t){console.error(),t.forEach(function(t,n){var r=w("error title"," %s) %s:\n")+w("error message"," %s")+w("error stack","\n%s\n"),o=t.err,i=o.message||"",s=o.stack||i,l=s.indexOf(i)+i.length,c=s.slice(0,l),f=o.actual,h=o.expected,d=!0;if(o.uncaught&&(c="Uncaught "+c),o.showDiff&&p(f,h)&&(d=!1,o.actual=f=m.stringify(f),o.expected=h=m.stringify(h)),"string"==typeof f&&"string"==typeof h){r=w("error title"," %s) %s:\n%s")+w("error stack","\n%s\n");var g=i.match(/^([^:]+): expected/);c="\n "+w("error message",g?g[1]:c),c+=e.inlineDiffs?a(o,d):u(o,d)}s=s.slice(l?l+1:l).replace(/^/gm," "),console.error(r,n+1,t.fullTitle(),c,s)})},o.prototype.epilogue=function(){var t,e=this.stats;console.log(),t=w("bright pass"," ")+w("green"," %d passing")+w("light"," (%s)"),console.log(t,e.passes||0,g(e.duration)),e.pending&&(t=w("pending"," ")+w("pending"," %d pending"),console.log(t,e.pending)),e.failures&&(t=w("fail"," %d failing"),console.error(t,e.failures),o.list(this.failures),console.error()),console.log()}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                ',e()),++n,console.log("%s

                                                %s

                                                ",e(),i.escape(t.title)),console.log("%s
                                                ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                ",e()),--n,console.log("%s
                                                ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                %s
                                                ",e(),i.escape(t.title));var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                                                %s
                                                ",e(),n)}),t.on("fail",function(t,n){console.log('%s
                                                %s
                                                ',e(),i.escape(t.title));var r=i.escape(i.clean(t.fn.toString()));console.log('%s
                                                %s
                                                ',e(),r),console.log('%s
                                                %s
                                                ',e(),i.escape(n))})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,.75*s.window.width|0),r=-1;t.on("start",function(){i.stdout.write("\n ")}),t.on("pending",function(){++r%n==0&&i.stdout.write("\n "),i.stdout.write(a("pending",s.symbols.dot))}),t.on("pass",function(t){++r%n==0&&i.stdout.write("\n "),i.stdout.write("slow"==t.speed?a("bright yellow",s.symbols.dot):a(t.speed,s.symbols.dot))}),t.on("fail",function(){++r%n==0&&i.stdout.write("\n "),i.stdout.write(a("fail",s.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function o(){}var s=n("./base"),a=s.color;e=t.exports=r,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",u=a.readFileSync(r,"utf8"),l=e.compile(u,{filename:r}),c=this;s.call(this,t,!1),t.on("end",function(){i.stdout.write(l({cov:c.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),a=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,r){function o(t){f.call(this,t);var e,n,r=this,o=this.stats,v=(t.total,s(m)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],T=y[2].getElementsByTagName("a")[0],k=y[3].getElementsByTagName("em")[0],E=v.getElementsByTagName("canvas")[0],j=s('
                                                  '),_=[j],C=document.getElementById("mocha");if(E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,n=E.getContext("2d"),n.scale(S,S),e=new h}return C?(c(b,"click",function(){u();var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&a("test pass")}),c(T,"click",function(){u();var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&a("test fail")}),C.appendChild(v),C.appendChild(j),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=r.suiteURL(t),n=s('
                                                • %s

                                                • ',e,d(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var i=o.tests/this.total*100|0;e&&e.update(i).draw(n);var a=new g-o.start;if(l(w,o.passes),l(x,o.failures),l(k,(a/1e3).toFixed(2)),"passed"==t.state)var u=r.testURL(t),f=s('
                                                • %e%ems ‣

                                                • ',t.speed,t.title,t.duration,u);else if(t.pending)var f=s('
                                                • %e

                                                • ',t.title);else{var f=s('
                                                • %e ‣

                                                • ',t.title,encodeURIComponent(t.fullTitle())),h=t.err.stack||t.err.toString();~h.indexOf(t.err.message)||(h=t.err.message+"\n"+h),"[object Error]"==h&&(h=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(h+="\n("+t.err.sourceURL+":"+t.err.line+")"),f.appendChild(s('
                                                  %e
                                                  ',h))}if(!t.pending){var d=f.getElementsByTagName("h2")[0];c(d,"click",function(){m.style.display="none"==m.style.display?"block":"none"});var m=s("
                                                  %e
                                                  ",p.clean(t.fn.toString()));f.appendChild(m),m.style.display="none"}_[0]&&_[0].appendChild(f)})):i("#mocha div missing, add it to your document")}function i(t){document.body.appendChild(s('
                                                  %s
                                                  ',t))}function s(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return d(e[r++])}}),n.firstChild}function a(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function a(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function u(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var l=r("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){i.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;s.call(this,t);var n=[],r=[],a=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){a.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:r.map(o),passes:a.map(o)};i.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration,err:t.err}}{var s=n("./base");s.cursor,s.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+u("runway",t)}s.call(this,t);var n=this,r=(this.stats,.75*s.window.width|0),o=t.total,l=i.stdout,c=u("plane","✈"),f=-1,p=0;t.on("start",function(){l.write("\n "),a.hide()}),t.on("test end",function(t){var n=-1==f?r*++p/o|0:f;"failed"==t.state&&(c=u("plane crash","✈"),f=n),l.write("\n\n"),l.write(e()),l.write("\n "),l.write(u("runway",Array(n).join("⋅"))),l.write(c),l.write(u("runway",Array(r-n).join("⋅")+"\n")),l.write(e()),l.write("")}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function o(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.plane=0,s.colors["plane crash"]=31,s.colors.runway=90,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){s.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){i.stdout.write(u("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=u("checkmark"," -")+u("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=u("checkmark"," "+s.symbols.dot)+u("pass"," %s: ")+u(t.speed,"%dms");a.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){a.CR(),console.log(u("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function o(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(u).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=r(t[i],e));return--e,o}function a(t){var e=n(t,{});return r(e,0)}o.call(this,t);var u=(this.stats,0),l="";a(t.suite),t.on("suite",function(t){++u;var n=s.slug(t.fullTitle());l+='\n',l+=e(t.title)+"\n"}),t.on("suite end",function(){--u}),t.on("pass",function(t){var e=s.clean(t.fn.toString());l+=t.title+".\n",l+="\n```js\n",l+=e+"\n",l+="```\n\n"}),t.on("end",function(){i.stdout.write("# TOC\n"),i.stdout.write(a(t.suite)),i.stdout.write(l)})}var o=n("./base"),s=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){s.call(this,t),t.on("start",function(){i.stdout.write(""),i.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function o(){}var s=n("./base");e=t.exports=r,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){a.call(this,t);{var e=this,n=(this.stats,.75*a.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11); +this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){a.cursor.hide(),e.draw()}),t.on("pending",function(){e.draw()}),t.on("pass",function(){e.draw()}),t.on("fail",function(){e.draw()}),t.on("end",function(){a.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){o("["+t.scoreboardWidth+"C"),o(e.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(){var t=this,e=this.scoreboardWidth+this.trajectories[0].length,n="["+e+"C",r="";o(n),o("_,------,"),o("\n"),o(n),r=t.tick?" ":" ",o("_|"+r+"/\\_/\\ "),o("\n"),o(n),r=t.tick?"_":"__";var i=t.tick?"~":"^";o(i+"|"+r+this.face()+" "),o("\n"),o(n),r=t.tick?" ":" ",o(r+'"" "" '),o("\n"),this.cursorUp(this.numberOfLines)},r.prototype.face=function(){var t=this.stats;return t.failures?"( x .x)":t.pending?"( o .o)":t.passes?"( ^ .^)":"( - .-)"},r.prototype.cursorUp=function(t){o("["+t+"A")},r.prototype.cursorDown=function(t){o("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=a.prototype,r.prototype=new s,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){s.call(this,t);var n=this,e=e||{},r=(this.stats,.5*s.window.width|0),o=t.total,l=0,c=(Math.max,-1);e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||s.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),a.hide()}),t.on("test end",function(){l++;var t=l/o,n=r*t|0,s=r-n;(c!==n||e.verbose)&&(c=n,a.CR(),i.stdout.write(""),i.stdout.write(u("progress"," "+e.open)),i.stdout.write(Array(n).join(e.complete)),i.stdout.write(Array(s).join(e.incomplete)),i.stdout.write(u("progress",e.close)),e.verbose&&i.stdout.write(u("progress"," "+l+" of "+o)))}),t.on("end",function(){a.show(),console.log(),n.epilogue()})}function o(){}var s=n("./base"),a=s.cursor,u=s.color;e=t.exports=r,s.colors.progress=90,o.prototype=s.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}i.call(this,t);var n=this,r=(this.stats,0),o=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+i.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+a("fail"," %d) %s"),++o,t.title)}),t.on("end",n.epilogue.bind(n))}function o(){}var i=n("./base"),s=i.cursor,a=i.color;e=t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,1),n=0,r=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){r++,console.log("not ok %d %s",e,o(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+r)),console.log("# pass "+n),console.log("# fail "+r)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,r){function o(t){l.call(this,t);var e=this.stats,n=[];t.on("pending",function(t){n.push(t)}),t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(a("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skipped:e.tests-e.failures-e.passes,timestamp:(new p).toUTCString(),time:e.duration/1e3||0},!1)),n.forEach(s),console.log("")})}function i(){}function s(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3||0};if("failed"==t.state){var n=t.err;console.log(a("testcase",e,!1,a("failure",{},!1,u(f(n.message)+"\n"+n.stack))))}else console.log(t.pending?a("testcase",e,!1,a("skipped",{},!0)):a("testcase",e,!0))}function a(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+f(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var l=r("./base"),c=r("../utils"),f=c.escape,p=n.Date;n.setTimeout,n.setInterval,n.clearTimeout,n.clearInterval}e=t.exports=o,i.prototype=l.prototype,o.prototype=new i,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,r){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this._enableTimeouts=!0,this.timedOut=!1}function i(){}var s=r("browser/events").EventEmitter,a=r("browser/debug")("mocha:runnable"),u=r("./ms"),l=n.Date,c=n.setTimeout,f=(n.setInterval,n.clearTimeout),p=(n.clearInterval,Object.prototype.toString);t.exports=o,i.prototype=s.prototype,o.prototype=new i,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=u(t)),a("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=u(t)),a("timeout %d",t),this._slow=t,this)},o.prototype.enableTimeouts=function(t){return 0===arguments.length?this._enableTimeouts:(a("enableTimeouts %s",t),this._enableTimeouts=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){f(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout()||1e9;this._enableTimeouts&&(this.clearTimeout(),this.timer=c(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.globals=function(t){this._allowedGlobals=t},o.prototype.run=function(t){function e(t){i||(i=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){var r=s.timeout();if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new l-a,o=!0,!n&&s.duration>r&&s._enableTimeouts&&(n=new Error("timeout of "+r+"ms exceeded")),t(n)}}function r(t){var e=t.call(u);e&&"function"==typeof e.then?(s.resetTimeout(),e.then(function(){n()},function(t){n(t||new Error("Promise rejected with no or falsy reason"))})):n()}var o,i,s=this,a=new l,u=this.ctx;if(u&&u.runnable(this),this.callback=n,this.async){this.resetTimeout();try{this.fn.call(u,function(t){return t instanceof Error||"[object Error]"===p.call(t)?n(t):null!=t?n("[object Object]"===Object.prototype.toString.call(t)?new Error("done() invoked with non-Error: "+JSON.stringify(t)):new Error("done() invoked with non-Error: "+t)):void n()})}catch(c){n(c)}}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending?n():r(this.fn)}catch(c){n(c)}}}}),t.register("runner.js",function(t,e,r){function o(t){var e=this;this._globals=[],this._abort=!1,this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(u()))}function s(){}function a(t,e){return p(e,function(e){if(/^d+/.test(e))return!1;if(n.navigator&&/^getInterface/.test(e))return!1;if(n.navigator&&/^\d+/.test(e))return!1;if(/^mocha-/.test(e))return!1;var r=p(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==r.length&&(!n.navigator||"onerror"!==e)})}function u(){if("object"==typeof i&&"string"==typeof i.version){var t=i.version.split(".").reduce(function(t,e){return t<<8|e});if(2315>t)return["errno"]}return[]}var l=r("browser/events").EventEmitter,c=r("browser/debug")("mocha:runner"),f=(r("./test"),r("./utils")),p=f.filter,h=(f.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=n.setImmediate||i.nextTick,s.prototype=l.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return c("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},o.prototype.globalProps=function(){for(var t=f.keys(n),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.suite.bail()&&this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=i[t];return o?s.failures&&r.bail()?e():(s.currentRunnable=o,o.ctx.currentTest=s.test,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(r){o.removeAllListeners("error");var i=o.error();return i&&s.fail(s.test,i),r?(s.failHook(o,r),e(r)):(s.emit("hook end",o),delete o.ctx.currentTest,void n(++t))})):e()}var r=this.suite,i=r["_"+t],s=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){if(t){var s=o.suite;return o.suite=i,n(t,s)}r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},o.prototype.runTests=function(t,e){function n(t,r,o){var s=i.suite;i.suite=o?r.parent:r,i.suite?i.hookUp("afterEach",function(t,o){return i.suite=s,t?n(t,o,!0):void e(r)}):(i.suite=s,e(r))}function r(a,u){if(i.failures&&t._bail)return e();if(i._abort)return e();if(a)return n(a,u,!0);if(o=s.shift(),!o)return e();var l=i._grep.test(o.fullTitle());return i._invert&&(l=!l),l?o.pending?(i.emit("pending",o),i.emit("test end",o),r()):(i.emit("test",i.test=o),void i.hookDown("beforeEach",function(t,e){return t?n(t,e,!1):(i.currentRunnable=i.test,void i.runTest(function(t){return o=i.test,t?(i.fail(o,t),i.emit("test end",o),i.hookUp("afterEach",r)):(o.state="passed",i.emit("pass",o),i.emit("test end",o),void i.hookUp("afterEach",r))}))})):r()}var o,i=this,s=t.tests.slice();this.next=r,r()},o.prototype.runSuite=function(t,e){function n(e){if(e)return e==t?r():r(e);if(i._abort)return r();var o=t.suites[s++];return o?void i.runSuite(o,n):r()}function r(n){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e(n)})}var o=this.grepTotal(t),i=this,s=0;return c("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(e){return e?r():void i.runTests(t,n)})):e()},o.prototype.uncaught=function(t){t?c("uncaught exception %s",t.message):(c("uncaught undefined exception"),t=new Error("Catched undefined error, did you throw without specifying what?"));var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return c("start"),this.on("end",function(){c("end"),i.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){c("finished running"),n.emit("end")}),i.on("uncaughtException",e),this},o.prototype.abort=function(){c("aborting"),this._abort=!0}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t;var n=function(){};n.prototype=e,this.ctx=new n,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._enableTimeouts=!0,this._slow=75,this._bail=!1}function o(){}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.enableTimeouts(this.enableTimeouts()),t.slow(this.slow()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.enableTimeouts=function(t){return 0===arguments.length?this._enableTimeouts:(s("enableTimeouts %s",t),this._enableTimeouts=t,this)},r.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),s("slow %d",t),this._slow=t,this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeAll.push(n),this.emit("beforeAll",n),this},r.prototype.afterAll=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after all" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._afterAll.push(n),this.emit("afterAll",n),this},r.prototype.beforeEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"before each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._beforeEach.push(n),this.emit("beforeEach",n),this},r.prototype.afterEach=function(t,e){if(this.pending)return this;"function"==typeof t&&(e=t,t=e.name),t='"after each" hook'+(t?": "+t:"");var n=new l(t,e);return n.parent=this,n.timeout(this.timeout()),n.enableTimeouts(this.enableTimeouts()),n.slow(this.slow()),n.ctx=this.ctx,this._afterEach.push(n),this.emit("afterEach",n),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.enableTimeouts(this.enableTimeouts()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.enableTimeouts(this.enableTimeouts()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){i.call(this,t,e),this.pending=!e,this.type="test"}function o(){}var i=n("./runnable");t.exports=r,o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew[ \t]+(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.map=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++)r.push(e.call(n,t[o],o));return r},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n){for(var r=n,o=0,i=t.length;i>o;o++)r=e(r,t[o],o,t);return r},e.filter=function(t,e){for(var n=[],r=0,o=t.length;o>r;r++){var i=t[r];e(i,r,t)&&n.push(i)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtime *{?/,"").replace(/\s+\}$/,"");var n=t.match(/^\n?( *)/)[1].length,r=t.match(/^\n?(\t*)/)[1].length,o=new RegExp("^\n?"+(r?" ":" ")+"{"+(r?r:n)+"}","gm");return t=t.replace(o,""),e.trim(t)},e.escapeRegexp=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},e.trim=function(t){return t.replace(/^\s+|\s+$/g,"")},e.parseQuery=function(t){return e.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),r=e.slice(0,n),o=e.slice(++n);return t[r]=decodeURIComponent(o),t},{})},e.highlightTags=function(t){for(var e=document.getElementsByTagName(t),n=0,r=e.length;r>n;++n)e[n].innerHTML=o(e[n].innerHTML)},e.stringify=function(t){return t instanceof RegExp?t.toString():JSON.stringify(e.canonicalize(t),null,2).replace(/,(\n|$)/g,"$1")},e.canonicalize=function(t,n){if(n=n||[],-1!==e.indexOf(n,t))return"[Circular]";var r;return"[object Array]"==={}.toString.call(t)?(n.push(t),r=e.map(t,function(t){return e.canonicalize(t,n)}),n.pop()):"object"==typeof t&&null!==t?(n.push(t),r={},e.forEach(e.keys(t).sort(),function(o){r[o]=e.canonicalize(t[o],n)}),n.pop()):r=t,r}});var n=function(){return this}(),r=n.Date,o=n.setTimeout,i=(n.setInterval,n.clearTimeout,n.clearInterval,{});i.exit=function(){},i.stdout={};var s=[],a=n.onerror;i.removeListener=function(t,e){if("uncaughtException"==t){n.onerror=a?a:function(){};var r=u.utils.indexOf(s,e);-1!=r&&s.splice(r,1)}},i.on=function(t,e){"uncaughtException"==t&&(n.onerror=function(t,n,r){return e(new Error(t+" ("+n+":"+r+")")),!0},s.push(e))};var u=n.Mocha=t("mocha"),l=n.mocha=new u({reporter:"html"});l.suite.removeAllListeners("pre-require");var c,f=[];u.Runner.immediately=function(t){f.push(t),c||(c=o(e,0))},l.throwError=function(t){throw u.utils.forEach(s,function(e){e(t)}),t},l.ui=function(t){return u.prototype.ui.call(this,t),this.suite.emit("pre-require",n,null,this),this},l.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},l.run=function(t){l.options;l.globals("location");var e=u.utils.parseQuery(n.location.search||"");return e.grep&&l.grep(e.grep),e.invert&&l.invert(),u.prototype.run.call(l,function(e){n.document&&u.utils.highlightTags("code"),t&&t(e)})},u.process=i}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.3.0/mocha.min.css b/ajax/libs/mocha/1.3.0/mocha.min.css new file mode 100644 index 000000000..32d94e79a --- /dev/null +++ b/ajax/libs/mocha/1.3.0/mocha.min.css @@ -0,0 +1 @@ +body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.3.0/mocha.min.js b/ajax/libs/mocha/1.3.0/mocha.min.js new file mode 100644 index 000000000..9bc2235de --- /dev/null +++ b/ajax/libs/mocha/1.3.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var s=0;ss;s++)if(o[s]===e||o[s].listener&&o[s].listener===e){r=s;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),s=0,i=r.length;i>s;s++)r[s].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,s=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,s,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,s,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,r-l/2+1,s+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.type="hook"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.xdescribe=function(){},t.xit=function(){},t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.it=t.specify=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var s;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var s=o.create(n[0],i);n.unshift(s),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var s=n("browser/path");e=t.exports=r,e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(){var t=this.suite;this.files.forEach(function(e){e=s.resolve(e),t.emit("pre-require",global,e),t.emit("require",n(e),e),t.emit("post-require",global,e)})},r.prototype.growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var s=n.failures+" of "+t.total+" tests failed";r(s,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(t):t,this},r.prototype.run=function(t){this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),s=new this._reporter(r);return r.ignoreLeaks=o.ignoreLeaks,o.grep&&r.grep(o.grep),o.globals&&r.globals(o.globals),o.growl&&this.growl(r,s),r.run(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new c}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new c,n.duration=new c-n.start}),t.on("pending",function(){n.pending++}))}function r(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return/^(\n+)$/.test(t.value)&&(t.value=Array(++RegExp.$1.length).join("")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=global.Date,l=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=o,e.useColors=l,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:l?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),o=t.err,i=o.message||"",a=o.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),l=o.actual,p=o.expected;if("string"==typeof l&&"string"==typeof p){var h=Math.max(l.length,p.length);c=20>h?s(o,"Chars"):s(o,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return r(++e,g)+" | "+t}).join("\n")}c="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=f("bright fail"," ✖")+f("fail"," %d of %d %s failed")+f("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(e=f("bright pass"," ✔")+f("green"," %d %s complete")+f("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=f("pending"," •")+f("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                  ',e()),++n,console.log("%s

                                                  %s

                                                  ",e(),t.title),console.log("%s
                                                  ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                  ",e()),--n,console.log("%s
                                                  ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                  %s
                                                  ",e(),t.title);var n=s.escape(s.clean(t.fn.toString()));console.log("%s
                                                  %s
                                                  ",e(),n)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(s("pending","."))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?s("bright yellow","."):s(t.speed,"."))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(s("fail","."))}),t.on("end",function(){console.log(),e.epilogue()})}var r=n("./base"),s=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",a=i.readFileSync(o,"utf8"),u=e.compile(a,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:r}))})}function r(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),i=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t){u.call(this,t);var e,n,o=this.stats,d=t.total,g=document.getElementById("mocha"),m=s(h),v=m.getElementsByTagName("li"),w=v[1].getElementsByTagName("em")[0],b=v[2].getElementsByTagName("em")[0],y=v[3].getElementsByTagName("em")[0],x=m.getElementsByTagName("canvas")[0],k=s('
                                                    '),j=[k];return x.getContext&&(n=x.getContext("2d"),e=new l),g?(g.appendChild(m),g.appendChild(k),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=location.protocol+"//"+location.host+location.pathname+"?grep=^"+c.escapeRegexp(t.fullTitle()),n=s('
                                                  • %s

                                                  • ',e,f(t.title));j[0].appendChild(n),j.unshift(document.createElement("ul")),n.appendChild(j[0])}}),t.on("suite end",function(t){t.root||j.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var r=o.tests/d*100|0;e&&e.update(r).draw(n);var u=new p-o.start;if(i(w,o.passes),i(b,o.failures),i(y,(u/1e3).toFixed(2)),"passed"==t.state)var l=s('
                                                  • %e%ems

                                                  • ',t.speed,t.title,t.duration);else if(t.pending)var l=s('
                                                  • %e

                                                  • ',t.title);else{var l=s('
                                                  • %e

                                                  • ',t.title),f=t.err.stack||t.err.toString();~f.indexOf(t.err.message)||(f=t.err.message+"\n"+f),"[object Error]"==f&&(f=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(f+="\n("+t.err.sourceURL+":"+t.err.line+")"),l.appendChild(s('
                                                    %e
                                                    ',f))}var h=l.getElementsByTagName("h2")[0];if(a(h,"click",function(){g.style.display="none"==g.style.display?"block":"none"}),!t.pending){var g=s("
                                                    %e
                                                    ",c.clean(t.fn.toString()));l.appendChild(g),g.style.display="none"}j[0].appendChild(l)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(s('
                                                    %s
                                                    ',t))}function s(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return f(e[o++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var u=n("./base"),c=n("../utils"),l=n("../browser/progress"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o;var h='
                                                    • passes: 0
                                                    • failures: 0
                                                    • duration: 0s
                                                    '}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Nyan=n("./nyan"),e.XUnit=n("./xunit"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function o(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var o=[],s=[],u=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=r(t);a.stats=n.stats,a.tests=o.map(i),a.failures=s.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function r(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var o=s(n,t[n]);e.files.push(o),e.hits+=o.hits,e.misses+=o.misses,e.sloc+=o.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(r),failures:o.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t,null,2))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}r.call(this,t);var n=this,o=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),s.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");s.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){s.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function i(t){var e=n(t,{});return o(e,0)}r.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=s.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=s.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var r=n("./base");e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){s.call(this,t);{var e=this,n=(this.stats,.75*s.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){s.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){s.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){r("["+t.scoreboardWidth+"C"),r(e.join("")),r("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(o){switch(r("["+n+"C"),o){case 0:r("_,------,"),r("\n");break;case 1:var s=e.tick?" ":" ";r("_|"+s+"/\\_/\\ "),r("\n");break;case 2:var i,s=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}r(a+"|"+s+i+" "),r("\n");break;case 3:var s=e.tick?" ":" ";r(s+'"" "" '),r("\n")}}),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){r("["+t+"A")},o.prototype.cursorDown=function(t){r("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),s=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*s+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){r.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),s.hide()}),t.on("test end",function(){u++;var t=u/a,n=o*t|0,r=o-n;s.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.progress=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}r.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){s.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,r(t))}),t.on("pass",function(t){console.log("ok %d %s",n,r(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,r(t)),console.log(e.stack.replace(/^/gm," "))})}function r(t){return t.fullTitle().replace(/#/g,"")}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){s.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var s=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("test end",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,i(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,s=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+s,o&&(r+=o+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}{var r=n("browser/events").EventEmitter,s=n("browser/debug")("runnable"),i=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){u(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(t){r||(r=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new i-c,o=!0,t(n)}}var o,r,s=this,u=this.timeout(),c=new i,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),s.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new i-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function r(t){return u(c(global),function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var s=n("browser/events").EventEmitter,i=n("browser/debug")("runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return i("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r(this._globals);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=r[t];return o?(s.currentRunnable=o,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var r=o.error();return r&&s.fail(s.test,r),e?s.failHook(o,e):(s.emit("hook end",o),void n(++t))})):e()}var o=this.suite,r=o["_"+t],s=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=s,n(t)):void o(e.pop())}):(r.suite=s,n())}var r=this,s=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(o=s.shift(),!o)return e();var i=r._grep.test(o.fullTitle());return r._invert&&(i=!i),i?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n)) +})})):n()}var o,r=this,s=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var r=this.grepTotal(t),s=this,a=0;return i("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){s.runTests(t,n)})):e()},o.prototype.uncaught=function(t){i("uncaught exception");var e=this.currentRunnable;if("failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var r=n("browser/events").EventEmitter,s=n("browser/debug")("suite"),i=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,e=n.fullTitle(),t.addSuite(n),n},o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return i.forEach(this.tests,t),i.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var r=n("browser/fs"),s=n("browser/path"),i=s.join,a=n("browser/debug")("watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var r=n,s=0,i=t.length;i>s;s++)r=e.call(o,r,t[s],s,t);return r},e.filter=function(t,e,n){for(var o=[],r=0,s=t.length;s>r;r++){var i=t[r];e.call(n,i,r,t)&&o.push(i)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),r.watchFile(t,n,function(n,o){o.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,o=e.length;o>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),o=e.slice(0,n),r=e.slice(++n);return t[o]=decodeURIComponent(r),t},{})}var o=mocha.utils,r={};mocha.suite=new mocha.Suite("",new mocha.Context),mocha.setup=function(t){if("string"==typeof t?r.ui=t:r=t,ui=mocha.interfaces[r.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');r.timeout&&mocha.suite.timeout(r.timeout),ui(mocha.suite),mocha.suite.emit("pre-require",window)},mocha.run=function(t){mocha.suite.emit("run");var o=new mocha.Runner(mocha.suite),s=r.reporter||mocha.reporters.HTML,i=(new s(o),n(window.location.search||""));return i.grep&&o.grep(new RegExp(i.grep)),r.ignoreLeaks&&(o.ignoreLeaks=!0),r.globals&&o.globals(r.globals),o.globals(["location"]),o.on("end",e),o.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.3.1/mocha.min.css b/ajax/libs/mocha/1.3.1/mocha.min.css new file mode 100644 index 000000000..39920bf97 --- /dev/null +++ b/ajax/libs/mocha/1.3.1/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#report.fail .test.pass,#report.pass .test.fail{display:none}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats a{text-decoration:none;color:inherit}#stats a:hover{border-bottom:1px solid #eee}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.3.1/mocha.min.js b/ajax/libs/mocha/1.3.1/mocha.min.js new file mode 100644 index 000000000..58b6cc24f --- /dev/null +++ b/ajax/libs/mocha/1.3.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var s=0;ss;s++)if(o[s]===e||o[s].listener&&o[s].listener===e){r=s;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),s=0,i=r.length;i>s;s++)r[s].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,s=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,s,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,s,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,r-l/2+1,s+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.type="hook"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.xdescribe=t.xcontext=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n(),e.shift()},t.describe=t.context=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;o.addTest(new r(t,n))},t.xit=t.xspecify=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var s;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var s=o.create(n[0],i);n.unshift(s),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var s=n("browser/path");e=t.exports=r,e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this.suite,o=this.files.length;this.files.forEach(function(r){r=s.resolve(r),e.emit("pre-require",global,r),e.emit("require",n(r),r),e.emit("post-require",global,r),--o||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var s=n.failures+" of "+t.total+" tests failed";r(s,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(t):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=t,this},r.prototype.run=function(t){this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),s=new this._reporter(r);return r.ignoreLeaks=o.ignoreLeaks,o.grep&&r.grep(o.grep,o.invert),o.globals&&r.globals(o.globals),o.growl&&this._growl(r,s),r.run(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new c}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new c,n.duration=new c-n.start}),t.on("pending",function(){n.pending++}))}function r(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return/^(\n+)$/.test(t.value)&&(t.value=Array(++RegExp.$1.length).join("")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=global.Date,l=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=o,e.useColors=l,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:l?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),o=t.err,i=o.message||"",a=o.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),l=o.actual,p=o.expected;if("string"==typeof l&&"string"==typeof p){var h=Math.max(l.length,p.length);c=20>h?s(o,"Chars"):s(o,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return r(++e,g)+" | "+t}).join("\n")}c="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=f("bright fail"," ✖")+f("fail"," %d of %d %s failed")+f("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(e=f("bright pass"," ✔")+f("green"," %d %s complete")+f("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=f("pending"," •")+f("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                    ',e()),++n,console.log("%s

                                                    %s

                                                    ",e(),t.title),console.log("%s
                                                    ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                    ",e()),--n,console.log("%s
                                                    ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                    %s
                                                    ",e(),t.title);var n=s.escape(s.clean(t.fn.toString()));console.log("%s
                                                    %s
                                                    ",e(),n)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),o="․",i=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(s("pending",o))}),t.on("pass",function(t){++i%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?s("bright yellow",o):s(t.speed,o))}),t.on("fail",function(){++i%n==0&&process.stdout.write("\n "),process.stdout.write(s("fail",o))}),t.on("end",function(){console.log(),e.epilogue()})}var r=n("./base"),s=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",a=i.readFileSync(o,"utf8"),u=e.compile(a,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:r}))})}function r(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),i=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t){u.call(this,t);var e,n,o=this.stats,d=t.total,g=document.getElementById("mocha"),m=s(h),v=m.getElementsByTagName("li"),w=v[1].getElementsByTagName("em")[0],b=v[1].getElementsByTagName("a")[0],y=v[2].getElementsByTagName("em")[0],x=v[2].getElementsByTagName("a")[0],k=v[3].getElementsByTagName("em")[0],E=m.getElementsByTagName("canvas")[0],T=s('
                                                      '),j=[T];return E.getContext&&(n=E.getContext("2d"),e=new l),g?(a(b,"click",function(){var t=/pass/.test(T.className)?"":" pass";T.className=T.className.replace(/fail|pass/g,"")+t}),a(x,"click",function(){var t=/fail/.test(T.className)?"":" fail";T.className=T.className.replace(/fail|pass/g,"")+t}),g.appendChild(m),g.appendChild(T),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=location.protocol+"//"+location.host+location.pathname+"?grep=^"+c.escapeRegexp(t.fullTitle()),n=s('
                                                    • %s

                                                    • ',e,f(t.title));j[0].appendChild(n),j.unshift(document.createElement("ul")),n.appendChild(j[0])}}),t.on("suite end",function(t){t.root||j.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var r=o.tests/d*100|0;e&&e.update(r).draw(n);var u=new p-o.start;if(i(w,o.passes),i(y,o.failures),i(k,(u/1e3).toFixed(2)),"passed"==t.state)var l=s('
                                                    • %e%ems

                                                    • ',t.speed,t.title,t.duration);else if(t.pending)var l=s('
                                                    • %e

                                                    • ',t.title);else{var l=s('
                                                    • %e

                                                    • ',t.title),f=t.err.stack||t.err.toString();~f.indexOf(t.err.message)||(f=t.err.message+"\n"+f),"[object Error]"==f&&(f=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(f+="\n("+t.err.sourceURL+":"+t.err.line+")"),l.appendChild(s('
                                                      %e
                                                      ',f))}if(!t.pending){var h=l.getElementsByTagName("h2")[0];a(h,"click",function(){g.style.display="none"==g.style.display?"inline-block":"none"});var g=s("
                                                      %e
                                                      ",c.clean(t.fn.toString()));l.appendChild(g),g.style.display="none"}j[0].appendChild(l)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(s('
                                                      %s
                                                      ',t))}function s(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return f(e[o++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var u=n("./base"),c=n("../utils"),l=n("../browser/progress"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o;var h=''}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Nyan=n("./nyan"),e.XUnit=n("./xunit"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function o(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var o=[],s=[],u=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=r(t);a.stats=n.stats,a.tests=o.map(i),a.failures=s.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function r(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var o=s(n,t[n]);e.files.push(o),e.hits+=o.hits,e.misses+=o.misses,e.sloc+=o.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(r),failures:o.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t,null,2))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}r.call(this,t);var n=this,o=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),s.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");s.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){s.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function i(t){var e=n(t,{});return o(e,0)}r.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=s.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=s.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var r=n("./base");e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){s.call(this,t);{var e=this,n=(this.stats,.75*s.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){s.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){s.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){r("["+t.scoreboardWidth+"C"),r(e.join("")),r("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(o){switch(r("["+n+"C"),o){case 0:r("_,------,"),r("\n");break;case 1:var s=e.tick?" ":" ";r("_|"+s+"/\\_/\\ "),r("\n");break;case 2:var i,s=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}r(a+"|"+s+i+" "),r("\n");break;case 3:var s=e.tick?" ":" ";r(s+'"" "" '),r("\n")}}),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){r("["+t+"A")},o.prototype.cursorDown=function(t){r("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),s=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*s+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){r.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),s.hide()}),t.on("test end",function(){u++;var t=u/a,n=o*t|0,r=o-n;s.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.progress=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}r.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){s.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,r(t))}),t.on("pass",function(t){console.log("ok %d %s",n,r(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,r(t)),console.log(e.stack.replace(/^/gm," "))})}function r(t){return t.fullTitle().replace(/#/g,"")}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){s.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var s=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,i(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,s=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+s,o&&(r+=o+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}{var r=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),i=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){u(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(t){r||(r=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new i-c,o=!0,t(n)}}var o,r,s=this,u=this.timeout(),c=new i,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),s.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new i-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function r(t){return u(c(global),function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var s=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return i("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r(this._globals);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=r[t];return o?(s.currentRunnable=o,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var r=o.error();return r&&s.fail(s.test,r),e?s.failHook(o,e):(s.emit("hook end",o),void n(++t))})):e()}var o=this.suite,r=o["_"+t],s=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=s,n(t)):void o(e.pop())}):(r.suite=s,n())}var r=this,s=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse(); +this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(o=s.shift(),!o)return e();var i=r._grep.test(o.fullTitle());return r._invert&&(i=!i),i?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n))})})):n()}var o,r=this,s=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var r=this.grepTotal(t),s=this,a=0;return i("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){s.runTests(t,n)})):e()},o.prototype.uncaught=function(t){i("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var r=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),i=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return i.forEach(this.tests,t),i.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var r=n("browser/fs"),s=n("browser/path"),i=s.join,a=n("browser/debug")("mocha:watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var r=n,s=0,i=t.length;i>s;s++)r=e.call(o,r,t[s],s,t);return r},e.filter=function(t,e,n){for(var o=[],r=0,s=t.length;s>r;r++){var i=t[r];e.call(n,i,r,t)&&o.push(i)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),r.watchFile(t,n,function(n,o){o.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,o=e.length;o>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),o=e.slice(0,n),r=e.slice(++n);return t[o]=decodeURIComponent(r),t},{})}var o=mocha.utils,r={};mocha.suite=new mocha.Suite("",new mocha.Context),mocha.setup=function(t){if("string"==typeof t?r.ui=t:r=t,ui=mocha.interfaces[r.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');r.timeout&&mocha.suite.timeout(r.timeout),ui(mocha.suite),mocha.suite.emit("pre-require",window)},mocha.run=function(t){mocha.suite.emit("run");var o=new mocha.Runner(mocha.suite),s=r.reporter||mocha.reporters.HTML,i=(new s(o),n(window.location.search||""));return i.grep&&o.grep(new RegExp(i.grep)),r.ignoreLeaks&&(o.ignoreLeaks=!0),r.globals&&o.globals(r.globals),o.globals(["location"]),o.on("end",e),o.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.3.2/mocha.min.css b/ajax/libs/mocha/1.3.2/mocha.min.css new file mode 100644 index 000000000..39920bf97 --- /dev/null +++ b/ajax/libs/mocha/1.3.2/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#report.fail .test.pass,#report.pass .test.fail{display:none}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats a{text-decoration:none;color:inherit}#stats a:hover{border-bottom:1px solid #eee}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.3.2/mocha.min.js b/ajax/libs/mocha/1.3.2/mocha.min.js new file mode 100644 index 000000000..58b6cc24f --- /dev/null +++ b/ajax/libs/mocha/1.3.2/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",r=e+"/index.js";return t.modules[o]&&o||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),r=n.split("/");o.pop();for(var s=0;ss;s++)if(o[s]===e||o[s].listener&&o[s].listener===e){r=s;break}if(0>r)return this;o.splice(r,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var r=e.slice(),s=0,i=r.length;i>s;s++)r[s].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,r=o,s=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,s,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,s,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,r-l/2+1,s+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.type="hook"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.xdescribe=t.xcontext=function(t,n){var r=o.create(e[0],t);r.pending=!0,e.unshift(r),n(),e.shift()},t.describe=t.context=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;o.addTest(new r(t,n))},t.xit=t.xspecify=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var s;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var s=o.create(n[0],i);n.unshift(s),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=o.create(e[0],t);e.unshift(r),n(),e.shift()},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var s=n("browser/path");e=t.exports=r,e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this.suite,o=this.files.length;this.files.forEach(function(r){r=s.resolve(r),e.emit("pre-require",global,r),e.emit("require",n(r),r),e.emit("post-require",global,r),--o||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var s=n.failures+" of "+t.total+" tests failed";r(s,{name:"mocha",title:"Failed",image:o("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(t):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=t,this},r.prototype.run=function(t){this.loadFiles();var n=this.suite,o=this.options,r=new e.Runner(n),s=new this._reporter(r);return r.ignoreLeaks=o.ignoreLeaks,o.grep&&r.grep(o.grep,o.invert),o.globals&&r.globals(o.globals),o.growl&&this._growl(r,s),r.run(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},o=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new c}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var o=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>o?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,o.push(t)}),t.on("end",function(){n.end=new c,n.duration=new c-n.start}),t.on("pending",function(){n.pending++}))}function r(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function s(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return/^(\n+)$/.test(t.value)&&(t.value=Array(++RegExp.$1.length).join("")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=global.Date,l=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=o,e.useColors=l,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:l?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),o=t.err,i=o.message||"",a=o.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),l=o.actual,p=o.expected;if("string"==typeof l&&"string"==typeof p){var h=Math.max(l.length,p.length);c=20>h?s(o,"Chars"):s(o,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return r(++e,g)+" | "+t}).join("\n")}c="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=f("bright fail"," ✖")+f("fail"," %d of %d %s failed")+f("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(e=f("bright pass"," ✔")+f("green"," %d %s complete")+f("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=f("pending"," •")+f("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                      ',e()),++n,console.log("%s

                                                      %s

                                                      ",e(),t.title),console.log("%s
                                                      ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                      ",e()),--n,console.log("%s
                                                      ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                      %s
                                                      ",e(),t.title);var n=s.escape(s.clean(t.fn.toString()));console.log("%s
                                                      %s
                                                      ",e(),n)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),o="․",i=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(s("pending",o))}),t.on("pass",function(t){++i%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?s("bright yellow",o):s(t.speed,o))}),t.on("fail",function(){++i%n==0&&process.stdout.write("\n "),process.stdout.write(s("fail",o))}),t.on("end",function(){console.log(),e.epilogue()})}var r=n("./base"),s=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",a=i.readFileSync(o,"utf8"),u=e.compile(a,{filename:o}),c=this;s.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:r}))})}function r(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var s=n("./json-cov"),i=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t){u.call(this,t);var e,n,o=this.stats,d=t.total,g=document.getElementById("mocha"),m=s(h),v=m.getElementsByTagName("li"),w=v[1].getElementsByTagName("em")[0],b=v[1].getElementsByTagName("a")[0],y=v[2].getElementsByTagName("em")[0],x=v[2].getElementsByTagName("a")[0],k=v[3].getElementsByTagName("em")[0],E=m.getElementsByTagName("canvas")[0],T=s('
                                                        '),j=[T];return E.getContext&&(n=E.getContext("2d"),e=new l),g?(a(b,"click",function(){var t=/pass/.test(T.className)?"":" pass";T.className=T.className.replace(/fail|pass/g,"")+t}),a(x,"click",function(){var t=/fail/.test(T.className)?"":" fail";T.className=T.className.replace(/fail|pass/g,"")+t}),g.appendChild(m),g.appendChild(T),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e=location.protocol+"//"+location.host+location.pathname+"?grep=^"+c.escapeRegexp(t.fullTitle()),n=s('
                                                      • %s

                                                      • ',e,f(t.title));j[0].appendChild(n),j.unshift(document.createElement("ul")),n.appendChild(j[0])}}),t.on("suite end",function(t){t.root||j.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var r=o.tests/d*100|0;e&&e.update(r).draw(n);var u=new p-o.start;if(i(w,o.passes),i(y,o.failures),i(k,(u/1e3).toFixed(2)),"passed"==t.state)var l=s('
                                                      • %e%ems

                                                      • ',t.speed,t.title,t.duration);else if(t.pending)var l=s('
                                                      • %e

                                                      • ',t.title);else{var l=s('
                                                      • %e

                                                      • ',t.title),f=t.err.stack||t.err.toString();~f.indexOf(t.err.message)||(f=t.err.message+"\n"+f),"[object Error]"==f&&(f=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(f+="\n("+t.err.sourceURL+":"+t.err.line+")"),l.appendChild(s('
                                                        %e
                                                        ',f))}if(!t.pending){var h=l.getElementsByTagName("h2")[0];a(h,"click",function(){g.style.display="none"==g.style.display?"inline-block":"none"});var g=s("
                                                        %e
                                                        ",c.clean(t.fn.toString()));l.appendChild(g),g.style.display="none"}j[0].appendChild(l)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(s('
                                                        %s
                                                        ',t))}function s(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return f(e[o++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var u=n("./base"),c=n("../utils"),l=n("../browser/progress"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o;var h=''}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Nyan=n("./nyan"),e.XUnit=n("./xunit"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function o(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var o=[],s=[],u=[];t.on("test end",function(t){o.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=r(t);a.stats=n.stats,a.tests=o.map(i),a.failures=s.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function r(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var o=s(n,t[n]);e.files.push(o),e.hits+=o.hits,e.misses+=o.misses,e.sloc+=o.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function s(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){s.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;s.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(r),failures:o.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t,null,2))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+i("runway",t)}r.call(this,t);var n=this,o=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),s.hide()}),t.on("test end",function(t){var n=-1==l?o*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");s.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){s.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+s.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=o(t[i],e));return--e,r}function i(t){var e=n(t,{});return o(e,0)}r.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=s.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=s.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var r=n("./base"),s=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var r=n("./base");e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){s.call(this,t);{var e=this,n=(this.stats,.75*s.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){s.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){s.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){r("["+t.scoreboardWidth+"C"),r(e.join("")),r("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(o){switch(r("["+n+"C"),o){case 0:r("_,------,"),r("\n");break;case 1:var s=e.tick?" ":" ";r("_|"+s+"/\\_/\\ "),r("\n");break;case 2:var i,s=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}r(a+"|"+s+i+" "),r("\n");break;case 3:var s=e.tick?" ":" ";r(s+'"" "" '),r("\n")}}),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){r("["+t+"A")},o.prototype.cursorDown=function(t){r("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),r=Math.floor(3*Math.sin(o)+3),s=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*r+6*s+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){r.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),s.hide()}),t.on("test end",function(){u++;var t=u/a,n=o*t|0,r=o-n;s.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){s.show(),console.log(),n.epilogue()})}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,r.colors.progress=90,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}r.call(this,t);var n=this,o=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");s.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");s.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){s.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var r=n("./base"),s=r.cursor,i=r.color;e=t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){s.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,r(t))}),t.on("pass",function(t){console.log("ok %d %s",n,r(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,r(t)),console.log(e.stack.replace(/^/gm," "))})}function r(t){return t.fullTitle().replace(/#/g,"")}{var s=n("./base");s.cursor,s.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){s.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var s=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(s("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(s("testcase",e,!1,s("failure",e,!1,i(n.stack))))}else console.log(t.pending?s("testcase",e,!1,s("skipped",{},!0)):s("testcase",e,!0))}function s(t,e,n,o){var r,s=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+s,o&&(r+=o+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,o.prototype=new a,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}{var r=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runnable"),i=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=o,o.prototype=new r,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(s("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){u(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(t){r||(r=!0,s.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!s.timedOut){if(o)return e(n);s.clearTimeout(),s.duration=new i-c,o=!0,t(n)}}var o,r,s=this,u=this.timeout(),c=new i,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),s.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new i-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function r(t){return u(c(global),function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var s=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=o,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return i("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},o.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r(this._globals);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=r[t];return o?(s.currentRunnable=o,s.emit("hook",o),o.on("error",function(t){s.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var r=o.error();return r&&s.fail(s.test,r),e?s.failHook(o,e):(s.emit("hook end",o),void n(++t))})):e()}var o=this.suite,r=o["_"+t],s=(o._timeout,this);process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=s,n(t)):void o(e.pop())}):(r.suite=s,n())}var r=this,s=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse(); +this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(o=s.shift(),!o)return e();var i=r._grep.test(o.fullTitle());return r._invert&&(i=!i),i?o.pending?(r.emit("pending",o),r.emit("test end",o),n()):(r.emit("test",r.test=o),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return o=r.test,t?(r.fail(o,t),r.emit("test end",o),r.hookUp("afterEach",n)):(o.state="passed",r.emit("pass",o),r.emit("test end",o),void r.hookUp("afterEach",n))})})):n()}var o,r=this,s=t.tests;this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void s.runSuite(e,n):o()}function o(){s.suite=t,s.hook("afterAll",function(){s.emit("suite end",t),e()})}var r=this.grepTotal(t),s=this,a=0;return i("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){s.runTests(t,n)})):e()},o.prototype.uncaught=function(t){i("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var r=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:suite"),i=n("./utils"),a=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},o.prototype=new r,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return s("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),s("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(s("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return i.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return i.forEach(this.tests,t),i.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}var r=n("./runnable");t.exports=o,o.prototype=new r,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~u.indexOf(t)}var r=n("browser/fs"),s=n("browser/path"),i=s.join,a=n("browser/debug")("mocha:watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,r=t.length;r>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,r=t.length;r>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n,o){for(var r=n,s=0,i=t.length;i>s;s++)r=e.call(o,r,t[s],s,t);return r},e.filter=function(t,e,n){for(var o=[],r=0,s=t.length;s>r;r++){var i=t[r];e.call(n,i,r,t)&&o.push(i)}return o},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),r.watchFile(t,n,function(n,o){o.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,o=e.length;o>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return o.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),o=e.slice(0,n),r=e.slice(++n);return t[o]=decodeURIComponent(r),t},{})}var o=mocha.utils,r={};mocha.suite=new mocha.Suite("",new mocha.Context),mocha.setup=function(t){if("string"==typeof t?r.ui=t:r=t,ui=mocha.interfaces[r.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');r.timeout&&mocha.suite.timeout(r.timeout),ui(mocha.suite),mocha.suite.emit("pre-require",window)},mocha.run=function(t){mocha.suite.emit("run");var o=new mocha.Runner(mocha.suite),s=r.reporter||mocha.reporters.HTML,i=(new s(o),n(window.location.search||""));return i.grep&&o.grep(new RegExp(i.grep)),r.ignoreLeaks&&(o.ignoreLeaks=!0),r.globals&&o.globals(r.globals),o.globals(["location"]),o.on("end",e),o.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.4.0/mocha.min.css b/ajax/libs/mocha/1.4.0/mocha.min.css new file mode 100644 index 000000000..39920bf97 --- /dev/null +++ b/ajax/libs/mocha/1.4.0/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#report.fail .test.pass,#report.pass .test.fail{display:none}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats a{text-decoration:none;color:inherit}#stats a:hover{border-bottom:1px solid #eee}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.4.0/mocha.min.js b/ajax/libs/mocha/1.4.0/mocha.min.js new file mode 100644 index 000000000..add9ae994 --- /dev/null +++ b/ajax/libs/mocha/1.4.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;ii;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,o-l/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=r,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n(),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n(),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);i.grep(r.fullTitle())},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n);i.grep(r.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n(),e.shift(),o},t.suite.only=function(e,n){var r=t.suite(e,n);i.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n);i.grep(r.fullTitle())}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var i=n("browser/path");e=t.exports=o,e.utils=n("./utils"),e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(t):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=t,this},o.prototype.run=function(t){this.loadFiles();var n=this.suite,r=this.options,o=new e.Runner(n),i=new this._reporter(o);return o.ignoreLeaks=r.ignoreLeaks,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),o.run(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},r=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new c}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var r=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>r?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,r.push(t)}),t.on("end",function(){n.end=new c,n.duration=new c-n.start}),t.on("pending",function(){n.pending++}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function i(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return/^(\n+)$/.test(t.value)&&(t.value=Array(++RegExp.$1.length).join("")),t.added?s("diff added",t.value):t.removed?s("diff removed",t.value):t.value}).join("")}function s(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=global.Date,l=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=r,e.useColors=l,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:l?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),r=t.err,s=r.message||"",a=r.stack||s,u=a.indexOf(s)+s.length,c=a.slice(0,u),l=r.actual,p=r.expected;if("string"==typeof l&&"string"==typeof p){var h=Math.max(l.length,p.length);c=20>h?i(r,"Chars"):i(r,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return o(++e,g)+" | "+t}).join("\n")}c="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},r.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=f("bright fail"," ✖")+f("fail"," %d of %d %s failed")+f("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),r.list(this.failures),void console.error()):(e=f("bright pass"," ✔")+f("green"," %d %s complete")+f("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=f("pending"," •")+f("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                        ',e()),++n,console.log("%s

                                                        %s

                                                        ",e(),t.title),console.log("%s
                                                        ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                        ",e()),--n,console.log("%s
                                                        ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                        %s
                                                        ",e(),t.title);var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                                                        %s
                                                        ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),r="․",s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending",r))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow",r):i(t.speed,r))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail",r))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),i=o.color;e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",a=s.readFileSync(r,"utf8"),u=e.compile(a,{filename:r}),c=this;i.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var i=n("./json-cov"),s=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t){u.call(this,t);var e,n,r=this.stats,d=t.total,g=document.getElementById("mocha"),m=i(h),v=m.getElementsByTagName("li"),w=v[1].getElementsByTagName("em")[0],b=v[1].getElementsByTagName("a")[0],y=v[2].getElementsByTagName("em")[0],x=v[2].getElementsByTagName("a")[0],k=v[3].getElementsByTagName("em")[0],T=m.getElementsByTagName("canvas")[0],E=i('
                                                          '),j=[E];if(T.getContext){var _=window.devicePixelRatio||1;T.style.width=T.width,T.style.height=T.height,T.width*=_,T.height*=_,n=T.getContext("2d"),n.scale(_,_),e=new l}return g?(a(b,"click",function(){var t=/pass/.test(E.className)?"":" pass";E.className=E.className.replace(/fail|pass/g,"")+t}),a(x,"click",function(){var t=/fail/.test(E.className)?"":" fail";E.className=E.className.replace(/fail|pass/g,"")+t}),g.appendChild(m),g.appendChild(E),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e="^"+encodeURIComponent(c.escapeRegexp(t.fullTitle())),n=location.protocol+"//"+location.host+location.pathname+"?grep="+e,r=i('
                                                        • %s

                                                        • ',n,f(t.title));j[0].appendChild(r),j.unshift(document.createElement("ul")),r.appendChild(j[0])}}),t.on("suite end",function(t){t.root||j.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var o=r.tests/d*100|0;e&&e.update(o).draw(n);var u=new p-r.start;if(s(w,r.passes),s(y,r.failures),s(k,(u/1e3).toFixed(2)),"passed"==t.state)var l=i('
                                                        • %e%ems

                                                        • ',t.speed,t.title,t.duration);else if(t.pending)var l=i('
                                                        • %e

                                                        • ',t.title);else{var l=i('
                                                        • %e

                                                        • ',t.title),f=t.err.stack||t.err.toString();~f.indexOf(t.err.message)||(f=t.err.message+"\n"+f),"[object Error]"==f&&(f=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(f+="\n("+t.err.sourceURL+":"+t.err.line+")"),l.appendChild(i('
                                                          %e
                                                          ',f))}if(!t.pending){var h=l.getElementsByTagName("h2")[0];a(h,"click",function(){g.style.display="none"==g.style.display?"inline-block":"none"});var g=i("
                                                          %e
                                                          ",c.clean(t.fn.toString()));l.appendChild(g),g.style.display="none"}j[0].appendChild(l)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                                                          %s
                                                          ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return f(e[r++])}}),n.firstChild}function s(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var u=n("./base"),c=n("../utils"),l=n("../browser/progress"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r;var h=''}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Nyan=n("./nyan"),e.XUnit=n("./xunit"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function r(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var r=[],i=[],u=[];t.on("test end",function(t){r.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){i.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=o(t);a.stats=n.stats,a.tests=r.map(s),a.failures=i.map(s),a.passes=u.map(s),e&&process.stdout.write(JSON.stringify(a,null,2))})}function o(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var r=i(n,t[n]);e.files.push(r),e.hits+=r.hits,e.misses+=r.misses,e.sloc+=r.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function i(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;i.call(this,t);var n=[],r=[],s=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){s.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:r.map(o),passes:s.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+s("runway",t)}o.call(this,t);var n=this,r=(this.stats,.75*o.window.width|0),a=t.total,u=process.stdout,c=s("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==l?r*++f/a|0:l;"failed"==t.state&&(c=s("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(s("runway",Array(n).join("⋅"))),u.write(c),u.write(s("runway",Array(r-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(s("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=s("checkmark"," -")+s("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=s("checkmark"," ✓")+s("pass"," %s: ")+s(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(s("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var s in t)"suite"!=s&&(s&&(n=" - ["+s+"](#"+i.slug(t[s].suite.fullTitle())+")\n"),s&&(o+=Array(e).join(" ")+n),o+=r(t[s],e));return--e,o}function s(t){var e=n(t,{});return r(e,0)}o.call(this,t);var a=(this.stats,t.total,0),u="";s(t.suite),t.on("suite",function(t){++a;var n=i.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=i.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(s(t.suite)),process.stdout.write(u)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){o.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var o=n("./base");e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){i.call(this,t);{var e=this,n=(this.stats,.75*i.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){i.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){i.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){o("["+t.scoreboardWidth+"C"),o(e.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(r){switch(o("["+n+"C"),r){case 0:o("_,------,"),o("\n");break;case 1:var i=e.tick?" ":" ";o("_|"+i+"/\\_/\\ "),o("\n");break;case 2:var s,i=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":s="( ^ .^)";break;case"fail":s="( o .o)";break;default:s="( - .-)"}o(a+"|"+i+s+" "),o("\n");break;case 3:var i=e.tick?" ":" ";o(i+'"" "" '),o("\n")}}),this.cursorUp(this.numberOfLines)},r.prototype.cursorUp=function(t){o("["+t+"A")},r.prototype.cursorDown=function(t){o("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){o.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*o.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){u++;var t=u/a,n=r*t|0,o=r-n;i.CR(),process.stdout.write(""),process.stdout.write(s("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(s("progress",e.close)),e.verbose&&process.stdout.write(s("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,o.colors.progress=90,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}o.call(this,t);var n=this,r=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(s("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("test",function(t){process.stdout.write(e()+s("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+s("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+s("checkmark"," ✓")+s("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+s("checkmark"," ✓")+s("pass"," %s ")+s(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+s("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,o(t))}),t.on("pass",function(t){console.log("ok %d %s",n,o(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,o(t)),console.log(e.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/teamcity.js",function(t,e,n){function r(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+o(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+o(t.fullTitle())+"' message='"+o(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+o(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+o(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function o(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var i=n("./base");e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,s(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,r.prototype=new a,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}{var o=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runnable"),s=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=r,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){u(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},r.prototype.run=function(t){function e(t){o||(o=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(r)return e(n);i.clearTimeout(),i.duration=new s-c,r=!0,t(n)}}var r,o,i=this,u=this.timeout(),c=new s,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),i.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new s-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function o(t){return u(c(global),function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=r,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return s("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globals=function(t){return 0==arguments.length?this._globals:(s("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},r.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=o(this._globals);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},r.prototype.hook=function(t,e){function n(t){var r=o[t];return r?(i.currentRunnable=r,i.emit("hook",r),r.on("error",function(t){i.failHook(r,t) +}),void r.run(function(e){r.removeAllListeners("error");var o=r.error();return o&&i.fail(i.test,o),e?i.failHook(r,e):(i.emit("hook end",r),void n(++t))})):e()}var r=this.suite,o=r["_"+t],i=(r._timeout,this);process.nextTick(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){return t?(o.suite=i,n(t)):void r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(){if(o.failures&&t._bail)return e();if(r=i.shift(),!r)return e();var s=o._grep.test(r.fullTitle());return o._invert&&(s=!s),s?r.pending?(o.emit("pending",r),o.emit("test end",r),n()):(o.emit("test",o.test=r),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return r=o.test,t?(o.fail(r,t),o.emit("test end",r),o.hookUp("afterEach",n)):(r.state="passed",o.emit("pass",r),o.emit("test end",r),void o.hookUp("afterEach",n))})})):n()}var r,o=this,i=t.tests;this.next=n,n()},r.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void i.runSuite(e,n):r()}function r(){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e()})}var o=this.grepTotal(t),i=this,a=0;return s("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){s("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return s("start"),this.on("end",function(){s("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){s("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var o=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:suite"),s=n("./utils"),a=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t){if(this.pending)return this;var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){if(this.pending)return this;var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){if(this.pending)return this;var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){if(this.pending)return this;var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return s.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return s.forEach(this.tests,t),s.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~u.indexOf(t)}var o=n("browser/fs"),i=n("browser/path"),s=i.join,a=n("browser/debug")("mocha:watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n,r){for(var o=n,i=0,s=t.length;s>i;i++)o=e.call(r,o,t[i],i,t);return o},e.filter=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++){var s=t[o];e.call(n,s,o,t)&&r.push(s)}return r},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),o.watchFile(t,n,function(n,r){r.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,r=e.length;r>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return r.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),r=e.slice(0,n),o=e.slice(++n);return t[r]=decodeURIComponent(o),t},{})}var r=mocha.utils,o={};mocha.suite=new mocha.Suite("",new mocha.Context),mocha.grep=function(t){o.grep=new RegExp(r.escapeRegexp(t))},mocha.setup=function(t){if("string"==typeof t?o.ui=t:o=t,ui=mocha.interfaces[o.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');o.timeout&&mocha.suite.timeout(o.timeout),ui(mocha.suite),mocha.suite.emit("pre-require",window,null,mocha)},mocha.run=function(t){mocha.suite.emit("run");var r=new mocha.Runner(mocha.suite),i=o.reporter||mocha.reporters.HTML,s=(new i(r),n(window.location.search||""));return s.grep&&r.grep(new RegExp(s.grep)),o.grep&&r.grep(o.grep),o.ignoreLeaks&&(r.ignoreLeaks=!0),o.globals&&r.globals(o.globals),r.globals(["location"]),r.on("end",e),r.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.4.1/mocha.min.css b/ajax/libs/mocha/1.4.1/mocha.min.css new file mode 100644 index 000000000..39920bf97 --- /dev/null +++ b/ajax/libs/mocha/1.4.1/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#report.fail .test.pass,#report.pass .test.fail{display:none}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats a{text-decoration:none;color:inherit}#stats a:hover{border-bottom:1px solid #eee}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.4.1/mocha.min.js b/ajax/libs/mocha/1.4.1/mocha.min.js new file mode 100644 index 000000000..498e9c7cf --- /dev/null +++ b/ajax/libs/mocha/1.4.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;ii;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,o-l/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=r,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n(),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n(),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);i.grep(r.fullTitle())},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n);i.grep(r.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n(),e.shift(),o},t.suite.only=function(e,n){var r=t.suite(e,n);i.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n);i.grep(r.fullTitle())}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.suite.timeout(t.timeout)}var i=n("browser/path"),s=n("./utils");e=t.exports=o,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if(t=t||"dot",this._reporter=n("./reporters/"+t),!this._reporter)throw new Error('invalid reporter "'+t+'"');return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=t,this},o.prototype.run=function(t){this.loadFiles();var n=this.suite,r=this.options,o=new e.Runner(n),i=new this._reporter(o);return o.ignoreLeaks=r.ignoreLeaks,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),o.run(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},r=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new c}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var r=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>r?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,r.push(t)}),t.on("end",function(){n.end=new c,n.duration=new c-n.start}),t.on("pending",function(){n.pending++}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function i(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return/^(\n+)$/.test(t.value)&&(t.value=Array(++RegExp.$1.length).join("")),t.added?s("diff added",t.value):t.removed?s("diff removed",t.value):t.value}).join("")}function s(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=global.Date,l=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=r,e.useColors=l,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:l?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),r=t.err,s=r.message||"",a=r.stack||s,u=a.indexOf(s)+s.length,c=a.slice(0,u),l=r.actual,p=r.expected;if("string"==typeof l&&"string"==typeof p){var h=Math.max(l.length,p.length);c=20>h?i(r,"Chars"):i(r,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return o(++e,g)+" | "+t}).join("\n")}c="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},r.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=f("bright fail"," ✖")+f("fail"," %d of %d %s failed")+f("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),r.list(this.failures),void console.error()):(e=f("bright pass"," ✔")+f("green"," %d %s complete")+f("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=f("pending"," •")+f("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                          ',e()),++n,console.log("%s

                                                          %s

                                                          ",e(),t.title),console.log("%s
                                                          ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                          ",e()),--n,console.log("%s
                                                          ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                          %s
                                                          ",e(),t.title);var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                                                          %s
                                                          ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),r="․",s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending",r))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow",r):i(t.speed,r))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail",r))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),i=o.color;e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",a=s.readFileSync(r,"utf8"),u=e.compile(a,{filename:r}),c=this;i.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var i=n("./json-cov"),s=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t){u.call(this,t);var e,n,r=this.stats,d=t.total,g=document.getElementById("mocha"),m=i(h),v=m.getElementsByTagName("li"),w=v[1].getElementsByTagName("em")[0],b=v[1].getElementsByTagName("a")[0],y=v[2].getElementsByTagName("em")[0],x=v[2].getElementsByTagName("a")[0],k=v[3].getElementsByTagName("em")[0],T=m.getElementsByTagName("canvas")[0],E=i('
                                                            '),j=[E];if(T.getContext){var _=window.devicePixelRatio||1;T.style.width=T.width,T.style.height=T.height,T.width*=_,T.height*=_,n=T.getContext("2d"),n.scale(_,_),e=new l}return g?(a(b,"click",function(){var t=/pass/.test(E.className)?"":" pass";E.className=E.className.replace(/fail|pass/g,"")+t}),a(x,"click",function(){var t=/fail/.test(E.className)?"":" fail";E.className=E.className.replace(/fail|pass/g,"")+t}),g.appendChild(m),g.appendChild(E),e&&e.size(40),t.on("suite",function(t){if(!t.root){var e="^"+encodeURIComponent(c.escapeRegexp(t.fullTitle())),n=location.protocol+"//"+location.host+location.pathname+"?grep="+e,r=i('
                                                          • %s

                                                          • ',n,f(t.title));j[0].appendChild(r),j.unshift(document.createElement("ul")),r.appendChild(j[0])}}),t.on("suite end",function(t){t.root||j.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var o=r.tests/d*100|0;e&&e.update(o).draw(n);var u=new p-r.start;if(s(w,r.passes),s(y,r.failures),s(k,(u/1e3).toFixed(2)),"passed"==t.state)var l=i('
                                                          • %e%ems

                                                          • ',t.speed,t.title,t.duration);else if(t.pending)var l=i('
                                                          • %e

                                                          • ',t.title);else{var l=i('
                                                          • %e

                                                          • ',t.title),f=t.err.stack||t.err.toString();~f.indexOf(t.err.message)||(f=t.err.message+"\n"+f),"[object Error]"==f&&(f=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(f+="\n("+t.err.sourceURL+":"+t.err.line+")"),l.appendChild(i('
                                                            %e
                                                            ',f))}if(!t.pending){var h=l.getElementsByTagName("h2")[0];a(h,"click",function(){g.style.display="none"==g.style.display?"inline-block":"none"});var g=i("
                                                            %e
                                                            ",c.clean(t.fn.toString()));l.appendChild(g),g.style.display="none"}j[0].appendChild(l)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                                                            %s
                                                            ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return f(e[r++])}}),n.firstChild}function s(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var u=n("./base"),c=n("../utils"),l=n("../browser/progress"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r;var h=''}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Nyan=n("./nyan"),e.XUnit=n("./xunit"),e.Markdown=n("./markdown"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function r(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var r=[],i=[],u=[];t.on("test end",function(t){r.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){i.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=o(t);a.stats=n.stats,a.tests=r.map(s),a.failures=i.map(s),a.passes=u.map(s),e&&process.stdout.write(JSON.stringify(a,null,2))})}function o(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var r=i(n,t[n]);e.files.push(r),e.hits+=r.hits,e.misses+=r.misses,e.sloc+=r.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function i(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;i.call(this,t);var n=[],r=[],s=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){s.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:r.map(o),passes:s.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+s("runway",t)}o.call(this,t);var n=this,r=(this.stats,.75*o.window.width|0),a=t.total,u=process.stdout,c=s("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==l?r*++f/a|0:l;"failed"==t.state&&(c=s("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(s("runway",Array(n).join("⋅"))),u.write(c),u.write(s("runway",Array(r-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(s("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=s("checkmark"," -")+s("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=s("checkmark"," ✓")+s("pass"," %s: ")+s(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(s("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var s in t)"suite"!=s&&(s&&(n=" - ["+s+"](#"+i.slug(t[s].suite.fullTitle())+")\n"),s&&(o+=Array(e).join(" ")+n),o+=r(t[s],e));return--e,o}function s(t){var e=n(t,{});return r(e,0)}o.call(this,t);var a=(this.stats,t.total,0),u="";s(t.suite),t.on("suite",function(t){++a;var n=i.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=i.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(s(t.suite)),process.stdout.write(u)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){o.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var o=n("./base");e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){i.call(this,t);{var e=this,n=(this.stats,.75*i.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){i.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){i.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){o("["+t.scoreboardWidth+"C"),o(e.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(r){switch(o("["+n+"C"),r){case 0:o("_,------,"),o("\n");break;case 1:var i=e.tick?" ":" ";o("_|"+i+"/\\_/\\ "),o("\n");break;case 2:var s,i=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":s="( ^ .^)";break;case"fail":s="( o .o)";break;default:s="( - .-)"}o(a+"|"+i+s+" "),o("\n");break;case 3:var i=e.tick?" ":" ";o(i+'"" "" '),o("\n")}}),this.cursorUp(this.numberOfLines)},r.prototype.cursorUp=function(t){o("["+t+"A")},r.prototype.cursorDown=function(t){o("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){o.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*o.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){u++;var t=u/a,n=r*t|0,o=r-n;i.CR(),process.stdout.write(""),process.stdout.write(s("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(s("progress",e.close)),e.verbose&&process.stdout.write(s("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,o.colors.progress=90,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}o.call(this,t);var n=this,r=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(s("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("test",function(t){process.stdout.write(e()+s("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+s("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+s("checkmark"," ✓")+s("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+s("checkmark"," ✓")+s("pass"," %s ")+s(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+s("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,o(t))}),t.on("pass",function(t){console.log("ok %d %s",n,o(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,o(t)),console.log(e.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/teamcity.js",function(t,e,n){function r(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+o(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+o(t.fullTitle())+"' message='"+o(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+o(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+o(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function o(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var i=n("./base");e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,s(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,r.prototype=new a,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}{var o=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runnable"),s=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=r,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){u(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},r.prototype.run=function(t){function e(t){o||(o=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(r)return e(n);i.clearTimeout(),i.duration=new s-c,r=!0,t(n)}}var r,o,i=this,u=this.timeout(),c=new s,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),i.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new s-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function o(t){return u(c(global),function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=r,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return s("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globals=function(t){return 0==arguments.length?this._globals:(s("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},r.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=o(this._globals);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},r.prototype.hook=function(t,e){function n(t){var r=o[t];return r?(i.currentRunnable=r,i.emit("hook",r),r.on("error",function(t){i.failHook(r,t) +}),void r.run(function(e){r.removeAllListeners("error");var o=r.error();return o&&i.fail(i.test,o),e?i.failHook(r,e):(i.emit("hook end",r),void n(++t))})):e()}var r=this.suite,o=r["_"+t],i=(r._timeout,this);process.nextTick(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){return t?(o.suite=i,n(t)):void r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(){if(o.failures&&t._bail)return e();if(r=i.shift(),!r)return e();var s=o._grep.test(r.fullTitle());return o._invert&&(s=!s),s?r.pending?(o.emit("pending",r),o.emit("test end",r),n()):(o.emit("test",o.test=r),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return r=o.test,t?(o.fail(r,t),o.emit("test end",r),o.hookUp("afterEach",n)):(r.state="passed",o.emit("pass",r),o.emit("test end",r),void o.hookUp("afterEach",n))})})):n()}var r,o=this,i=t.tests;this.next=n,n()},r.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void i.runSuite(e,n):r()}function r(){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e()})}var o=this.grepTotal(t),i=this,a=0;return s("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){s("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return s("start"),this.on("end",function(){s("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){s("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var o=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:suite"),s=n("./utils"),a=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t){if(this.pending)return this;var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){if(this.pending)return this;var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){if(this.pending)return this;var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){if(this.pending)return this;var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return s.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return s.forEach(this.tests,t),s.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~u.indexOf(t)}var o=n("browser/fs"),i=n("browser/path"),s=i.join,a=n("browser/debug")("mocha:watch"),u=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n,r){for(var o=n,i=0,s=t.length;s>i;i++)o=e.call(r,o,t[i],i,t);return o},e.filter=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++){var s=t[o];e.call(n,s,o,t)&&r.push(s)}return r},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){a("file %s",t),o.watchFile(t,n,function(n,r){r.mtime/g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}function e(){for(var e=document.getElementsByTagName("code"),n=0,r=e.length;r>n;++n)e[n].innerHTML=t(e[n].innerHTML)}function n(t){return r.reduce(t.replace("?","").split("&"),function(t,e){var n=e.indexOf("="),r=e.slice(0,n),o=e.slice(++n);return t[r]=decodeURIComponent(o),t},{})}var r=mocha.utils,o={};mocha.suite=new mocha.Suite("",new mocha.Context),mocha.grep=function(t){o.grep=new RegExp(r.escapeRegexp(t))},mocha.setup=function(t){if("string"==typeof t?o.ui=t:o=t,ui=mocha.interfaces[o.ui],!ui)throw new Error('invalid mocha interface "'+ui+'"');o.timeout&&mocha.suite.timeout(o.timeout),ui(mocha.suite),mocha.suite.emit("pre-require",window,null,mocha)},mocha.run=function(t){mocha.suite.emit("run");var r=new mocha.Runner(mocha.suite),i=o.reporter||mocha.reporters.HTML,s=(new i(r),n(window.location.search||""));return s.grep&&r.grep(new RegExp(s.grep)),o.grep&&r.grep(o.grep),o.ignoreLeaks&&(r.ignoreLeaks=!0),o.globals&&r.globals(o.globals),r.globals(["location"]),r.on("end",e),r.run(t)}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.4.2/mocha.min.css b/ajax/libs/mocha/1.4.2/mocha.min.css new file mode 100644 index 000000000..39920bf97 --- /dev/null +++ b/ajax/libs/mocha/1.4.2/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#report.fail .test.pass,#report.pass .test.fail{display:none}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats a{text-decoration:none;color:inherit}#stats a:hover{border-bottom:1px solid #eee}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.4.2/mocha.min.js b/ajax/libs/mocha/1.4.2/mocha.min.js new file mode 100644 index 000000000..58204f33f --- /dev/null +++ b/ajax/libs/mocha/1.4.2/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),r=t.modules[n];if(!r)throw new Error('failed to require "'+e+'"');return r.exports||(r.exports={},r.call(r.exports,r,r.exports,t.relative(n))),r.exports}t.modules={},t.resolve=function(e){var n=e,r=e+".js",o=e+"/index.js";return t.modules[r]&&r||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var r=e.split("/"),o=n.split("/");r.pop();for(var i=0;ii;i++)if(r[i]===e||r[i].listener&&r[i].listener===e){o=i;break}if(0>o)return this;r.splice(o,1),r.length||delete this.$events[t]}else(r===e||r.listener&&r.listener===e)&&delete this.$events[t]}return this},r.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},r.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},r.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var r=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,r);else{if(!n(e))return!1;for(var o=e.slice(),i=0,s=o.length;s>i;i++)o[i].apply(this,r)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,r=n/2,o=r,i=r,s=r-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,i,s,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,i,s-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,o-l/2+1,i+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function r(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=r,r.prototype=new o,r.prototype.constructor=r,r.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n(),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=r.create(e[0],t);o.pending=!0,e.unshift(o),n(),e.shift()},t.describe.only=function(e,n){var r=t.describe(e,n);i.grep(r.fullTitle())},t.it=t.specify=function(t,n){var r=e[0];if(r.pending)var n=null;var i=new o(t,n);return r.addTest(i),i},t.it.only=function(e,n){var r=t.it(e,n);i.grep(r.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var i;for(var s in t)if("function"==typeof t[s]){var a=t[s];switch(s){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(s,a))}}else{var i=r.create(n[0],s);n.unshift(i),e(t[s]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=r.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var r=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,i){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=r.create(e[0],t);return e.unshift(o),n(),e.shift(),o},t.suite.only=function(e,n){var r=t.suite(e,n);i.grep(r.fullTitle())},t.test=function(t,n){var r=new o(t,n);return e[0].addTest(r),r},t.test.only=function(e,n){var r=t.test(e,n);i.grep(r.fullTitle())}})}}),t.register("mocha.js",function(t,e,n){function r(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout)}var i=n("browser/path"),s=n("./utils");e=t.exports=o,e.utils=s,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,r=this.suite,o=this.files.length;this.files.forEach(function(s){s=i.resolve(s),r.emit("pre-require",global,s,e),r.emit("require",n(s),s,e),r.emit("post-require",global,s,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var i=n.failures+" of "+t.total+" tests failed";o(i,{name:"mocha",title:"Failed",image:r("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:r("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(s.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.run=function(t){this.loadFiles();var n=this.suite,r=this.options,o=new e.Runner(n),i=new this._reporter(o);return o.ignoreLeaks=r.ignoreLeaks,r.grep&&o.grep(r.grep,r.invert),r.globals&&o.globals(r.globals),r.growl&&this._growl(o,i),o.run(t)}}),t.register("reporters/base.js",function(t,e,n){function r(t){var n=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},r=this.failures=[];t&&(this.runner=t,t.on("start",function(){n.start=new c}),t.on("suite",function(t){n.suites=n.suites||0,t.root||n.suites++}),t.on("test end",function(){n.tests=n.tests||0,n.tests++}),t.on("pass",function(t){n.passes=n.passes||0;var r=e.slow/2;t.speed=t.duration>e.slow?"slow":t.duration>r?"medium":"fast",n.passes++}),t.on("fail",function(t,e){n.failures=n.failures||0,n.failures++,t.err=e,r.push(t)}),t.on("end",function(){n.end=new c,n.duration=new c-n.start}),t.on("pending",function(){n.pending++}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function i(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return/^(\n+)$/.test(t.value)&&(t.value=Array(++RegExp.$1.length).join("")),t.added?s("diff added",t.value):t.removed?s("diff removed",t.value):t.value}).join("")}function s(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=global.Date,l=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=r,e.useColors=l,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:l?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.slow=75,e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),r=t.err,s=r.message||"",a=r.stack||s,u=a.indexOf(s)+s.length,c=a.slice(0,u),l=r.actual,p=r.expected;if("string"==typeof l&&"string"==typeof p){var h=Math.max(l.length,p.length);c=20>h?i(r,"Chars"):i(r,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return o(++e,g)+" | "+t}).join("\n")}c="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},r.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=f("bright fail"," ✖")+f("fail"," %d of %d %s failed")+f("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),r.list(this.failures),void console.error()):(e=f("bright pass"," ✔")+f("green"," %d %s complete")+f("light"," (%dms)"),console.log(e,n.tests||0,t(n.tests),n.duration),n.pending&&(e=f("pending"," •")+f("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function r(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                            ',e()),++n,console.log("%s

                                                            %s

                                                            ",e(),t.title),console.log("%s
                                                            ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                            ",e()),--n,console.log("%s
                                                            ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                            %s
                                                            ",e(),t.title);var n=i.escape(i.clean(t.fn.toString()));console.log("%s
                                                            %s
                                                            ",e(),n)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/dot.js",function(t,e,n){function r(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),r="․",s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending",r))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow",r):i(t.speed,r))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail",r))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),i=o.color;e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/html-cov.js",function(t,e,n){function r(t){var e=n("jade"),r=__dirname+"/templates/coverage.jade",a=s.readFileSync(r,"utf8"),u=e.compile(a,{filename:r}),c=this;i.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var i=n("./json-cov"),s=n("browser/fs");e=t.exports=r}),t.register("reporters/html.js",function(t,e,n){function r(t,e){u.call(this,t);var n,r,d=this.stats,g=t.total,m=i(h),v=m.getElementsByTagName("li"),w=v[1].getElementsByTagName("em")[0],y=v[1].getElementsByTagName("a")[0],b=v[2].getElementsByTagName("em")[0],x=v[2].getElementsByTagName("a")[0],k=v[3].getElementsByTagName("em")[0],T=m.getElementsByTagName("canvas")[0],j=i('
                                                              '),E=[j];if(e=e||document.getElementById("mocha"),T.getContext){var _=window.devicePixelRatio||1;T.style.width=T.width,T.style.height=T.height,T.width*=_,T.height*=_,r=T.getContext("2d"),r.scale(_,_),n=new l}return e?(a(y,"click",function(){var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t}),a(x,"click",function(){var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t}),e.appendChild(m),e.appendChild(j),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=i('
                                                            • %s

                                                            • ',e,f(t.title));E[0].appendChild(n),E.unshift(document.createElement("ul")),n.appendChild(E[0])}}),t.on("suite end",function(t){t.root||E.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=d.tests/g*100|0;n&&n.update(e).draw(r);var o=new p-d.start;if(s(w,d.passes),s(b,d.failures),s(k,(o/1e3).toFixed(2)),"passed"==t.state)var u=i('
                                                            • %e%ems

                                                            • ',t.speed,t.title,t.duration);else if(t.pending)var u=i('
                                                            • %e

                                                            • ',t.title);else{var u=i('
                                                            • %e

                                                            • ',t.title),l=t.err.stack||t.err.toString();~l.indexOf(t.err.message)||(l=t.err.message+"\n"+l),"[object Error]"==l&&(l=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(l+="\n("+t.err.sourceURL+":"+t.err.line+")"),u.appendChild(i('
                                                              %e
                                                              ',l))}if(!t.pending){var f=u.getElementsByTagName("h2")[0];a(f,"click",function(){h.style.display="none"==h.style.display?"inline-block":"none"});var h=i("
                                                              %e
                                                              ",c.clean(t.fn.toString()));u.appendChild(h),h.style.display="none"}E[0].appendChild(u)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(i('
                                                              %s
                                                              ',t))}function i(t){var e=arguments,n=document.createElement("div"),r=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[r++]);case"e":return f(e[r++])}}),n.firstChild}function s(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var u=n("./base"),c=n("../utils"),l=n("../browser/progress"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r;var h=''}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Nyan=n("./nyan"),e.XUnit=n("./xunit"),e.Markdown=n("./markdown"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function r(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var r=[],i=[],u=[];t.on("test end",function(t){r.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){i.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=o(t);a.stats=n.stats,a.tests=r.map(s),a.failures=i.map(s),a.passes=u.map(s),e&&process.stdout.write(JSON.stringify(a,null,2))})}function o(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var r=i(n,t[n]);e.files.push(r),e.hits+=r.hits,e.misses+=r.misses,e.sloc+=r.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function i(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,r){r++,0===e[r]?(n.misses++,n.sloc++):void 0!==e[r]&&(n.hits++,n.sloc++),n.source[r]={source:t,coverage:void 0===e[r]?"":e[r]}}),n.coverage=n.hits/n.sloc*100,n}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=r}),t.register("reporters/json-stream.js",function(t,e,n){function r(t){i.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.color}e=t.exports=r}),t.register("reporters/json.js",function(t,e,n){function r(t){var e=this;i.call(this,t);var n=[],r=[],s=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){s.push(t)}),t.on("fail",function(t){r.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:r.map(o),passes:s.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/landing.js",function(t,e,n){function r(t){function e(){var t=Array(r).join("-");return" "+s("runway",t)}o.call(this,t);var n=this,r=(this.stats,.75*o.window.width|0),a=t.total,u=process.stdout,c=s("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==l?r*++f/a|0:l;"failed"==t.state&&(c=s("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(s("runway",Array(n).join("⋅"))),u.write(c),u.write(s("runway",Array(r-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/list.js",function(t,e,n){function r(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(s("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=s("checkmark"," -")+s("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=s("checkmark"," ✓")+s("pass"," %s: ")+s(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(s("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/markdown.js",function(t,e,n){function r(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var r=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),r}function r(t,e){++e;var n,o="";for(var s in t)"suite"!=s&&(s&&(n=" - ["+s+"](#"+i.slug(t[s].suite.fullTitle())+")\n"),s&&(o+=Array(e).join(" ")+n),o+=r(t[s],e));return--e,o}function s(t){var e=n(t,{});return r(e,0)}o.call(this,t);var a=(this.stats,t.total,0),u="";s(t.suite),t.on("suite",function(t){++a;var n=i.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=i.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(s(t.suite)),process.stdout.write(u)})}var o=n("./base"),i=n("../utils");e=t.exports=r}),t.register("reporters/min.js",function(t,e,n){function r(t){o.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var o=n("./base");e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/nyan.js",function(t,e,n){function r(t){i.call(this,t);{var e=this,n=(this.stats,.75*i.window.width|0),r=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-r,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){i.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){i.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&r.shift(),r.push(e)}},r.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){o("["+t.scoreboardWidth+"C"),o(e.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},r.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(r){switch(o("["+n+"C"),r){case 0:o("_,------,"),o("\n");break;case 1:var i=e.tick?" ":" ";o("_|"+i+"/\\_/\\ "),o("\n");break;case 2:var s,i=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":s="( ^ .^)";break;case"fail":s="( o .o)";break;default:s="( - .-)"}o(a+"|"+i+s+" "),o("\n");break;case 3:var i=e.tick?" ":" ";o(i+'"" "" '),o("\n")}}),this.cursorUp(this.numberOfLines)},r.prototype.cursorUp=function(t){o("["+t+"A")},r.prototype.cursorDown=function(t){o("["+t+"B")},r.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),r=e*(1/6),o=Math.floor(3*Math.sin(r)+3),i=Math.floor(3*Math.sin(r+2*n)+3),s=Math.floor(3*Math.sin(r+4*n)+3);t.push(36*o+6*i+s+16)}return t},r.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},r.prototype=new i,r.prototype.constructor=r}),t.register("reporters/progress.js",function(t,e,n){function r(t,e){o.call(this,t);{var n=this,e=e||{},r=(this.stats,.5*o.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){u++;var t=u/a,n=r*t|0,o=r-n;i.CR(),process.stdout.write(""),process.stdout.write(s("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(s("progress",e.close)),e.verbose&&process.stdout.write(s("progress"," "+u+" of "+a))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,o.colors.progress=90,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/spec.js",function(t,e,n){function r(t){function e(){return Array(r).join(" ")}o.call(this,t);var n=this,r=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++r,console.log(s("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--r,1==r&&console.log()}),t.on("test",function(t){process.stdout.write(e()+s("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+s("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+s("checkmark"," ✓")+s("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+s("checkmark"," ✓")+s("pass"," %s ")+s(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+s("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),i=o.cursor,s=o.color;e=t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("reporters/tap.js",function(t,e,n){function r(t){i.call(this,t);var e=(this.stats,t.total),n=1;t.on("start",function(){console.log("%d..%d",1,e)}),t.on("test end",function(){++n}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",n,o(t))}),t.on("pass",function(t){console.log("ok %d %s",n,o(t))}),t.on("fail",function(t,e){console.log("not ok %d %s",n,o(t)),console.log(e.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var i=n("./base");i.cursor,i.color}e=t.exports=r}),t.register("reporters/teamcity.js",function(t,e,n){function r(t){i.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+o(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+o(t.fullTitle())+"' message='"+o(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+o(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+o(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function o(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var i=n("./base");e=t.exports=r}),t.register("reporters/xunit.js",function(t,e,n){function r(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,s(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,r){var o,i=n?"/>":">",s=[];for(var a in e)s.push(a+'="'+c(e[a])+'"');return o="<"+t+(s.length?" "+s.join(" "):"")+i,r&&(o+=r+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=r,r.prototype=new a,r.prototype.constructor=r}),t.register("runnable.js",function(t,e,n){function r(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this.timedOut=!1}{var o=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runnable"),s=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=r,r.prototype=new o,r.prototype.constructor=r,r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},r.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},r.prototype.clearTimeout=function(){u(this.timer)},r.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},r.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},r.prototype.run=function(t){function e(t){o||(o=!0,i.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!i.timedOut){if(r)return e(n);i.clearTimeout(),i.duration=new s-c,r=!0,t(n)}}var r,o,i=this,u=this.timeout(),c=new s,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),i.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new s-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function r(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function o(t){return u(c(global),function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var i=n("browser/events").EventEmitter,s=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=r,r.prototype=new i,r.prototype.constructor=r,r.prototype.grep=function(t,e){return s("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},r.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var r=e._grep.test(t.fullTitle());e._invert&&(r=!r),r&&n++}),n},r.prototype.globals=function(t){return 0==arguments.length?this._globals:(s("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},r.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=o(this._globals);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},r.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},r.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end") +},r.prototype.hook=function(t,e){function n(t){var r=o[t];return r?(i.currentRunnable=r,i.emit("hook",r),r.on("error",function(t){i.failHook(r,t)}),void r.run(function(e){r.removeAllListeners("error");var o=r.error();return o&&i.fail(i.test,o),e?i.failHook(r,e):(i.emit("hook end",r),void n(++t))})):e()}var r=this.suite,o=r["_"+t],i=(r._timeout,this);process.nextTick(function(){n(0)})},r.prototype.hooks=function(t,e,n){function r(s){return o.suite=s,s?void o.hook(t,function(t){return t?(o.suite=i,n(t)):void r(e.pop())}):(o.suite=i,n())}var o=this,i=this.suite;r(e.pop())},r.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},r.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},r.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},r.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(r){t(r)}},r.prototype.runTests=function(t,e){function n(){if(o.failures&&t._bail)return e();if(r=i.shift(),!r)return e();var s=o._grep.test(r.fullTitle());return o._invert&&(s=!s),s?r.pending?(o.emit("pending",r),o.emit("test end",r),n()):(o.emit("test",o.test=r),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return r=o.test,t?(o.fail(r,t),o.emit("test end",r),o.hookUp("afterEach",n)):(r.state="passed",o.emit("pass",r),o.emit("test end",r),void o.hookUp("afterEach",n))})})):n()}var r,o=this,i=t.tests;this.next=n,n()},r.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void i.runSuite(e,n):r()}function r(){i.suite=t,i.hook("afterAll",function(){i.emit("suite end",t),e()})}var o=this.grepTotal(t),i=this,a=0;return s("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){i.runTests(t,n)})):e()},r.prototype.uncaught=function(t){s("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},r.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return s("start"),this.on("end",function(){s("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){s("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function r(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._bail=!1}var o=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:suite"),s=n("./utils"),a=n("./hook");e=t.exports=r,e.create=function(t,e){var n=new r(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},r.prototype=new o,r.prototype.constructor=r,r.prototype.clone=function(){var t=new r(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.bail(this.bail()),t},r.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(String(t).match(/s$/)&&(t=1e3*parseFloat(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},r.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},r.prototype.beforeAll=function(t){if(this.pending)return this;var e=new a('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},r.prototype.afterAll=function(t){if(this.pending)return this;var e=new a('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},r.prototype.beforeEach=function(t){if(this.pending)return this;var e=new a('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},r.prototype.afterEach=function(t){if(this.pending)return this;var e=new a('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},r.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},r.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},r.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},r.prototype.total=function(){return s.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},r.prototype.eachTest=function(t){return s.forEach(this.tests,t),s.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function r(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=r,r.prototype=new o,r.prototype.constructor=r}),t.register("utils.js",function(t,e,n){function r(t){return!~c.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var i=n("browser/fs"),s=n("browser/path"),a=s.join,u=n("browser/debug")("mocha:watch"),c=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var r=0,o=t.length;o>r;r++)e.call(n,t[r],r)},e.indexOf=function(t,e,n){for(var r=n||0,o=t.length;o>r;r++)if(t[r]===e)return r;return-1},e.reduce=function(t,e,n,r){for(var o=n,i=0,s=t.length;s>i;i++)o=e.call(r,o,t[i],i,t);return o},e.filter=function(t,e,n){for(var r=[],o=0,i=t.length;i>o;o++){var s=t[o];e.call(n,s,o,t)&&r.push(s)}return r},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var r in t)n.call(t,r)&&e.push(r);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),i.watchFile(t,n,function(n,r){r.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=e)},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var r=e.utils.parseQuery(window.location.search||"");return r.grep&&n.grep(r.grep),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.4.3/mocha.min.css b/ajax/libs/mocha/1.4.3/mocha.min.css new file mode 100644 index 000000000..39920bf97 --- /dev/null +++ b/ajax/libs/mocha/1.4.3/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#report.fail .test.pass,#report.pass .test.fail{display:none}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats a{text-decoration:none;color:inherit}#stats a:hover{border-bottom:1px solid #eee}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.4.3/mocha.min.js b/ajax/libs/mocha/1.4.3/mocha.min.js new file mode 100644 index 000000000..8924e2b88 --- /dev/null +++ b/ajax/libs/mocha/1.4.3/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",r=e+"/index.js";return t.modules[s]&&s||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),r=n.split("/");s.pop();for(var o=0;oo;o++)if(s[o]===e||s[o].listener&&s[o].listener===e){r=o;break}if(0>r)return this;s.splice(r,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var r=e.slice(),o=0,i=r.length;i>o;o++)r[o].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,r=s,o=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,o,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,o,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,r-l/2+1,o+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){r.call(this,t,e),this.type="hook"}var r=n("./runnable");t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,o){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=s.create(e[0],t);return e.unshift(r),n(),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=s.create(e[0],t);r.pending=!0,e.unshift(r),n(),e.shift()},t.describe.only=function(e,n){var s=t.describe(e,n);o.grep(s.fullTitle())},t.it=t.specify=function(t,n){var s=e[0];if(s.pending)var n=null;var o=new r(t,n);return s.addTest(o),o},t.it.only=function(e,n){var s=t.it(e,n);o.grep(s.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var o;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var o=s.create(n[0],i);n.unshift(o),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,o){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=s.create(e[0],t);return e.unshift(r),n(),e.shift(),r},t.suite.only=function(e,n){var s=t.suite(e,n);o.grep(s.fullTitle())},t.test=function(t,n){var s=new r(t,n);return e[0].addTest(s),s},t.test.only=function(e,n){var s=t.test(e,n);o.grep(s.fullTitle())}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var o=n("browser/path"),i=n("./utils");e=t.exports=r,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,s=this.suite,r=this.files.length;this.files.forEach(function(i){i=o.resolve(i),s.emit("pre-require",global,i,e),s.emit("require",n(i),i,e),s.emit("post-require",global,i,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var o=n.failures+" of "+t.total+" tests failed";r(o,{name:"mocha",title:"Failed",image:s("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:s("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,s=this.options,r=new e.Runner(n),o=new this._reporter(r);return r.ignoreLeaks=s.ignoreLeaks,s.grep&&r.grep(s.grep,s.invert),s.globals&&r.globals(s.globals),s.growl&&this._growl(r,o),r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?t/i+" day":t>i?t/i+" days":t==o?t/o+" hour":t>o?t/o+" hours":t==r?t/r+" minute":t>r?t/r+" minutes":t==s?t/s+" second":t>s?t/s+" seconds":t+" ms"}var s=1e3,r=60*s,o=60*r,i=24*o;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.on("start",function(){e.start=new l}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,s){e.failures=e.failures||0,e.failures++,t.err=s,n.push(t)}),t.on("end",function(){e.end=new l,e.duration=new l-e.start}),t.on("pending",function(){e.pending++}))}function r(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function o(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n"),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return p(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=n("../ms"),l=global.Date,f=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=s,e.useColors=f,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var p=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:f?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=p("error title"," %s) %s:\n")+p("error message"," %s")+p("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),l=s.actual,f=s.expected;if("string"==typeof l&&"string"==typeof f){var h=Math.max(l.length,f.length);c=20>h?o(s,"Chars"):o(s,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return r(++e,g)+" | "+t}).join("\n")}c="\n"+p("diff removed","actual")+" "+p("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=p("error title"," %s) %s:\n%s")+p("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},s.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=p("bright fail"," ✖")+p("fail"," %d of %d %s failed")+p("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),s.list(this.failures),void console.error()):(e=p("bright pass"," ✔")+p("green"," %d %s complete")+p("light"," (%s)"),console.log(e,n.tests||0,t(n.tests),c(n.duration)),n.pending&&(e=p("pending"," •")+p("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                              ',e()),++n,console.log("%s

                                                              %s

                                                              ",e(),t.title),console.log("%s
                                                              ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                              ",e()),--n,console.log("%s
                                                              ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                              %s
                                                              ",e(),t.title);var n=o.escape(o.clean(t.fn.toString()));console.log("%s
                                                              %s
                                                              ",e(),n)})}var r=n("./base"),o=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),s="․",i=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(o("pending",s))}),t.on("pass",function(t){++i%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?o("bright yellow",s):o(t.speed,s))}),t.on("fail",function(){++i%n==0&&process.stdout.write("\n "),process.stdout.write(o("fail",s))}),t.on("end",function(){console.log(),e.epilogue()})}var r=n("./base"),o=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),c=this;o.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:r}))})}function r(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var o=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t,e){u.call(this,t);var n,s,d=this.stats,g=t.total,m=o(h),v=m.getElementsByTagName("li"),w=v[1].getElementsByTagName("em")[0],y=v[1].getElementsByTagName("a")[0],b=v[2].getElementsByTagName("em")[0],x=v[2].getElementsByTagName("a")[0],k=v[3].getElementsByTagName("em")[0],T=m.getElementsByTagName("canvas")[0],j=o('
                                                                '),E=[j];if(e=e||document.getElementById("mocha"),T.getContext){var _=window.devicePixelRatio||1;T.style.width=T.width,T.style.height=T.height,T.width*=_,T.height*=_,s=T.getContext("2d"),s.scale(_,_),n=new l}return e?(a(y,"click",function(){var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t}),a(x,"click",function(){var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t}),e.appendChild(m),e.appendChild(j),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=o('
                                                              • %s

                                                              • ',e,f(t.title));E[0].appendChild(n),E.unshift(document.createElement("ul")),n.appendChild(E[0])}}),t.on("suite end",function(t){t.root||E.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=d.tests/g*100|0;n&&n.update(e).draw(s);var r=new p-d.start;if(i(w,d.passes),i(b,d.failures),i(k,(r/1e3).toFixed(2)),"passed"==t.state)var u=o('
                                                              • %e%ems

                                                              • ',t.speed,t.title,t.duration);else if(t.pending)var u=o('
                                                              • %e

                                                              • ',t.title);else{var u=o('
                                                              • %e

                                                              • ',t.title),l=t.err.stack||t.err.toString();~l.indexOf(t.err.message)||(l=t.err.message+"\n"+l),"[object Error]"==l&&(l=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(l+="\n("+t.err.sourceURL+":"+t.err.line+")"),u.appendChild(o('
                                                                %e
                                                                ',l))}if(!t.pending){var f=u.getElementsByTagName("h2")[0];a(f,"click",function(){h.style.display="none"==h.style.display?"inline-block":"none"});var h=o("
                                                                %e
                                                                ",c.clean(t.fn.toString()));u.appendChild(h),h.style.display="none"}E[0].appendChild(u)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(o('
                                                                %s
                                                                ',t))}function o(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return f(e[s++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var u=n("./base"),c=n("../utils"),l=n("../browser/progress"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=s;var h=''}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Nyan=n("./nyan"),e.XUnit=n("./xunit"),e.Markdown=n("./markdown"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function s(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var s=[],o=[],u=[];t.on("test end",function(t){s.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=r(t);a.stats=n.stats,a.tests=s.map(i),a.failures=o.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function r(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var s=o(n,t[n]);e.files.push(s),e.hits+=s.hits,e.misses+=s.misses,e.sloc+=s.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function o(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var o=n("./base");o.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;o.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(r),failures:s.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t,null,2))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var o=n("./base");o.cursor,o.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}r.call(this,t);var n=this,s=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),o.hide()}),t.on("test end",function(t){var n=-1==l?s*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){o.show(),console.log(),n.epilogue()})}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");o.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){o.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+o.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=s(t[i],e));return--e,r}function i(t){var e=n(t,{});return s(e,0)}r.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=o.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=o.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var r=n("./base"),o=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var r=n("./base");e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/nyan.js",function(t,e,n){function s(t){o.call(this,t);{var e=this,n=(this.stats,.75*o.window.width|0),s=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-s,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){o.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){o.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&s.shift(),s.push(e)}},s.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){r("["+t.scoreboardWidth+"C"),r(e.join("")),r("\n")}),this.cursorUp(this.numberOfLines)},s.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(s){switch(r("["+n+"C"),s){case 0:r("_,------,"),r("\n");break;case 1:var o=e.tick?" ":" ";r("_|"+o+"/\\_/\\ "),r("\n");break;case 2:var i,o=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}r(a+"|"+o+i+" "),r("\n");break;case 3:var o=e.tick?" ":" ";r(o+'"" "" '),r("\n")}}),this.cursorUp(this.numberOfLines)},s.prototype.cursorUp=function(t){r("["+t+"A")},s.prototype.cursorDown=function(t){r("["+t+"B")},s.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),s=e*(1/6),r=Math.floor(3*Math.sin(s)+3),o=Math.floor(3*Math.sin(s+2*n)+3),i=Math.floor(3*Math.sin(s+4*n)+3);t.push(36*r+6*o+i+16)}return t},s.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){r.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),o.hide()}),t.on("test end",function(){u++;var t=u/a,n=s*t|0,r=s-n;o.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){o.show(),console.log(),n.epilogue()})}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,r.colors.progress=90,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}r.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");o.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");o.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){o.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){o.call(this,t);var e=(this.stats,1);t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){console.log("not ok %d %s",e,r(t)),console.log(n.stack.replace(/^/gm," "))})}function r(t){return t.fullTitle().replace(/#/g,"")}{var o=n("./base");o.cursor,o.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){o.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var o=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(o("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(o("testcase",e,!1,o("failure",e,!1,i(n.stack))))}else console.log(t.pending?o("testcase",e,!1,o("skipped",{},!0)):o("testcase",e,!0))}function o(t,e,n,s){var r,o=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+o,s&&(r+=s+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}{var r=n("browser/events").EventEmitter,o=n("browser/debug")("mocha:runnable"),i=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(o("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:(o("timeout %d",t),this._slow=t,this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){u(this.timer)},s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(t){r||(r=!0,o.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!o.timedOut){if(s)return e(n);o.clearTimeout(),o.duration=new i-c,s=!0,t(n)}}var s,r,o=this,u=this.timeout(),c=new i,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),o.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new i-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function r(t){return u(c(global),function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e) +})}var o=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.grep=function(t,e){return i("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},s.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var s=e._grep.test(t.fullTitle());e._invert&&(s=!s),s&&n++}),n},s.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},s.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e=r(this._globals);this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0]))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=r[t];return s?(o.currentRunnable=s,o.emit("hook",s),s.on("error",function(t){o.failHook(s,t)}),void s.run(function(e){s.removeAllListeners("error");var r=s.error();return r&&o.fail(o.test,r),e?o.failHook(s,e):(o.emit("hook end",s),void n(++t))})):e()}var s=this.suite,r=s["_"+t],o=this;process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=o,n(t)):void s(e.pop())}):(r.suite=o,n())}var r=this,o=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(s=o.shift(),!s)return e();var i=r._grep.test(s.fullTitle());return r._invert&&(i=!i),i?s.pending?(r.emit("pending",s),r.emit("test end",s),n()):(r.emit("test",r.test=s),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return s=r.test,t?(r.fail(s,t),r.emit("test end",s),r.hookUp("afterEach",n)):(s.state="passed",r.emit("pass",s),r.emit("test end",s),void r.hookUp("afterEach",n))})})):n()}var s,r=this,o=t.tests;this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void o.runSuite(e,n):s()}function s(){o.suite=t,o.hook("afterAll",function(){o.emit("suite end",t),e()})}var r=this.grepTotal(t),o=this,a=0;return i("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){o.runTests(t,n)})):e()},s.prototype.uncaught=function(t){i("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}var r=n("browser/events").EventEmitter,o=n("browser/debug")("mocha:suite"),i=n("./ms"),a=n("./utils"),u=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=new r,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return o("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),o("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),o("slow %d",t),this._slow=t,this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(o("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){if(this.pending)return this;var e=new u('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){if(this.pending)return this;var e=new u('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){if(this.pending)return this;var e=new u('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){if(this.pending)return this;var e=new u('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return a.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},s.prototype.eachTest=function(t){return a.forEach(this.tests,t),a.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function s(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}var r=n("./runnable");t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("utils.js",function(t,e,n){function s(t){return!~c.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var o=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),c=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,r=t.length;r>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,r=t.length;r>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n){for(var s=n,r=0,o=t.length;o>r;r++)s=e(s,t[r],r,t);return s},e.filter=function(t,e){for(var n=[],s=0,r=t.length;r>s;s++){var o=t[s];e(o,s,t)&&n.push(o)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),o.watchFile(t,n,function(n,s){s.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=e)},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var s=e.utils.parseQuery(window.location.search||"");return s.grep&&n.grep(s.grep),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.5.0/mocha.min.css b/ajax/libs/mocha/1.5.0/mocha.min.css new file mode 100644 index 000000000..39920bf97 --- /dev/null +++ b/ajax/libs/mocha/1.5.0/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#report.fail .test.pass,#report.pass .test.fail{display:none}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats a{text-decoration:none;color:inherit}#stats a:hover{border-bottom:1px solid #eee}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.5.0/mocha.min.js b/ajax/libs/mocha/1.5.0/mocha.min.js new file mode 100644 index 000000000..136cafc53 --- /dev/null +++ b/ajax/libs/mocha/1.5.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",r=e+"/index.js";return t.modules[s]&&s||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),r=n.split("/");s.pop();for(var o=0;oo;o++)if(s[o]===e||s[o].listener&&s[o].listener===e){r=o;break}if(0>r)return this;s.splice(r,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var r=e.slice(),o=0,i=r.length;i>o;o++)r[o].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,r=s,o=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,o,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,o,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,r-l/2+1,o+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){r.call(this,t,e),this.type="hook"}var r=n("./runnable");t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,o){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=s.create(e[0],t);return e.unshift(r),n(),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=s.create(e[0],t);r.pending=!0,e.unshift(r),n(),e.shift()},t.describe.only=function(e,n){var s=t.describe(e,n);o.grep(s.fullTitle())},t.it=t.specify=function(t,n){var s=e[0];if(s.pending)var n=null;var o=new r(t,n);return s.addTest(o),o},t.it.only=function(e,n){var s=t.it(e,n);o.grep(s.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var o;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var o=s.create(n[0],i);n.unshift(o),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,o){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=s.create(e[0],t);return e.unshift(r),n(),e.shift(),r},t.suite.only=function(e,n){var s=t.suite(e,n);o.grep(s.fullTitle())},t.test=function(t,n){var s=new r(t,n);return e[0].addTest(s),s},t.test.only=function(e,n){var s=t.test(e,n);o.grep(s.fullTitle())}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var o=n("browser/path"),i=n("./utils");e=t.exports=r,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,s=this.suite,r=this.files.length;this.files.forEach(function(i){i=o.resolve(i),s.emit("pre-require",global,i,e),s.emit("require",n(i),i,e),s.emit("post-require",global,i,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var o=n.failures+" of "+t.total+" tests failed";r(o,{name:"mocha",title:"Failed",image:s("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:s("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,s=this.options,r=new e.Runner(n),o=new this._reporter(r);return r.ignoreLeaks=s.ignoreLeaks,s.grep&&r.grep(s.grep,s.invert),s.globals&&r.globals(s.globals),s.growl&&this._growl(r,o),r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?t/i+" day":t>i?t/i+" days":t==o?t/o+" hour":t>o?t/o+" hours":t==r?t/r+" minute":t>r?t/r+" minutes":t==s?t/s+" second":t>s?t/s+" seconds":t+" ms"}var s=1e3,r=60*s,o=60*r,i=24*o;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.on("start",function(){e.start=new l}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,s){e.failures=e.failures||0,e.failures++,t.err=s,n.push(t)}),t.on("end",function(){e.end=new l,e.duration=new l-e.start}),t.on("pending",function(){e.pending++}))}function r(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function o(t,e){return u["diff"+e](t.actual,t.expected).map(function(t){return t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n"),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return p(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=n("../ms"),l=global.Date,f=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=s,e.useColors=f,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var p=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:f?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=p("error title"," %s) %s:\n")+p("error message"," %s")+p("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),l=s.actual,f=s.expected;if("string"==typeof l&&"string"==typeof f){var h=Math.max(l.length,f.length);c=20>h?o(s,"Chars"):o(s,"Words");var d=c.split("\n");if(d.length>4){var g=String(d.length).length;c=d.map(function(t,e){return r(++e,g)+" | "+t}).join("\n")}c="\n"+p("diff removed","actual")+" "+p("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=p("error title"," %s) %s:\n%s")+p("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},s.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=p("bright fail"," ✖")+p("fail"," %d of %d %s failed")+p("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),s.list(this.failures),void console.error()):(e=p("bright pass"," ✔")+p("green"," %d %s complete")+p("light"," (%s)"),console.log(e,n.tests||0,t(n.tests),c(n.duration)),n.pending&&(e=p("pending"," •")+p("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                                ',e()),++n,console.log("%s

                                                                %s

                                                                ",e(),t.title),console.log("%s
                                                                ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                                ",e()),--n,console.log("%s
                                                                ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                                %s
                                                                ",e(),t.title);var n=o.escape(o.clean(t.fn.toString()));console.log("%s
                                                                %s
                                                                ",e(),n)})}var r=n("./base"),o=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),s="․",i=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(o("pending",s))}),t.on("pass",function(t){++i%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?o("bright yellow",s):o(t.speed,s))}),t.on("fail",function(){++i%n==0&&process.stdout.write("\n "),process.stdout.write(o("fail",s))}),t.on("end",function(){console.log(),e.epilogue()})}var r=n("./base"),o=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),c=this;o.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:r}))})}function r(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var o=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t,e){u.call(this,t);var n,s,d=this.stats,g=t.total,m=o(h),v=m.getElementsByTagName("li"),w=v[1].getElementsByTagName("em")[0],y=v[1].getElementsByTagName("a")[0],b=v[2].getElementsByTagName("em")[0],x=v[2].getElementsByTagName("a")[0],k=v[3].getElementsByTagName("em")[0],T=m.getElementsByTagName("canvas")[0],j=o('
                                                                  '),E=[j];if(e=e||document.getElementById("mocha"),T.getContext){var _=window.devicePixelRatio||1;T.style.width=T.width,T.style.height=T.height,T.width*=_,T.height*=_,s=T.getContext("2d"),s.scale(_,_),n=new l}return e?(a(y,"click",function(){var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t}),a(x,"click",function(){var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t}),e.appendChild(m),e.appendChild(j),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=o('
                                                                • %s

                                                                • ',e,f(t.title));E[0].appendChild(n),E.unshift(document.createElement("ul")),n.appendChild(E[0])}}),t.on("suite end",function(t){t.root||E.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=d.tests/g*100|0;n&&n.update(e).draw(s);var r=new p-d.start;if(i(w,d.passes),i(b,d.failures),i(k,(r/1e3).toFixed(2)),"passed"==t.state)var u=o('
                                                                • %e%ems

                                                                • ',t.speed,t.title,t.duration);else if(t.pending)var u=o('
                                                                • %e

                                                                • ',t.title);else{var u=o('
                                                                • %e

                                                                • ',t.title),l=t.err.stack||t.err.toString();~l.indexOf(t.err.message)||(l=t.err.message+"\n"+l),"[object Error]"==l&&(l=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(l+="\n("+t.err.sourceURL+":"+t.err.line+")"),u.appendChild(o('
                                                                  %e
                                                                  ',l))}if(!t.pending){var f=u.getElementsByTagName("h2")[0];a(f,"click",function(){h.style.display="none"==h.style.display?"inline-block":"none"});var h=o("
                                                                  %e
                                                                  ",c.clean(t.fn.toString()));u.appendChild(h),h.style.display="none"}E[0].appendChild(u)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(o('
                                                                  %s
                                                                  ',t))}function o(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return f(e[s++])}}),n.firstChild}function i(t,e){t.textContent?t.textContent=e:t.innerText=e}function a(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}{var u=n("./base"),c=n("../utils"),l=n("../browser/progress"),f=c.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=s;var h=''}),t.register("reporters/index.js",function(t,e,n){e.Base=n("./base"),e.Dot=n("./dot"),e.Doc=n("./doc"),e.TAP=n("./tap"),e.JSON=n("./json"),e.HTML=n("./html"),e.List=n("./list"),e.Min=n("./min"),e.Spec=n("./spec"),e.Nyan=n("./nyan"),e.XUnit=n("./xunit"),e.Markdown=n("./markdown"),e.Progress=n("./progress"),e.Landing=n("./landing"),e.JSONCov=n("./json-cov"),e.HTMLCov=n("./html-cov"),e.JSONStream=n("./json-stream"),e.Teamcity=n("./teamcity")}),t.register("reporters/json-cov.js",function(t,e,n){function s(t,e){var n=this,e=1==arguments.length?!0:e;a.call(this,t);var s=[],o=[],u=[];t.on("test end",function(t){s.push(t)}),t.on("pass",function(t){u.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t=global._$jscoverage||{},a=n.cov=r(t);a.stats=n.stats,a.tests=s.map(i),a.failures=o.map(i),a.passes=u.map(i),e&&process.stdout.write(JSON.stringify(a,null,2))})}function r(t){var e={instrumentation:"node-jscoverage",sloc:0,hits:0,misses:0,coverage:0,files:[]};for(var n in t){var s=o(n,t[n]);e.files.push(s),e.hits+=s.hits,e.misses+=s.misses,e.sloc+=s.sloc}return e.sloc>0&&(e.coverage=e.hits/e.sloc*100),e}function o(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var o=n("./base");o.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;o.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(r),failures:s.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t,null,2))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var o=n("./base");o.cursor,o.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}r.call(this,t);var n=this,s=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),o.hide()}),t.on("test end",function(t){var n=-1==l?s*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){o.show(),console.log(),n.epilogue()})}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");o.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){o.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+o.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=s(t[i],e));return--e,r}function i(t){var e=n(t,{});return s(e,0)}r.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=o.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=o.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var r=n("./base"),o=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var r=n("./base");e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/nyan.js",function(t,e,n){function s(t){o.call(this,t);{var e=this,n=(this.stats,.75*o.window.width|0),s=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-s,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){o.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){o.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&s.shift(),s.push(e)}},s.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){r("["+t.scoreboardWidth+"C"),r(e.join("")),r("\n")}),this.cursorUp(this.numberOfLines)},s.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(s){switch(r("["+n+"C"),s){case 0:r("_,------,"),r("\n");break;case 1:var o=e.tick?" ":" ";r("_|"+o+"/\\_/\\ "),r("\n");break;case 2:var i,o=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}r(a+"|"+o+i+" "),r("\n");break;case 3:var o=e.tick?" ":" ";r(o+'"" "" '),r("\n")}}),this.cursorUp(this.numberOfLines)},s.prototype.cursorUp=function(t){r("["+t+"A")},s.prototype.cursorDown=function(t){r("["+t+"B")},s.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),s=e*(1/6),r=Math.floor(3*Math.sin(s)+3),o=Math.floor(3*Math.sin(s+2*n)+3),i=Math.floor(3*Math.sin(s+4*n)+3);t.push(36*r+6*o+i+16)}return t},s.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){r.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),o.hide()}),t.on("test end",function(){u++;var t=u/a,n=s*t|0,r=s-n;o.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){o.show(),console.log(),n.epilogue()})}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,r.colors.progress=90,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}r.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");o.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");o.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){o.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){o.call(this,t);var e=(this.stats,1);t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){console.log("not ok %d %s",e,r(t)),console.log(n.stack.replace(/^/gm," "))})}function r(t){return t.fullTitle().replace(/#/g,"")}{var o=n("./base");o.cursor,o.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){o.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var o=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(o("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(o("testcase",e,!1,o("failure",e,!1,i(n.stack))))}else console.log(t.pending?o("testcase",e,!1,o("skipped",{},!0)):o("testcase",e,!0))}function o(t,e,n,s){var r,o=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+o,s&&(r+=s+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}{var r=n("browser/events").EventEmitter,o=n("browser/debug")("mocha:runnable"),i=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(o("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:(o("timeout %d",t),this._slow=t,this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){u(this.timer)},s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(t){r||(r=!0,o.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!o.timedOut){if(s)return e(n);o.clearTimeout(),o.duration=new i-c,s=!0,t(n)}}var s,r,o=this,u=this.timeout(),c=new i,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),o.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new i-c,t()}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function r(t,e){return u(e,function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e) +})}var o=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.grep=function(t,e){return i("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},s.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var s=e._grep.test(t.fullTitle());e._invert&&(s=!s),s&&n++}),n},s.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},s.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e,n=this._globals,s=c(global),o=process.kill;o&&1==n.length-s.length||2!=n.length-s.length&&(e=r(n,s),this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=r[t];return s?(o.currentRunnable=s,o.emit("hook",s),s.on("error",function(t){o.failHook(s,t)}),void s.run(function(e){s.removeAllListeners("error");var r=s.error();return r&&o.fail(o.test,r),e?o.failHook(s,e):(o.emit("hook end",s),void n(++t))})):e()}var s=this.suite,r=s["_"+t],o=this;process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=o,n(t)):void s(e.pop())}):(r.suite=o,n())}var r=this,o=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(s=o.shift(),!s)return e();var i=r._grep.test(s.fullTitle());return r._invert&&(i=!i),i?s.pending?(r.emit("pending",s),r.emit("test end",s),n()):(r.emit("test",r.test=s),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return s=r.test,t?(r.fail(s,t),r.emit("test end",s),r.hookUp("afterEach",n)):(s.state="passed",r.emit("pass",s),r.emit("test end",s),void r.hookUp("afterEach",n))})})):n()}var s,r=this,o=t.tests;this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void o.runSuite(e,n):s()}function s(){o.suite=t,o.hook("afterAll",function(){o.emit("suite end",t),e()})}var r=this.grepTotal(t),o=this,a=0;return i("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){o.runTests(t,n)})):e()},s.prototype.uncaught=function(t){i("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}var r=n("browser/events").EventEmitter,o=n("browser/debug")("mocha:suite"),i=n("./ms"),a=n("./utils"),u=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=new r,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return o("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),o("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),o("slow %d",t),this._slow=t,this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(o("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){if(this.pending)return this;var e=new u('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){if(this.pending)return this;var e=new u('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){if(this.pending)return this;var e=new u('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){if(this.pending)return this;var e=new u('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return a.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},s.prototype.eachTest=function(t){return a.forEach(this.tests,t),a.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function s(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}var r=n("./runnable");t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("utils.js",function(t,e,n){function s(t){return!~c.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var o=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),c=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,r=t.length;r>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,r=t.length;r>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n){for(var s=n,r=0,o=t.length;o>r;r++)s=e(s,t[r],r,t);return s},e.filter=function(t,e){for(var n=[],s=0,r=t.length;r>s;s++){var o=t[s];e(o,s,t)&&n.push(o)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),o.watchFile(t,n,function(n,s){s.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=e)},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var s=e.utils.parseQuery(window.location.search||"");return s.grep&&n.grep(s.grep),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.6.0/mocha.min.css b/ajax/libs/mocha/1.6.0/mocha.min.css new file mode 100644 index 000000000..c9466ed63 --- /dev/null +++ b/ajax/libs/mocha/1.6.0/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}.hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test:hover h2::after{position:relative;top:0;right:-10px;content:'(view source)';font-size:12px;font-family:arial;color:#888}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee}#report.fail .test.pass,#report.pass .test.fail{display:none}#error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#stats .progress{float:right;padding-top:0}#stats em{color:#000}#stats a{text-decoration:none;color:inherit}#stats a:hover{border-bottom:1px solid #eee}#stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.6.0/mocha.min.js b/ajax/libs/mocha/1.6.0/mocha.min.js new file mode 100644 index 000000000..758b774b9 --- /dev/null +++ b/ajax/libs/mocha/1.6.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",r=e+"/index.js";return t.modules[s]&&s||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),r=n.split("/");s.pop();for(var o=0;oo;o++)if(s[o]===e||s[o].listener&&s[o].listener===e){r=o;break}if(0>r)return this;s.splice(r,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var r=e.slice(),o=0,i=r.length;i>o;o++)r[o].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,r=s,o=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,o,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,o,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,r-l/2+1,o+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){r.call(this,t,e),this.type="hook"}var r=n("./runnable");t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,o){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=s.create(e[0],t);return e.unshift(r),n(),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=s.create(e[0],t);r.pending=!0,e.unshift(r),n(),e.shift()},t.describe.only=function(e,n){var s=t.describe(e,n);o.grep(s.fullTitle())},t.it=t.specify=function(t,n){var s=e[0];if(s.pending)var n=null;var o=new r(t,n);return s.addTest(o),o},t.it.only=function(e,n){var s=t.it(e,n);o.grep(s.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var o;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var o=s.create(n[0],i);n.unshift(o),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,o){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=s.create(e[0],t);return e.unshift(r),n(),e.shift(),r},t.suite.only=function(e,n){var s=t.suite(e,n);o.grep(s.fullTitle())},t.test=function(t,n){var s=new r(t,n);return e[0].addTest(s),s},t.test.only=function(e,n){var s=t.test(e,n);o.grep(s.fullTitle())}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var o=n("browser/path"),i=n("./utils");e=t.exports=r,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,s=this.suite,r=this.files.length;this.files.forEach(function(i){i=o.resolve(i),s.emit("pre-require",global,i,e),s.emit("require",n(i),i,e),s.emit("post-require",global,i,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var o=n.failures+" of "+t.total+" tests failed";r(o,{name:"mocha",title:"Failed",image:s("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:s("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,s=this.options,r=new e.Runner(n),o=new this._reporter(r);return r.ignoreLeaks=s.ignoreLeaks,s.grep&&r.grep(s.grep,s.invert),s.globals&&r.globals(s.globals),s.growl&&this._growl(r,o),r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?t/i+" day":t>i?t/i+" days":t==o?t/o+" hour":t>o?t/o+" hours":t==r?t/r+" minute":t>r?t/r+" minutes":t==s?t/s+" second":t>s?t/s+" seconds":t+" ms"}var s=1e3,r=60*s,o=60*r,i=24*o;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.on("start",function(){e.start=new l}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,s){e.failures=e.failures||0,e.failures++,t.err=s,n.push(t)}),t.on("end",function(){e.end=new l,e.duration=new l-e.start}),t.on("pending",function(){e.pending++}))}function r(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function o(t,e,n){return u["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return p(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=n("../ms"),l=global.Date,f=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=s,e.useColors=f,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41};var p=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:f?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=p("error title"," %s) %s:\n")+p("error message"," %s")+p("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),l=s.actual,f=s.expected,h=!0;if(s.showDiff&&(h=!1,s.actual=l=JSON.stringify(l,null,2),s.expected=f=JSON.stringify(f,null,2)),"string"==typeof l&&"string"==typeof f){var d=Math.max(l.length,f.length);c=20>d?o(s,"Chars",h):o(s,"Words",h);var g=c.split("\n");if(g.length>4){var m=String(g.length).length;c=g.map(function(t,e){return r(++e,m)+" | "+t}).join("\n")}c="\n"+p("diff removed","actual")+" "+p("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=p("error title"," %s) %s:\n%s")+p("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},s.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var e,n=this.stats;return console.log(),n.failures?(e=p("bright fail"," ✖")+p("fail"," %d of %d %s failed")+p("light",":"),console.error(e,n.failures,this.runner.total,t(this.runner.total)),s.list(this.failures),void console.error()):(e=p("bright pass"," ✔")+p("green"," %d %s complete")+p("light"," (%s)"),console.log(e,n.tests||0,t(n.tests),c(n.duration)),n.pending&&(e=p("pending"," •")+p("pending"," %d %s pending"),console.log(e,n.pending,t(n.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                                  ',e()),++n,console.log("%s

                                                                  %s

                                                                  ",e(),t.title),console.log("%s
                                                                  ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                                  ",e()),--n,console.log("%s
                                                                  ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                                  %s
                                                                  ",e(),t.title);var n=o.escape(o.clean(t.fn.toString()));console.log("%s
                                                                  %s
                                                                  ",e(),n)})}var r=n("./base"),o=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),s="․",i=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(o("pending",s))}),t.on("pass",function(t){++i%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?o("bright yellow",s):o(t.speed,s))}),t.on("fail",function(){++i%n==0&&process.stdout.write("\n "),process.stdout.write(o("fail",s))}),t.on("end",function(){console.log(),e.epilogue()})}var r=n("./base"),o=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),c=this;o.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:r}))})}function r(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var o=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t,e){l.call(this,t);var n,s,m=this.stats,v=t.total,w=o(g),y=w.getElementsByTagName("li"),b=y[1].getElementsByTagName("em")[0],x=y[1].getElementsByTagName("a")[0],k=y[2].getElementsByTagName("em")[0],T=y[2].getElementsByTagName("a")[0],E=y[3].getElementsByTagName("em")[0],j=w.getElementsByTagName("canvas")[0],_=o('
                                                                    '),S=[_];if(e=e||document.getElementById("mocha"),j.getContext){var C=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=C,j.height*=C,s=j.getContext("2d"),s.scale(C,C),n=new p}return e?(c(x,"click",function(){a();var t=/pass/.test(_.className)?"":" pass";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&i("test pass")}),c(T,"click",function(){a();var t=/fail/.test(_.className)?"":" fail";_.className=_.className.replace(/fail|pass/g,"")+t,_.className.trim()&&i("test fail")}),e.appendChild(w),e.appendChild(_),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=o('
                                                                  • %s

                                                                  • ',e,h(t.title));S[0].appendChild(n),S.unshift(document.createElement("ul")),n.appendChild(S[0])}}),t.on("suite end",function(t){t.root||S.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=m.tests/v*100|0;n&&n.update(e).draw(s);var r=new d-m.start;if(u(b,m.passes),u(k,m.failures),u(E,(r/1e3).toFixed(2)),"passed"==t.state)var i=o('
                                                                  • %e%ems

                                                                  • ',t.speed,t.title,t.duration);else if(t.pending)var i=o('
                                                                  • %e

                                                                  • ',t.title);else{var i=o('
                                                                  • %e

                                                                  • ',t.title),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),i.appendChild(o('
                                                                    %e
                                                                    ',a))}if(!t.pending){var l=i.getElementsByTagName("h2")[0];c(l,"click",function(){p.style.display="none"==p.style.display?"inline-block":"none"});var p=o("
                                                                    %e
                                                                    ",f.clean(t.fn.toString()));i.appendChild(p),p.style.display="none"}S[0].appendChild(i)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(o('
                                                                    %s
                                                                    ',t))}function o(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return h(e[s++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function o(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var o=n("./base");o.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;o.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(r),failures:s.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t,null,2))})}function r(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var o=n("./base");o.cursor,o.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}r.call(this,t);var n=this,s=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),o.hide()}),t.on("test end",function(t){var n=-1==l?s*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){o.show(),console.log(),n.epilogue()})}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," ✓")+i("pass"," %s: ")+i(t.speed,"%dms");o.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){o.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+o.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=s(t[i],e));return--e,r}function i(t){var e=n(t,{});return s(e,0)}r.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=o.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=o.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var r=n("./base"),o=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var r=n("./base");e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/nyan.js",function(t,e,n){function s(t){o.call(this,t);{var e=this,n=(this.stats,.75*o.window.width|0),s=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-s,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){o.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){o.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&s.shift(),s.push(e)}},s.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){r("["+t.scoreboardWidth+"C"),r(e.join("")),r("\n")}),this.cursorUp(this.numberOfLines)},s.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(s){switch(r("["+n+"C"),s){case 0:r("_,------,"),r("\n");break;case 1:var o=e.tick?" ":" ";r("_|"+o+"/\\_/\\ "),r("\n");break;case 2:var i,o=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}r(a+"|"+o+i+" "),r("\n");break;case 3:var o=e.tick?" ":" ";r(o+'"" "" '),r("\n")}}),this.cursorUp(this.numberOfLines)},s.prototype.cursorUp=function(t){r("["+t+"A")},s.prototype.cursorDown=function(t){r("["+t+"B")},s.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),s=e*(1/6),r=Math.floor(3*Math.sin(s)+3),o=Math.floor(3*Math.sin(s+2*n)+3),i=Math.floor(3*Math.sin(s+4*n)+3);t.push(36*r+6*o+i+16)}return t},s.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){r.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||"⋅",e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),o.hide()}),t.on("test end",function(){u++;var t=u/a,n=s*t|0,r=s-n;o.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){o.show(),console.log(),n.epilogue()})}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,r.colors.progress=90,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}r.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," ✓")+i("pass"," %s ");o.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," ✓")+i("pass"," %s ")+i(t.speed,"(%dms)");o.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){o.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){o.call(this,t);var e=(this.stats,1);t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){console.log("not ok %d %s",e,r(t)),console.log(n.stack.replace(/^/gm," "))})}function r(t){return t.fullTitle().replace(/#/g,"")}{var o=n("./base");o.cursor,o.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){o.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var o=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(o("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(o("testcase",e,!1,o("failure",e,!1,i(n.stack))))}else console.log(t.pending?o("testcase",e,!1,o("skipped",{},!0)):o("testcase",e,!0))}function o(t,e,n,s){var r,o=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+o,s&&(r+=s+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}{var r=n("browser/events").EventEmitter,o=n("browser/debug")("mocha:runnable"),i=global.Date,a=global.setTimeout,u=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:(o("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:(o("timeout %d",t),this._slow=t,this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){u(this.timer)},s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=a(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(t){r||(r=!0,o.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!o.timedOut){if(s)return e(n);o.clearTimeout(),o.duration=new i-c,s=!0,t(n)}}var s,r,o=this,u=this.timeout(),c=new i,l=this.ctx;if(l&&l.runnable(this),this.async&&u&&(this.timer=a(function(){n(new Error("timeout of "+u+"ms exceeded")),o.timedOut=!0},u)),this.callback=n,this.async)try{this.fn.call(l,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else try{this.pending||this.fn.call(l),this.duration=new i-c,t() +}catch(f){t(f)}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(a.keys(global).concat(["errno"]))}function r(t,e){return u(e,function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var o=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,c=a.keys;t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.grep=function(t,e){return i("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},s.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var s=e._grep.test(t.fullTitle());e._invert&&(s=!s),s&&n++}),n},s.prototype.globals=function(t){return 0==arguments.length?this._globals:(i("globals %j",t),a.forEach(t,function(t){this._globals.push(t)},this),this)},s.prototype.checkGlobals=function(t){if(!this.ignoreLeaks){var e,n=this._globals,s=c(global),o=process.kill;o&&1==n.length-s.length||2!=n.length-s.length&&(e=r(n,s),this._globals=this._globals.concat(e),e.length>1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=r[t];return s?(o.currentRunnable=s,o.emit("hook",s),s.on("error",function(t){o.failHook(s,t)}),void s.run(function(e){s.removeAllListeners("error");var r=s.error();return r&&o.fail(o.test,r),e?o.failHook(s,e):(o.emit("hook end",s),void n(++t))})):e()}var s=this.suite,r=s["_"+t],o=this;process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=o,n(t)):void s(e.pop())}):(r.suite=o,n())}var r=this,o=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(s=o.shift(),!s)return e();var i=r._grep.test(s.fullTitle());return r._invert&&(i=!i),i?s.pending?(r.emit("pending",s),r.emit("test end",s),n()):(r.emit("test",r.test=s),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return s=r.test,t?(r.fail(s,t),r.emit("test end",s),r.hookUp("afterEach",n)):(s.state="passed",r.emit("pass",s),r.emit("test end",s),void r.hookUp("afterEach",n))})})):n()}var s,r=this,o=t.tests;this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void o.runSuite(e,n):s()}function s(){o.suite=t,o.hook("afterAll",function(){o.emit("suite end",t),e()})}var r=this.grepTotal(t),o=this,a=0;return i("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){o.runTests(t,n)})):e()},s.prototype.uncaught=function(t){i("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}var r=n("browser/events").EventEmitter,o=n("browser/debug")("mocha:suite"),i=n("./ms"),a=n("./utils"),u=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=new r,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return o("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),o("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),o("slow %d",t),this._slow=t,this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(o("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){if(this.pending)return this;var e=new u('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){if(this.pending)return this;var e=new u('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){if(this.pending)return this;var e=new u('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){if(this.pending)return this;var e=new u('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return a.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},s.prototype.eachTest=function(t){return a.forEach(this.tests,t),a.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function s(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}var r=n("./runnable");t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("utils.js",function(t,e,n){function s(t){return!~c.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var o=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),c=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,r=t.length;r>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,r=t.length;r>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n){for(var s=n,r=0,o=t.length;o>r;r++)s=e(s,t[r],r,t);return s},e.filter=function(t,e){for(var n=[],s=0,r=t.length;r>s;s++){var o=t[s];e(o,s,t)&&n.push(o)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),o.watchFile(t,n,function(n,s){s.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=e)},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var s=e.utils.parseQuery(window.location.search||"");return s.grep&&n.grep(s.grep),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.7.0/mocha.min.css b/ajax/libs/mocha/1.7.0/mocha.min.css new file mode 100644 index 000000000..28cfe905f --- /dev/null +++ b/ajax/libs/mocha/1.7.0/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}.hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:-20px;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.2;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.7.0/mocha.min.js b/ajax/libs/mocha/1.7.0/mocha.min.js new file mode 100644 index 000000000..636d13955 --- /dev/null +++ b/ajax/libs/mocha/1.7.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",o=e+"/index.js";return t.modules[s]&&s||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),o=n.split("/");s.pop();for(var r=0;rr;r++)if(s[r]===e||s[r].listener&&s[r].listener===e){o=r;break}if(0>o)return this;s.splice(o,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var o=e.slice(),r=0,i=o.length;i>r;r++)o[r].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,o=s,r=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,r,i-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,o-c/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var o=s.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=s.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var s=t.describe(e,n);r.grep(s.fullTitle())},t.it=t.specify=function(t,n){var s=e[0];if(s.pending)var n=null;var r=new o(t,n);return s.addTest(r),r},t.it.only=function(e,n){var s=t.it(e,n);r.grep(s.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(i,a))}}else{var r=s.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=s.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.only=function(e,n){var s=t.suite(e,n);r.grep(s.fullTitle())},t.test=function(t,n){var s=new o(t,n);return e[0].addTest(s),s},t.test.only=function(e,n){var s=t.test(e,n);r.grep(s.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var r=n("browser/path"),i=n("./utils");e=t.exports=o,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,s=this.suite,o=this.files.length;this.files.forEach(function(i){i=r.resolve(i),s.emit("pre-require",global,i,e),s.emit("require",n(i),i,e),s.emit("post-require",global,i,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";o(r,{name:"mocha",title:"Failed",image:s("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:s("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,s=this.options,o=new e.Runner(n),r=new this._reporter(o);return o.ignoreLeaks=s.ignoreLeaks,o.asyncOnly=s.asyncOnly,s.grep&&o.grep(s.grep,s.invert),s.globals&&o.globals(s.globals),s.growl&&this._growl(o,r),o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?Math.round(t/i)+" day":t>i?Math.round(t/i)+" days":t==r?Math.round(t/r)+" hour":t>r?Math.round(t/r)+" hours":t==o?Math.round(t/o)+" minute":t>o?Math.round(t/o)+" minutes":t==s?Math.round(t/s)+" second":t>s?Math.round(t/s)+" seconds":t+" ms"}var s=1e3,o=60*s,r=60*o,i=24*r;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new c}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,s){e.failures=e.failures||0,e.failures++,t.err=s,n.push(t)}),t.on("end",function(){e.end=new c,e.duration=new c-e.start}),t.on("pending",function(){e.pending++}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e,n){return u["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return p(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),l=n("../ms"),c=global.Date,f=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=s,e.useColors=f,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✔",err:"✖",dot:"․"},"win32"==process.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var p=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:f?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=p("error title"," %s) %s:\n")+p("error message"," %s")+p("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,l=a.slice(0,u),c=s.actual,f=s.expected,h=!0;if(s.showDiff&&(h=!1,s.actual=c=JSON.stringify(c,null,2),s.expected=f=JSON.stringify(f,null,2)),"string"==typeof c&&"string"==typeof f){var d=Math.max(c.length,f.length);l=20>d?r(s,"Chars",h):r(s,"Words",h);var g=l.split("\n");if(g.length>4){var m=String(g.length).length;l=g.map(function(t,e){return o(++e,m)+" | "+t}).join("\n")}l="\n"+p("diff removed","actual")+" "+p("diff added","expected")+"\n\n"+l+"\n",l=l.replace(/^/gm," "),n=p("error title"," %s) %s:\n%s")+p("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),l,a)})},s.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var n,o=this.stats;return console.log(),o.failures?(n=p("bright fail"," "+e.symbols.err)+p("fail"," %d of %d %s failed")+p("light",":"),console.error(n,o.failures,this.runner.total,t(this.runner.total)),s.list(this.failures),void console.error()):(n=p("bright pass"," "+e.symbols.ok)+p("green"," %d %s complete")+p("light"," (%s)"),console.log(n,o.tests||0,t(o.tests),l(o.duration)),o.pending&&(n=p("pending"," •")+p("pending"," %d %s pending"),console.log(n,o.pending,t(o.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                                    ',e()),++n,console.log("%s

                                                                    %s

                                                                    ",e(),r.escape(t.title)),console.log("%s
                                                                    ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                                    ",e()),--n,console.log("%s
                                                                    ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                                    %s
                                                                    ",e(),r.escape(t.title));var n=r.escape(r.clean(t.fn.toString()));console.log("%s
                                                                    %s
                                                                    ",e(),n)})}var o=n("./base"),r=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending",o.symbols.dot))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow",o.symbols.dot):r(t.speed,o.symbols.dot))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail",o.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),l=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:l.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t,e){c.call(this,t);var n,s,m=this.stats,v=(t.total,r(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],E=v.getElementsByTagName("canvas")[0],j=r('
                                                                      '),_=[j];if(e=e||document.getElementById("mocha"),E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,s=E.getContext("2d"),s.scale(S,S),n=new p}return e?(l(b,"click",function(){a();var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&i("test pass")}),l(k,"click",function(){a();var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&i("test fail")}),e.appendChild(v),e.appendChild(j),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=r('
                                                                    • %s

                                                                    • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=m.tests/this.total*100|0;n&&n.update(e).draw(s);var o=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(o/1e3).toFixed(2)),"passed"==t.state)var i=r('
                                                                    • %e%ems ‣

                                                                    • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var i=r('
                                                                    • %e

                                                                    • ',t.title);else{var i=r('
                                                                    • %e ‣

                                                                    • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),i.appendChild(r('
                                                                      %e
                                                                      ',a))}if(!t.pending){var c=i.getElementsByTagName("h2")[0];l(c,"click",function(){p.style.display="none"==p.style.display?"inline-block":"none"});var p=r("
                                                                      %e
                                                                      ",f.clean(t.fn.toString()));i.appendChild(p),p.style.display="none"}_[0]&&_[0].appendChild(i)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(r('
                                                                      %s
                                                                      ',t))}function r(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return h(e[s++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;r.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:s.map(o),passes:i.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}o.call(this,t);var n=this,s=(this.stats,.75*o.window.width|0),a=t.total,u=process.stdout,l=i("plane","✈"),c=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==c?s*++f/a|0:c;"failed"==t.state&&(l=i("plane crash","✈"),c=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(l),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," "+o.symbols.dot)+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+r.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=s(t[i],e));return--e,o}function i(t){var e=n(t,{});return s(e,0)}o.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=r.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=r.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var o=n("./base"),r=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){o.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var o=n("./base");e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/nyan.js",function(t,e,n){function s(t){r.call(this,t);{var e=this,n=(this.stats,.75*r.window.width|0),s=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-s,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){r.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){r.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&s.shift(),s.push(e)}},s.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){o("["+t.scoreboardWidth+"C"),o(e.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},s.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(s){switch(o("["+n+"C"),s){case 0:o("_,------,"),o("\n");break;case 1:var r=e.tick?" ":" ";o("_|"+r+"/\\_/\\ "),o("\n");break;case 2:var i,r=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}o(a+"|"+r+i+" "),o("\n");break;case 3:var r=e.tick?" ":" ";o(r+'"" "" '),o("\n")}}),this.cursorUp(this.numberOfLines)},s.prototype.cursorUp=function(t){o("["+t+"A")},s.prototype.cursorDown=function(t){o("["+t+"B")},s.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),s=e*(1/6),o=Math.floor(3*Math.sin(s)+3),r=Math.floor(3*Math.sin(s+2*n)+3),i=Math.floor(3*Math.sin(s+4*n)+3);t.push(36*o+6*r+i+16)}return t},s.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){o.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*o.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||o.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){u++;var t=u/a,n=s*t|0,o=s-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.progress=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}o.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," "+o.symbols.ok)+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," "+o.symbols.ok)+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){r.call(this,t);var e=(this.stats,1);t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){console.log("not ok %d %s",e,o(t)),console.log(n.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+o(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+o(t.fullTitle())+"' message='"+o(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+o(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+o(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function o(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var r=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new c).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=l(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,s){var o,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+l(e[a])+'"');return o="<"+t+(i.length?" "+i.join(" "):"")+r,s&&(o+=s+""}{var a=n("./base"),u=n("../utils"),l=u.escape,c=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}{var o=n("browser/events").EventEmitter,r=n("browser/debug")("mocha:runnable"),i=n("./ms"),a=global.Date,u=global.setTimeout,l=(global.setInterval,global.clearTimeout);global.clearInterval}t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._slow=t,this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){l(this.timer)},s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0 +},2)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=u(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(t){o||(o=!0,r.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(s)return e(n);r.clearTimeout(),r.duration=new a-l,s=!0,t(n)}}var s,o,r=this,i=this.timeout(),l=new a,c=this.ctx;if(c&&c.runnable(this),this.async&&i&&(this.timer=u(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new a-l,t()}catch(f){t(f)}}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function o(t,e){return u(e,function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,l=(a.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.grep=function(t,e){return i("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},s.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var s=e._grep.test(t.fullTitle());e._invert&&(s=!s),s&&n++}),n},s.prototype.globalProps=function(){for(var t=a.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=o[t];return s?(r.currentRunnable=s,r.emit("hook",s),s.on("error",function(t){r.failHook(s,t)}),void s.run(function(e){s.removeAllListeners("error");var o=s.error();return o&&r.fail(r.test,o),e?r.failHook(s,e):(r.emit("hook end",s),void n(++t))})):e()}var s=this.suite,o=s["_"+t],r=this;process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return o.suite=i,i?void o.hook(t,function(t){return t?(o.suite=r,n(t)):void s(e.pop())}):(o.suite=r,n())}var o=this,r=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){if(o.failures&&t._bail)return e();if(s=r.shift(),!s)return e();var i=o._grep.test(s.fullTitle());return o._invert&&(i=!i),i?s.pending?(o.emit("pending",s),o.emit("test end",s),n()):(o.emit("test",o.test=s),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return s=o.test,t?(o.fail(s,t),o.emit("test end",s),o.hookUp("afterEach",n)):(s.state="passed",o.emit("pass",s),o.emit("test end",s),void o.hookUp("afterEach",n))})})):n()}var s,o=this,r=t.tests.slice();this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void r.runSuite(e,n):s()}function s(){r.suite=t,r.hook("afterAll",function(){r.emit("suite end",t),e()})}var o=this.grepTotal(t),r=this,a=0;return i("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){r.runTests(t,n)})):e()},s.prototype.uncaught=function(t){i("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("mocha:suite"),i=n("./ms"),a=n("./utils"),u=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=new o,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return r("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),r("slow %d",t),this._slow=t,this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(r("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){if(this.pending)return this;var e=new u('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){if(this.pending)return this;var e=new u('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){if(this.pending)return this;var e=new u('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){if(this.pending)return this;var e=new u('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return a.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},s.prototype.eachTest=function(t){return a.forEach(this.tests,t),a.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("utils.js",function(t,e,n){function s(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var r=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,o=t.length;o>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,o=t.length;o>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n){for(var s=n,o=0,r=t.length;r>o;o++)s=e(s,t[o],o,t);return s},e.filter=function(t,e){for(var n=[],s=0,o=t.length;o>s;s++){var r=t[s];e(r,s,t)&&n.push(r)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),r.watchFile(t,n,function(n,s){s.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=e)},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var s=e.utils.parseQuery(window.location.search||"");return s.grep&&n.grep(s.grep),s.invert&&n.invert(),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.7.1/mocha.min.css b/ajax/libs/mocha/1.7.1/mocha.min.css new file mode 100644 index 000000000..28cfe905f --- /dev/null +++ b/ajax/libs/mocha/1.7.1/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}.hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:-20px;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.2;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.7.1/mocha.min.js b/ajax/libs/mocha/1.7.1/mocha.min.js new file mode 100644 index 000000000..2e0f20bda --- /dev/null +++ b/ajax/libs/mocha/1.7.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",r=e+"/index.js";return t.modules[s]&&s||t.modules[r]&&r||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),r=n.split("/");s.pop();for(var o=0;oo;o++)if(s[o]===e||s[o].listener&&s[o].listener===e){r=o;break}if(0>r)return this;s.splice(r,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var r=e.slice(),o=0,i=r.length;i>o;o++)r[o].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,r=s,o=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(r,o,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(r,o,i-1,0,u,!0),t.stroke();var c=this._text||(0|e)+"%",l=t.measureText(c).width;return t.fillText(c,r-l/2+1,o+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){r.call(this,t,e),this.type="hook"}var r=n("./runnable");t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,o){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var r=s.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var r=s.create(e[0],t);r.pending=!0,e.unshift(r),n.call(r),e.shift()},t.describe.only=function(e,n){var s=t.describe(e,n);o.grep(s.fullTitle())},t.it=t.specify=function(t,n){var s=e[0];if(s.pending)var n=null;var o=new r(t,n);return s.addTest(o),o},t.it.only=function(e,n){var s=t.it(e,n);o.grep(s.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){function e(t){var o;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new r(i,a))}}else{var o=s.create(n[0],i);n.unshift(o),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new r(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),r=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,o){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var r=s.create(e[0],t);return e.unshift(r),n.call(r),e.shift(),r},t.suite.only=function(e,n){var s=t.suite(e,n);o.grep(s.fullTitle())},t.test=function(t,n){var s=new r(t,n);return e[0].addTest(s),s},t.test.only=function(e,n){var s=t.test(e,n);o.grep(s.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function r(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var o=n("browser/path"),i=n("./utils");e=t.exports=r,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),r.prototype.addFile=function(t){return this.files.push(t),this},r.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},r.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},r.prototype.loadFiles=function(t){var e=this,s=this.suite,r=this.files.length;this.files.forEach(function(i){i=o.resolve(i),s.emit("pre-require",global,i,e),s.emit("require",n(i),i,e),s.emit("post-require",global,i,e),--r||t&&t()})},r.prototype._growl=function(t,e){var r=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var o=n.failures+" of "+t.total+" tests failed";r(o,{name:"mocha",title:"Failed",image:s("error")})}else r(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:s("ok")})})},r.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},r.prototype.invert=function(){return this.options.invert=!0,this},r.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},r.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},r.prototype.growl=function(){return this.options.growl=!0,this},r.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},r.prototype.timeout=function(t){return this.suite.timeout(t),this},r.prototype.slow=function(t){return this.suite.slow(t),this},r.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},r.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,s=this.options,r=new e.Runner(n),o=new this._reporter(r);return r.ignoreLeaks=s.ignoreLeaks,r.asyncOnly=s.asyncOnly,s.grep&&r.grep(s.grep,s.invert),s.globals&&r.globals(s.globals),s.growl&&this._growl(r,o),r.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?Math.round(t/i)+" day":t>i?Math.round(t/i)+" days":t==o?Math.round(t/o)+" hour":t>o?Math.round(t/o)+" hours":t==r?Math.round(t/r)+" minute":t>r?Math.round(t/r)+" minutes":t==s?Math.round(t/s)+" second":t>s?Math.round(t/s)+" seconds":t+" ms"}var s=1e3,r=60*s,o=60*r,i=24*o;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new l}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,s){e.failures=e.failures||0,e.failures++,t.err=s,n.push(t)}),t.on("end",function(){e.end=new l,e.duration=new l-e.start}),t.on("pending",function(){e.pending++}))}function r(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function o(t,e,n){return u["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return p(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),c=n("../ms"),l=global.Date,f=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=s,e.useColors=f,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==process.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var p=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:f?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=p("error title"," %s) %s:\n")+p("error message"," %s")+p("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,c=a.slice(0,u),l=s.actual,f=s.expected,h=!0;if(s.showDiff&&(h=!1,s.actual=l=JSON.stringify(l,null,2),s.expected=f=JSON.stringify(f,null,2)),"string"==typeof l&&"string"==typeof f){var d=Math.max(l.length,f.length);c=20>d?o(s,"Chars",h):o(s,"Words",h);var g=c.split("\n");if(g.length>4){var m=String(g.length).length;c=g.map(function(t,e){return r(++e,m)+" | "+t}).join("\n")}c="\n"+p("diff removed","actual")+" "+p("diff added","expected")+"\n\n"+c+"\n",c=c.replace(/^/gm," "),n=p("error title"," %s) %s:\n%s")+p("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),c,a)})},s.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var n,r=this.stats;return console.log(),r.failures?(n=p("bright fail"," "+e.symbols.err)+p("fail"," %d of %d %s failed")+p("light",":"),console.error(n,r.failures,this.runner.total,t(this.runner.total)),s.list(this.failures),void console.error()):(n=p("bright pass"," ")+p("green"," %d %s complete")+p("light"," (%s)"),console.log(n,r.tests||0,t(r.tests),c(r.duration)),r.pending&&(n=p("pending"," ")+p("pending"," %d %s pending"),console.log(n,r.pending,t(r.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}r.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                                      ',e()),++n,console.log("%s

                                                                      %s

                                                                      ",e(),o.escape(t.title)),console.log("%s
                                                                      ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                                      ",e()),--n,console.log("%s
                                                                      ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                                      %s
                                                                      ",e(),o.escape(t.title));var n=o.escape(o.clean(t.fn.toString()));console.log("%s
                                                                      %s
                                                                      ",e(),n)})}var r=n("./base"),o=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(o("pending",r.symbols.dot))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?o("bright yellow",r.symbols.dot):o(t.speed,r.symbols.dot))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(o("fail",r.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}var r=n("./base"),o=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),c=this;o.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:c.cov,coverageClass:r}))})}function r(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var o=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t,e){l.call(this,t);var n,s,m=this.stats,v=(t.total,o(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],j=v.getElementsByTagName("canvas")[0],E=o('
                                                                        '),_=[E];if(e=e||document.getElementById("mocha"),j.getContext){var S=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=S,j.height*=S,s=j.getContext("2d"),s.scale(S,S),n=new p}return e?(c(b,"click",function(){a();var t=/pass/.test(E.className)?"":" pass";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&i("test pass")}),c(k,"click",function(){a();var t=/fail/.test(E.className)?"":" fail";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&i("test fail")}),e.appendChild(v),e.appendChild(E),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=o('
                                                                      • %s

                                                                      • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e,n){("hook"==e.type||n.uncaught)&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=m.tests/this.total*100|0;n&&n.update(e).draw(s);var r=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(r/1e3).toFixed(2)),"passed"==t.state)var i=o('
                                                                      • %e%ems ‣

                                                                      • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var i=o('
                                                                      • %e

                                                                      • ',t.title);else{var i=o('
                                                                      • %e ‣

                                                                      • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),i.appendChild(o('
                                                                        %e
                                                                        ',a))}if(!t.pending){var l=i.getElementsByTagName("h2")[0];c(l,"click",function(){p.style.display="none"==p.style.display?"inline-block":"none"});var p=o("
                                                                        %e
                                                                        ",f.clean(t.fn.toString()));i.appendChild(p),p.style.display="none"}_[0]&&_[0].appendChild(i)})):r("#mocha div missing, add it to your document")}function r(t){document.body.appendChild(o('
                                                                        %s
                                                                        ',t))}function o(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return h(e[s++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function o(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",r(t)]))}),t.on("fail",function(t,e){t.error=e,console.log(JSON.stringify(["fail",r(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function r(t){var e={title:t.title,fullTitle:t.fullTitle(),duration:t.duration};return t.error&&(e.error={message:t.error.message,stack:t.error.stack}),e}{var o=n("./base");o.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;o.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t,e){t.error=e,s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(r),failures:s.map(r),passes:i.map(r)};process.stdout.write(JSON.stringify(t,null,2))})}function r(t){var e={title:t.title,fullTitle:t.fullTitle(),duration:t.duration};return t.error&&(e.error={message:t.error.message,stack:t.error.stack}),e}{var o=n("./base");o.cursor,o.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}r.call(this,t);var n=this,s=(this.stats,.75*r.window.width|0),a=t.total,u=process.stdout,c=i("plane","✈"),l=-1,f=0;t.on("start",function(){u.write("\n "),o.hide()}),t.on("test end",function(t){var n=-1==l?s*++f/a|0:l;"failed"==t.state&&(c=i("plane crash","✈"),l=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(c),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){o.show(),console.log(),n.epilogue()})}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," "+r.symbols.dot)+i("pass"," %s: ")+i(t.speed,"%dms");o.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){o.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,r="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+o.slug(t[i].suite.fullTitle())+")\n"),i&&(r+=Array(e).join(" ")+n),r+=s(t[i],e));return--e,r}function i(t){var e=n(t,{});return s(e,0)}r.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=o.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=o.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var r=n("./base"),o=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var r=n("./base");e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/nyan.js",function(t,e,n){function s(t){o.call(this,t);{var e=this,n=(this.stats,.75*o.window.width|0),s=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-s,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){o.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){o.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&s.shift(),s.push(e)}},s.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){r("["+t.scoreboardWidth+"C"),r(e.join("")),r("\n")}),this.cursorUp(this.numberOfLines)},s.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(s){switch(r("["+n+"C"),s){case 0:r("_,------,"),r("\n");break;case 1:var o=e.tick?" ":" ";r("_|"+o+"/\\_/\\ "),r("\n");break;case 2:var i,o=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}r(a+"|"+o+i+" "),r("\n");break;case 3:var o=e.tick?" ":" ";r(o+'"" "" '),r("\n")}}),this.cursorUp(this.numberOfLines)},s.prototype.cursorUp=function(t){r("["+t+"A")},s.prototype.cursorDown=function(t){r("["+t+"B")},s.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),s=e*(1/6),r=Math.floor(3*Math.sin(s)+3),o=Math.floor(3*Math.sin(s+2*n)+3),i=Math.floor(3*Math.sin(s+4*n)+3);t.push(36*r+6*o+i+16)}return t},s.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){r.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*r.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||r.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),o.hide()}),t.on("test end",function(){u++;var t=u/a,n=s*t|0,r=s-n;o.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){o.show(),console.log(),n.epilogue()})}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,r.colors.progress=90,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}r.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," "+r.symbols.ok)+i("pass"," %s ");o.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," "+r.symbols.ok)+i("pass"," %s ")+i(t.speed,"(%dms)");o.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){o.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var r=n("./base"),o=r.cursor,i=r.color;e=t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){o.call(this,t);var e=(this.stats,1);t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,r(t))}),t.on("pass",function(t){console.log("ok %d %s",e,r(t))}),t.on("fail",function(t,n){console.log("not ok %d %s",e,r(t)),console.log(n.stack.replace(/^/gm," "))})}function r(t){return t.fullTitle().replace(/#/g,"")}{var o=n("./base");o.cursor,o.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){o.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+r(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+r(t.fullTitle())+"' message='"+r(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+r(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+r(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function r(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var o=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(o("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new l).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(o("testcase",e,!1,o("failure",e,!1,i(n.stack))))}else console.log(t.pending?o("testcase",e,!1,o("skipped",{},!0)):o("testcase",e,!0))}function o(t,e,n,s){var r,o=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return r="<"+t+(i.length?" "+i.join(" "):"")+o,s&&(r+=s+""}{var a=n("./base"),u=n("../utils"),c=u.escape,l=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}var r=n("browser/events").EventEmitter,o=n("browser/debug")("mocha:runnable"),i=n("./ms"),a=global.Date,u=global.setTimeout,c=(global.setInterval,global.clearTimeout),l=(global.clearInterval,Object.prototype.toString);t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),o("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),o("timeout %d",t),this._slow=t,this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title +},s.prototype.clearTimeout=function(){c(this.timer)},s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=u(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(t){r||(r=!0,o.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!o.timedOut){if(s)return e(n);o.clearTimeout(),o.duration=new a-c,s=!0,t(n)}}var s,r,o=this,i=this.timeout(),c=new a,f=this.ctx;if(f&&f.runnable(this),this.async&&i&&(this.timer=u(function(){n(new Error("timeout of "+i+"ms exceeded")),o.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(f,function(t){return"[object Error]"===l.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(f),this.duration=new a-c,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function r(t,e){return u(e,function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var o=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,c=(a.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.grep=function(t,e){return i("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},s.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var s=e._grep.test(t.fullTitle());e._invert&&(s=!s),s&&n++}),n},s.prototype.globalProps=function(){for(var t=a.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=r[t];return s?(o.currentRunnable=s,o.emit("hook",s),s.on("error",function(t){o.failHook(s,t)}),void s.run(function(e){s.removeAllListeners("error");var r=s.error();return r&&o.fail(o.test,r),e?o.failHook(s,e):(o.emit("hook end",s),void n(++t))})):e()}var s=this.suite,r=s["_"+t],o=this;process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return r.suite=i,i?void r.hook(t,function(t){return t?(r.suite=o,n(t)):void s(e.pop())}):(r.suite=o,n())}var r=this,o=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){if(r.failures&&t._bail)return e();if(s=o.shift(),!s)return e();var i=r._grep.test(s.fullTitle());return r._invert&&(i=!i),i?s.pending?(r.emit("pending",s),r.emit("test end",s),n()):(r.emit("test",r.test=s),void r.hookDown("beforeEach",function(){r.currentRunnable=r.test,r.runTest(function(t){return s=r.test,t?(r.fail(s,t),r.emit("test end",s),r.hookUp("afterEach",n)):(s.state="passed",r.emit("pass",s),r.emit("test end",s),void r.hookUp("afterEach",n))})})):n()}var s,r=this,o=t.tests.slice();this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void o.runSuite(e,n):s()}function s(){o.suite=t,o.hook("afterAll",function(){o.emit("suite end",t),e()})}var r=this.grepTotal(t),o=this,a=0;return i("run suite %s",t.fullTitle()),r?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){o.runTests(t,n)})):e()},s.prototype.uncaught=function(t){i("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}var r=n("browser/events").EventEmitter,o=n("browser/debug")("mocha:suite"),i=n("./ms"),a=n("./utils"),u=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=new r,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return o("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),o("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),o("slow %d",t),this._slow=t,this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(o("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){if(this.pending)return this;var e=new u('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){if(this.pending)return this;var e=new u('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){if(this.pending)return this;var e=new u('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){if(this.pending)return this;var e=new u('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return a.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},s.prototype.eachTest=function(t){return a.forEach(this.tests,t),a.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function s(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}var r=n("./runnable");t.exports=s,s.prototype=new r,s.prototype.constructor=s}),t.register("utils.js",function(t,e,n){function s(t){return!~c.indexOf(t)}function r(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var o=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),c=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,r=t.length;r>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,r=t.length;r>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n){for(var s=n,r=0,o=t.length;o>r;r++)s=e(s,t[r],r,t);return s},e.filter=function(t,e){for(var n=[],s=0,r=t.length;r>s;s++){var o=t[s];e(o,s,t)&&n.push(o)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),o.watchFile(t,n,function(n,s){s.mtimen;++n)e[n].innerHTML=r(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=e)},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var s=e.utils.parseQuery(window.location.search||"");return s.grep&&n.grep(s.grep),s.invert&&n.invert(),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.7.2/mocha.min.css b/ajax/libs/mocha/1.7.2/mocha.min.css new file mode 100644 index 000000000..28cfe905f --- /dev/null +++ b/ajax/libs/mocha/1.7.2/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}.hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:-20px;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.2;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.7.2/mocha.min.js b/ajax/libs/mocha/1.7.2/mocha.min.js new file mode 100644 index 000000000..b24051760 --- /dev/null +++ b/ajax/libs/mocha/1.7.2/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",o=e+"/index.js";return t.modules[s]&&s||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),o=n.split("/");s.pop();for(var r=0;rr;r++)if(s[r]===e||s[r].listener&&s[r].listener===e){o=r;break}if(0>o)return this;s.splice(o,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var o=e.slice(),r=0,i=o.length;i>r;r++)o[r].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,o=s,r=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,r,i-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,o-c/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var o=s.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=s.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var s=t.describe(e,n);r.grep(s.fullTitle())},t.it=t.specify=function(t,n){var s=e[0];if(s.pending)var n=null;var r=new o(t,n);return s.addTest(r),r},t.it.only=function(e,n){var s=t.it(e,n);r.grep(s.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(i,a))}}else{var r=s.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=s.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.only=function(e,n){var s=t.suite(e,n);r.grep(s.fullTitle())},t.test=function(t,n){var s=new o(t,n);return e[0].addTest(s),s},t.test.only=function(e,n){var s=t.test(e,n);r.grep(s.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var r=n("browser/path"),i=n("./utils");e=t.exports=o,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,s=this.suite,o=this.files.length;this.files.forEach(function(i){i=r.resolve(i),s.emit("pre-require",global,i,e),s.emit("require",n(i),i,e),s.emit("post-require",global,i,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";o(r,{name:"mocha",title:"Failed",image:s("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:s("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,s=this.options,o=new e.Runner(n),r=new this._reporter(o);return o.ignoreLeaks=s.ignoreLeaks,o.asyncOnly=s.asyncOnly,s.grep&&o.grep(s.grep,s.invert),s.globals&&o.globals(s.globals),s.growl&&this._growl(o,r),o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?Math.round(t/i)+" day":t>i?Math.round(t/i)+" days":t==r?Math.round(t/r)+" hour":t>r?Math.round(t/r)+" hours":t==o?Math.round(t/o)+" minute":t>o?Math.round(t/o)+" minutes":t==s?Math.round(t/s)+" second":t>s?Math.round(t/s)+" seconds":t+" ms"}var s=1e3,o=60*s,r=60*o,i=24*r;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new c}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,s){e.failures=e.failures||0,e.failures++,t.err=s,n.push(t)}),t.on("end",function(){e.end=new c,e.duration=new c-e.start}),t.on("pending",function(){e.pending++}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e,n){return u["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return p(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),l=n("../ms"),c=global.Date,f=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=s,e.useColors=f,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==process.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var p=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:f?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=p("error title"," %s) %s:\n")+p("error message"," %s")+p("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,l=a.slice(0,u),c=s.actual,f=s.expected,h=!0;if(s.showDiff&&(h=!1,s.actual=c=JSON.stringify(c,null,2),s.expected=f=JSON.stringify(f,null,2)),"string"==typeof c&&"string"==typeof f){var d=Math.max(c.length,f.length);l=20>d?r(s,"Chars",h):r(s,"Words",h);var g=l.split("\n");if(g.length>4){var m=String(g.length).length;l=g.map(function(t,e){return o(++e,m)+" | "+t}).join("\n")}l="\n"+p("diff removed","actual")+" "+p("diff added","expected")+"\n\n"+l+"\n",l=l.replace(/^/gm," "),n=p("error title"," %s) %s:\n%s")+p("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),l,a)})},s.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var n,o=this.stats;return console.log(),o.failures?(n=p("bright fail"," "+e.symbols.err)+p("fail"," %d of %d %s failed")+p("light",":"),console.error(n,o.failures,this.runner.total,t(this.runner.total)),s.list(this.failures),void console.error()):(n=p("bright pass"," ")+p("green"," %d %s complete")+p("light"," (%s)"),console.log(n,o.tests||0,t(o.tests),l(o.duration)),o.pending&&(n=p("pending"," ")+p("pending"," %d %s pending"),console.log(n,o.pending,t(o.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                                        ',e()),++n,console.log("%s

                                                                        %s

                                                                        ",e(),r.escape(t.title)),console.log("%s
                                                                        ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                                        ",e()),--n,console.log("%s
                                                                        ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                                        %s
                                                                        ",e(),r.escape(t.title));var n=r.escape(r.clean(t.fn.toString()));console.log("%s
                                                                        %s
                                                                        ",e(),n)})}var o=n("./base"),r=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending",o.symbols.dot))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow",o.symbols.dot):r(t.speed,o.symbols.dot))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail",o.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),l=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:l.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t,e){c.call(this,t);var n,s,m=this.stats,v=(t.total,r(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],E=v.getElementsByTagName("canvas")[0],j=r('
                                                                          '),_=[j];if(e=e||document.getElementById("mocha"),E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,s=E.getContext("2d"),s.scale(S,S),n=new p}return e?(l(b,"click",function(){a();var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&i("test pass")}),l(k,"click",function(){a();var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&i("test fail")}),e.appendChild(v),e.appendChild(j),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=r('
                                                                        • %s

                                                                        • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=m.tests/this.total*100|0;n&&n.update(e).draw(s);var o=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(o/1e3).toFixed(2)),"passed"==t.state)var i=r('
                                                                        • %e%ems ‣

                                                                        • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var i=r('
                                                                        • %e

                                                                        • ',t.title);else{var i=r('
                                                                        • %e ‣

                                                                        • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),i.appendChild(r('
                                                                          %e
                                                                          ',a))}if(!t.pending){var c=i.getElementsByTagName("h2")[0];l(c,"click",function(){p.style.display="none"==p.style.display?"inline-block":"none"});var p=r("
                                                                          %e
                                                                          ",f.clean(t.fn.toString()));i.appendChild(p),p.style.display="none"}_[0]&&_[0].appendChild(i)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(r('
                                                                          %s
                                                                          ',t))}function r(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return h(e[s++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;r.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:s.map(o),passes:i.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}o.call(this,t);var n=this,s=(this.stats,.75*o.window.width|0),a=t.total,u=process.stdout,l=i("plane","✈"),c=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==c?s*++f/a|0:c;"failed"==t.state&&(l=i("plane crash","✈"),c=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(l),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," "+o.symbols.dot)+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+r.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=s(t[i],e));return--e,o}function i(t){var e=n(t,{});return s(e,0)}o.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=r.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=r.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var o=n("./base"),r=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){o.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var o=n("./base");e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/nyan.js",function(t,e,n){function s(t){r.call(this,t);{var e=this,n=(this.stats,.75*r.window.width|0),s=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-s,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){r.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){r.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&s.shift(),s.push(e)}},s.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){o("["+t.scoreboardWidth+"C"),o(e.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},s.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(s){switch(o("["+n+"C"),s){case 0:o("_,------,"),o("\n");break;case 1:var r=e.tick?" ":" ";o("_|"+r+"/\\_/\\ "),o("\n");break;case 2:var i,r=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}o(a+"|"+r+i+" "),o("\n");break;case 3:var r=e.tick?" ":" ";o(r+'"" "" '),o("\n")}}),this.cursorUp(this.numberOfLines)},s.prototype.cursorUp=function(t){o("["+t+"A")},s.prototype.cursorDown=function(t){o("["+t+"B")},s.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),s=e*(1/6),o=Math.floor(3*Math.sin(s)+3),r=Math.floor(3*Math.sin(s+2*n)+3),i=Math.floor(3*Math.sin(s+4*n)+3);t.push(36*o+6*r+i+16)}return t},s.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){o.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*o.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||o.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){u++;var t=u/a,n=s*t|0,o=s-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.progress=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}o.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," "+o.symbols.ok)+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," "+o.symbols.ok)+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){r.call(this,t);var e=(this.stats,1);t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){console.log("not ok %d %s",e,o(t)),console.log(n.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+o(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+o(t.fullTitle())+"' message='"+o(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+o(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+o(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function o(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var r=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new c).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=l(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,s){var o,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+l(e[a])+'"');return o="<"+t+(i.length?" "+i.join(" "):"")+r,s&&(o+=s+""}{var a=n("./base"),u=n("../utils"),l=u.escape,c=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("mocha:runnable"),i=n("./ms"),a=global.Date,u=global.setTimeout,l=(global.setInterval,global.clearTimeout),c=(global.clearInterval,Object.prototype.toString);t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._slow=t,this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){l(this.timer)},s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0 +},2)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=u(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(t){o||(o=!0,r.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(s)return e(n);r.clearTimeout(),r.duration=new a-l,s=!0,t(n)}}var s,o,r=this,i=this.timeout(),l=new a,f=this.ctx;if(f&&f.runnable(this),this.async&&i&&(this.timer=u(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(f,function(t){return"[object Error]"===c.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(f),this.duration=new a-l,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function o(t,e){return u(e,function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,l=(a.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.grep=function(t,e){return i("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},s.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var s=e._grep.test(t.fullTitle());e._invert&&(s=!s),s&&n++}),n},s.prototype.globalProps=function(){for(var t=a.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=o[t];return s?(r.currentRunnable=s,r.emit("hook",s),s.on("error",function(t){r.failHook(s,t)}),void s.run(function(e){s.removeAllListeners("error");var o=s.error();return o&&r.fail(r.test,o),e?r.failHook(s,e):(r.emit("hook end",s),void n(++t))})):e()}var s=this.suite,o=s["_"+t],r=this;process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return o.suite=i,i?void o.hook(t,function(t){return t?(o.suite=r,n(t)):void s(e.pop())}):(o.suite=r,n())}var o=this,r=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){if(o.failures&&t._bail)return e();if(s=r.shift(),!s)return e();var i=o._grep.test(s.fullTitle());return o._invert&&(i=!i),i?s.pending?(o.emit("pending",s),o.emit("test end",s),n()):(o.emit("test",o.test=s),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return s=o.test,t?(o.fail(s,t),o.emit("test end",s),o.hookUp("afterEach",n)):(s.state="passed",o.emit("pass",s),o.emit("test end",s),void o.hookUp("afterEach",n))})})):n()}var s,o=this,r=t.tests.slice();this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void r.runSuite(e,n):s()}function s(){r.suite=t,r.hook("afterAll",function(){r.emit("suite end",t),e()})}var o=this.grepTotal(t),r=this,a=0;return i("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){r.runTests(t,n)})):e()},s.prototype.uncaught=function(t){i("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){function e(t,e,s){n.uncaught(new Error(t+" ("+e+":"+s+")"))}var n=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("mocha:suite"),i=n("./ms"),a=n("./utils"),u=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=new o,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return r("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),r("slow %d",t),this._slow=t,this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(r("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){if(this.pending)return this;var e=new u('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){if(this.pending)return this;var e=new u('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){if(this.pending)return this;var e=new u('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){if(this.pending)return this;var e=new u('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return a.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},s.prototype.eachTest=function(t){return a.forEach(this.tests,t),a.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("utils.js",function(t,e,n){function s(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var r=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,o=t.length;o>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,o=t.length;o>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n){for(var s=n,o=0,r=t.length;r>o;o++)s=e(s,t[o],o,t);return s},e.filter=function(t,e){for(var n=[],s=0,o=t.length;o>s;s++){var r=t[s];e(r,s,t)&&n.push(r)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),r.watchFile(t,n,function(n,s){s.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=e)},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var s=e.utils.parseQuery(window.location.search||"");return s.grep&&n.grep(s.grep),s.invert&&n.invert(),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.7.3/mocha.min.css b/ajax/libs/mocha/1.7.3/mocha.min.css new file mode 100644 index 000000000..28cfe905f --- /dev/null +++ b/ajax/libs/mocha/1.7.3/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}.hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:-20px;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.2;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.7.3/mocha.min.js b/ajax/libs/mocha/1.7.3/mocha.min.js new file mode 100644 index 000000000..4fa39a5ec --- /dev/null +++ b/ajax/libs/mocha/1.7.3/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",o=e+"/index.js";return t.modules[s]&&s||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),o=n.split("/");s.pop();for(var r=0;rr;r++)if(s[r]===e||s[r].listener&&s[r].listener===e){o=r;break}if(0>o)return this;s.splice(o,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var o=e.slice(),r=0,i=o.length;i>r;r++)o[r].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,o=s,r=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,r,i-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,o-c/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var o=s.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=s.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var s=t.describe(e,n);r.grep(s.fullTitle())},t.it=t.specify=function(t,n){var s=e[0];if(s.pending)var n=null;var r=new o(t,n);return s.addTest(r),r},t.it.only=function(e,n){var s=t.it(e,n);r.grep(s.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(i,a))}}else{var r=s.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=s.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.only=function(e,n){var s=t.suite(e,n);r.grep(s.fullTitle())},t.test=function(t,n){var s=new o(t,n);return e[0].addTest(s),s},t.test.only=function(e,n){var s=t.test(e,n);r.grep(s.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var r=n("browser/path"),i=n("./utils");e=t.exports=o,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,s=this.suite,o=this.files.length;this.files.forEach(function(i){i=r.resolve(i),s.emit("pre-require",global,i,e),s.emit("require",n(i),i,e),s.emit("post-require",global,i,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";o(r,{name:"mocha",title:"Failed",image:s("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:s("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,s=this.options,o=new e.Runner(n),r=new this._reporter(o);return o.ignoreLeaks=s.ignoreLeaks,o.asyncOnly=s.asyncOnly,s.grep&&o.grep(s.grep,s.invert),s.globals&&o.globals(s.globals),s.growl&&this._growl(o,r),o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?Math.round(t/i)+" day":t>i?Math.round(t/i)+" days":t==r?Math.round(t/r)+" hour":t>r?Math.round(t/r)+" hours":t==o?Math.round(t/o)+" minute":t>o?Math.round(t/o)+" minutes":t==s?Math.round(t/s)+" second":t>s?Math.round(t/s)+" seconds":t+" ms"}var s=1e3,o=60*s,r=60*o,i=24*r;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new c}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,s){e.failures=e.failures||0,e.failures++,t.err=s,n.push(t)}),t.on("end",function(){e.end=new c,e.duration=new c-e.start}),t.on("pending",function(){e.pending++}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e,n){return u["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return p(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),l=n("../ms"),c=global.Date,f=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=s,e.useColors=f,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==process.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var p=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:f?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=p("error title"," %s) %s:\n")+p("error message"," %s")+p("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,l=a.slice(0,u),c=s.actual,f=s.expected,h=!0;if(s.showDiff&&(h=!1,s.actual=c=JSON.stringify(c,null,2),s.expected=f=JSON.stringify(f,null,2)),"string"==typeof c&&"string"==typeof f){var d=Math.max(c.length,f.length);l=20>d?r(s,"Chars",h):r(s,"Words",h);var g=l.split("\n");if(g.length>4){var m=String(g.length).length;l=g.map(function(t,e){return o(++e,m)+" | "+t}).join("\n")}l="\n"+p("diff removed","actual")+" "+p("diff added","expected")+"\n\n"+l+"\n",l=l.replace(/^/gm," "),n=p("error title"," %s) %s:\n%s")+p("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),l,a)})},s.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var n,o=this.stats;return console.log(),o.failures?(n=p("bright fail"," "+e.symbols.err)+p("fail"," %d of %d %s failed")+p("light",":"),console.error(n,o.failures,this.runner.total,t(this.runner.total)),s.list(this.failures),void console.error()):(n=p("bright pass"," ")+p("green"," %d %s complete")+p("light"," (%s)"),console.log(n,o.tests||0,t(o.tests),l(o.duration)),o.pending&&(n=p("pending"," ")+p("pending"," %d %s pending"),console.log(n,o.pending,t(o.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                                          ',e()),++n,console.log("%s

                                                                          %s

                                                                          ",e(),r.escape(t.title)),console.log("%s
                                                                          ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                                          ",e()),--n,console.log("%s
                                                                          ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                                          %s
                                                                          ",e(),r.escape(t.title));var n=r.escape(r.clean(t.fn.toString()));console.log("%s
                                                                          %s
                                                                          ",e(),n)})}var o=n("./base"),r=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending",o.symbols.dot))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow",o.symbols.dot):r(t.speed,o.symbols.dot))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail",o.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),l=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:l.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t,e){c.call(this,t);var n,s,m=this.stats,v=(t.total,r(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],E=v.getElementsByTagName("canvas")[0],j=r('
                                                                            '),_=[j];if(e=e||document.getElementById("mocha"),E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,s=E.getContext("2d"),s.scale(S,S),n=new p}return e?(l(b,"click",function(){a();var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&i("test pass")}),l(k,"click",function(){a();var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&i("test fail")}),e.appendChild(v),e.appendChild(j),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=r('
                                                                          • %s

                                                                          • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=m.tests/this.total*100|0;n&&n.update(e).draw(s);var o=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(o/1e3).toFixed(2)),"passed"==t.state)var i=r('
                                                                          • %e%ems ‣

                                                                          • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var i=r('
                                                                          • %e

                                                                          • ',t.title);else{var i=r('
                                                                          • %e ‣

                                                                          • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),i.appendChild(r('
                                                                            %e
                                                                            ',a))}if(!t.pending){var c=i.getElementsByTagName("h2")[0];l(c,"click",function(){p.style.display="none"==p.style.display?"inline-block":"none"});var p=r("
                                                                            %e
                                                                            ",f.clean(t.fn.toString()));i.appendChild(p),p.style.display="none"}_[0]&&_[0].appendChild(i)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(r('
                                                                            %s
                                                                            ',t))}function r(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return h(e[s++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;r.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:s.map(o),passes:i.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}o.call(this,t);var n=this,s=(this.stats,.75*o.window.width|0),a=t.total,u=process.stdout,l=i("plane","✈"),c=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==c?s*++f/a|0:c;"failed"==t.state&&(l=i("plane crash","✈"),c=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(l),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," "+o.symbols.dot)+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+r.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=s(t[i],e));return--e,o}function i(t){var e=n(t,{});return s(e,0)}o.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=r.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=r.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var o=n("./base"),r=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){o.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var o=n("./base");e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/nyan.js",function(t,e,n){function s(t){r.call(this,t);{var e=this,n=(this.stats,.75*r.window.width|0),s=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-s,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){r.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){r.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&s.shift(),s.push(e)}},s.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){o("["+t.scoreboardWidth+"C"),o(e.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},s.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(s){switch(o("["+n+"C"),s){case 0:o("_,------,"),o("\n");break;case 1:var r=e.tick?" ":" ";o("_|"+r+"/\\_/\\ "),o("\n");break;case 2:var i,r=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}o(a+"|"+r+i+" "),o("\n");break;case 3:var r=e.tick?" ":" ";o(r+'"" "" '),o("\n")}}),this.cursorUp(this.numberOfLines)},s.prototype.cursorUp=function(t){o("["+t+"A")},s.prototype.cursorDown=function(t){o("["+t+"B")},s.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),s=e*(1/6),o=Math.floor(3*Math.sin(s)+3),r=Math.floor(3*Math.sin(s+2*n)+3),i=Math.floor(3*Math.sin(s+4*n)+3);t.push(36*o+6*r+i+16)}return t},s.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){o.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*o.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||o.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){u++;var t=u/a,n=s*t|0,o=s-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.progress=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}o.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," "+o.symbols.ok)+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," "+o.symbols.ok)+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){r.call(this,t);var e=(this.stats,1);t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){console.log("not ok %d %s",e,o(t)),console.log(n.stack.replace(/^/gm," "))})}function o(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+o(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+o(t.fullTitle())+"' message='"+o(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+o(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+o(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function o(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var r=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new c).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=l(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,s){var o,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+l(e[a])+'"');return o="<"+t+(i.length?" "+i.join(" "):"")+r,s&&(o+=s+""}{var a=n("./base"),u=n("../utils"),l=u.escape,c=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("mocha:runnable"),i=n("./ms"),a=global.Date,u=global.setTimeout,l=(global.setInterval,global.clearTimeout),c=(global.clearInterval,Object.prototype.toString);t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._slow=t,this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){l(this.timer)},s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0 +},2)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=u(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(t){o||(o=!0,r.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(s)return e(n);r.clearTimeout(),r.duration=new a-l,s=!0,t(n)}}var s,o,r=this,i=this.timeout(),l=new a,f=this.ctx;if(f&&f.runnable(this),this.async&&i&&(this.timer=u(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(f,function(t){return"[object Error]"===c.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(f),this.duration=new a-l,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function o(t,e){return u(e,function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,l=(a.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.grep=function(t,e){return i("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},s.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var s=e._grep.test(t.fullTitle());e._invert&&(s=!s),s&&n++}),n},s.prototype.globalProps=function(){for(var t=a.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=o[t];return s?(r.currentRunnable=s,r.emit("hook",s),s.on("error",function(t){r.failHook(s,t)}),void s.run(function(e){s.removeAllListeners("error");var o=s.error();return o&&r.fail(r.test,o),e?r.failHook(s,e):(r.emit("hook end",s),void n(++t))})):e()}var s=this.suite,o=s["_"+t],r=this;process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return o.suite=i,i?void o.hook(t,function(t){return t?(o.suite=r,n(t)):void s(e.pop())}):(o.suite=r,n())}var o=this,r=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){if(o.failures&&t._bail)return e();if(s=r.shift(),!s)return e();var i=o._grep.test(s.fullTitle());return o._invert&&(i=!i),i?s.pending?(o.emit("pending",s),o.emit("test end",s),n()):(o.emit("test",o.test=s),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return s=o.test,t?(o.fail(s,t),o.emit("test end",s),o.hookUp("afterEach",n)):(s.state="passed",o.emit("pass",s),o.emit("test end",s),void o.hookUp("afterEach",n))})})):n()}var s,o=this,r=t.tests.slice();this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void r.runSuite(e,n):s()}function s(){r.suite=t,r.hook("afterAll",function(){r.emit("suite end",t),e()})}var o=this.grepTotal(t),r=this,a=0;return i("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){r.runTests(t,n)})):e()},s.prototype.uncaught=function(t){i("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){var e=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",e.uncaught.bind(e)),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),e.emit("end")}),process.on("uncaughtException",this.uncaught.bind(this)),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("mocha:suite"),i=n("./ms"),a=n("./utils"),u=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=new o,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return r("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),r("slow %d",t),this._slow=t,this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(r("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){if(this.pending)return this;var e=new u('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){if(this.pending)return this;var e=new u('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){if(this.pending)return this;var e=new u('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){if(this.pending)return this;var e=new u('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return a.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},s.prototype.eachTest=function(t){return a.forEach(this.tests,t),a.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("utils.js",function(t,e,n){function s(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var r=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,o=t.length;o>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,o=t.length;o>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n){for(var s=n,o=0,r=t.length;r>o;o++)s=e(s,t[o],o,t);return s},e.filter=function(t,e){for(var n=[],s=0,o=t.length;o>s;s++){var r=t[s];e(r,s,t)&&n.push(r)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),r.watchFile(t,n,function(n,s){s.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=function(t,n,s){e(new Error(t+" ("+n+":"+s+")"))})},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var s=e.utils.parseQuery(window.location.search||"");return s.grep&&n.grep(s.grep),s.invert&&n.invert(),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.7.4/mocha.min.css b/ajax/libs/mocha/1.7.4/mocha.min.css new file mode 100644 index 000000000..28cfe905f --- /dev/null +++ b/ajax/libs/mocha/1.7.4/mocha.min.css @@ -0,0 +1 @@ +@charset "UTF-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}.hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite,#mocha .test{margin-left:15px}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:inline-block;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:-20px;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.2;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.7.4/mocha.min.js b/ajax/libs/mocha/1.7.4/mocha.min.js new file mode 100644 index 000000000..9428e2c9e --- /dev/null +++ b/ajax/libs/mocha/1.7.4/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),s=t.modules[n];if(!s)throw new Error('failed to require "'+e+'"');return s.exports||(s.exports={},s.call(s.exports,s,s.exports,t.relative(n))),s.exports}t.modules={},t.resolve=function(e){var n=e,s=e+".js",o=e+"/index.js";return t.modules[s]&&s||t.modules[o]&&o||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var s=e.split("/"),o=n.split("/");s.pop();for(var r=0;rr;r++)if(s[r]===e||s[r].listener&&s[r].listener===e){o=r;break}if(0>o)return this;s.splice(o,1),s.length||delete this.$events[t]}else(s===e||s.listener&&s.listener===e)&&delete this.$events[t]}return this},s.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},s.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},s.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var s=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,s);else{if(!n(e))return!1;for(var o=e.slice(),r=0,i=o.length;i>r;r++)o[r].apply(this,s)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,s=n/2,o=s,r=s,i=s-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(o,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(o,r,i-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,o-c/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.type="hook"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var o=s.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var o=s.create(e[0],t);o.pending=!0,e.unshift(o),n.call(o),e.shift()},t.describe.only=function(e,n){var s=t.describe(e,n);r.grep(s.fullTitle())},t.it=t.specify=function(t,n){var s=e[0];if(s.pending)var n=null;var r=new o(t,n);return s.addTest(r),r},t.it.only=function(e,n){var s=t.it(e,n);r.grep(s.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new o(i,a))}}else{var r=s.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=s.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new o(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var s=n("../suite"),o=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var o=s.create(e[0],t);return e.unshift(o),n.call(o),e.shift(),o},t.suite.only=function(e,n){var s=t.suite(e,n);r.grep(s.fullTitle())},t.test=function(t,n){var s=new o(t,n);return e[0].addTest(s),s},t.test.only=function(e,n){var s=t.test(e,n);r.grep(s.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function s(t){return __dirname+"/../images/"+t+".png"}function o(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var r=n("browser/path"),i=n("./utils");e=t.exports=o,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),o.prototype.addFile=function(t){return this.files.push(t),this},o.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},o.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},o.prototype.loadFiles=function(t){var e=this,s=this.suite,o=this.files.length;this.files.forEach(function(i){i=r.resolve(i),s.emit("pre-require",global,i,e),s.emit("require",n(i),i,e),s.emit("post-require",global,i,e),--o||t&&t()})},o.prototype._growl=function(t,e){var o=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";o(r,{name:"mocha",title:"Failed",image:s("error")})}else o(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:s("ok")})})},o.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},o.prototype.invert=function(){return this.options.invert=!0,this},o.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},o.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},o.prototype.growl=function(){return this.options.growl=!0,this},o.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},o.prototype.timeout=function(t){return this.suite.timeout(t),this},o.prototype.slow=function(t){return this.suite.slow(t),this},o.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},o.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,s=this.options,o=new e.Runner(n),r=new this._reporter(o);return o.ignoreLeaks=s.ignoreLeaks,o.asyncOnly=s.asyncOnly,s.grep&&o.grep(s.grep,s.invert),s.globals&&o.globals(s.globals),s.growl&&this._growl(o,r),o.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?Math.round(t/i)+" day":t>i?Math.round(t/i)+" days":t==r?Math.round(t/r)+" hour":t>r?Math.round(t/r)+" hours":t==o?Math.round(t/o)+" minute":t>o?Math.round(t/o)+" minutes":t==s?Math.round(t/s)+" second":t>s?Math.round(t/s)+" seconds":t+" ms"}var s=1e3,o=60*s,r=60*o,i=24*r;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function s(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new c}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,s){e.failures=e.failures||0,e.failures++,t.err=s,n.push(t)}),t.on("end",function(){e.end=new c,e.duration=new c-e.start}),t.on("pending",function(){e.pending++}))}function o(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e,n){return u["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return p(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),l=n("../ms"),c=global.Date,f=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=s,e.useColors=f,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==process.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var p=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:f?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=p("error title"," %s) %s:\n")+p("error message"," %s")+p("error stack","\n%s\n"),s=t.err,i=s.message||"",a=s.stack||i,u=a.indexOf(i)+i.length,l=a.slice(0,u),c=s.actual,f=s.expected,h=!0;if(s.showDiff&&(h=!1,s.actual=c=JSON.stringify(c,null,2),s.expected=f=JSON.stringify(f,null,2)),"string"==typeof c&&"string"==typeof f){var d=Math.max(c.length,f.length);l=20>d?r(s,"Chars",h):r(s,"Words",h);var g=l.split("\n");if(g.length>4){var m=String(g.length).length;l=g.map(function(t,e){return o(++e,m)+" | "+t}).join("\n")}l="\n"+p("diff removed","actual")+" "+p("diff added","expected")+"\n\n"+l+"\n",l=l.replace(/^/gm," "),n=p("error title"," %s) %s:\n%s")+p("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),l,a)})},s.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var n,o=this.stats;return console.log(),o.failures?(n=p("bright fail"," "+e.symbols.err)+p("fail"," %d of %d %s failed")+p("light",":"),console.error(n,o.failures,this.runner.total,t(this.runner.total)),s.list(this.failures),void console.error()):(n=p("bright pass"," ")+p("green"," %d %s complete")+p("light"," (%s)"),console.log(n,o.tests||0,t(o.tests),l(o.duration)),o.pending&&(n=p("pending"," ")+p("pending"," %d %s pending"),console.log(n,o.pending,t(o.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function s(t){function e(){return Array(n).join(" ")}o.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                                            ',e()),++n,console.log("%s

                                                                            %s

                                                                            ",e(),r.escape(t.title)),console.log("%s
                                                                            ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                                            ",e()),--n,console.log("%s
                                                                            ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                                            %s
                                                                            ",e(),r.escape(t.title));var n=r.escape(r.clean(t.fn.toString()));console.log("%s
                                                                            %s
                                                                            ",e(),n)})}var o=n("./base"),r=n("../utils");e=t.exports=s}),t.register("reporters/dot.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,.75*o.window.width|0),s=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(r("pending",o.symbols.dot))}),t.on("pass",function(t){++s%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?r("bright yellow",o.symbols.dot):r(t.speed,o.symbols.dot))}),t.on("fail",function(){++s%n==0&&process.stdout.write("\n "),process.stdout.write(r("fail",o.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}var o=n("./base"),r=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/html-cov.js",function(t,e,n){function s(t){var e=n("jade"),s=__dirname+"/templates/coverage.jade",a=i.readFileSync(s,"utf8"),u=e.compile(a,{filename:s}),l=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:l.cov,coverageClass:o}))})}function o(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=s}),t.register("reporters/html.js",function(t,e,n){function s(t,e){c.call(this,t);var n,s,m=this.stats,v=(t.total,r(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],E=v.getElementsByTagName("canvas")[0],j=r('
                                                                              '),_=[j];if(e=e||document.getElementById("mocha"),E.getContext){var S=window.devicePixelRatio||1;E.style.width=E.width,E.style.height=E.height,E.width*=S,E.height*=S,s=E.getContext("2d"),s.scale(S,S),n=new p}return e?(l(b,"click",function(){a();var t=/pass/.test(j.className)?"":" pass";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&i("test pass")}),l(k,"click",function(){a();var t=/fail/.test(j.className)?"":" fail";j.className=j.className.replace(/fail|pass/g,"")+t,j.className.trim()&&i("test fail")}),e.appendChild(v),e.appendChild(j),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=r('
                                                                            • %s

                                                                            • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=m.tests/this.total*100|0;n&&n.update(e).draw(s);var o=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(o/1e3).toFixed(2)),"passed"==t.state)var i=r('
                                                                            • %e%ems ‣

                                                                            • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var i=r('
                                                                            • %e

                                                                            • ',t.title);else{var i=r('
                                                                            • %e ‣

                                                                            • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),i.appendChild(r('
                                                                              %e
                                                                              ',a))}if(!t.pending){var c=i.getElementsByTagName("h2")[0];l(c,"click",function(){p.style.display="none"==p.style.display?"inline-block":"none"});var p=r("
                                                                              %e
                                                                              ",f.clean(t.fn.toString()));i.appendChild(p),p.style.display="none"}_[0]&&_[0].appendChild(i)})):o("#mocha div missing, add it to your document")}function o(t){document.body.appendChild(r('
                                                                              %s
                                                                              ',t))}function r(t){var e=arguments,n=document.createElement("div"),s=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[s++]);case"e":return h(e[s++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,s){s++,0===e[s]?(n.misses++,n.sloc++):void 0!==e[s]&&(n.hits++,n.sloc++),n.source[s]={source:t,coverage:void 0===e[s]?"":e[s]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=s}),t.register("reporters/json-stream.js",function(t,e,n){function s(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",o(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",o(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=s}),t.register("reporters/json.js",function(t,e,n){function s(t){var e=this;r.call(this,t);var n=[],s=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){s.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(o),failures:s.map(o),passes:i.map(o)};process.stdout.write(JSON.stringify(t,null,2))})}function o(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/landing.js",function(t,e,n){function s(t){function e(){var t=Array(s).join("-");return" "+i("runway",t)}o.call(this,t);var n=this,s=(this.stats,.75*o.window.width|0),a=t.total,u=process.stdout,l=i("plane","✈"),c=-1,f=0;t.on("start",function(){u.write("\n "),r.hide()}),t.on("test end",function(t){var n=-1==c?s*++f/a|0:c;"failed"==t.state&&(l=i("plane crash","✈"),c=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(i("runway",Array(n).join("⋅"))),u.write(l),u.write(i("runway",Array(s-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.plane=0,o.colors["plane crash"]=31,o.colors.runway=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/list.js",function(t,e,n){function s(t){o.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(i("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=i("checkmark"," -")+i("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=i("checkmark"," "+o.symbols.dot)+i("pass"," %s: ")+i(t.speed,"%dms");r.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){r.CR(),console.log(i("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/markdown.js",function(t,e,n){function s(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var s=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),s}function s(t,e){++e;var n,o="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+r.slug(t[i].suite.fullTitle())+")\n"),i&&(o+=Array(e).join(" ")+n),o+=s(t[i],e));return--e,o}function i(t){var e=n(t,{});return s(e,0)}o.call(this,t);var a=(this.stats,t.total,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=r.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=r.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var o=n("./base"),r=n("../utils");e=t.exports=s}),t.register("reporters/min.js",function(t,e,n){function s(t){o.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}var o=n("./base");e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/nyan.js",function(t,e,n){function s(t){r.call(this,t);{var e=this,n=(this.stats,.75*r.window.width|0),s=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-s,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){r.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){r.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&s.shift(),s.push(e)}},s.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){o("["+t.scoreboardWidth+"C"),o(e.join("")),o("\n")}),this.cursorUp(this.numberOfLines)},s.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(s){switch(o("["+n+"C"),s){case 0:o("_,------,"),o("\n");break;case 1:var r=e.tick?" ":" ";o("_|"+r+"/\\_/\\ "),o("\n");break;case 2:var i,r=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}o(a+"|"+r+i+" "),o("\n");break;case 3:var r=e.tick?" ":" ";o(r+'"" "" '),o("\n")}}),this.cursorUp(this.numberOfLines)},s.prototype.cursorUp=function(t){o("["+t+"A")},s.prototype.cursorDown=function(t){o("["+t+"B")},s.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),s=e*(1/6),o=Math.floor(3*Math.sin(s)+3),r=Math.floor(3*Math.sin(s+2*n)+3),i=Math.floor(3*Math.sin(s+4*n)+3);t.push(36*o+6*r+i+16)}return t},s.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},s.prototype=new r,s.prototype.constructor=s}),t.register("reporters/progress.js",function(t,e,n){function s(t,e){o.call(this,t);{var n=this,e=e||{},s=(this.stats,.5*o.window.width|0),a=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||o.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),r.hide()}),t.on("test end",function(){u++;var t=u/a,n=s*t|0,o=s-n;r.CR(),process.stdout.write(""),process.stdout.write(i("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(o).join(e.incomplete)),process.stdout.write(i("progress",e.close)),e.verbose&&process.stdout.write(i("progress"," "+u+" of "+a))}),t.on("end",function(){r.show(),console.log(),n.epilogue()})}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,o.colors.progress=90,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/spec.js",function(t,e,n){function s(t){function e(){return Array(s).join(" ")}o.call(this,t);var n=this,s=(this.stats,0),a=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++s,console.log(i("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--s,1==s&&console.log()}),t.on("test",function(t){process.stdout.write(e()+i("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+i("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+i("checkmark"," "+o.symbols.ok)+i("pass"," %s ");r.CR(),console.log(n,t.title)}else{var n=e()+i("checkmark"," "+o.symbols.ok)+i("pass"," %s ")+i(t.speed,"(%dms)");r.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){r.CR(),console.log(e()+i("fail"," %d) %s"),++a,t.title)}),t.on("end",n.epilogue.bind(n))}var o=n("./base"),r=o.cursor,i=o.color;e=t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("reporters/tap.js",function(t,e,n){function s(t){r.call(this,t);var e=(this.stats,1),n=0,s=1;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,o(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,o(t))}),t.on("fail",function(t,n){s++,console.log("not ok %d %s",e,o(t)),console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+s)),console.log("# pass "+n),console.log("# fail "+s)})}function o(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=s}),t.register("reporters/teamcity.js",function(t,e,n){function s(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+o(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+o(t.fullTitle())+"' message='"+o(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+o(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+o(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function o(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var r=n("./base");e=t.exports=s}),t.register("reporters/xunit.js",function(t,e,n){function s(t){a.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(r("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new c).toUTCString(),time:e.duration/1e3},!1)),n.forEach(o),console.log("")})}function o(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=l(n.message),console.log(r("testcase",e,!1,r("failure",e,!1,i(n.stack))))}else console.log(t.pending?r("testcase",e,!1,r("skipped",{},!0)):r("testcase",e,!0))}function r(t,e,n,s){var o,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+l(e[a])+'"');return o="<"+t+(i.length?" "+i.join(" "):"")+r,s&&(o+=s+""}{var a=n("./base"),u=n("../utils"),l=u.escape,c=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=s,s.prototype=new a,s.prototype.constructor=s}),t.register("runnable.js",function(t,e,n){function s(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("mocha:runnable"),i=n("./ms"),a=global.Date,u=global.setTimeout,l=(global.setInterval,global.clearTimeout),c=(global.clearInterval,Object.prototype.toString);t.exports=s,s.prototype=new o,s.prototype.constructor=s,s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._slow=t,this)},s.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},s.prototype.clearTimeout=function(){l(this.timer) +},s.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},s.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=u(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},s.prototype.run=function(t){function e(t){o||(o=!0,r.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(s)return e(n);r.clearTimeout(),r.duration=new a-l,s=!0,t(n)}}var s,o,r=this,i=this.timeout(),l=new a,f=this.ctx;if(f&&f.runnable(this),this.async&&i&&(this.timer=u(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(f,function(t){return"[object Error]"===c.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(p){n(p)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(f),this.duration=new a-l,t()}catch(p){t(p)}}}}),t.register("runner.js",function(t,e,n){function s(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function o(t,e){return u(e,function(e){var n=u(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runner"),a=(n("./test"),n("./utils")),u=a.filter,l=(a.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=s,s.prototype=new r,s.prototype.constructor=s,s.prototype.grep=function(t,e){return i("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},s.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var s=e._grep.test(t.fullTitle());e._invert&&(s=!s),s&&n++}),n},s.prototype.globalProps=function(){for(var t=a.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},s.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},s.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},s.prototype.hook=function(t,e){function n(t){var s=o[t];return s?(r.currentRunnable=s,r.emit("hook",s),s.on("error",function(t){r.failHook(s,t)}),void s.run(function(e){s.removeAllListeners("error");var o=s.error();return o&&r.fail(r.test,o),e?r.failHook(s,e):(r.emit("hook end",s),void n(++t))})):e()}var s=this.suite,o=s["_"+t],r=this;process.nextTick(function(){n(0)})},s.prototype.hooks=function(t,e,n){function s(i){return o.suite=i,i?void o.hook(t,function(t){return t?(o.suite=r,n(t)):void s(e.pop())}):(o.suite=r,n())}var o=this,r=this.suite;s(e.pop())},s.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},s.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},s.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},s.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(s){t(s)}},s.prototype.runTests=function(t,e){function n(){if(o.failures&&t._bail)return e();if(s=r.shift(),!s)return e();var i=o._grep.test(s.fullTitle());return o._invert&&(i=!i),i?s.pending?(o.emit("pending",s),o.emit("test end",s),n()):(o.emit("test",o.test=s),void o.hookDown("beforeEach",function(){o.currentRunnable=o.test,o.runTest(function(t){return s=o.test,t?(o.fail(s,t),o.emit("test end",s),o.hookUp("afterEach",n)):(s.state="passed",o.emit("pass",s),o.emit("test end",s),void o.hookUp("afterEach",n))})})):n()}var s,o=this,r=t.tests.slice();this.next=n,n()},s.prototype.runSuite=function(t,e){function n(){var e=t.suites[a++];return e?void r.runSuite(e,n):s()}function s(){r.suite=t,r.hook("afterAll",function(){r.emit("suite end",t),e()})}var o=this.grepTotal(t),r=this,a=0;return i("run suite %s",t.fullTitle()),o?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){r.runTests(t,n)})):e()},s.prototype.uncaught=function(t){i("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},s.prototype.run=function(t){var e=this,t=t||function(){};return i("start"),this.on("end",function(){i("end"),process.removeListener("uncaughtException",function(t){e.uncaught(t)}),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){i("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function s(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}var o=n("browser/events").EventEmitter,r=n("browser/debug")("mocha:suite"),i=n("./ms"),a=n("./utils"),u=n("./hook");e=t.exports=s,e.create=function(t,e){var n=new s(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=new o,s.prototype.constructor=s,s.prototype.clone=function(){var t=new s(this.title);return r("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},s.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=i(t)),r("timeout %d",t),this._timeout=parseInt(t,10),this)},s.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=i(t)),r("slow %d",t),this._slow=t,this)},s.prototype.bail=function(t){return 0==arguments.length?this._bail:(r("bail %s",t),this._bail=t,this)},s.prototype.beforeAll=function(t){if(this.pending)return this;var e=new u('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},s.prototype.afterAll=function(t){if(this.pending)return this;var e=new u('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},s.prototype.beforeEach=function(t){if(this.pending)return this;var e=new u('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},s.prototype.afterEach=function(t){if(this.pending)return this;var e=new u('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},s.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},s.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},s.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},s.prototype.total=function(){return a.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},s.prototype.eachTest=function(t){return a.forEach(this.tests,t),a.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function s(t,e){o.call(this,t,e),this.pending=!e,this.type="test"}var o=n("./runnable");t.exports=s,s.prototype=new o,s.prototype.constructor=s}),t.register("utils.js",function(t,e,n){function s(t){return!~l.indexOf(t)}function o(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var r=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var s=0,o=t.length;o>s;s++)e.call(n,t[s],s)},e.indexOf=function(t,e,n){for(var s=n||0,o=t.length;o>s;s++)if(t[s]===e)return s;return-1},e.reduce=function(t,e,n){for(var s=n,o=0,r=t.length;r>o;o++)s=e(s,t[o],o,t);return s},e.filter=function(t,e){for(var n=[],s=0,o=t.length;o>s;s++){var r=t[s];e(r,s,t)&&n.push(r)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var s in t)n.call(t,s)&&e.push(s);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),r.watchFile(t,n,function(n,s){s.mtimen;++n)e[n].innerHTML=o(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=function(t,n,s){e(new Error(t+" ("+n+":"+s+")"))})},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var s=e.utils.parseQuery(window.location.search||"");return s.grep&&n.grep(s.grep),s.invert&&n.invert(),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.8.0/mocha.min.css b/ajax/libs/mocha/1.8.0/mocha.min.css new file mode 100644 index 000000000..a548eeecf --- /dev/null +++ b/ajax/libs/mocha/1.8.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}.hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.8.0/mocha.min.js b/ajax/libs/mocha/1.8.0/mocha.min.js new file mode 100644 index 000000000..2ab2afe34 --- /dev/null +++ b/ajax/libs/mocha/1.8.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",s=e+"/index.js";return t.modules[o]&&o||t.modules[s]&&s||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),s=n.split("/");o.pop();for(var r=0;r/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n==e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,s=e.length,r=o+s,i=[{newPos:-1,components:[]}],a=this.extractCommon(i[0],n,e,0);if(i[0].newPos+1>=o&&a+1>=s)return i[0].components;for(var u=1;r>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,p=i[l-1],f=i[l+1];a=(f?f.newPos:0)-l,p&&(i[l-1]=void 0);var h=p&&p.newPos+1=0&&s>a;if(h||d){!h||d&&p.newPos=o&&a+1>=s)return c.components;i[l]=c}else i[l]=void 0}},pushComponent:function(t,e,n,o){var s=t[t.length-1];s&&s.added===n&&s.removed===o?t[t.length-1]={value:this.join(s.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var s=e.length,r=n.length,i=t.newPos,a=i-o;s>i+1&&r>a+1&&this.equals(e[i+1],n[a+1]);)i++,a++,this.pushComponent(t.components,e[i],void 0,void 0);return t.newPos=i,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t==e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var s=new o,r=new o(!0);r.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var i=new o(!0);i.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var a=new o;return a.tokenize=function(t){return t.split(/^/m)},{diffChars:function(t,e){return s.diff(t,e)},diffWords:function(t,e){return r.diff(t,e)},diffLines:function(t,e){return a.diff(t,e)},diffCss:function(t,e){return i.diff(t,e)},createPatch:function(t,e,n,o,s){function r(t){return t.map(function(t){return" "+t})}function i(t,e,n){var o=l[l.length-2],s=e===l.length-2,r=e===l.length-3&&(n.added===!o.added||n.removed===!o.removed);/\n$/.test(n.value)||!s&&!r||t.push("\\ No newline at end of file")}var u=[];u.push("Index: "+t),u.push("==================================================================="),u.push("--- "+t+("undefined"==typeof o?"":" "+o)),u.push("+++ "+t+("undefined"==typeof s?"":" "+s));var l=a.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,p=0,f=[],h=1,d=1,g=0;g"):s.removed&&e.push(""),e.push(n(s.value)),s.added?e.push(""):s.removed&&e.push("")}return e.join("")}}}();"undefined"!=typeof t&&(t.exports=e)}),t.register("browser/events.js",function(t,e){function n(t){return"[object Array]"=={}.toString.call(t)}function o(){}e.EventEmitter=o,o.prototype.on=function(t,e){return this.$events||(this.$events={}),this.$events[t]?n(this.$events[t])?this.$events[t].push(e):this.$events[t]=[this.$events[t],e]:this.$events[t]=e,this},o.prototype.addListener=o.prototype.on,o.prototype.once=function(t,e){function n(){o.removeListener(t,n),e.apply(this,arguments)}var o=this;return n.listener=e,this.on(t,n),this},o.prototype.removeListener=function(t,e){if(this.$events&&this.$events[t]){var o=this.$events[t];if(n(o)){for(var s=-1,r=0,i=o.length;i>r;r++)if(o[r]===e||o[r].listener&&o[r].listener===e){s=r;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),r=0,i=s.length;i>r;r++)s[r].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,r=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,r,i-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,s-c/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.type="hook"}function s(){}var r=n("./runnable");t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var s=o.create(e[0],t);return e.unshift(s),n.call(s),e.shift(),s},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var s=o.create(e[0],t);s.pending=!0,e.unshift(s),n.call(s),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);r.grep(o.fullTitle())},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var r=new s(t,n);return o.addTest(r),r},t.it.only=function(e,n){var o=t.it(e,n);r.grep(o.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(i,a))}}else{var r=o.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);return e.unshift(s),n.call(s),e.shift(),s},t.suite.only=function(e,n){var o=t.suite(e,n);r.grep(o.fullTitle())},t.test=function(t,n){var o=new s(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n);r.grep(o.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function s(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var r=n("browser/path"),i=n("./utils");e=t.exports=s,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),s.prototype.bail=function(t){return null==t&&(t=!0),this.suite.bail(t),this},s.prototype.addFile=function(t){return this.files.push(t),this},s.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},s.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},s.prototype.loadFiles=function(t){var e=this,o=this.suite,s=this.files.length;this.files.forEach(function(i){i=r.resolve(i),o.emit("pre-require",global,i,e),o.emit("require",n(i),i,e),o.emit("post-require",global,i,e),--s||t&&t()})},s.prototype._growl=function(t,e){var s=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";s(r,{name:"mocha",title:"Failed",image:o("error")})}else s(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},s.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},s.prototype.invert=function(){return this.options.invert=!0,this},s.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},s.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},s.prototype.growl=function(){return this.options.growl=!0,this},s.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},s.prototype.timeout=function(t){return this.suite.timeout(t),this},s.prototype.slow=function(t){return this.suite.slow(t),this},s.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},s.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,s=new e.Runner(n),r=new this._reporter(s);return s.ignoreLeaks=o.ignoreLeaks,s.asyncOnly=o.asyncOnly,o.grep&&s.grep(o.grep,o.invert),o.globals&&s.globals(o.globals),o.growl&&this._growl(s,r),s.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?Math.round(t/i)+" day":t>i?Math.round(t/i)+" days":t==r?Math.round(t/r)+" hour":t>r?Math.round(t/r)+" hours":t==s?Math.round(t/s)+" minute":t>s?Math.round(t/s)+" minutes":t==o?Math.round(t/o)+" second":t>o?Math.round(t/o)+" seconds":t+" ms"}var o=1e3,s=60*o,r=60*s,i=24*r;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new c}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new c,e.duration=new c-e.start}),t.on("pending",function(){e.pending++}))}function s(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e,n){return u["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),l=n("../ms"),c=global.Date,p=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=o,e.useColors=p,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==process.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:p?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),o=t.err,i=o.message||"",a=o.stack||i,u=a.indexOf(i)+i.length,l=a.slice(0,u),c=o.actual,p=o.expected,h=!0;if(o.showDiff&&(h=!1,o.actual=c=JSON.stringify(c,null,2),o.expected=p=JSON.stringify(p,null,2)),"string"==typeof c&&"string"==typeof p){var d=Math.max(c.length,p.length);l=20>d?r(o,"Chars",h):r(o,"Words",h);var g=l.split("\n");if(g.length>4){var m=String(g.length).length;l=g.map(function(t,e){return s(++e,m)+" | "+t}).join("\n")}l="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+l+"\n",l=l.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),l,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var n,s=this.stats;return console.log(),s.failures?(n=f("bright fail"," "+e.symbols.err)+f("fail"," %d of %d %s failed")+f("light",":"),console.error(n,s.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(n=f("bright pass"," ")+f("green"," %d %s complete")+f("light"," (%s)"),console.log(n,s.tests||0,t(s.tests),l(s.duration)),s.pending&&(n=f("pending"," ")+f("pending"," %d %s pending"),console.log(n,s.pending,t(s.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}s.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                                              ',e()),++n,console.log("%s

                                                                              %s

                                                                              ",e(),r.escape(t.title)),console.log("%s
                                                                              ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                                              ",e()),--n,console.log("%s
                                                                              ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                                              %s
                                                                              ",e(),r.escape(t.title));var n=r.escape(r.clean(t.fn.toString()));console.log("%s
                                                                              %s
                                                                              ",e(),n)})}var s=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending",r.symbols.dot))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow",r.symbols.dot):i(t.speed,r.symbols.dot))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail",r.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function s(){}var r=n("./base"),i=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",a=i.readFileSync(o,"utf8"),u=e.compile(a,{filename:o}),l=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:l.cov,coverageClass:s}))})}function s(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this.stats,v=(t.total,r(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],j=v.getElementsByTagName("canvas")[0],E=r('
                                                                                '),_=[E];if(e=e||document.getElementById("mocha"),j.getContext){var C=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=C,j.height*=C,o=j.getContext("2d"),o.scale(C,C),n=new f}return e?(l(b,"click",function(){a();var t=/pass/.test(E.className)?"":" pass";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&i("test pass")}),l(k,"click",function(){a();var t=/fail/.test(E.className)?"":" fail";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&i("test fail")}),e.appendChild(v),e.appendChild(E),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=r('
                                                                              • %s

                                                                              • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=m.tests/this.total*100|0;n&&n.update(e).draw(o);var s=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(s/1e3).toFixed(2)),"passed"==t.state)var i=r('
                                                                              • %e%ems ‣

                                                                              • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var i=r('
                                                                              • %e

                                                                              • ',t.title);else{var i=r('
                                                                              • %e ‣

                                                                              • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),i.appendChild(r('
                                                                                %e
                                                                                ',a))}if(!t.pending){var c=i.getElementsByTagName("h2")[0];l(c,"click",function(){f.style.display="none"==f.style.display?"block":"none"});var f=r("
                                                                                %e
                                                                                ",p.clean(t.fn.toString()));i.appendChild(f),f.style.display="none"}_[0]&&_[0].appendChild(i)})):s("#mocha div missing, add it to your document")}function s(t){document.body.appendChild(r('
                                                                                %s
                                                                                ',t))}function r(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;r.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t,null,2))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+a("runway",t)}r.call(this,t);var n=this,o=(this.stats,.75*r.window.width|0),s=t.total,u=process.stdout,l=a("plane","✈"),c=-1,p=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==c?o*++p/s|0:c;"failed"==t.state&&(l=a("plane crash","✈"),c=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(a("runway",Array(n).join("⋅"))),u.write(l),u.write(a("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(a("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=a("checkmark"," -")+a("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=a("checkmark"," "+r.symbols.dot)+a("pass"," %s: ")+a(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(a("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,s="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+r.slug(t[i].suite.fullTitle())+")\n"),i&&(s+=Array(e).join(" ")+n),s+=o(t[i],e));return--e,s}function i(t){var e=n(t,{});return o(e,0)}s.call(this,t);var a=(this.stats,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=r.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=r.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var s=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function s(){}var r=n("./base");e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){i.call(this,t);{var e=this,n=(this.stats,.75*i.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){i.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){i.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){s("["+t.scoreboardWidth+"C"),s(e.join("")),s("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(o){switch(s("["+n+"C"),o){case 0:s("_,------,"),s("\n");break;case 1:var r=e.tick?" ":" ";s("_|"+r+"/\\_/\\ "),s("\n");break;case 2:var i,r=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}s(a+"|"+r+i+" "),s("\n");break;case 3:var r=e.tick?" ":" ";s(r+'"" "" '),s("\n")}}),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){s("["+t+"A")},o.prototype.cursorDown=function(t){s("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),s=Math.floor(3*Math.sin(o)+3),r=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*s+6*r+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){r.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*r.window.width|0),s=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||r.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){u++;var t=u/s,n=o*t|0,r=o-n;i.CR(),process.stdout.write(""),process.stdout.write(a("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(a("progress",e.close)),e.verbose&&process.stdout.write(a("progress"," "+u+" of "+s))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,r.colors.progress=90,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}r.call(this,t);var n=this,o=(this.stats,0),s=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+a("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+r.symbols.ok)+a("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+r.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+a("fail"," %d) %s"),++s,t.title) +}),t.on("end",n.epilogue.bind(n))}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){r.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,s(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,s(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,s(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function s(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+s(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+s(t.fullTitle())+"' message='"+s(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+s(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+s(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function s(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var r=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new p).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function s(){}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,a(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var s,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return s="<"+t+(i.length?" "+i.join(" "):"")+r,o&&(s+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,s.prototype=u.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function s(){}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),p=(global.clearInterval,Object.prototype.toString);t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(t){s||(s=!0,r.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(o)return e(n);r.clearTimeout(),r.duration=new u-a,o=!0,t(n)}}var o,s,r=this,i=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&i&&(this.timer=l(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===p.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(f){t(f)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function s(){}function r(t,e){return l(e,function(e){var n=l(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var i=n("browser/events").EventEmitter,a=n("browser/debug")("mocha:runner"),u=(n("./test"),n("./utils")),l=u.filter,c=(u.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return a("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=u.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(r.currentRunnable=o,r.emit("hook",o),o.on("error",function(t){r.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var s=o.error();return s&&r.fail(r.test,s),e?r.failHook(o,e):(r.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],r=this;process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=r,n(t)):void o(e.pop())}):(s.suite=r,n())}var s=this,r=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(s.failures&&t._bail)return e();if(o=r.shift(),!o)return e();var i=s._grep.test(o.fullTitle());return s._invert&&(i=!i),i?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=s.test,s.runTest(function(t){return o=s.test,t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.state="passed",s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n()}var o,s=this,r=t.tests.slice();this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void r.runSuite(e,n):o()}function o(){r.suite=t,r.hook("afterAll",function(){r.emit("suite end",t),e()})}var s=this.grepTotal(t),r=this,i=0;return a("run suite %s",t.fullTitle()),s?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){r.runTests(t,n)})):e()},o.prototype.uncaught=function(t){a("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){var e=this,t=t||function(){};return a("start"),this.on("end",function(){a("end"),process.removeListener("uncaughtException",function(t){e.uncaught(t)}),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){a("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function s(){}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}function s(){}var r=n("./runnable");t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function s(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var r=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,s=0,r=t.length;r>s;s++)o=e(o,t[s],s,t);return o},e.filter=function(t,e){for(var n=[],o=0,s=t.length;s>o;o++){var r=t[o];e(r,o,t)&&n.push(r)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),r.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=s(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))})},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var o=e.utils.parseQuery(window.location.search||"");return o.grep&&n.grep(o.grep),o.invert&&n.invert(),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.8.1/mocha.min.css b/ajax/libs/mocha/1.8.1/mocha.min.css new file mode 100644 index 000000000..a548eeecf --- /dev/null +++ b/ajax/libs/mocha/1.8.1/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}.hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD} \ No newline at end of file diff --git a/ajax/libs/mocha/1.8.1/mocha.min.js b/ajax/libs/mocha/1.8.1/mocha.min.js new file mode 100644 index 000000000..9fefe958f --- /dev/null +++ b/ajax/libs/mocha/1.8.1/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",s=e+"/index.js";return t.modules[o]&&o||t.modules[s]&&s||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),s=n.split("/");o.pop();for(var r=0;r/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n==e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,s=e.length,r=o+s,i=[{newPos:-1,components:[]}],a=this.extractCommon(i[0],n,e,0);if(i[0].newPos+1>=o&&a+1>=s)return i[0].components;for(var u=1;r>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,p=i[l-1],f=i[l+1];a=(f?f.newPos:0)-l,p&&(i[l-1]=void 0);var h=p&&p.newPos+1=0&&s>a;if(h||d){!h||d&&p.newPos=o&&a+1>=s)return c.components;i[l]=c}else i[l]=void 0}},pushComponent:function(t,e,n,o){var s=t[t.length-1];s&&s.added===n&&s.removed===o?t[t.length-1]={value:this.join(s.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var s=e.length,r=n.length,i=t.newPos,a=i-o;s>i+1&&r>a+1&&this.equals(e[i+1],n[a+1]);)i++,a++,this.pushComponent(t.components,e[i],void 0,void 0);return t.newPos=i,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t==e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var s=new o,r=new o(!0);r.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var i=new o(!0);i.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var a=new o;return a.tokenize=function(t){return t.split(/^/m)},{diffChars:function(t,e){return s.diff(t,e)},diffWords:function(t,e){return r.diff(t,e)},diffLines:function(t,e){return a.diff(t,e)},diffCss:function(t,e){return i.diff(t,e)},createPatch:function(t,e,n,o,s){function r(t){return t.map(function(t){return" "+t})}function i(t,e,n){var o=l[l.length-2],s=e===l.length-2,r=e===l.length-3&&(n.added===!o.added||n.removed===!o.removed);/\n$/.test(n.value)||!s&&!r||t.push("\\ No newline at end of file")}var u=[];u.push("Index: "+t),u.push("==================================================================="),u.push("--- "+t+("undefined"==typeof o?"":" "+o)),u.push("+++ "+t+("undefined"==typeof s?"":" "+s));var l=a.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,p=0,f=[],h=1,d=1,g=0;g"):s.removed&&e.push(""),e.push(n(s.value)),s.added?e.push(""):s.removed&&e.push("")}return e.join("")}}}();"undefined"!=typeof t&&(t.exports=e)}),t.register("browser/events.js",function(t,e){function n(t){return"[object Array]"=={}.toString.call(t)}function o(){}e.EventEmitter=o,o.prototype.on=function(t,e){return this.$events||(this.$events={}),this.$events[t]?n(this.$events[t])?this.$events[t].push(e):this.$events[t]=[this.$events[t],e]:this.$events[t]=e,this},o.prototype.addListener=o.prototype.on,o.prototype.once=function(t,e){function n(){o.removeListener(t,n),e.apply(this,arguments)}var o=this;return n.listener=e,this.on(t,n),this},o.prototype.removeListener=function(t,e){if(this.$events&&this.$events[t]){var o=this.$events[t];if(n(o)){for(var s=-1,r=0,i=o.length;i>r;r++)if(o[r]===e||o[r].listener&&o[r].listener===e){s=r;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),r=0,i=s.length;i>r;r++)s[r].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,r=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,r,i-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,s-c/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.type="hook"}function s(){}var r=n("./runnable");t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var s=o.create(e[0],t);return e.unshift(s),n.call(s),e.shift(),s},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var s=o.create(e[0],t);s.pending=!0,e.unshift(s),n.call(s),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);r.grep(o.fullTitle())},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var r=new s(t,n);return o.addTest(r),r},t.it.only=function(e,n){var o=t.it(e,n);r.grep(o.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(i,a))}}else{var r=o.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);return e.unshift(s),n.call(s),e.shift(),s},t.suite.only=function(e,n){var o=t.suite(e,n);r.grep(o.fullTitle())},t.test=function(t,n){var o=new s(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n);r.grep(o.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function s(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var r=n("browser/path"),i=n("./utils");e=t.exports=s,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),s.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},s.prototype.addFile=function(t){return this.files.push(t),this},s.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},s.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},s.prototype.loadFiles=function(t){var e=this,o=this.suite,s=this.files.length;this.files.forEach(function(i){i=r.resolve(i),o.emit("pre-require",global,i,e),o.emit("require",n(i),i,e),o.emit("post-require",global,i,e),--s||t&&t()})},s.prototype._growl=function(t,e){var s=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";s(r,{name:"mocha",title:"Failed",image:o("error")})}else s(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},s.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},s.prototype.invert=function(){return this.options.invert=!0,this},s.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},s.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},s.prototype.growl=function(){return this.options.growl=!0,this},s.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},s.prototype.timeout=function(t){return this.suite.timeout(t),this},s.prototype.slow=function(t){return this.suite.slow(t),this},s.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},s.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,s=new e.Runner(n),r=new this._reporter(s);return s.ignoreLeaks=o.ignoreLeaks,s.asyncOnly=o.asyncOnly,o.grep&&s.grep(o.grep,o.invert),o.globals&&s.globals(o.globals),o.growl&&this._growl(s,r),s.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?Math.round(t/i)+" day":t>i?Math.round(t/i)+" days":t==r?Math.round(t/r)+" hour":t>r?Math.round(t/r)+" hours":t==s?Math.round(t/s)+" minute":t>s?Math.round(t/s)+" minutes":t==o?Math.round(t/o)+" second":t>o?Math.round(t/o)+" seconds":t+" ms"}var o=1e3,s=60*o,r=60*s,i=24*r;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new c}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new c,e.duration=new c-e.start}),t.on("pending",function(){e.pending++}))}function s(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e,n){return u["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),l=n("../ms"),c=global.Date,p=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=o,e.useColors=p,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==process.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:p?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),o=t.err,i=o.message||"",a=o.stack||i,u=a.indexOf(i)+i.length,l=a.slice(0,u),c=o.actual,p=o.expected,h=!0;if(o.showDiff&&(h=!1,o.actual=c=JSON.stringify(c,null,2),o.expected=p=JSON.stringify(p,null,2)),"string"==typeof c&&"string"==typeof p){var d=Math.max(c.length,p.length);l=20>d?r(o,"Chars",h):r(o,"Words",h);var g=l.split("\n");if(g.length>4){var m=String(g.length).length;l=g.map(function(t,e){return s(++e,m)+" | "+t}).join("\n")}l="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+l+"\n",l=l.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),l,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var n,s=this.stats;return console.log(),s.failures?(n=f("bright fail"," "+e.symbols.err)+f("fail"," %d of %d %s failed")+f("light",":"),console.error(n,s.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(n=f("bright pass"," ")+f("green"," %d %s complete")+f("light"," (%s)"),console.log(n,s.tests||0,t(s.tests),l(s.duration)),s.pending&&(n=f("pending"," ")+f("pending"," %d %s pending"),console.log(n,s.pending,t(s.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}s.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                                                ',e()),++n,console.log("%s

                                                                                %s

                                                                                ",e(),r.escape(t.title)),console.log("%s
                                                                                ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                                                ",e()),--n,console.log("%s
                                                                                ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                                                %s
                                                                                ",e(),r.escape(t.title));var n=r.escape(r.clean(t.fn.toString()));console.log("%s
                                                                                %s
                                                                                ",e(),n)})}var s=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending",r.symbols.dot))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow",r.symbols.dot):i(t.speed,r.symbols.dot))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail",r.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function s(){}var r=n("./base"),i=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",a=i.readFileSync(o,"utf8"),u=e.compile(a,{filename:o}),l=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:l.cov,coverageClass:s}))})}function s(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this.stats,v=(t.total,r(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],j=v.getElementsByTagName("canvas")[0],E=r('
                                                                                  '),_=[E];if(e=e||document.getElementById("mocha"),j.getContext){var C=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=C,j.height*=C,o=j.getContext("2d"),o.scale(C,C),n=new f}return e?(l(b,"click",function(){a();var t=/pass/.test(E.className)?"":" pass";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&i("test pass")}),l(k,"click",function(){a();var t=/fail/.test(E.className)?"":" fail";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&i("test fail")}),e.appendChild(v),e.appendChild(E),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=r('
                                                                                • %s

                                                                                • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=m.tests/this.total*100|0;n&&n.update(e).draw(o);var s=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(s/1e3).toFixed(2)),"passed"==t.state)var i=r('
                                                                                • %e%ems ‣

                                                                                • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var i=r('
                                                                                • %e

                                                                                • ',t.title);else{var i=r('
                                                                                • %e ‣

                                                                                • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),i.appendChild(r('
                                                                                  %e
                                                                                  ',a))}if(!t.pending){var c=i.getElementsByTagName("h2")[0];l(c,"click",function(){f.style.display="none"==f.style.display?"block":"none"});var f=r("
                                                                                  %e
                                                                                  ",p.clean(t.fn.toString()));i.appendChild(f),f.style.display="none"}_[0]&&_[0].appendChild(i)})):s("#mocha div missing, add it to your document")}function s(t){document.body.appendChild(r('
                                                                                  %s
                                                                                  ',t))}function r(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;r.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t,null,2))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+a("runway",t)}r.call(this,t);var n=this,o=(this.stats,.75*r.window.width|0),s=t.total,u=process.stdout,l=a("plane","✈"),c=-1,p=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==c?o*++p/s|0:c;"failed"==t.state&&(l=a("plane crash","✈"),c=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(a("runway",Array(n).join("⋅"))),u.write(l),u.write(a("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(a("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=a("checkmark"," -")+a("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=a("checkmark"," "+r.symbols.dot)+a("pass"," %s: ")+a(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(a("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,s="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+r.slug(t[i].suite.fullTitle())+")\n"),i&&(s+=Array(e).join(" ")+n),s+=o(t[i],e));return--e,s}function i(t){var e=n(t,{});return o(e,0)}s.call(this,t);var a=(this.stats,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=r.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=r.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var s=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function s(){}var r=n("./base");e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){i.call(this,t);{var e=this,n=(this.stats,.75*i.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){i.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){i.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){s("["+t.scoreboardWidth+"C"),s(e.join("")),s("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(o){switch(s("["+n+"C"),o){case 0:s("_,------,"),s("\n");break;case 1:var r=e.tick?" ":" ";s("_|"+r+"/\\_/\\ "),s("\n");break;case 2:var i,r=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}s(a+"|"+r+i+" "),s("\n");break;case 3:var r=e.tick?" ":" ";s(r+'"" "" '),s("\n")}}),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){s("["+t+"A")},o.prototype.cursorDown=function(t){s("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),s=Math.floor(3*Math.sin(o)+3),r=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*s+6*r+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){r.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*r.window.width|0),s=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||r.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){u++;var t=u/s,n=o*t|0,r=o-n;i.CR(),process.stdout.write(""),process.stdout.write(a("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(a("progress",e.close)),e.verbose&&process.stdout.write(a("progress"," "+u+" of "+s))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,r.colors.progress=90,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}r.call(this,t);var n=this,o=(this.stats,0),s=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+a("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+r.symbols.ok)+a("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+r.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+a("fail"," %d) %s"),++s,t.title) +}),t.on("end",n.epilogue.bind(n))}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){r.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,s(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,s(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,s(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function s(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+s(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+s(t.fullTitle())+"' message='"+s(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+s(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+s(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function s(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var r=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new p).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function s(){}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,a(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var s,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return s="<"+t+(i.length?" "+i.join(" "):"")+r,o&&(s+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,s.prototype=u.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function s(){}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),p=(global.clearInterval,Object.prototype.toString);t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(t){s||(s=!0,r.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(o)return e(n);r.clearTimeout(),r.duration=new u-a,o=!0,t(n)}}var o,s,r=this,i=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&i&&(this.timer=l(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===p.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(f){t(f)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function s(){}function r(t,e){return l(e,function(e){var n=l(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var i=n("browser/events").EventEmitter,a=n("browser/debug")("mocha:runner"),u=(n("./test"),n("./utils")),l=u.filter,c=(u.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return a("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=u.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(r.currentRunnable=o,r.emit("hook",o),o.on("error",function(t){r.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var s=o.error();return s&&r.fail(r.test,s),e?r.failHook(o,e):(r.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],r=this;process.nextTick(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=r,n(t)):void o(e.pop())}):(s.suite=r,n())}var s=this,r=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(s.failures&&t._bail)return e();if(o=r.shift(),!o)return e();var i=s._grep.test(o.fullTitle());return s._invert&&(i=!i),i?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=s.test,s.runTest(function(t){return o=s.test,t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.state="passed",s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n()}var o,s=this,r=t.tests.slice();this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void r.runSuite(e,n):o()}function o(){r.suite=t,r.hook("afterAll",function(){r.emit("suite end",t),e()})}var s=this.grepTotal(t),r=this,i=0;return a("run suite %s",t.fullTitle()),s?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){r.runTests(t,n)})):e()},o.prototype.uncaught=function(t){a("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){var e=this,t=t||function(){};return a("start"),this.on("end",function(){a("end"),process.removeListener("uncaughtException",function(t){e.uncaught(t)}),t(e.failures)}),this.emit("start"),this.runSuite(this.suite,function(){a("finished running"),e.emit("end")}),process.on("uncaughtException",function(t){e.uncaught(t)}),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function s(){}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}function s(){}var r=n("./runnable");t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function s(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var r=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,s=0,r=t.length;r>s;s++)o=e(o,t[s],s,t);return o},e.filter=function(t,e){for(var n=[],o=0,s=t.length;s>o;o++){var r=t[o];e(r,o,t)&&n.push(r)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),r.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=s(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))})},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var o=e.utils.parseQuery(window.location.search||"");return o.grep&&n.grep(o.grep),o.invert&&n.invert(),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.8.2/mocha.min.css b/ajax/libs/mocha/1.8.2/mocha.min.css new file mode 100644 index 000000000..97cb8299d --- /dev/null +++ b/ajax/libs/mocha/1.8.2/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}.hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD}@media screen and (max-device-width:480px){body{padding:60px 0}#stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.8.2/mocha.min.js b/ajax/libs/mocha/1.8.2/mocha.min.js new file mode 100644 index 000000000..05e412d47 --- /dev/null +++ b/ajax/libs/mocha/1.8.2/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",s=e+"/index.js";return t.modules[o]&&o||t.modules[s]&&s||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),s=n.split("/");o.pop();for(var r=0;r/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n==e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,s=e.length,r=o+s,i=[{newPos:-1,components:[]}],a=this.extractCommon(i[0],n,e,0);if(i[0].newPos+1>=o&&a+1>=s)return i[0].components;for(var u=1;r>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,p=i[l-1],f=i[l+1];a=(f?f.newPos:0)-l,p&&(i[l-1]=void 0);var h=p&&p.newPos+1=0&&s>a;if(h||d){!h||d&&p.newPos=o&&a+1>=s)return c.components;i[l]=c}else i[l]=void 0}},pushComponent:function(t,e,n,o){var s=t[t.length-1];s&&s.added===n&&s.removed===o?t[t.length-1]={value:this.join(s.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var s=e.length,r=n.length,i=t.newPos,a=i-o;s>i+1&&r>a+1&&this.equals(e[i+1],n[a+1]);)i++,a++,this.pushComponent(t.components,e[i],void 0,void 0);return t.newPos=i,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t==e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var s=new o,r=new o(!0);r.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var i=new o(!0);i.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var a=new o;return a.tokenize=function(t){return t.split(/^/m)},{diffChars:function(t,e){return s.diff(t,e)},diffWords:function(t,e){return r.diff(t,e)},diffLines:function(t,e){return a.diff(t,e)},diffCss:function(t,e){return i.diff(t,e)},createPatch:function(t,e,n,o,s){function r(t){return t.map(function(t){return" "+t})}function i(t,e,n){var o=l[l.length-2],s=e===l.length-2,r=e===l.length-3&&(n.added===!o.added||n.removed===!o.removed);/\n$/.test(n.value)||!s&&!r||t.push("\\ No newline at end of file")}var u=[];u.push("Index: "+t),u.push("==================================================================="),u.push("--- "+t+("undefined"==typeof o?"":" "+o)),u.push("+++ "+t+("undefined"==typeof s?"":" "+s));var l=a.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,p=0,f=[],h=1,d=1,g=0;g"):s.removed&&e.push(""),e.push(n(s.value)),s.added?e.push(""):s.removed&&e.push("")}return e.join("")}}}();"undefined"!=typeof t&&(t.exports=e)}),t.register("browser/events.js",function(t,e){function n(t){return"[object Array]"=={}.toString.call(t)}function o(){}e.EventEmitter=o,o.prototype.on=function(t,e){return this.$events||(this.$events={}),this.$events[t]?n(this.$events[t])?this.$events[t].push(e):this.$events[t]=[this.$events[t],e]:this.$events[t]=e,this},o.prototype.addListener=o.prototype.on,o.prototype.once=function(t,e){function n(){o.removeListener(t,n),e.apply(this,arguments)}var o=this;return n.listener=e,this.on(t,n),this},o.prototype.removeListener=function(t,e){if(this.$events&&this.$events[t]){var o=this.$events[t];if(n(o)){for(var s=-1,r=0,i=o.length;i>r;r++)if(o[r]===e||o[r].listener&&o[r].listener===e){s=r;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),r=0,i=s.length;i>r;r++)s[r].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,r=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,r,i-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,s-c/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.type="hook"}function s(){}var r=n("./runnable");t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var s=o.create(e[0],t);return e.unshift(s),n.call(s),e.shift(),s},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var s=o.create(e[0],t);s.pending=!0,e.unshift(s),n.call(s),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);r.grep(o.fullTitle())},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var r=new s(t,n);return o.addTest(r),r},t.it.only=function(e,n){var o=t.it(e,n);r.grep(o.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(i,a))}}else{var r=o.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);return e.unshift(s),n.call(s),e.shift(),s},t.suite.only=function(e,n){var o=t.suite(e,n);r.grep(o.fullTitle())},t.test=function(t,n){var o=new s(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n);r.grep(o.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function s(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var r=n("browser/path"),i=n("./utils");e=t.exports=s,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),s.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},s.prototype.addFile=function(t){return this.files.push(t),this},s.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},s.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},s.prototype.loadFiles=function(t){var e=this,o=this.suite,s=this.files.length;this.files.forEach(function(i){i=r.resolve(i),o.emit("pre-require",global,i,e),o.emit("require",n(i),i,e),o.emit("post-require",global,i,e),--s||t&&t()})},s.prototype._growl=function(t,e){var s=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";s(r,{name:"mocha",title:"Failed",image:o("error")})}else s(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},s.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},s.prototype.invert=function(){return this.options.invert=!0,this},s.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},s.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},s.prototype.growl=function(){return this.options.growl=!0,this},s.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},s.prototype.timeout=function(t){return this.suite.timeout(t),this},s.prototype.slow=function(t){return this.suite.slow(t),this},s.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},s.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,s=new e.Runner(n),r=new this._reporter(s);return s.ignoreLeaks=o.ignoreLeaks,s.asyncOnly=o.asyncOnly,o.grep&&s.grep(o.grep,o.invert),o.globals&&s.globals(o.globals),o.growl&&this._growl(s,r),s.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?Math.round(t/i)+" day":t>i?Math.round(t/i)+" days":t==r?Math.round(t/r)+" hour":t>r?Math.round(t/r)+" hours":t==s?Math.round(t/s)+" minute":t>s?Math.round(t/s)+" minutes":t==o?Math.round(t/o)+" second":t>o?Math.round(t/o)+" seconds":t+" ms"}var o=1e3,s=60*o,r=60*s,i=24*r;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new c}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new c,e.duration=new c-e.start}),t.on("pending",function(){e.pending++}))}function s(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e,n){return u["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),l=n("../ms"),c=global.Date,p=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=o,e.useColors=p,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==process.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:p?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),o=t.err,i=o.message||"",a=o.stack||i,u=a.indexOf(i)+i.length,l=a.slice(0,u),c=o.actual,p=o.expected,h=!0;if(o.showDiff&&(h=!1,o.actual=c=JSON.stringify(c,null,2),o.expected=p=JSON.stringify(p,null,2)),"string"==typeof c&&"string"==typeof p){var d=Math.max(c.length,p.length);l=20>d?r(o,"Chars",h):r(o,"Words",h);var g=l.split("\n");if(g.length>4){var m=String(g.length).length;l=g.map(function(t,e){return s(++e,m)+" | "+t}).join("\n")}l="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+l+"\n",l=l.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),l,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var n,s=this.stats;return console.log(),s.failures?(n=f("bright fail"," "+e.symbols.err)+f("fail"," %d of %d %s failed")+f("light",":"),console.error(n,s.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(n=f("bright pass"," ")+f("green"," %d %s complete")+f("light"," (%s)"),console.log(n,s.tests||0,t(s.tests),l(s.duration)),s.pending&&(n=f("pending"," ")+f("pending"," %d %s pending"),console.log(n,s.pending,t(s.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}s.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                                                  ',e()),++n,console.log("%s

                                                                                  %s

                                                                                  ",e(),r.escape(t.title)),console.log("%s
                                                                                  ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                                                  ",e()),--n,console.log("%s
                                                                                  ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                                                  %s
                                                                                  ",e(),r.escape(t.title));var n=r.escape(r.clean(t.fn.toString()));console.log("%s
                                                                                  %s
                                                                                  ",e(),n)})}var s=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending",r.symbols.dot))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow",r.symbols.dot):i(t.speed,r.symbols.dot))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail",r.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function s(){}var r=n("./base"),i=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",a=i.readFileSync(o,"utf8"),u=e.compile(a,{filename:o}),l=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:l.cov,coverageClass:s}))})}function s(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this.stats,v=(t.total,r(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],j=v.getElementsByTagName("canvas")[0],E=r('
                                                                                    '),_=[E];if(e=e||document.getElementById("mocha"),j.getContext){var C=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=C,j.height*=C,o=j.getContext("2d"),o.scale(C,C),n=new f}return e?(l(b,"click",function(){a();var t=/pass/.test(E.className)?"":" pass";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&i("test pass")}),l(k,"click",function(){a();var t=/fail/.test(E.className)?"":" fail";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&i("test fail")}),e.appendChild(v),e.appendChild(E),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=r('
                                                                                  • %s

                                                                                  • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){window.scrollTo(0,document.body.scrollHeight);var e=m.tests/this.total*100|0;n&&n.update(e).draw(o);var s=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(s/1e3).toFixed(2)),"passed"==t.state)var i=r('
                                                                                  • %e%ems ‣

                                                                                  • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var i=r('
                                                                                  • %e

                                                                                  • ',t.title);else{var i=r('
                                                                                  • %e ‣

                                                                                  • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),i.appendChild(r('
                                                                                    %e
                                                                                    ',a))}if(!t.pending){var c=i.getElementsByTagName("h2")[0];l(c,"click",function(){f.style.display="none"==f.style.display?"block":"none"});var f=r("
                                                                                    %e
                                                                                    ",p.clean(t.fn.toString()));i.appendChild(f),f.style.display="none"}_[0]&&_[0].appendChild(i)})):s("#mocha div missing, add it to your document")}function s(t){document.body.appendChild(r('
                                                                                    %s
                                                                                    ',t))}function r(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;r.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t,null,2))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+a("runway",t)}r.call(this,t);var n=this,o=(this.stats,.75*r.window.width|0),s=t.total,u=process.stdout,l=a("plane","✈"),c=-1,p=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==c?o*++p/s|0:c;"failed"==t.state&&(l=a("plane crash","✈"),c=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(a("runway",Array(n).join("⋅"))),u.write(l),u.write(a("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(a("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=a("checkmark"," -")+a("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=a("checkmark"," "+r.symbols.dot)+a("pass"," %s: ")+a(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(a("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,s="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+r.slug(t[i].suite.fullTitle())+")\n"),i&&(s+=Array(e).join(" ")+n),s+=o(t[i],e));return--e,s}function i(t){var e=n(t,{});return o(e,0)}s.call(this,t);var a=(this.stats,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=r.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=r.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var s=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function s(){}var r=n("./base");e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){i.call(this,t);{var e=this,n=(this.stats,.75*i.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){i.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){i.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){s("["+t.scoreboardWidth+"C"),s(e.join("")),s("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length;[0,1,2,3].forEach(function(o){switch(s("["+n+"C"),o){case 0:s("_,------,"),s("\n");break;case 1:var r=e.tick?" ":" ";s("_|"+r+"/\\_/\\ "),s("\n");break;case 2:var i,r=e.tick?"_":"__",a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}s(a+"|"+r+i+" "),s("\n");break;case 3:var r=e.tick?" ":" ";s(r+'"" "" '),s("\n")}}),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){s("["+t+"A")},o.prototype.cursorDown=function(t){s("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),s=Math.floor(3*Math.sin(o)+3),r=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*s+6*r+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){r.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*r.window.width|0),s=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||r.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){u++;var t=u/s,n=o*t|0,r=o-n;i.CR(),process.stdout.write(""),process.stdout.write(a("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(a("progress",e.close)),e.verbose&&process.stdout.write(a("progress"," "+u+" of "+s))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,r.colors.progress=90,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}r.call(this,t);var n=this,o=(this.stats,0),s=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+a("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+r.symbols.ok)+a("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+r.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+a("fail"," %d) %s"),++s,t.title) +}),t.on("end",n.epilogue.bind(n))}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/tap.js",function(t,e,n){function o(t){r.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,s(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,s(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,s(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function s(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+s(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+s(t.fullTitle())+"' message='"+s(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+s(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+s(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function s(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var r=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new p).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function s(){}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,a(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var s,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return s="<"+t+(i.length?" "+i.join(" "):"")+r,o&&(s+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,s.prototype=u.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function s(){}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),p=(global.clearInterval,Object.prototype.toString);t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(t){s||(s=!0,r.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(o)return e(n);r.clearTimeout(),r.duration=new u-a,o=!0,t(n)}}var o,s,r=this,i=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&i&&(this.timer=l(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===p.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(f){t(f)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function s(){}function r(t,e){return l(e,function(e){var n=l(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var i=n("browser/events").EventEmitter,a=n("browser/debug")("mocha:runner"),u=(n("./test"),n("./utils")),l=u.filter,c=(u.keys,global.setImmediate||process.nextTick),p=["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"];t.exports=o,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return a("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=u.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=s[t];return o?(r.currentRunnable=o,r.emit("hook",o),o.on("error",function(t){r.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var s=o.error();return s&&r.fail(r.test,s),e?r.failHook(o,e):(r.emit("hook end",o),void n(++t))})):e()}var o=this.suite,s=o["_"+t],r=this;c(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=r,n(t)):void o(e.pop())}):(s.suite=r,n())}var s=this,r=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(s.failures&&t._bail)return e();if(o=r.shift(),!o)return e();var i=s._grep.test(o.fullTitle());return s._invert&&(i=!i),i?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=s.test,s.runTest(function(t){return o=s.test,t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.state="passed",s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n()}var o,s=this,r=t.tests.slice();this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void r.runSuite(e,n):o()}function o(){r.suite=t,r.hook("afterAll",function(){r.emit("suite end",t),e()})}var s=this.grepTotal(t),r=this,i=0;return a("run suite %s",t.fullTitle()),s?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){r.runTests(t,n)})):e()},o.prototype.uncaught=function(t){a("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return a("start"),this.on("end",function(){a("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){a("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function s(){}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}function s(){}var r=n("./runnable");t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function s(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var r=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,s=0,r=t.length;r>s;s++)o=e(o,t[s],s,t);return o},e.filter=function(t,e){for(var n=[],o=0,s=t.length;s>o;o++){var r=t[o];e(r,o,t)&&n.push(r)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),r.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=s(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.nextTick=function(){if(window.ActiveXObject||!window.postMessage)return function(t){t()};var t=[],e="mocha-zero-timeout";return window.addEventListener("message",function(n){n.source==window&&n.data==e&&(n.stopPropagation&&n.stopPropagation(),t.length&&t.shift()())},!0),function(n){t.push(n),window.postMessage(e,"*")}}(),process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))})},function(){var e=window.Mocha=t("mocha"),n=window.mocha=new e({reporter:"html"});n.ui=function(t){return e.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},n.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},n.run=function(t){n.options;n.globals("location");var o=e.utils.parseQuery(window.location.search||"");return o.grep&&n.grep(o.grep),o.invert&&n.invert(),e.prototype.run.call(n,function(){e.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file diff --git a/ajax/libs/mocha/1.9.0/mocha.min.css b/ajax/libs/mocha/1.9.0/mocha.min.css new file mode 100644 index 000000000..f4c04cb75 --- /dev/null +++ b/ajax/libs/mocha/1.9.0/mocha.min.css @@ -0,0 +1 @@ +@charset "utf-8";body{font:20px/1.5 "Helvetica Neue",Helvetica,Arial,sans-serif;padding:60px 50px}#mocha li,#mocha ul{margin:0;padding:0}#mocha ul{list-style:none}#mocha h1,#mocha h2{margin:0}#mocha h1{margin-top:15px;font-size:1em;font-weight:200}#mocha h1 a{text-decoration:none;color:inherit}#mocha h1 a:hover{text-decoration:underline}#mocha .suite .suite h1{margin-top:0;font-size:.8em}.hidden{display:none}#mocha h2{font-size:12px;font-weight:400;cursor:pointer}#mocha .suite{margin-left:15px}#mocha .test{margin-left:15px;overflow:hidden}#mocha .test.pending:hover h2::after{content:'(pending)';font-family:arial}#mocha .test.pass.medium .duration{background:#C09853}#mocha .test.pass.slow .duration{background:#B94A48}#mocha .test.pass::before{content:'✓';font-size:12px;display:block;float:left;margin-right:5px;color:#00d6b2}#mocha .test.pass .duration{font-size:9px;margin-left:5px;padding:2px 5px;color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.2);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;border-radius:5px}#mocha .test.pass.fast .duration{display:none}#mocha .test.pending{color:#0b97c4}#mocha .test.pending::before{content:'◦';color:#0b97c4}#mocha .test.fail{color:#c00}#mocha .test.fail pre{color:#000}#mocha .test.fail::before{content:'✖';font-size:12px;display:block;float:left;margin-right:5px;color:#c00}#mocha .test pre.error{color:#c00;max-height:300px;overflow:auto}#mocha .test pre{display:block;float:left;clear:left;font:12px/1.5 monaco,monospace;margin:5px;padding:15px;border:1px solid #eee;border-bottom-color:#ddd;-webkit-border-radius:3px;-webkit-box-shadow:0 1px 3px #eee;-moz-border-radius:3px;-moz-box-shadow:0 1px 3px #eee}#mocha .test h2{position:relative}#mocha .test a.replay{position:absolute;top:3px;right:0;text-decoration:none;vertical-align:middle;display:block;width:15px;height:15px;line-height:15px;text-align:center;background:#eee;font-size:15px;-moz-border-radius:15px;border-radius:15px;-webkit-transition:opacity 200ms;-moz-transition:opacity 200ms;transition:opacity 200ms;opacity:.3;color:#888}#mocha .test:hover a.replay{opacity:1}#mocha-report.fail .test.pass,#mocha-report.pass .test.fail{display:none}#mocha-error{color:#c00;font-size:1.5 em;font-weight:100;letter-spacing:1px}#mocha-stats{position:fixed;top:15px;right:10px;font-size:12px;margin:0;color:#888}#mocha-stats .progress{float:right;padding-top:0}#mocha-stats em{color:#000}#mocha-stats a{text-decoration:none;color:inherit}#mocha-stats a:hover{border-bottom:1px solid #eee}#mocha-stats li{display:inline-block;margin:0 5px;list-style:none;padding-top:11px}#mocha-stats canvas{width:40px;height:40px}code .comment{color:#ddd}code .init{color:#2F6FAD}code .string{color:#5890AD}code .keyword{color:#8A6343}code .number{color:#2F6FAD}@media screen and (max-device-width:480px){body{padding:60px 0}#stats{position:absolute}} \ No newline at end of file diff --git a/ajax/libs/mocha/1.9.0/mocha.min.js b/ajax/libs/mocha/1.9.0/mocha.min.js new file mode 100644 index 000000000..019cbb064 --- /dev/null +++ b/ajax/libs/mocha/1.9.0/mocha.min.js @@ -0,0 +1,2 @@ +!function(){function t(e){var n=t.resolve(e),o=t.modules[n];if(!o)throw new Error('failed to require "'+e+'"');return o.exports||(o.exports={},o.call(o.exports,o,o.exports,t.relative(n))),o.exports}t.modules={},t.resolve=function(e){var n=e,o=e+".js",s=e+"/index.js";return t.modules[o]&&o||t.modules[s]&&s||n},t.register=function(e,n){t.modules[e]=n},t.relative=function(e){return function(n){if("."!=n.charAt(0))return t(n);var o=e.split("/"),s=n.split("/");o.pop();for(var r=0;r/g,">"),e=e.replace(/"/g,""")}var o=function(t){this.ignoreWhitespace=t};o.prototype={diff:function(e,n){if(n==e)return[{value:n}];if(!n)return[{value:e,removed:!0}];if(!e)return[{value:n,added:!0}];n=this.tokenize(n),e=this.tokenize(e);var o=n.length,s=e.length,r=o+s,i=[{newPos:-1,components:[]}],a=this.extractCommon(i[0],n,e,0);if(i[0].newPos+1>=o&&a+1>=s)return i[0].components;for(var u=1;r>=u;u++)for(var l=-1*u;u>=l;l+=2){var c,p=i[l-1],f=i[l+1];a=(f?f.newPos:0)-l,p&&(i[l-1]=void 0);var h=p&&p.newPos+1=0&&s>a;if(h||d){!h||d&&p.newPos=o&&a+1>=s)return c.components;i[l]=c}else i[l]=void 0}},pushComponent:function(t,e,n,o){var s=t[t.length-1];s&&s.added===n&&s.removed===o?t[t.length-1]={value:this.join(s.value,e),added:n,removed:o}:t.push({value:e,added:n,removed:o})},extractCommon:function(t,e,n,o){for(var s=e.length,r=n.length,i=t.newPos,a=i-o;s>i+1&&r>a+1&&this.equals(e[i+1],n[a+1]);)i++,a++,this.pushComponent(t.components,e[i],void 0,void 0);return t.newPos=i,a},equals:function(t,e){var n=/\S/;return!this.ignoreWhitespace||n.test(t)||n.test(e)?t==e:!0},join:function(t,e){return t+e},tokenize:function(t){return t}};var s=new o,r=new o(!0);r.tokenize=function(t){return e(t.split(/(\s+|\b)/))};var i=new o(!0);i.tokenize=function(t){return e(t.split(/([{}:;,]|\s+)/))};var a=new o;return a.tokenize=function(t){return t.split(/^/m)},{diffChars:function(t,e){return s.diff(t,e)},diffWords:function(t,e){return r.diff(t,e)},diffLines:function(t,e){return a.diff(t,e)},diffCss:function(t,e){return i.diff(t,e)},createPatch:function(t,e,n,o,s){function r(t){return t.map(function(t){return" "+t})}function i(t,e,n){var o=l[l.length-2],s=e===l.length-2,r=e===l.length-3&&(n.added===!o.added||n.removed===!o.removed);/\n$/.test(n.value)||!s&&!r||t.push("\\ No newline at end of file")}var u=[];u.push("Index: "+t),u.push("==================================================================="),u.push("--- "+t+("undefined"==typeof o?"":" "+o)),u.push("+++ "+t+("undefined"==typeof s?"":" "+s));var l=a.diff(e,n);l[l.length-1].value||l.pop(),l.push({value:"",lines:[]});for(var c=0,p=0,f=[],h=1,d=1,g=0;g"):s.removed&&e.push(""),e.push(n(s.value)),s.added?e.push(""):s.removed&&e.push("")}return e.join("")}}}();"undefined"!=typeof t&&(t.exports=e)}),t.register("browser/events.js",function(t,e){function n(t){return"[object Array]"=={}.toString.call(t)}function o(){}e.EventEmitter=o,o.prototype.on=function(t,e){return this.$events||(this.$events={}),this.$events[t]?n(this.$events[t])?this.$events[t].push(e):this.$events[t]=[this.$events[t],e]:this.$events[t]=e,this},o.prototype.addListener=o.prototype.on,o.prototype.once=function(t,e){function n(){o.removeListener(t,n),e.apply(this,arguments)}var o=this;return n.listener=e,this.on(t,n),this},o.prototype.removeListener=function(t,e){if(this.$events&&this.$events[t]){var o=this.$events[t];if(n(o)){for(var s=-1,r=0,i=o.length;i>r;r++)if(o[r]===e||o[r].listener&&o[r].listener===e){s=r;break}if(0>s)return this;o.splice(s,1),o.length||delete this.$events[t]}else(o===e||o.listener&&o.listener===e)&&delete this.$events[t]}return this},o.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},o.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),n(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},o.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var o=[].slice.call(arguments,1);if("function"==typeof e)e.apply(this,o);else{if(!n(e))return!1;for(var s=e.slice(),r=0,i=s.length;i>r;r++)s[r].apply(this,o)}return!0}}),t.register("browser/fs.js",function(){}),t.register("browser/path.js",function(){}),t.register("browser/progress.js",function(t){function e(){this.percent=0,this.size(0),this.fontSize(11),this.font("helvetica, arial, sans-serif")}t.exports=e,e.prototype.size=function(t){return this._size=t,this},e.prototype.text=function(t){return this._text=t,this},e.prototype.fontSize=function(t){return this._fontSize=t,this},e.prototype.font=function(t){return this._font=t,this},e.prototype.update=function(t){return this.percent=t,this},e.prototype.draw=function(t){var e=Math.min(this.percent,100),n=this._size,o=n/2,s=o,r=o,i=o-1,a=this._fontSize;t.font=a+"px "+this._font;var u=2*Math.PI*(e/100);t.clearRect(0,0,n,n),t.strokeStyle="#9f9f9f",t.beginPath(),t.arc(s,r,i,0,u,!1),t.stroke(),t.strokeStyle="#eee",t.beginPath(),t.arc(s,r,i-1,0,u,!0),t.stroke();var l=this._text||(0|e)+"%",c=t.measureText(l).width;return t.fillText(l,s-c/2+1,r+a/2-1),this}}),t.register("browser/tty.js",function(t,e){e.isatty=function(){return!0},e.getWindowSize=function(){return[window.innerHeight,window.innerWidth]}}),t.register("context.js",function(t){function e(){}t.exports=e,e.prototype.runnable=function(t){return 0==arguments.length?this._runnable:(this.test=this._runnable=t,this)},e.prototype.timeout=function(t){return this.runnable().timeout(t),this},e.prototype.slow=function(t){return this.runnable().slow(t),this},e.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_runnable"!=t&&"test"!=t?e:void 0},2)}}),t.register("hook.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.type="hook"}function s(){}var r=n("./runnable");t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.error=function(t){if(0==arguments.length){var t=this._error;return this._error=null,t}this._error=t}}),t.register("interfaces/bdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.describe=t.context=function(t,n){var s=o.create(e[0],t);return e.unshift(s),n.call(s),e.shift(),s},t.xdescribe=t.xcontext=t.describe.skip=function(t,n){var s=o.create(e[0],t);s.pending=!0,e.unshift(s),n.call(s),e.shift()},t.describe.only=function(e,n){var o=t.describe(e,n);r.grep(o.fullTitle())},t.it=t.specify=function(t,n){var o=e[0];if(o.pending)var n=null;var r=new s(t,n);return o.addTest(r),r},t.it.only=function(e,n){var o=t.it(e,n);r.grep(o.fullTitle())},t.xit=t.xspecify=t.it.skip=function(e){t.it(e)}})}}),t.register("interfaces/exports.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){function e(t){var r;for(var i in t)if("function"==typeof t[i]){var a=t[i];switch(i){case"before":n[0].beforeAll(a);break;case"after":n[0].afterAll(a);break;case"beforeEach":n[0].beforeEach(a);break;case"afterEach":n[0].afterEach(a);break;default:n[0].addTest(new s(i,a))}}else{var r=o.create(n[0],i);n.unshift(r),e(t[i]),n.shift()}}var n=[t];t.on("require",e)}}),t.register("interfaces/index.js",function(t,e,n){e.bdd=n("./bdd"),e.tdd=n("./tdd"),e.qunit=n("./qunit"),e.exports=n("./exports")}),t.register("interfaces/qunit.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t){t.before=function(t){e[0].beforeAll(t)},t.after=function(t){e[0].afterAll(t)},t.beforeEach=function(t){e[0].beforeEach(t)},t.afterEach=function(t){e[0].afterEach(t)},t.suite=function(t){e.length>1&&e.shift();var n=o.create(e[0],t);e.unshift(n)},t.test=function(t,n){e[0].addTest(new s(t,n))}})}}),t.register("interfaces/tdd.js",function(t,e,n){var o=n("../suite"),s=n("../test");t.exports=function(t){var e=[t];t.on("pre-require",function(t,n,r){t.setup=function(t){e[0].beforeEach(t)},t.teardown=function(t){e[0].afterEach(t)},t.suiteSetup=function(t){e[0].beforeAll(t)},t.suiteTeardown=function(t){e[0].afterAll(t)},t.suite=function(t,n){var s=o.create(e[0],t);return e.unshift(s),n.call(s),e.shift(),s},t.suite.only=function(e,n){var o=t.suite(e,n);r.grep(o.fullTitle())},t.test=function(t,n){var o=new s(t,n);return e[0].addTest(o),o},t.test.only=function(e,n){var o=t.test(e,n);r.grep(o.fullTitle())},t.test.skip=function(e){t.test(e)}})}}),t.register("mocha.js",function(t,e,n){function o(t){return __dirname+"/../images/"+t+".png"}function s(t){t=t||{},this.files=[],this.options=t,this.grep(t.grep),this.suite=new e.Suite("",new e.Context),this.ui(t.ui),this.bail(t.bail),this.reporter(t.reporter),t.timeout&&this.timeout(t.timeout),t.slow&&this.slow(t.slow)}var r=n("browser/path"),i=n("./utils");e=t.exports=s,e.utils=i,e.interfaces=n("./interfaces"),e.reporters=n("./reporters"),e.Runnable=n("./runnable"),e.Context=n("./context"),e.Runner=n("./runner"),e.Suite=n("./suite"),e.Hook=n("./hook"),e.Test=n("./test"),s.prototype.bail=function(t){return 0==arguments.length&&(t=!0),this.suite.bail(t),this},s.prototype.addFile=function(t){return this.files.push(t),this},s.prototype.reporter=function(t){if("function"==typeof t)this._reporter=t;else{t=t||"dot";try{this._reporter=n("./reporters/"+t)}catch(e){this._reporter=n(t)}if(!this._reporter)throw new Error('invalid reporter "'+t+'"')}return this},s.prototype.ui=function(t){if(t=t||"bdd",this._ui=e.interfaces[t],!this._ui)throw new Error('invalid interface "'+t+'"');return this._ui=this._ui(this.suite),this},s.prototype.loadFiles=function(t){var e=this,o=this.suite,s=this.files.length;this.files.forEach(function(i){i=r.resolve(i),o.emit("pre-require",global,i,e),o.emit("require",n(i),i,e),o.emit("post-require",global,i,e),--s||t&&t()})},s.prototype._growl=function(t,e){var s=n("growl");t.on("end",function(){var n=e.stats;if(n.failures){var r=n.failures+" of "+t.total+" tests failed";s(r,{name:"mocha",title:"Failed",image:o("error")})}else s(n.passes+" tests passed in "+n.duration+"ms",{name:"mocha",title:"Passed",image:o("ok")})})},s.prototype.grep=function(t){return this.options.grep="string"==typeof t?new RegExp(i.escapeRegexp(t)):t,this},s.prototype.invert=function(){return this.options.invert=!0,this},s.prototype.ignoreLeaks=function(){return this.options.ignoreLeaks=!0,this},s.prototype.checkLeaks=function(){return this.options.ignoreLeaks=!1,this},s.prototype.growl=function(){return this.options.growl=!0,this},s.prototype.globals=function(t){return this.options.globals=(this.options.globals||[]).concat(t),this},s.prototype.timeout=function(t){return this.suite.timeout(t),this},s.prototype.slow=function(t){return this.suite.slow(t),this},s.prototype.asyncOnly=function(){return this.options.asyncOnly=!0,this},s.prototype.run=function(t){this.files.length&&this.loadFiles();var n=this.suite,o=this.options,s=new e.Runner(n),r=new this._reporter(s);return s.ignoreLeaks=!1!==o.ignoreLeaks,s.asyncOnly=o.asyncOnly,o.grep&&s.grep(o.grep,o.invert),o.globals&&s.globals(o.globals),o.growl&&this._growl(s,r),s.run(t)}}),t.register("ms.js",function(t){function e(t){var e=/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),o=(e[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"y":return 315576e5*n;case"days":case"day":case"d":return 864e5*n;case"hours":case"hour":case"h":return 36e5*n;case"minutes":case"minute":case"m":return 6e4*n;case"seconds":case"second":case"s":return 1e3*n;case"ms":return n}}}function n(t){return t==i?Math.round(t/i)+" day":t>i?Math.round(t/i)+" days":t==r?Math.round(t/r)+" hour":t>r?Math.round(t/r)+" hours":t==s?Math.round(t/s)+" minute":t>s?Math.round(t/s)+" minutes":t==o?Math.round(t/o)+" second":t>o?Math.round(t/o)+" seconds":t+" ms"}var o=1e3,s=60*o,r=60*s,i=24*r;t.exports=function(t){return"string"==typeof t?e(t):n(t)}}),t.register("reporters/base.js",function(t,e,n){function o(t){var e=this.stats={suites:0,tests:0,passes:0,pending:0,failures:0},n=this.failures=[];t&&(this.runner=t,t.stats=e,t.on("start",function(){e.start=new c}),t.on("suite",function(t){e.suites=e.suites||0,t.root||e.suites++}),t.on("test end",function(){e.tests=e.tests||0,e.tests++}),t.on("pass",function(t){e.passes=e.passes||0;var n=t.slow()/2;t.speed=t.duration>t.slow()?"slow":t.duration>n?"medium":"fast",e.passes++}),t.on("fail",function(t,o){e.failures=e.failures||0,e.failures++,t.err=o,n.push(t)}),t.on("end",function(){e.end=new c,e.duration=new c-e.start}),t.on("pending",function(){e.pending++}))}function s(t,e){return t=String(t),Array(e-t.length+1).join(" ")+t}function r(t,e,n){return u["diff"+e](t.actual,t.expected).map(function(t){return n&&(t.value=t.value.replace(/\t/g,"").replace(/\r/g,"").replace(/\n/g,"\n")),t.added?i("diff added",t.value):t.removed?i("diff removed",t.value):t.value}).join("")}function i(t,e){return e.split("\n").map(function(e){return f(t,e)}).join("\n")}var a=n("browser/tty"),u=n("browser/diff"),l=n("../ms"),c=global.Date,p=(global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval,a.isatty(1)&&a.isatty(2));e=t.exports=o,e.useColors=p,e.colors={pass:90,fail:31,"bright pass":92,"bright fail":91,"bright yellow":93,pending:36,suite:0,"error title":0,"error message":31,"error stack":90,checkmark:32,fast:90,medium:33,slow:31,green:32,light:90,"diff gutter":90,"diff added":42,"diff removed":41},e.symbols={ok:"✓",err:"✖",dot:"․"},"win32"==process.platform&&(e.symbols.ok="√",e.symbols.err="×",e.symbols.dot=".");var f=e.color=function(t,n){return e.useColors?"["+e.colors[t]+"m"+n+"":n};e.window={width:p?process.stdout.getWindowSize?process.stdout.getWindowSize(1)[0]:a.getWindowSize()[1]:75},e.cursor={hide:function(){process.stdout.write("[?25l")},show:function(){process.stdout.write("[?25h")},deleteLine:function(){process.stdout.write("")},beginningOfLine:function(){process.stdout.write("")},CR:function(){e.cursor.deleteLine(),e.cursor.beginningOfLine()}},e.list=function(t){console.error(),t.forEach(function(t,e){var n=f("error title"," %s) %s:\n")+f("error message"," %s")+f("error stack","\n%s\n"),o=t.err,i=o.message||"",a=o.stack||i,u=a.indexOf(i)+i.length,l=a.slice(0,u),c=o.actual,p=o.expected,h=!0;if(o.showDiff&&(h=!1,o.actual=c=JSON.stringify(c,null,2),o.expected=p=JSON.stringify(p,null,2)),"string"==typeof c&&"string"==typeof p){var d=Math.max(c.length,p.length);l=20>d?r(o,"Chars",h):r(o,"Words",h);var g=l.split("\n");if(g.length>4){var m=String(g.length).length;l=g.map(function(t,e){return s(++e,m)+" | "+t}).join("\n")}l="\n"+f("diff removed","actual")+" "+f("diff added","expected")+"\n\n"+l+"\n",l=l.replace(/^/gm," "),n=f("error title"," %s) %s:\n%s")+f("error stack","\n%s\n")}a=a.slice(u?u+1:u).replace(/^/gm," "),console.error(n,e+1,t.fullTitle(),l,a)})},o.prototype.epilogue=function(){function t(t){return 1==t?"test":"tests"}var n,s=this.stats;return console.log(),s.failures?(n=f("bright fail"," "+e.symbols.err)+f("fail"," %d of %d %s failed")+f("light",":"),console.error(n,s.failures,this.runner.total,t(this.runner.total)),o.list(this.failures),void console.error()):(n=f("bright pass"," ")+f("green"," %d %s complete")+f("light"," (%s)"),console.log(n,s.tests||0,t(s.tests),l(s.duration)),s.pending&&(n=f("pending"," ")+f("pending"," %d %s pending"),console.log(n,s.pending,t(s.pending))),void console.log())}}),t.register("reporters/doc.js",function(t,e,n){function o(t){function e(){return Array(n).join(" ")}s.call(this,t);var n=(this.stats,t.total,2);t.on("suite",function(t){t.root||(++n,console.log('%s
                                                                                    ',e()),++n,console.log("%s

                                                                                    %s

                                                                                    ",e(),r.escape(t.title)),console.log("%s
                                                                                    ",e()))}),t.on("suite end",function(t){t.root||(console.log("%s
                                                                                    ",e()),--n,console.log("%s
                                                                                    ",e()),--n)}),t.on("pass",function(t){console.log("%s
                                                                                    %s
                                                                                    ",e(),r.escape(t.title));var n=r.escape(r.clean(t.fn.toString()));console.log("%s
                                                                                    %s
                                                                                    ",e(),n)})}var s=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/dot.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,.75*r.window.width|0),o=0;t.on("start",function(){process.stdout.write("\n ")}),t.on("pending",function(){process.stdout.write(i("pending",r.symbols.dot))}),t.on("pass",function(t){++o%n==0&&process.stdout.write("\n "),process.stdout.write("slow"==t.speed?i("bright yellow",r.symbols.dot):i(t.speed,r.symbols.dot))}),t.on("fail",function(){++o%n==0&&process.stdout.write("\n "),process.stdout.write(i("fail",r.symbols.dot))}),t.on("end",function(){console.log(),e.epilogue()})}function s(){}var r=n("./base"),i=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/html-cov.js",function(t,e,n){function o(t){var e=n("jade"),o=__dirname+"/templates/coverage.jade",a=i.readFileSync(o,"utf8"),u=e.compile(a,{filename:o}),l=this;r.call(this,t,!1),t.on("end",function(){process.stdout.write(u({cov:l.cov,coverageClass:s}))})}function s(t){return t>=75?"high":t>=50?"medium":t>=25?"low":"terrible"}var r=n("./json-cov"),i=n("browser/fs");e=t.exports=o}),t.register("reporters/html.js",function(t,e,n){function o(t,e){c.call(this,t);var n,o,m=this.stats,v=(t.total,r(g)),y=v.getElementsByTagName("li"),w=y[1].getElementsByTagName("em")[0],b=y[1].getElementsByTagName("a")[0],x=y[2].getElementsByTagName("em")[0],k=y[2].getElementsByTagName("a")[0],T=y[3].getElementsByTagName("em")[0],j=v.getElementsByTagName("canvas")[0],E=r('
                                                                                      '),_=[E];if(e=e||document.getElementById("mocha"),j.getContext){var C=window.devicePixelRatio||1;j.style.width=j.width,j.style.height=j.height,j.width*=C,j.height*=C,o=j.getContext("2d"),o.scale(C,C),n=new f}return e?(l(b,"click",function(){a();var t=/pass/.test(E.className)?"":" pass";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&i("test pass")}),l(k,"click",function(){a();var t=/fail/.test(E.className)?"":" fail";E.className=E.className.replace(/fail|pass/g,"")+t,E.className.trim()&&i("test fail")}),e.appendChild(v),e.appendChild(E),n&&n.size(40),t.on("suite",function(t){if(!t.root){var e="?grep="+encodeURIComponent(t.fullTitle()),n=r('
                                                                                    • %s

                                                                                    • ',e,h(t.title));_[0].appendChild(n),_.unshift(document.createElement("ul")),n.appendChild(_[0])}}),t.on("suite end",function(t){t.root||_.shift()}),t.on("fail",function(e){"hook"==e.type&&t.emit("test end",e)}),void t.on("test end",function(t){var e=m.tests/this.total*100|0;n&&n.update(e).draw(o);var s=new d-m.start;if(u(w,m.passes),u(x,m.failures),u(T,(s/1e3).toFixed(2)),"passed"==t.state)var i=r('
                                                                                    • %e%ems ‣

                                                                                    • ',t.speed,t.title,t.duration,encodeURIComponent(t.fullTitle()));else if(t.pending)var i=r('
                                                                                    • %e

                                                                                    • ',t.title);else{var i=r('
                                                                                    • %e ‣

                                                                                    • ',t.title,encodeURIComponent(t.fullTitle())),a=t.err.stack||t.err.toString();~a.indexOf(t.err.message)||(a=t.err.message+"\n"+a),"[object Error]"==a&&(a=t.err.message),!t.err.stack&&t.err.sourceURL&&void 0!==t.err.line&&(a+="\n("+t.err.sourceURL+":"+t.err.line+")"),i.appendChild(r('
                                                                                      %e
                                                                                      ',a))}if(!t.pending){var c=i.getElementsByTagName("h2")[0];l(c,"click",function(){f.style.display="none"==f.style.display?"block":"none"});var f=r("
                                                                                      %e
                                                                                      ",p.clean(t.fn.toString()));i.appendChild(f),f.style.display="none"}_[0]&&_[0].appendChild(i)})):s("#mocha div missing, add it to your document")}function s(t){document.body.appendChild(r('
                                                                                      %s
                                                                                      ',t))}function r(t){var e=arguments,n=document.createElement("div"),o=1;return n.innerHTML=t.replace(/%([se])/g,function(t,n){switch(n){case"s":return String(e[o++]);case"e":return h(e[o++])}}),n.firstChild}function i(t){for(var e=document.getElementsByClassName("suite"),n=0;n0&&(e.coverage=e.hits/e.sloc*100),e}function r(t,e){var n={filename:t,coverage:0,hits:0,misses:0,sloc:0,source:{}};return e.source.forEach(function(t,o){o++,0===e[o]?(n.misses++,n.sloc++):void 0!==e[o]&&(n.hits++,n.sloc++),n.source[o]={source:t,coverage:void 0===e[o]?"":e[o]}}),n.coverage=n.hits/n.sloc*100,n}function i(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}var a=n("./base");e=t.exports=o}),t.register("reporters/json-stream.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,t.total);t.on("start",function(){console.log(JSON.stringify(["start",{total:n}]))}),t.on("pass",function(t){console.log(JSON.stringify(["pass",s(t)]))}),t.on("fail",function(t){console.log(JSON.stringify(["fail",s(t)]))}),t.on("end",function(){process.stdout.write(JSON.stringify(["end",e.stats]))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.color}e=t.exports=o}),t.register("reporters/json.js",function(t,e,n){function o(t){var e=this;r.call(this,t);var n=[],o=[],i=[];t.on("test end",function(t){n.push(t)}),t.on("pass",function(t){i.push(t)}),t.on("fail",function(t){o.push(t)}),t.on("end",function(){var t={stats:e.stats,tests:n.map(s),failures:o.map(s),passes:i.map(s)};process.stdout.write(JSON.stringify(t,null,2))})}function s(t){return{title:t.title,fullTitle:t.fullTitle(),duration:t.duration}}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/landing.js",function(t,e,n){function o(t){function e(){var t=Array(o).join("-");return" "+a("runway",t)}r.call(this,t);var n=this,o=(this.stats,.75*r.window.width|0),s=t.total,u=process.stdout,l=a("plane","✈"),c=-1,p=0;t.on("start",function(){u.write("\n "),i.hide()}),t.on("test end",function(t){var n=-1==c?o*++p/s|0:c;"failed"==t.state&&(l=a("plane crash","✈"),c=n),u.write("\n\n"),u.write(e()),u.write("\n "),u.write(a("runway",Array(n).join("⋅"))),u.write(l),u.write(a("runway",Array(o-n).join("⋅")+"\n")),u.write(e()),u.write("")}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,r.colors.plane=0,r.colors["plane crash"]=31,r.colors.runway=90,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/list.js",function(t,e,n){function o(t){r.call(this,t);var e=this,n=(this.stats,0);t.on("start",function(){console.log()}),t.on("test",function(t){process.stdout.write(a("pass"," "+t.fullTitle()+": "))}),t.on("pending",function(t){var e=a("checkmark"," -")+a("pending"," %s");console.log(e,t.fullTitle())}),t.on("pass",function(t){var e=a("checkmark"," "+r.symbols.dot)+a("pass"," %s: ")+a(t.speed,"%dms");i.CR(),console.log(e,t.fullTitle(),t.duration)}),t.on("fail",function(t){i.CR(),console.log(a("fail"," %d) %s"),++n,t.fullTitle())}),t.on("end",e.epilogue.bind(e))}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/markdown.js",function(t,e,n){function o(t){function e(t){return Array(a).join("#")+" "+t}function n(t,e){var o=e;return e=e[t.title]=e[t.title]||{suite:t},t.suites.forEach(function(t){n(t,e)}),o}function o(t,e){++e;var n,s="";for(var i in t)"suite"!=i&&(i&&(n=" - ["+i+"](#"+r.slug(t[i].suite.fullTitle())+")\n"),i&&(s+=Array(e).join(" ")+n),s+=o(t[i],e));return--e,s}function i(t){var e=n(t,{});return o(e,0)}s.call(this,t);var a=(this.stats,0),u="";i(t.suite),t.on("suite",function(t){++a;var n=r.slug(t.fullTitle());u+='\n',u+=e(t.title)+"\n"}),t.on("suite end",function(){--a}),t.on("pass",function(t){var e=r.clean(t.fn.toString());u+=t.title+".\n",u+="\n```js\n",u+=e+"\n",u+="```\n\n"}),t.on("end",function(){process.stdout.write("# TOC\n"),process.stdout.write(i(t.suite)),process.stdout.write(u)})}var s=n("./base"),r=n("../utils");e=t.exports=o}),t.register("reporters/min.js",function(t,e,n){function o(t){r.call(this,t),t.on("start",function(){process.stdout.write(""),process.stdout.write("")}),t.on("end",this.epilogue.bind(this))}function s(){}var r=n("./base");e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/nyan.js",function(t,e,n){function o(t){i.call(this,t);{var e=this,n=(this.stats,.75*i.window.width|0),o=(this.rainbowColors=e.generateColors(),this.colorIndex=0,this.numberOfLines=4,this.trajectories=[[],[],[],[]],this.nyanCatWidth=11);this.trajectoryWidthMax=n-o,this.scoreboardWidth=5,this.tick=0}t.on("start",function(){i.cursor.hide(),e.draw("start")}),t.on("pending",function(){e.draw("pending")}),t.on("pass",function(){e.draw("pass")}),t.on("fail",function(){e.draw("fail")}),t.on("end",function(){i.cursor.show();for(var t=0;t=this.trajectoryWidthMax&&o.shift(),o.push(e)}},o.prototype.drawRainbow=function(){var t=this;this.trajectories.forEach(function(e){s("["+t.scoreboardWidth+"C"),s(e.join("")),s("\n")}),this.cursorUp(this.numberOfLines)},o.prototype.drawNyanCat=function(t){var e=this,n=this.scoreboardWidth+this.trajectories[0].length,o="["+n+"C",r="";s(o),s("_,------,"),s("\n"),s(o),r=e.tick?" ":" ",s("_|"+r+"/\\_/\\ "),s("\n"),s(o),r=e.tick?"_":"__";var i,a=e.tick?"~":"^";switch(t){case"pass":i="( ^ .^)";break;case"fail":i="( o .o)";break;default:i="( - .-)"}s(a+"|"+r+i+" "),s("\n"),s(o),r=e.tick?" ":" ",s(r+'"" "" '),s("\n"),this.cursorUp(this.numberOfLines)},o.prototype.cursorUp=function(t){s("["+t+"A")},o.prototype.cursorDown=function(t){s("["+t+"B")},o.prototype.generateColors=function(){for(var t=[],e=0;42>e;e++){var n=Math.floor(Math.PI/3),o=e*(1/6),s=Math.floor(3*Math.sin(o)+3),r=Math.floor(3*Math.sin(o+2*n)+3),i=Math.floor(3*Math.sin(o+4*n)+3);t.push(36*s+6*r+i+16)}return t},o.prototype.rainbowify=function(t){var e=this.rainbowColors[this.colorIndex%this.rainbowColors.length];return this.colorIndex+=1,"[38;5;"+e+"m"+t+""},r.prototype=i.prototype,o.prototype=new r,o.prototype.constructor=o}),t.register("reporters/progress.js",function(t,e,n){function o(t,e){r.call(this,t);{var n=this,e=e||{},o=(this.stats,.5*r.window.width|0),s=t.total,u=0;Math.max}e.open=e.open||"[",e.complete=e.complete||"▬",e.incomplete=e.incomplete||r.symbols.dot,e.close=e.close||"]",e.verbose=!1,t.on("start",function(){console.log(),i.hide()}),t.on("test end",function(){u++;var t=u/s,n=o*t|0,r=o-n;i.CR(),process.stdout.write(""),process.stdout.write(a("progress"," "+e.open)),process.stdout.write(Array(n).join(e.complete)),process.stdout.write(Array(r).join(e.incomplete)),process.stdout.write(a("progress",e.close)),e.verbose&&process.stdout.write(a("progress"," "+u+" of "+s))}),t.on("end",function(){i.show(),console.log(),n.epilogue()})}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,r.colors.progress=90,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("reporters/spec.js",function(t,e,n){function o(t){function e(){return Array(o).join(" ")}r.call(this,t);var n=this,o=(this.stats,0),s=0;t.on("start",function(){console.log()}),t.on("suite",function(t){++o,console.log(a("suite","%s%s"),e(),t.title)}),t.on("suite end",function(){--o,1==o&&console.log()}),t.on("test",function(t){process.stdout.write(e()+a("pass"," ◦ "+t.title+": "))}),t.on("pending",function(t){var n=e()+a("pending"," - %s");console.log(n,t.title)}),t.on("pass",function(t){if("fast"==t.speed){var n=e()+a("checkmark"," "+r.symbols.ok)+a("pass"," %s ");i.CR(),console.log(n,t.title)}else{var n=e()+a("checkmark"," "+r.symbols.ok)+a("pass"," %s ")+a(t.speed,"(%dms)");i.CR(),console.log(n,t.title,t.duration)}}),t.on("fail",function(t){i.CR(),console.log(e()+a("fail"," %d) %s"),++s,t.title)}),t.on("end",n.epilogue.bind(n))}function s(){}var r=n("./base"),i=r.cursor,a=r.color;e=t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o +}),t.register("reporters/tap.js",function(t,e,n){function o(t){r.call(this,t);var e=(this.stats,1),n=0,o=0;t.on("start",function(){var e=t.grepTotal(t.suite);console.log("%d..%d",1,e)}),t.on("test end",function(){++e}),t.on("pending",function(t){console.log("ok %d %s # SKIP -",e,s(t))}),t.on("pass",function(t){n++,console.log("ok %d %s",e,s(t))}),t.on("fail",function(t,n){o++,console.log("not ok %d %s",e,s(t)),n.stack&&console.log(n.stack.replace(/^/gm," "))}),t.on("end",function(){console.log("# tests "+(n+o)),console.log("# pass "+n),console.log("# fail "+o)})}function s(t){return t.fullTitle().replace(/#/g,"")}{var r=n("./base");r.cursor,r.color}e=t.exports=o}),t.register("reporters/teamcity.js",function(t,e,n){function o(t){r.call(this,t);var e=this.stats;t.on("start",function(){console.log("##teamcity[testSuiteStarted name='mocha.suite']")}),t.on("test",function(t){console.log("##teamcity[testStarted name='"+s(t.fullTitle())+"']")}),t.on("fail",function(t,e){console.log("##teamcity[testFailed name='"+s(t.fullTitle())+"' message='"+s(e.message)+"']")}),t.on("pending",function(t){console.log("##teamcity[testIgnored name='"+s(t.fullTitle())+"' message='pending']")}),t.on("test end",function(t){console.log("##teamcity[testFinished name='"+s(t.fullTitle())+"' duration='"+t.duration+"']")}),t.on("end",function(){console.log("##teamcity[testSuiteFinished name='mocha.suite' duration='"+e.duration+"']")})}function s(t){return t.replace(/\|/g,"||").replace(/\n/g,"|n").replace(/\r/g,"|r").replace(/\[/g,"|[").replace(/\]/g,"|]").replace(/\u0085/g,"|x").replace(/\u2028/g,"|l").replace(/\u2029/g,"|p").replace(/'/g,"|'")}var r=n("./base");e=t.exports=o}),t.register("reporters/xunit.js",function(t,e,n){function o(t){u.call(this,t);var e=this.stats,n=[];t.on("pass",function(t){n.push(t)}),t.on("fail",function(t){n.push(t)}),t.on("end",function(){console.log(i("testsuite",{name:"Mocha Tests",tests:e.tests,failures:e.failures,errors:e.failures,skip:e.tests-e.failures-e.passes,timestamp:(new p).toUTCString(),time:e.duration/1e3},!1)),n.forEach(r),console.log("")})}function s(){}function r(t){var e={classname:t.parent.fullTitle(),name:t.title,time:t.duration/1e3};if("failed"==t.state){var n=t.err;e.message=c(n.message),console.log(i("testcase",e,!1,i("failure",e,!1,a(n.stack))))}else console.log(t.pending?i("testcase",e,!1,i("skipped",{},!0)):i("testcase",e,!0))}function i(t,e,n,o){var s,r=n?"/>":">",i=[];for(var a in e)i.push(a+'="'+c(e[a])+'"');return s="<"+t+(i.length?" "+i.join(" "):"")+r,o&&(s+=o+""}{var u=n("./base"),l=n("../utils"),c=l.escape,p=global.Date;global.setTimeout,global.setInterval,global.clearTimeout,global.clearInterval}e=t.exports=o,s.prototype=u.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("runnable.js",function(t,e,n){function o(t,e){this.title=t,this.fn=e,this.async=e&&e.length,this.sync=!this.async,this._timeout=2e3,this._slow=75,this.timedOut=!1}function s(){}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:runnable"),a=n("./ms"),u=global.Date,l=global.setTimeout,c=(global.setInterval,global.clearTimeout),p=(global.clearInterval,Object.prototype.toString);t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=t,this.timer&&this.resetTimeout(),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._slow=t,this)},o.prototype.fullTitle=function(){return this.parent.fullTitle()+" "+this.title},o.prototype.clearTimeout=function(){c(this.timer)},o.prototype.inspect=function(){return JSON.stringify(this,function(t,e){return"_"!=t[0]?"parent"==t?"#":"ctx"==t?"#":e:void 0},2)},o.prototype.resetTimeout=function(){var t=this,e=this.timeout();this.clearTimeout(),e&&(this.timer=l(function(){t.callback(new Error("timeout of "+e+"ms exceeded")),t.timedOut=!0},e))},o.prototype.run=function(t){function e(t){s||(s=!0,r.emit("error",t||new Error("done() called multiple times")))}function n(n){if(!r.timedOut){if(o)return e(n);r.clearTimeout(),r.duration=new u-a,o=!0,t(n)}}var o,s,r=this,i=this.timeout(),a=new u,c=this.ctx;if(c&&c.runnable(this),this.async&&i&&(this.timer=l(function(){n(new Error("timeout of "+i+"ms exceeded")),r.timedOut=!0},i)),this.callback=n,this.async)try{this.fn.call(c,function(t){return t instanceof Error||"[object Error]"===p.call(t)?n(t):null!=t?n(new Error("done() invoked with non-Error: "+t)):void n()})}catch(f){n(f)}else{if(this.asyncOnly)return n(new Error("--async-only option in use without declaring `done()`"));try{this.pending||this.fn.call(c),this.duration=new u-a,t()}catch(f){t(f)}}}}),t.register("runner.js",function(t,e,n){function o(t){var e=this;this._globals=[],this.suite=t,this.total=t.total(),this.failures=0,this.on("test end",function(t){e.checkGlobals(t)}),this.on("hook end",function(t){e.checkGlobals(t)}),this.grep(/.*/),this.globals(this.globalProps().concat(["errno"]))}function s(){}function r(t,e){return l(e,function(e){var n=l(t,function(t){return~t.indexOf("*")?0==e.indexOf(t.split("*")[0]):/^mocha-/.test(e)?!0:e==t});return 0==n.length&&(!global.navigator||"onerror"!==e)})}var i=n("browser/events").EventEmitter,a=n("browser/debug")("mocha:runner"),u=(n("./test"),n("./utils")),l=u.filter,c=(u.keys,["setTimeout","clearTimeout","setInterval","clearInterval","XMLHttpRequest","Date"]);t.exports=o,o.immediately=global.setImmediate||process.nextTick,s.prototype=i.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.grep=function(t,e){return a("grep %s",t),this._grep=t,this._invert=e,this.total=this.grepTotal(this.suite),this},o.prototype.grepTotal=function(t){var e=this,n=0;return t.eachTest(function(t){var o=e._grep.test(t.fullTitle());e._invert&&(o=!o),o&&n++}),n},o.prototype.globalProps=function(){for(var t=u.keys(global),e=0;e1?this.fail(t,new Error("global leaks detected: "+e.join(", "))):e.length&&this.fail(t,new Error("global leak detected: "+e[0])))}},o.prototype.fail=function(t,e){++this.failures,t.state="failed","string"==typeof e&&(e=new Error('the string "'+e+'" was thrown, throw an Error :)')),this.emit("fail",t,e)},o.prototype.failHook=function(t,e){this.fail(t,e),this.emit("end")},o.prototype.hook=function(t,e){function n(t){var o=r[t];return o?(i.currentRunnable=o,i.emit("hook",o),o.on("error",function(t){i.failHook(o,t)}),void o.run(function(e){o.removeAllListeners("error");var s=o.error();return s&&i.fail(i.test,s),e?i.failHook(o,e):(i.emit("hook end",o),void n(++t))})):e()}var s=this.suite,r=s["_"+t],i=this;o.immediately(function(){n(0)})},o.prototype.hooks=function(t,e,n){function o(i){return s.suite=i,i?void s.hook(t,function(t){return t?(s.suite=r,n(t)):void o(e.pop())}):(s.suite=r,n())}var s=this,r=this.suite;o(e.pop())},o.prototype.hookUp=function(t,e){var n=[this.suite].concat(this.parents()).reverse();this.hooks(t,n,e)},o.prototype.hookDown=function(t,e){var n=[this.suite].concat(this.parents());this.hooks(t,n,e)},o.prototype.parents=function(){for(var t=this.suite,e=[];t=t.parent;)e.push(t);return e},o.prototype.runTest=function(t){var e=this.test,n=this;this.asyncOnly&&(e.asyncOnly=!0);try{e.on("error",function(t){n.fail(e,t)}),e.run(t)}catch(o){t(o)}},o.prototype.runTests=function(t,e){function n(){if(s.failures&&t._bail)return e();if(o=r.shift(),!o)return e();var i=s._grep.test(o.fullTitle());return s._invert&&(i=!i),i?o.pending?(s.emit("pending",o),s.emit("test end",o),n()):(s.emit("test",s.test=o),void s.hookDown("beforeEach",function(){s.currentRunnable=s.test,s.runTest(function(t){return o=s.test,t?(s.fail(o,t),s.emit("test end",o),s.hookUp("afterEach",n)):(o.state="passed",s.emit("pass",o),s.emit("test end",o),void s.hookUp("afterEach",n))})})):n()}var o,s=this,r=t.tests.slice();this.next=n,n()},o.prototype.runSuite=function(t,e){function n(){var e=t.suites[i++];return e?void r.runSuite(e,n):o()}function o(){r.suite=t,r.hook("afterAll",function(){r.emit("suite end",t),e()})}var s=this.grepTotal(t),r=this,i=0;return a("run suite %s",t.fullTitle()),s?(this.emit("suite",this.suite=t),void this.hook("beforeAll",function(){r.runTests(t,n)})):e()},o.prototype.uncaught=function(t){a("uncaught exception %s",t.message);var e=this.currentRunnable;if(e&&"failed"!=e.state)return e.clearTimeout(),t.uncaught=!0,this.fail(e,t),"test"==e.type?(this.emit("test end",e),void this.hookUp("afterEach",this.next)):void this.emit("end")},o.prototype.run=function(t){function e(t){n.uncaught(t)}var n=this,t=t||function(){};return a("start"),this.on("end",function(){a("end"),process.removeListener("uncaughtException",e),t(n.failures)}),this.emit("start"),this.runSuite(this.suite,function(){a("finished running"),n.emit("end")}),process.on("uncaughtException",e),this}}),t.register("suite.js",function(t,e,n){function o(t,e){this.title=t,this.ctx=e,this.suites=[],this.tests=[],this.pending=!1,this._beforeEach=[],this._beforeAll=[],this._afterEach=[],this._afterAll=[],this.root=!t,this._timeout=2e3,this._slow=75,this._bail=!1}function s(){}var r=n("browser/events").EventEmitter,i=n("browser/debug")("mocha:suite"),a=n("./ms"),u=n("./utils"),l=n("./hook");e=t.exports=o,e.create=function(t,e){var n=new o(e,t.ctx);return n.parent=t,t.pending&&(n.pending=!0),e=n.fullTitle(),t.addSuite(n),n},s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o,o.prototype.clone=function(){var t=new o(this.title);return i("clone"),t.ctx=this.ctx,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),t},o.prototype.timeout=function(t){return 0==arguments.length?this._timeout:("string"==typeof t&&(t=a(t)),i("timeout %d",t),this._timeout=parseInt(t,10),this)},o.prototype.slow=function(t){return 0===arguments.length?this._slow:("string"==typeof t&&(t=a(t)),i("slow %d",t),this._slow=t,this)},o.prototype.bail=function(t){return 0==arguments.length?this._bail:(i("bail %s",t),this._bail=t,this)},o.prototype.beforeAll=function(t){if(this.pending)return this;var e=new l('"before all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeAll.push(e),this.emit("beforeAll",e),this},o.prototype.afterAll=function(t){if(this.pending)return this;var e=new l('"after all" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterAll.push(e),this.emit("afterAll",e),this},o.prototype.beforeEach=function(t){if(this.pending)return this;var e=new l('"before each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._beforeEach.push(e),this.emit("beforeEach",e),this},o.prototype.afterEach=function(t){if(this.pending)return this;var e=new l('"after each" hook',t);return e.parent=this,e.timeout(this.timeout()),e.slow(this.slow()),e.ctx=this.ctx,this._afterEach.push(e),this.emit("afterEach",e),this},o.prototype.addSuite=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.bail(this.bail()),this.suites.push(t),this.emit("suite",t),this},o.prototype.addTest=function(t){return t.parent=this,t.timeout(this.timeout()),t.slow(this.slow()),t.ctx=this.ctx,this.tests.push(t),this.emit("test",t),this},o.prototype.fullTitle=function(){if(this.parent){var t=this.parent.fullTitle();if(t)return t+" "+this.title}return this.title},o.prototype.total=function(){return u.reduce(this.suites,function(t,e){return t+e.total()},0)+this.tests.length},o.prototype.eachTest=function(t){return u.forEach(this.tests,t),u.forEach(this.suites,function(e){e.eachTest(t)}),this}}),t.register("test.js",function(t,e,n){function o(t,e){r.call(this,t,e),this.pending=!e,this.type="test"}function s(){}var r=n("./runnable");t.exports=o,s.prototype=r.prototype,o.prototype=new s,o.prototype.constructor=o}),t.register("utils.js",function(t,e,n){function o(t){return!~l.indexOf(t)}function s(t){return t.replace(//g,">").replace(/\/\/(.*)/gm,'//$1').replace(/('.*?')/gm,'$1').replace(/(\d+\.\d+)/gm,'$1').replace(/(\d+)/gm,'$1').replace(/\bnew *(\w+)/gm,'new $1').replace(/\b(function|new|throw|return|var|if|else)\b/gm,'$1')}var r=n("browser/fs"),i=n("browser/path"),a=i.join,u=n("browser/debug")("mocha:watch"),l=["node_modules",".git"];e.escape=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(//g,">")},e.forEach=function(t,e,n){for(var o=0,s=t.length;s>o;o++)e.call(n,t[o],o)},e.indexOf=function(t,e,n){for(var o=n||0,s=t.length;s>o;o++)if(t[o]===e)return o;return-1},e.reduce=function(t,e,n){for(var o=n,s=0,r=t.length;r>s;s++)o=e(o,t[s],s,t);return o},e.filter=function(t,e){for(var n=[],o=0,s=t.length;s>o;o++){var r=t[o];e(r,o,t)&&n.push(r)}return n},e.keys=Object.keys||function(t){var e=[],n=Object.prototype.hasOwnProperty;for(var o in t)n.call(t,o)&&e.push(o);return e},e.watch=function(t,e){var n={interval:100};t.forEach(function(t){u("file %s",t),r.watchFile(t,n,function(n,o){o.mtimen;++n)e[n].innerHTML=s(e[n].innerHTML)}}),process={},process.exit=function(){},process.stdout={},global=window,process.removeListener=function(t){"uncaughtException"==t&&(window.onerror=null)},process.on=function(t,e){"uncaughtException"==t&&(window.onerror=function(t,n,o){e(new Error(t+" ("+n+":"+o+")"))})},function(){function e(){for(var t=(new Date).getTime();r.length&&(new Date).getTime()-t<100;)r.shift()();n=r.length?setTimeout(e,0):null}var n,o=window.Mocha=t("mocha"),s=window.mocha=new o({reporter:"html"}),r=[];o.Runner.immediately=function(t){r.push(t),n||(n=setTimeout(e,0))},s.ui=function(t){return o.prototype.ui.call(this,t),this.suite.emit("pre-require",window,null,this),this},s.setup=function(t){"string"==typeof t&&(t={ui:t});for(var e in t)this[e](t[e]);return this},s.run=function(t){s.options;s.globals("location");var e=o.utils.parseQuery(window.location.search||"");return e.grep&&s.grep(e.grep),e.invert&&s.invert(),o.prototype.run.call(s,function(){o.utils.highlightTags("code"),t&&t()})}}()}(); \ No newline at end of file