Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial commit FTW

  • Loading branch information...
commit 59dfa92f02d65caf6bb7bd77331e29c09b9c1603 0 parents
@stevekinney authored
Showing with 41,607 additions and 0 deletions.
  1. BIN  .DS_Store
  2. +1 −0  .npmignore
  3. +22 −0 LICENSE-MIT
  4. +63 −0 README.md
  5. +26 −0 index.js
  6. +1 −0  node_modules/.bin/_mocha
  7. +1 −0  node_modules/.bin/mocha
  8. +6 −0 node_modules/mocha/.npmignore
  9. +5 −0 node_modules/mocha/.travis.yml
  10. +506 −0 node_modules/mocha/History.md
  11. +22 −0 node_modules/mocha/LICENSE
  12. +129 −0 node_modules/mocha/Makefile
  13. +36 −0 node_modules/mocha/Readme.md
  14. +5,224 −0 node_modules/mocha/_mocha.js
  15. +420 −0 node_modules/mocha/bin/_mocha
  16. +47 −0 node_modules/mocha/bin/mocha
  17. +16 −0 node_modules/mocha/component.json
  18. BIN  node_modules/mocha/images/error.png
  19. BIN  node_modules/mocha/images/ok.png
  20. +4 −0 node_modules/mocha/index.js
  21. +6 −0 node_modules/mocha/lib/browser/debug.js
  22. +287 −0 node_modules/mocha/lib/browser/diff.js
  23. +178 −0 node_modules/mocha/lib/browser/events.js
  24. 0  node_modules/mocha/lib/browser/fs.js
  25. 0  node_modules/mocha/lib/browser/path.js
  26. +125 −0 node_modules/mocha/lib/browser/progress.js
  27. +8 −0 node_modules/mocha/lib/browser/tty.js
  28. +69 −0 node_modules/mocha/lib/context.js
  29. +50 −0 node_modules/mocha/lib/hook.js
  30. +133 −0 node_modules/mocha/lib/interfaces/bdd.js
  31. +60 −0 node_modules/mocha/lib/interfaces/exports.js
  32. +5 −0 node_modules/mocha/lib/interfaces/index.js
  33. +91 −0 node_modules/mocha/lib/interfaces/qunit.js
  34. +123 −0 node_modules/mocha/lib/interfaces/tdd.js
  35. +316 −0 node_modules/mocha/lib/mocha.js
  36. +81 −0 node_modules/mocha/lib/ms.js
  37. +381 −0 node_modules/mocha/lib/reporters/base.js
  38. +56 −0 node_modules/mocha/lib/reporters/doc.js
  39. +62 −0 node_modules/mocha/lib/reporters/dot.js
  40. +51 −0 node_modules/mocha/lib/reporters/html-cov.js
  41. +255 −0 node_modules/mocha/lib/reporters/html.js
  42. +19 −0 node_modules/mocha/lib/reporters/index.js
  43. +153 −0 node_modules/mocha/lib/reporters/json-cov.js
  44. +61 −0 node_modules/mocha/lib/reporters/json-stream.js
  45. +70 −0 node_modules/mocha/lib/reporters/json.js
  46. +97 −0 node_modules/mocha/lib/reporters/landing.js
  47. +64 −0 node_modules/mocha/lib/reporters/list.js
  48. +91 −0 node_modules/mocha/lib/reporters/markdown.js
  49. +38 −0 node_modules/mocha/lib/reporters/min.js
  50. +259 −0 node_modules/mocha/lib/reporters/nyan.js
  51. +86 −0 node_modules/mocha/lib/reporters/progress.js
  52. +87 −0 node_modules/mocha/lib/reporters/spec.js
  53. +73 −0 node_modules/mocha/lib/reporters/tap.js
  54. +65 −0 node_modules/mocha/lib/reporters/teamcity.js
  55. +50 −0 node_modules/mocha/lib/reporters/templates/coverage.jade
  56. +13 −0 node_modules/mocha/lib/reporters/templates/menu.jade
  57. +34 −0 node_modules/mocha/lib/reporters/templates/script.html
  58. +307 −0 node_modules/mocha/lib/reporters/templates/style.html
  59. +115 −0 node_modules/mocha/lib/reporters/xunit.js
  60. +219 −0 node_modules/mocha/lib/runnable.js
  61. +533 −0 node_modules/mocha/lib/runner.js
  62. +296 −0 node_modules/mocha/lib/suite.js
  63. +17 −0 node_modules/mocha/lib/template.html
  64. +32 −0 node_modules/mocha/lib/test.js
  65. +282 −0 node_modules/mocha/lib/utils.js
  66. +231 −0 node_modules/mocha/mocha.css
  67. +5,340 −0 node_modules/mocha/mocha.js
  68. +1 −0  node_modules/mocha/node_modules/.bin/jade
  69. +4 −0 node_modules/mocha/node_modules/commander/.npmignore
  70. +4 −0 node_modules/mocha/node_modules/commander/.travis.yml
  71. +107 −0 node_modules/mocha/node_modules/commander/History.md
  72. +7 −0 node_modules/mocha/node_modules/commander/Makefile
  73. +262 −0 node_modules/mocha/node_modules/commander/Readme.md
  74. +2 −0  node_modules/mocha/node_modules/commander/index.js
  75. +1,026 −0 node_modules/mocha/node_modules/commander/lib/commander.js
  76. +37 −0 node_modules/mocha/node_modules/commander/package.json
  77. +4 −0 node_modules/mocha/node_modules/debug/.npmignore
  78. +62 −0 node_modules/mocha/node_modules/debug/History.md
  79. +115 −0 node_modules/mocha/node_modules/debug/Readme.md
  80. +9 −0 node_modules/mocha/node_modules/debug/component.json
  81. +124 −0 node_modules/mocha/node_modules/debug/debug.js
  82. +19 −0 node_modules/mocha/node_modules/debug/example/app.js
  83. +24 −0 node_modules/mocha/node_modules/debug/example/browser.html
  84. +10 −0 node_modules/mocha/node_modules/debug/example/wildcards.js
  85. +22 −0 node_modules/mocha/node_modules/debug/example/worker.js
  86. +5 −0 node_modules/mocha/node_modules/debug/index.js
  87. +134 −0 node_modules/mocha/node_modules/debug/lib/debug.js
  88. +39 −0 node_modules/mocha/node_modules/debug/package.json
  89. +31 −0 node_modules/mocha/node_modules/diff/LICENSE
  90. +94 −0 node_modules/mocha/node_modules/diff/README.md
  91. +287 −0 node_modules/mocha/node_modules/diff/diff.js
  92. +89 −0 node_modules/mocha/node_modules/diff/index.html
  93. +45 −0 node_modules/mocha/node_modules/diff/package.json
  94. +81 −0 node_modules/mocha/node_modules/diff/style.css
  95. +616 −0 node_modules/mocha/node_modules/diff/test/diffTest.js
  96. +63 −0 node_modules/mocha/node_modules/growl/History.md
  97. +99 −0 node_modules/mocha/node_modules/growl/Readme.md
  98. +234 −0 node_modules/mocha/node_modules/growl/lib/growl.js
  99. +13 −0 node_modules/mocha/node_modules/growl/package.json
  100. +20 −0 node_modules/mocha/node_modules/growl/test.js
  101. +15 −0 node_modules/mocha/node_modules/jade/.npmignore
  102. +22 −0 node_modules/mocha/node_modules/jade/LICENSE
  103. +147 −0 node_modules/mocha/node_modules/jade/bin/jade
  104. +4 −0 node_modules/mocha/node_modules/jade/index.js
  105. +3,586 −0 node_modules/mocha/node_modules/jade/jade.js
  106. +510 −0 node_modules/mocha/node_modules/jade/jade.md
  107. +2 −0  node_modules/mocha/node_modules/jade/jade.min.js
  108. +642 −0 node_modules/mocha/node_modules/jade/lib/compiler.js
  109. +18 −0 node_modules/mocha/node_modules/jade/lib/doctypes.js
  110. +97 −0 node_modules/mocha/node_modules/jade/lib/filters.js
  111. +28 −0 node_modules/mocha/node_modules/jade/lib/inline-tags.js
  112. +237 −0 node_modules/mocha/node_modules/jade/lib/jade.js
  113. +771 −0 node_modules/mocha/node_modules/jade/lib/lexer.js
  114. +77 −0 node_modules/mocha/node_modules/jade/lib/nodes/attrs.js
  115. +33 −0 node_modules/mocha/node_modules/jade/lib/nodes/block-comment.js
  116. +121 −0 node_modules/mocha/node_modules/jade/lib/nodes/block.js
  117. +43 −0 node_modules/mocha/node_modules/jade/lib/nodes/case.js
  118. +35 −0 node_modules/mocha/node_modules/jade/lib/nodes/code.js
  119. +32 −0 node_modules/mocha/node_modules/jade/lib/nodes/comment.js
  120. +29 −0 node_modules/mocha/node_modules/jade/lib/nodes/doctype.js
  121. +35 −0 node_modules/mocha/node_modules/jade/lib/nodes/each.js
  122. +35 −0 node_modules/mocha/node_modules/jade/lib/nodes/filter.js
  123. +20 −0 node_modules/mocha/node_modules/jade/lib/nodes/index.js
  124. +32 −0 node_modules/mocha/node_modules/jade/lib/nodes/literal.js
  125. +36 −0 node_modules/mocha/node_modules/jade/lib/nodes/mixin.js
  126. +25 −0 node_modules/mocha/node_modules/jade/lib/nodes/node.js
  127. +95 −0 node_modules/mocha/node_modules/jade/lib/nodes/tag.js
  128. +36 −0 node_modules/mocha/node_modules/jade/lib/nodes/text.js
  129. +710 −0 node_modules/mocha/node_modules/jade/lib/parser.js
  130. +174 −0 node_modules/mocha/node_modules/jade/lib/runtime.js
  131. +19 −0 node_modules/mocha/node_modules/jade/lib/self-closing.js
  132. +49 −0 node_modules/mocha/node_modules/jade/lib/utils.js
  133. +2 −0  node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.orig
  134. +5 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.rej
  135. +2 −0  node_modules/mocha/node_modules/jade/node_modules/mkdirp/.npmignore
  136. +21 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/LICENSE
  137. +54 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/README.markdown
  138. +6 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js
  139. +6 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig
  140. +19 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej
  141. +79 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/index.js
  142. +35 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/package.json
  143. +38 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/chmod.js
  144. +37 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/clobber.js
  145. +28 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/mkdirp.js
  146. +32 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm.js
  147. +39 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm_sync.js
  148. +41 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/race.js
  149. +32 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/rel.js
  150. +27 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/sync.js
  151. +28 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask.js
  152. +27 −0 node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask_sync.js
  153. +47 −0 node_modules/mocha/node_modules/jade/package.json
  154. +179 −0 node_modules/mocha/node_modules/jade/runtime.js
  155. +1 −0  node_modules/mocha/node_modules/jade/runtime.min.js
  156. +7 −0 node_modules/mocha/node_modules/jade/test.jade
  157. +5 −0 node_modules/mocha/node_modules/jade/testing/head.jade
  158. +22 −0 node_modules/mocha/node_modules/jade/testing/index.jade
  159. +11 −0 node_modules/mocha/node_modules/jade/testing/index.js
  160. +6 −0 node_modules/mocha/node_modules/jade/testing/layout.jade
  161. +7 −0 node_modules/mocha/node_modules/jade/testing/user.jade
  162. +27 −0 node_modules/mocha/node_modules/jade/testing/user.js
  163. +2 −0  node_modules/mocha/node_modules/mkdirp/.gitignore.orig
  164. +5 −0 node_modules/mocha/node_modules/mkdirp/.gitignore.rej
  165. +2 −0  node_modules/mocha/node_modules/mkdirp/.npmignore
  166. +4 −0 node_modules/mocha/node_modules/mkdirp/.travis.yml
  167. +21 −0 node_modules/mocha/node_modules/mkdirp/LICENSE
  168. +61 −0 node_modules/mocha/node_modules/mkdirp/README.markdown
  169. +6 −0 node_modules/mocha/node_modules/mkdirp/examples/pow.js
  170. +6 −0 node_modules/mocha/node_modules/mkdirp/examples/pow.js.orig
  171. +19 −0 node_modules/mocha/node_modules/mkdirp/examples/pow.js.rej
  172. +94 −0 node_modules/mocha/node_modules/mkdirp/index.js
  173. +35 −0 node_modules/mocha/node_modules/mkdirp/package.json
  174. +38 −0 node_modules/mocha/node_modules/mkdirp/test/chmod.js
  175. +37 −0 node_modules/mocha/node_modules/mkdirp/test/clobber.js
  176. +28 −0 node_modules/mocha/node_modules/mkdirp/test/mkdirp.js
  177. +32 −0 node_modules/mocha/node_modules/mkdirp/test/perm.js
  178. +39 −0 node_modules/mocha/node_modules/mkdirp/test/perm_sync.js
  179. +41 −0 node_modules/mocha/node_modules/mkdirp/test/race.js
  180. +32 −0 node_modules/mocha/node_modules/mkdirp/test/rel.js
  181. +25 −0 node_modules/mocha/node_modules/mkdirp/test/return.js
  182. +24 −0 node_modules/mocha/node_modules/mkdirp/test/return_sync.js
  183. +18 −0 node_modules/mocha/node_modules/mkdirp/test/root.js
  184. +32 −0 node_modules/mocha/node_modules/mkdirp/test/sync.js
  185. +28 −0 node_modules/mocha/node_modules/mkdirp/test/umask.js
  186. +32 −0 node_modules/mocha/node_modules/mkdirp/test/umask_sync.js
  187. +1 −0  node_modules/mocha/node_modules/ms/.npmignore
  188. +21 −0 node_modules/mocha/node_modules/ms/History.md
  189. +8 −0 node_modules/mocha/node_modules/ms/Makefile
  190. +24 −0 node_modules/mocha/node_modules/ms/README.md
  191. +7 −0 node_modules/mocha/node_modules/ms/component.json
  192. +81 −0 node_modules/mocha/node_modules/ms/ms.js
  193. +17 −0 node_modules/mocha/node_modules/ms/package.json
  194. +19 −0 node_modules/mocha/node_modules/ms/test/index.html
  195. +9,266 −0 node_modules/mocha/node_modules/ms/test/support/jquery.js
  196. +85 −0 node_modules/mocha/node_modules/ms/test/test.js
  197. +50 −0 node_modules/mocha/package.json
  198. +14 −0 node_modules/mocha/test.js
  199. +1,417 −0 npm-debug.log
  200. +35 −0 package.json
  201. +129 −0 test/test.js
BIN  .DS_Store
Binary file not shown
1  .npmignore
@@ -0,0 +1 @@
+/node_modules/
22 LICENSE-MIT
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Steve Kinney
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
63 README.md
@@ -0,0 +1,63 @@
+# Phone Number Formatter
+
+Parsing and formatting phone numbers so you don't have to.
+
+## Getting Started
+Install the module with: `npm install phone-formatter`
+
+Phone-formatter is pretty straight-forward. First, it can normalize pretty much any format you can throw at it. If it can't, then send a pull request with a failing test and it will (shortly thereafter).
+
+```javascript
+var phoneFormatter = require('phone-formatter');
+
+phoneFormatter.normalize('212.555.1212');
+// returns "2125551212"
+
+phoneFormatter.normalize('+1 (212) 555-1212');
+// returns "2125551212"
+```
+
+You get the idea. It can also format a series of ten digits into almost any format your heart desires. Use the letter "N" as a place holder.
+
+```javascript
+phoneFormatter.format("2125551212", "(NNN) NNN-NNNN");
+// returns "(212) 555-1212"
+```
+
+## Documentation
+
+As it stands, there are only two methods, `normalize` and `format`. They are pretty much fleshed out above. That said, I'm reserving this second for future greatness.
+
+I can confirm that Phone Formatter can normalize the following formats.
+
+* (212) 555 1212
+* (212) 555.1212
+* (212) 555-1212
+* (212) 5551212
+* (212)5551212
+* 212 555 1212
+* 212.555.1212
+* 212-555-1212
+* 1-212-555-1212
+* +1 (212) 555-1212
+* 12125551212
+* +45 (212) 555-1212
+* 212555121
+
+It may handle ever more, but I haven't tested it.
+
+## Contributing
+
+Pull requests are welcome as long as they are accompanied by tests.
+
+Right now, this library is incredibly American-centric and that kind of stinks, but my use case consisted exclusively of American phone numbers. If you'd like to tweak Phone Formatter to better suit your situation, please do!
+
+**Brief Style Guide**: Two spaces, no space before function parentheses, semi-colons everywhere.
+
+## Release History
+
+* 0.0.1: Just two methods and some tests.
+
+## License
+Copyright (c) 2013 Steve Kinney
+Licensed under the MIT license.
26 index.js
@@ -0,0 +1,26 @@
+module.exports = {
+
+ normalize: function extract(phoneNumber) {
+
+ return phoneNumber.replace(
+ /^[\+\d{1,3}\-\s]*\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/,
+ "$1$2$3"
+ );
+
+ },
+
+ format: function format(phoneNumber, formatString, options) {
+
+ if (options && options.normalize === true) {
+ phoneNumber = this.normalize(phoneNumber)
+ };
+
+ for ( var i = 0, l = phoneNumber.length; i < l; i++ ) {
+ formatString = formatString.replace("N", phoneNumber[i]);
+ }
+
+ return formatString;
+
+ },
+
+};
1  node_modules/.bin/_mocha
1  node_modules/.bin/mocha
6 node_modules/mocha/.npmignore
@@ -0,0 +1,6 @@
+test
+examples
+*.sock
+lib-cov
+editors
+support
5 node_modules/mocha/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
+ - 0.8
506 node_modules/mocha/History.md
@@ -0,0 +1,506 @@
+
+1.8.1 / 2013-01-09
+==================
+
+ * fix .bail() arity check causing it to default to true
+
+1.8.0 / 2013-01-08
+==================
+
+ * add Mocha() options bail support
+ * add `Mocha#bail()` method
+ * add instanceof check back for inheriting from Error
+ * add component.json
+ * add diff.js to browser build
+ * update growl
+ * fix TAP reporter failures comment :D
+
+1.7.4 / 2012-12-06
+==================
+
+ * add total number of passes and failures to TAP
+ * remove .bind() calls. re #680
+ * fix indexOf. Closes #680
+
+1.7.3 / 2012-11-30
+==================
+
+ * fix uncaught error support for the browser
+ * revert uncaught "fix" which breaks node
+
+1.7.2 / 2012-11-28
+==================
+
+ * fix uncaught errors to expose the original error message
+
+1.7.0 / 2012-11-07
+==================
+
+ * add `--async-only` support to prevent false positives for missing `done()`
+ * add sorting by filename in code coverage
+ * add HTML 5 doctype to browser template.
+ * add play button to html reporter to rerun a single test
+ * add `this.timeout(ms)` as Suite#timeout(ms). Closes #599
+ * update growl dependency to 1.6.x
+ * fix encoding of test-case ?grep. Closes #637
+ * fix unicode chars on windows
+ * fix dom globals in Opera/IE. Closes #243
+ * fix markdown reporter a tags
+ * fix `this.timeout("5s")` support
+
+1.6.0 / 2012-10-02
+==================
+
+ * add object diffs when `err.showDiff` is present
+ * add hiding of empty suites when pass/failures are toggled
+ * add faster `.length` checks to `checkGlobals()` before performing the filter
+
+1.5.0 / 2012-09-21
+==================
+
+ * add `ms()` to `.slow()` and `.timeout()`
+ * add `Mocha#checkLeaks()` to re-enable global leak checks
+ * add `this.slow()` option [aheckmann]
+ * add tab, CR, LF to error diffs for now
+ * add faster `.checkGlobals()` solution [guille]
+ * remove `fn.call()` from reduce util
+ * remove `fn.call()` from filter util
+ * fix forEach. Closes #582
+ * fix relaying of signals [TooTallNate]
+ * fix TAP reporter grep number
+
+1.4.2 / 2012-09-01
+==================
+
+ * add support to multiple `Mocha#globals()` calls, and strings
+ * add `mocha.reporter()` constructor support [jfirebaugh]
+ * add `mocha.timeout()`
+ * move query-string parser to utils.js
+ * move highlight code to utils.js
+ * fix third-party reporter support [exogen]
+ * fix client-side API to match node-side [jfirebaugh]
+ * fix mocha in iframe [joliss]
+
+1.4.1 / 2012-08-28
+==================
+
+ * add missing `Markdown` export
+ * fix `Mocha#grep()`, escape regexp strings
+ * fix reference error when `devicePixelRatio` is not defined. Closes #549
+
+1.4.0 / 2012-08-22
+==================
+
+ * add mkdir -p to `mocha init`. Closes #539
+ * add `.only()`. Closes #524
+ * add `.skip()`. Closes #524
+ * change str.trim() to use utils.trim(). Closes #533
+ * fix HTML progress indicator retina display
+ * fix url-encoding of click-to-grep HTML functionality
+
+1.3.2 / 2012-08-01
+==================
+
+ * fix exports double-execution regression. Closes #531
+
+1.3.1 / 2012-08-01
+==================
+
+ * add passes/failures toggling to HTML reporter
+ * add pending state to `xit()` and `xdescribe()` [Brian Moore]
+ * add the @charset "UTF-8"; to fix #522 with FireFox. [Jonathan Creamer]
+ * add border-bottom to #stats links
+ * add check for runnable in `Runner#uncaught()`. Closes #494
+ * add 0.4 and 0.6 back to travis.yml
+ * add `-E, --growl-errors` to growl on failures only
+ * add prefixes to debug() names. Closes #497
+ * add `Mocha#invert()` to js api
+ * change dot reporter to use sexy unicode dots
+ * fix error when clicking pending test in HTML reporter
+ * fix `make tm`
+
+1.3.0 / 2012-07-05
+==================
+
+ * add window scrolling to `HTML` reporter
+ * add v8 `--trace-*` option support
+ * add support for custom reports via `--reporter MODULE`
+ * add `--invert` switch to invert `--grep` matches
+ * fix export of `Nyan` reporter. Closes #495
+ * fix escaping of `HTML` suite titles. Closes #486
+ * fix `done()` called multiple times with an error test
+ * change `--grep` - regexp escape the input
+
+1.2.2 / 2012-06-28
+==================
+
+ * Added 0.8.0 support
+
+1.2.1 / 2012-06-25
+==================
+
+ * Added `this.test.error(err)` support to after each hooks. Closes #287
+ * Added: export top-level suite on global mocha object (mocha.suite). Closes #448
+ * Fixed `js` code block format error in markdown reporter
+ * Fixed deprecation warning when using `path.existsSync`
+ * Fixed --globals with wildcard
+ * Fixed chars in nyan when his head moves back
+ * Remove `--growl` from test/mocha.opts. Closes #289
+
+1.2.0 / 2012-06-17
+==================
+
+ * Added `nyan` reporter [Atsuya Takagi]
+ * Added `mocha init <path>` to copy client files
+ * Added "specify" synonym for "it" [domenic]
+ * Added global leak wildcard support [nathanbowser]
+ * Fixed runner emitter leak. closes #432
+ * Fixed omission of .js extension. Closes #454
+
+1.1.0 / 2012-05-30
+==================
+
+ * Added: check each `mocha(1)` arg for directories to walk
+ * Added `--recursive` [tricknotes]
+ * Added `context` for BDD [hokaccha]
+ * Added styling for new clickable titles
+ * Added clickable suite titles to HTML reporter
+ * Added warning when strings are thrown as errors
+ * Changed: green arrows again in HTML reporter styling
+ * Changed ul/li elements instead of divs for better copy-and-pasting [joliss]
+ * Fixed issue #325 - add better grep support to js api
+ * Fixed: save timer references to avoid Sinon interfering.
+
+1.0.3 / 2012-04-30
+==================
+
+ * Fixed string diff newlines
+ * Fixed: removed mocha.css target. Closes #401
+
+1.0.2 / 2012-04-25
+==================
+
+ * Added HTML reporter duration. Closes #47
+ * Fixed: one postMessage event listener [exogen]
+ * Fixed: allow --globals to be used multiple times. Closes #100 [brendannee]
+ * Fixed #158: removes jquery include from browser tests
+ * Fixed grep. Closes #372 [brendannee]
+ * Fixed #166 - When grepping don't display the empty suites
+ * Removed test/browser/style.css. Closes #385
+
+1.0.1 / 2012-04-04
+==================
+
+ * Fixed `.timeout()` in hooks
+ * Fixed: allow callback for `mocha.run()` in client version
+ * Fixed browser hook error display. Closes #361
+
+1.0.0 / 2012-03-24
+==================
+
+ * Added js API. Closes #265
+ * Added: initial run of tests with `--watch`. Closes #345
+ * Added: mark `location` as a global on the CS. Closes #311
+ * Added `markdown` reporter (github flavour)
+ * Added: scrolling menu to coverage.html. Closes #335
+ * Added source line to html report for Safari [Tyson Tate]
+ * Added "min" reporter, useful for `--watch` [Jakub Nešetřil]
+ * Added support for arbitrary compilers via . Closes #338 [Ian Young]
+ * Added Teamcity export to lib/reporters/index [Michael Riley]
+ * Fixed chopping of first char in error reporting. Closes #334 [reported by topfunky]
+ * Fixed terrible FF / Opera stack traces
+
+0.14.1 / 2012-03-06
+==================
+
+ * Added lib-cov to _.npmignore_
+ * Added reporter to `mocha.run([reporter])` as argument
+ * Added some margin-top to the HTML reporter
+ * Removed jQuery dependency
+ * Fixed `--watch`: purge require cache. Closes #266
+
+0.14.0 / 2012-03-01
+==================
+
+ * Added string diff support for terminal reporters
+
+0.13.0 / 2012-02-23
+==================
+
+ * Added preliminary test coverage support. Closes #5
+ * Added `HTMLCov` reporter
+ * Added `JSONCov` reporter [kunklejr]
+ * Added `xdescribe()` and `xit()` to the BDD interface. Closes #263 (docs * Changed: make json reporter output pretty json
+ * Fixed node-inspector support, swapped `--debug` for `debug` to match node.
+needed)
+Closes #247
+
+0.12.1 / 2012-02-14
+==================
+
+ * Added `npm docs mocha` support [TooTallNate]
+ * Added a `Context` object used for hook and test-case this. Closes #253
+ * Fixed `Suite#clone()` `.ctx` reference. Closes #262
+
+0.12.0 / 2012-02-02
+==================
+
+ * Added .coffee `--watch` support. Closes #242
+ * Added support to `--require` files relative to the CWD. Closes #241
+ * Added quick n dirty syntax highlighting. Closes #248
+ * Changed: made HTML progress indicator smaller
+ * Fixed xunit errors attribute [dhendo]
+
+0.10.2 / 2012-01-21
+==================
+
+ * Fixed suite count in reporter stats. Closes #222
+ * Fixed `done()` after timeout error reporting [Phil Sung]
+ * Changed the 0-based errors to 1
+
+0.10.1 / 2012-01-17
+==================
+
+ * Added support for node 0.7.x
+ * Fixed absolute path support. Closes #215 [kompiro]
+ * Fixed `--no-colors` option [Jussi Virtanen]
+ * Fixed Arial CSS typo in the correct file
+
+0.10.0 / 2012-01-13
+==================
+
+ * Added `-b, --bail` to exit on first exception [guillermo]
+ * Added support for `-gc` / `--expose-gc` [TooTallNate]
+ * Added `qunit`-inspired interface
+ * Added MIT LICENSE. Closes #194
+ * Added: `--watch` all .js in the CWD. Closes #139
+ * Fixed `self.test` reference in runner. Closes #189
+ * Fixed double reporting of uncaught exceptions after timeout. Closes #195
+
+0.8.2 / 2012-01-05
+==================
+
+ * Added test-case context support. Closes #113
+ * Fixed exit status. Closes #187
+ * Update commander. Closes #190
+
+0.8.1 / 2011-12-30
+==================
+
+ * Fixed reporting of uncaught exceptions. Closes #183
+ * Fixed error message defaulting [indutny]
+ * Changed mocha(1) from bash to node for windows [Nathan Rajlich]
+
+0.8.0 / 2011-12-28
+==================
+
+ * Added `XUnit` reporter [FeeFighters/visionmedia]
+ * Added `say(1)` notification support [Maciej Małecki]
+ * Changed: fail when done() is invoked with a non-Error. Closes #171
+ * Fixed `err.stack`, defaulting to message. Closes #180
+ * Fixed: `make tm` mkdir -p the dest. Closes #137
+ * Fixed mocha(1) --help bin name
+ * Fixed `-d` for `--debug` support
+
+0.7.1 / 2011-12-22
+==================
+
+ * Removed `mocha-debug(1)`, use `mocha --debug`
+ * Fixed CWD relative requires
+ * Fixed growl issue on windows [Raynos]
+ * Fixed: platform specific line endings [TooTallNate]
+ * Fixed: escape strings in HTML reporter. Closes #164
+
+0.7.0 / 2011-12-18
+==================
+
+ * Added support for IE{7,8} [guille]
+ * Changed: better browser nextTick implementation [guille]
+
+0.6.0 / 2011-12-18
+==================
+
+ * Added setZeroTimeout timeout for browser (nicer stack traces). Closes #153
+ * Added "view source" on hover for HTML reporter to make it obvious
+ * Changed: replace custom growl with growl lib
+ * Fixed duplicate reporting for HTML reporter. Closes #154
+ * Fixed silent hook errors in the HTML reporter. Closes #150
+
+0.5.0 / 2011-12-14
+==================
+
+ * Added: push node_modules directory onto module.paths for relative require Closes #93
+ * Added teamcity reporter [blindsey]
+ * Fixed: recover from uncaught exceptions for tests. Closes #94
+ * Fixed: only emit "test end" for uncaught within test, not hook
+
+0.4.0 / 2011-12-14
+==================
+
+ * Added support for test-specific timeouts via `this.timeout(0)`. Closes #134
+ * Added guillermo's client-side EventEmitter. Closes #132
+ * Added progress indicator to the HTML reporter
+ * Fixed slow browser tests. Closes #135
+ * Fixed "suite" color for light terminals
+ * Fixed `require()` leak spotted by [guillermo]
+
+0.3.6 / 2011-12-09
+==================
+
+ * Removed suite merging (for now)
+
+0.3.5 / 2011-12-08
+==================
+
+ * Added support for `window.onerror` [guillermo]
+ * Fixed: clear timeout on uncaught exceptions. Closes #131 [guillermo]
+ * Added `mocha.css` to PHONY list.
+ * Added `mocha.js` to PHONY list.
+
+0.3.4 / 2011-12-08
+==================
+
+ * Added: allow `done()` to be called with non-Error
+ * Added: return Runner from `mocha.run()`. Closes #126
+ * Fixed: run afterEach even on failures. Closes #125
+ * Fixed clobbering of current runnable. Closes #121
+
+0.3.3 / 2011-12-08
+==================
+
+ * Fixed hook timeouts. Closes #120
+ * Fixed uncaught exceptions in hooks
+
+0.3.2 / 2011-12-05
+==================
+
+ * Fixed weird reporting when `err.message` is not present
+
+0.3.1 / 2011-12-04
+==================
+
+ * Fixed hook event emitter leak. Closes #117
+ * Fixed: export `Spec` constructor. Closes #116
+
+0.3.0 / 2011-12-04
+==================
+
+ * Added `-w, --watch`. Closes #72
+ * Added `--ignore-leaks` to ignore global leak checking
+ * Added browser `?grep=pattern` support
+ * Added `--globals <names>` to specify accepted globals. Closes #99
+ * Fixed `mocha-debug(1)` on some systems. Closes #232
+ * Fixed growl total, use `runner.total`
+
+0.2.0 / 2011-11-30
+==================
+
+ * Added `--globals <names>` to specify accepted globals. Closes #99
+ * Fixed funky highlighting of messages. Closes #97
+ * Fixed `mocha-debug(1)`. Closes #232
+ * Fixed growl total, use runner.total
+
+0.1.0 / 2011-11-29
+==================
+
+ * Added `suiteSetup` and `suiteTeardown` to TDD interface [David Henderson]
+ * Added growl icons. Closes #84
+ * Fixed coffee-script support
+
+0.0.8 / 2011-11-25
+==================
+
+ * Fixed: use `Runner#total` for accurate reporting
+
+0.0.7 / 2011-11-25
+==================
+
+ * Added `Hook`
+ * Added `Runnable`
+ * Changed: `Test` is `Runnable`
+ * Fixed global leak reporting in hooks
+ * Fixed: > 2 calls to done() only report the error once
+ * Fixed: clear timer on failure. Closes #80
+
+0.0.6 / 2011-11-25
+==================
+
+ * Fixed return on immediate async error. Closes #80
+
+0.0.5 / 2011-11-24
+==================
+
+ * Fixed: make mocha.opts whitespace less picky [kkaefer]
+
+0.0.4 / 2011-11-24
+==================
+
+ * Added `--interfaces`
+ * Added `--reporters`
+ * Added `-c, --colors`. Closes #69
+ * Fixed hook timeouts
+
+0.0.3 / 2011-11-23
+==================
+
+ * Added `-C, --no-colors` to explicitly disable
+ * Added coffee-script support
+
+0.0.2 / 2011-11-22
+==================
+
+ * Fixed global leak detection due to Safari bind() change
+ * Fixed: escape html entities in Doc reporter
+ * Fixed: escape html entities in HTML reporter
+ * Fixed pending test support for HTML reporter. Closes #66
+
+0.0.1 / 2011-11-22
+==================
+
+ * Added `--timeout` second shorthand support, ex `--timeout 3s`.
+ * Fixed "test end" event for uncaughtExceptions. Closes #61
+
+0.0.1-alpha6 / 2011-11-19
+==================
+
+ * Added travis CI support (needs enabling when public)
+ * Added preliminary browser support
+ * Added `make mocha.css` target. Closes #45
+ * Added stack trace to TAP errors. Closes #52
+ * Renamed tearDown to teardown. Closes #49
+ * Fixed: cascading hooksc. Closes #30
+ * Fixed some colors for non-tty
+ * Fixed errors thrown in sync test-cases due to nextTick
+ * Fixed Base.window.width... again give precedence to 0.6.x
+
+0.0.1-alpha5 / 2011-11-17
+==================
+
+ * Added `doc` reporter. Closes #33
+ * Added suite merging. Closes #28
+ * Added TextMate bundle and `make tm`. Closes #20
+
+0.0.1-alpha4 / 2011-11-15
+==================
+
+ * Fixed getWindowSize() for 0.4.x
+
+0.0.1-alpha3 / 2011-11-15
+==================
+
+ * Added `-s, --slow <ms>` to specify "slow" test threshold
+ * Added `mocha-debug(1)`
+ * Added `mocha.opts` support. Closes #31
+ * Added: default [files] to _test/*.js_
+ * Added protection against multiple calls to `done()`. Closes #35
+ * Changed: bright yellow for slow Dot reporter tests
+
+0.0.1-alpha1 / 2011-11-08
+==================
+
+ * Missed this one :)
+
+0.0.1-alpha1 / 2011-11-08
+==================
+
+ * Initial release
22 node_modules/mocha/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2011-2013 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
129 node_modules/mocha/Makefile
@@ -0,0 +1,129 @@
+
+REPORTER ?= dot
+TM_DEST = ~/Library/Application\ Support/TextMate/Bundles
+TM_BUNDLE = JavaScript\ mocha.tmbundle
+SRC = $(shell find lib -name "*.js" -type f | sort)
+SUPPORT = $(wildcard support/*.js)
+
+all: mocha.js
+
+lib/browser/diff.js: node_modules/diff/diff.js
+ cp node_modules/diff/diff.js lib/browser/diff.js
+
+mocha.js: $(SRC) $(SUPPORT) lib/browser/diff.js
+ @node support/compile $(SRC)
+ @cat \
+ support/head.js \
+ _mocha.js \
+ support/tail.js \
+ support/foot.js \
+ > mocha.js
+
+clean:
+ rm -f mocha.js
+ rm -fr lib-cov
+ rm -f coverage.html
+
+test-cov: lib-cov
+ @COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
+
+lib-cov:
+ @rm -fr ./$@
+ @jscoverage lib $@
+
+test: test-unit
+
+test-all: test-bdd test-tdd test-qunit test-exports test-unit test-grep test-jsapi test-compilers
+
+test-jsapi:
+ @node test/jsapi
+
+test-unit:
+ @./bin/mocha \
+ --reporter $(REPORTER) \
+ test/acceptance/*.js \
+ test/*.js
+
+test-compilers:
+ @./bin/mocha \
+ --reporter $(REPORTER) \
+ --compilers coffee:coffee-script,foo:./test/compiler/foo \
+ test/acceptance/test.coffee \
+ test/acceptance/test.foo
+
+test-bdd:
+ @./bin/mocha \
+ --reporter $(REPORTER) \
+ --ui bdd \
+ test/acceptance/interfaces/bdd
+
+test-tdd:
+ @./bin/mocha \
+ --reporter $(REPORTER) \
+ --ui tdd \
+ test/acceptance/interfaces/tdd
+
+test-qunit:
+ @./bin/mocha \
+ --reporter $(REPORTER) \
+ --ui qunit \
+ test/acceptance/interfaces/qunit
+
+test-exports:
+ @./bin/mocha \
+ --reporter $(REPORTER) \
+ --ui exports \
+ test/acceptance/interfaces/exports
+
+test-grep:
+ @./bin/mocha \
+ --reporter $(REPORTER) \
+ --grep fast \
+ test/acceptance/misc/grep
+
+test-invert:
+ @./bin/mocha \
+ --reporter $(REPORTER) \
+ --grep slow \
+ --invert \
+ test/acceptance/misc/grep
+
+test-bail:
+ @./bin/mocha \
+ --reporter $(REPORTER) \
+ --bail \
+ test/acceptance/misc/bail
+
+test-async-only:
+ @./bin/mocha \
+ --reporter $(REPORTER) \
+ --async-only \
+ test/acceptance/misc/asyncOnly
+
+non-tty:
+ @./bin/mocha \
+ --reporter dot \
+ test/acceptance/interfaces/bdd 2>&1 > /tmp/dot.out
+
+ @echo dot:
+ @cat /tmp/dot.out
+
+ @./bin/mocha \
+ --reporter list \
+ test/acceptance/interfaces/bdd 2>&1 > /tmp/list.out
+
+ @echo list:
+ @cat /tmp/list.out
+
+ @./bin/mocha \
+ --reporter spec \
+ test/acceptance/interfaces/bdd 2>&1 > /tmp/spec.out
+
+ @echo spec:
+ @cat /tmp/spec.out
+
+tm:
+ mkdir -p $(TM_DEST)
+ cp -fr editors/$(TM_BUNDLE) $(TM_DEST)
+
+.PHONY: test-cov test-jsapi test-compilers watch test test-all test-bdd test-tdd test-qunit test-exports test-unit non-tty test-grep tm clean
36 node_modules/mocha/Readme.md
@@ -0,0 +1,36 @@
+ [![Build Status](https://secure.travis-ci.org/visionmedia/mocha.png)](http://travis-ci.org/visionmedia/mocha)
+
+ [![Mocha test framework](http://f.cl.ly/items/3l1k0n2A1U3M1I1L210p/Screen%20Shot%202012-02-24%20at%202.21.43%20PM.png)](http://visionmedia.github.com/mocha)
+
+ Mocha is a simple, flexible, fun JavaScript test framework for node.js and the browser. For more information view the [documentation](http://visionmedia.github.com/mocha).
+
+## Contributors
+
+```
+
+project : mocha
+repo age : 1 year, 3 months
+active : 233 days
+commits : 1034
+files : 114
+authors :
+ 451 TJ Holowaychuk 43.6%
+ 389 Tj Holowaychuk 37.6%
+ 31 Guillermo Rauch 3.0%
+ 13 Attila Domokos 1.3%
+ 8 Jo Liss 0.8%
+ 7 Nathan Rajlich 0.7%
+ 6 James Carr 0.6%
+ 6 Brendan Nee 0.6%
+ 5 John Firebaugh 0.5%
+ 5 Aaron Heckmann 0.5%
+ 4 Joshua Krall 0.4%
+ 4 Xavier Antoviaque 0.4%
+ 4 hokaccha 0.4%
+```
+
+## Links
+
+ - [Google Group](http://groups.google.com/group/mochajs)
+ - [Wiki](https://github.com/visionmedia/mocha/wiki)
+ - Mocha [Extensions and reporters](https://github.com/visionmedia/mocha/wiki)
5,224 node_modules/mocha/_mocha.js
5,224 additions, 0 deletions not shown
420 node_modules/mocha/bin/_mocha
@@ -0,0 +1,420 @@
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander')
+ , path = require('path')
+ , fs = require('fs')
+ , resolve = path.resolve
+ , exists = fs.existsSync || path.existsSync
+ , Mocha = require('../')
+ , utils = Mocha.utils
+ , reporters = Mocha.reporters
+ , interfaces = Mocha.interfaces
+ , Base = reporters.Base
+ , join = path.join
+ , basename = path.basename
+ , cwd = process.cwd()
+ , mocha = new Mocha;
+
+/**
+ * Save timer references to avoid Sinon interfering (see GH-237).
+ */
+
+var Date = global.Date
+ , setTimeout = global.setTimeout
+ , setInterval = global.setInterval
+ , clearTimeout = global.clearTimeout
+ , clearInterval = global.clearInterval;
+
+/**
+ * Files.
+ */
+
+var files = [];
+
+/**
+ * Globals.
+ */
+
+var globals = [];
+
+/**
+ * Images.
+ */
+
+var images = {
+ fail: __dirname + '/../images/error.png'
+ , pass: __dirname + '/../images/ok.png'
+};
+
+// options
+
+program
+ .version(JSON.parse(fs.readFileSync(__dirname + '/../package.json', 'utf8')).version)
+ .usage('[debug] [options] [files]')
+ .option('-r, --require <name>', 'require the given module')
+ .option('-R, --reporter <name>', 'specify the reporter to use', 'dot')
+ .option('-u, --ui <name>', 'specify user-interface (bdd|tdd|exports)', 'bdd')
+ .option('-g, --grep <pattern>', 'only run tests matching <pattern>')
+ .option('-i, --invert', 'inverts --grep matches')
+ .option('-t, --timeout <ms>', 'set test-case timeout in milliseconds [2000]')
+ .option('-s, --slow <ms>', '"slow" test threshold in milliseconds [75]')
+ .option('-w, --watch', 'watch files for changes')
+ .option('-c, --colors', 'force enabling of colors')
+ .option('-C, --no-colors', 'force disabling of colors')
+ .option('-G, --growl', 'enable growl notification support')
+ .option('-d, --debug', "enable node's debugger, synonym for node --debug")
+ .option('-b, --bail', "bail after first test failure")
+ .option('-A, --async-only', "force all tests to take a callback (async)")
+ .option('--recursive', 'include sub directories')
+ .option('--debug-brk', "enable node's debugger breaking on the first line")
+ .option('--globals <names>', 'allow the given comma-delimited global [names]', list, [])
+ .option('--ignore-leaks', 'ignore global variable leaks')
+ .option('--interfaces', 'display available interfaces')
+ .option('--reporters', 'display available reporters')
+ .option('--compilers <ext>:<module>,...', 'use the given module(s) to compile files', list, [])
+
+program.name = 'mocha';
+
+// init command
+
+program
+ .command('init <path>')
+ .description('initialize a client-side mocha setup at <path>')
+ .action(function(path){
+ var mkdir = require('mkdirp');
+ mkdir.sync(path);
+ var css = fs.readFileSync(join(__dirname, '..', 'mocha.css'));
+ var js = fs.readFileSync(join(__dirname, '..', 'mocha.js'));
+ var tmpl = fs.readFileSync(join(__dirname, '..', 'lib/template.html'));
+ fs.writeFileSync(join(path, 'mocha.css'), css);
+ fs.writeFileSync(join(path, 'mocha.js'), js);
+ fs.writeFileSync(join(path, 'tests.html'), tmpl);
+ process.exit(0);
+ });
+
+// --globals
+
+program.on('globals', function(val){
+ globals = globals.concat(list(val));
+});
+
+// --reporters
+
+program.on('reporters', function(){
+ console.log();
+ console.log(' dot - dot matrix');
+ console.log(' doc - html documentation');
+ console.log(' spec - hierarchical spec list');
+ console.log(' json - single json object');
+ console.log(' progress - progress bar');
+ console.log(' list - spec-style listing');
+ console.log(' tap - test-anything-protocol');
+ console.log(' landing - unicode landing strip');
+ console.log(' xunit - xunit reportert');
+ console.log(' teamcity - teamcity ci support');
+ console.log(' html-cov - HTML test coverage');
+ console.log(' json-cov - JSON test coverage');
+ console.log(' min - minimal reporter (great with --watch)');
+ console.log(' json-stream - newline delimited json events');
+ console.log(' markdown - markdown documentation (github flavour)');
+ console.log(' nyan - nyan cat!');
+ console.log();
+ process.exit();
+});
+
+// --interfaces
+
+program.on('interfaces', function(){
+ console.log('');
+ console.log(' bdd');
+ console.log(' tdd');
+ console.log(' qunit');
+ console.log(' exports');
+ console.log('');
+ process.exit();
+});
+
+// -r, --require
+
+module.paths.push(cwd, join(cwd, 'node_modules'));
+
+program.on('require', function(mod){
+ var abs = exists(mod)
+ || exists(mod + '.js');
+
+ if (abs) mod = join(cwd, mod);
+ require(mod);
+});
+
+// mocha.opts support
+
+try {
+ var opts = fs.readFileSync('test/mocha.opts', 'utf8')
+ .trim()
+ .split(/\s+/);
+
+ process.argv = process.argv
+ .slice(0, 2)
+ .concat(opts.concat(process.argv.slice(2)));
+} catch (err) {
+ // ignore
+}
+
+// parse args
+
+program.parse(process.argv);
+
+// infinite stack traces
+
+Error.stackTraceLimit = Infinity; // TODO: config
+
+// reporter
+
+mocha.reporter(program.reporter);
+
+// interface
+
+mocha.ui(program.ui);
+
+// load reporter
+
+try {
+ Reporter = require('../lib/reporters/' + program.reporter);
+} catch (err) {
+ try {
+ Reporter = require(program.reporter);
+ } catch (err) {
+ throw new Error('reporter "' + program.reporter + '" does not exist');
+ }
+}
+
+// --no-colors
+
+if (!program.colors) Base.useColors = false;
+
+// --colors
+
+if (~process.argv.indexOf('--colors') ||
+ ~process.argv.indexOf('-c')) {
+ Base.useColors = true;
+}
+
+// --slow <ms>
+
+if (program.slow) mocha.suite.slow(program.slow);
+
+// --timeout
+
+if (program.timeout) mocha.suite.timeout(program.timeout);
+
+// --bail
+
+mocha.suite.bail(program.bail);
+
+// --grep
+
+if (program.grep) mocha.grep(new RegExp(program.grep));
+
+// --invert
+
+if (program.invert) mocha.invert();
+
+// --ignore-leaks
+
+if (program.ignoreLeaks) mocha.ignoreLeaks();
+
+// --growl
+
+if (program.growl) mocha.growl();
+
+// --async-only
+
+if (program.asyncOnly) mocha.asyncOnly();
+
+// --globals
+
+mocha.globals(globals);
+
+// custom compiler support
+
+var extensions = ['js'];
+program.compilers.forEach(function(c) {
+ var compiler = c.split(':')
+ , ext = compiler[0]
+ , mod = compiler[1];
+
+ if (mod[0] == '.') mod = join(process.cwd(), mod);
+ require(mod);
+ extensions.push(ext);
+});
+
+var re = new RegExp('\\.(' + extensions.join('|') + ')$');
+
+// files
+
+var files = []
+ , args = program.args;
+
+// default files to test/*.{js,coffee}
+
+if (!args.length) args.push('test');
+
+args.forEach(function(arg){
+ files = files.concat(lookupFiles(arg, program.recursive));
+});
+
+// resolve
+
+files = files.map(function(path){
+ return resolve(path);
+});
+
+// --watch
+
+if (program.watch) {
+ console.log();
+ hideCursor();
+ process.on('SIGINT', function(){
+ showCursor();
+ console.log('\n');
+ process.exit();
+ });
+
+ var frames = [
+ ' \u001b[96m◜ \u001b[90mwatching\u001b[0m'
+ , ' \u001b[96m◠ \u001b[90mwatching\u001b[0m'
+ , ' \u001b[96m◝ \u001b[90mwatching\u001b[0m'
+ , ' \u001b[96m◞ \u001b[90mwatching\u001b[0m'
+ , ' \u001b[96m◡ \u001b[90mwatching\u001b[0m'
+ , ' \u001b[96m◟ \u001b[90mwatching\u001b[0m'
+ ];
+
+ var watchFiles = utils.files(cwd);
+
+ function loadAndRun() {
+ mocha.files = files;
+ mocha.run(function(){
+ play(frames);
+ });
+ }
+
+ function purge() {
+ watchFiles.forEach(function(file){
+ delete require.cache[file];
+ });
+ }
+
+ loadAndRun();
+
+ utils.watch(watchFiles, function(){
+ purge();
+ stop()
+ mocha.suite = mocha.suite.clone();
+ mocha.ui(program.ui);
+ loadAndRun();
+ });
+
+ return;
+}
+
+// load
+
+mocha.files = files;
+mocha.run(process.exit);
+
+// enable growl notifications
+
+function growl(runner, reporter) {
+ var notify = require('growl');
+
+ runner.on('end', function(){
+ var stats = reporter.stats;
+ if (stats.failures) {
+ var msg = stats.failures + ' of ' + runner.total + ' tests failed';
+ notify(msg, { name: 'mocha', title: 'Failed', image: images.fail });
+ } else {
+ notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', {
+ name: 'mocha'
+ , title: 'Passed'
+ , image: images.pass
+ });
+ }
+ });
+}
+
+/**
+ * Parse list.
+ */
+
+function list(str) {
+ return str.split(/ *, */);
+}
+
+/**
+ * Hide the cursor.
+ */
+
+function hideCursor(){
+ process.stdout.write('\u001b[?25l');
+};
+
+/**
+ * Show the cursor.
+ */
+
+function showCursor(){
+ process.stdout.write('\u001b[?25h');
+};
+
+/**
+ * Stop play()ing.
+ */
+
+function stop() {
+ process.stdout.write('\u001b[2K');
+ clearInterval(play.timer);
+}
+
+/**
+ * Lookup file names at the given `path`.
+ */
+
+function lookupFiles(path, recursive) {
+ var files = [];
+
+ if (!exists(path)) path += '.js';
+ var stat = fs.statSync(path);
+ if (stat.isFile()) return path;
+
+ fs.readdirSync(path).forEach(function(file){
+ file = join(path, file);
+ var stat = fs.statSync(file);
+ if (stat.isDirectory()) {
+ if (recursive) files = files.concat(lookupFiles(file, recursive));
+ return
+ }
+ if (!stat.isFile() || !re.test(file) || basename(file)[0] == '.') return;
+ files.push(file);
+ });
+
+ return files;
+}
+
+/**
+ * Play the given array of strings.
+ */
+
+function play(arr, interval) {
+ var len = arr.length
+ , interval = interval || 100
+ , i = 0;
+
+ play.timer = setInterval(function(){
+ var str = arr[i++ % len];
+ process.stdout.write('\r' + str);
+ }, interval);
+}
47 node_modules/mocha/bin/mocha
@@ -0,0 +1,47 @@
+#!/usr/bin/env node
+
+/**
+ * This tiny wrapper file checks for known node flags and appends them
+ * when found, before invoking the "real" _mocha(1) executable.
+ */
+
+var spawn = require('child_process').spawn
+ , args = [ __dirname + '/_mocha' ];
+
+process.argv.slice(2).forEach(function (arg) {
+ switch (arg) {
+ case '-d':
+ args.unshift('--debug');
+ break;
+ case 'debug':
+ case '--debug':
+ case '--debug-brk':
+ args.unshift(arg);
+ break;
+ case '-gc':
+ case '--expose-gc':
+ args.unshift('--expose-gc');
+ break;
+ case '--gc-global':
+ case '--harmony':
+ case '--harmony-proxies':
+ case '--harmony-collections':
+ args.unshift(arg);
+ break;
+ default:
+ if (0 == arg.indexOf('--trace')) args.unshift(arg);
+ else args.push(arg);
+ break;
+ }
+});
+
+var proc = spawn(process.argv[0], args, { customFds: [0,1,2] });
+proc.on('exit', function (code, signal) {
+ process.on('exit', function(){
+ if (signal) {
+ process.kill(process.pid, signal);
+ } else {
+ process.exit(code);
+ }
+ });
+});
16 node_modules/mocha/component.json
@@ -0,0 +1,16 @@
+{
+ "name": "mocha",
+ "version": "1.8.1",
+ "repo": "visionmedia/mocha",
+ "description": "simple, flexible, fun test framework",
+ "keywords": [
+ "mocha",
+ "test",
+ "bdd",
+ "tdd",
+ "tap"
+ ],
+ "main": "mocha.js",
+ "scripts": ["mocha.js"],
+ "styles": ["mocha.css"]
+}
BIN  node_modules/mocha/images/error.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  node_modules/mocha/images/ok.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 node_modules/mocha/index.js
@@ -0,0 +1,4 @@
+
+module.exports = process.env.COV
+ ? require('./lib-cov/mocha')
+ : require('./lib/mocha');
6 node_modules/mocha/lib/browser/debug.js
@@ -0,0 +1,6 @@
+
+module.exports = function(type){
+ return function(){
+
+ }
+};
287 node_modules/mocha/lib/browser/diff.js
@@ -0,0 +1,287 @@
+/* See license.txt for terms of usage */
+
+/*
+ * Text diff implementation.
+ *
+ * This library supports the following APIS:
+ * JsDiff.diffChars: Character by character diff
+ * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace
+ * JsDiff.diffLines: Line based diff
+ *
+ * JsDiff.diffCss: Diff targeted at CSS content
+ *
+ * These methods are based on the implementation proposed in
+ * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986).
+ * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927
+ */
+var JsDiff = (function() {
+ function clonePath(path) {
+ return { newPos: path.newPos, components: path.components.slice(0) };
+ }
+ function removeEmpty(array) {
+ var ret = [];
+ for (var i = 0; i < array.length; i++) {
+ if (array[i]) {
+ ret.push(array[i]);
+ }
+ }
+ return ret;
+ }
+ function escapeHTML(s) {
+ var n = s;
+ n = n.replace(/&/g, "&amp;");
+ n = n.replace(/</g, "&lt;");
+ n = n.replace(/>/g, "&gt;");
+ n = n.replace(/"/g, "&quot;");
+
+ return n;
+ }
+
+
+ var fbDiff = function(ignoreWhitespace) {
+ this.ignoreWhitespace = ignoreWhitespace;
+ };
+ fbDiff.prototype = {
+ diff: function(oldString, newString) {
+ // Handle the identity case (this is due to unrolling editLength == 0
+ if (newString == oldString) {
+ return [{ value: newString }];
+ }
+ if (!newString) {
+ return [{ value: oldString, removed: true }];
+ }
+ if (!oldString) {
+ return [{ value: newString, added: true }];
+ }
+
+ newString = this.tokenize(newString);
+ oldString = this.tokenize(oldString);
+
+ var newLen = newString.length, oldLen = oldString.length;
+ var maxEditLength = newLen + oldLen;
+ var bestPath = [{ newPos: -1, components: [] }];
+
+ // Seed editLength = 0
+ var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
+ if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) {
+ return bestPath[0].components;
+ }
+
+ for (var editLength = 1; editLength <= maxEditLength; editLength++) {
+ for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) {
+ var basePath;
+ var addPath = bestPath[diagonalPath-1],
+ removePath = bestPath[diagonalPath+1];
+ oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
+ if (addPath) {
+ // No one else is going to attempt to use this value, clear it
+ bestPath[diagonalPath-1] = undefined;
+ }
+
+ var canAdd = addPath && addPath.newPos+1 < newLen;
+ var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;
+ if (!canAdd && !canRemove) {
+ bestPath[diagonalPath] = undefined;
+ continue;
+ }
+
+ // Select the diagonal that we want to branch from. We select the prior
+ // path whose position in the new string is the farthest from the origin
+ // and does not pass the bounds of the diff graph
+ if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {
+ basePath = clonePath(removePath);
+ this.pushComponent(basePath.components, oldString[oldPos], undefined, true);
+ } else {
+ basePath = clonePath(addPath);
+ basePath.newPos++;
+ this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined);
+ }
+
+ var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath);
+
+ if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) {
+ return basePath.components;
+ } else {
+ bestPath[diagonalPath] = basePath;
+ }
+ }
+ }
+ },
+
+ pushComponent: function(components, value, added, removed) {
+ var last = components[components.length-1];
+ if (last && last.added === added && last.removed === removed) {
+ // We need to clone here as the component clone operation is just
+ // as shallow array clone
+ components[components.length-1] =
+ {value: this.join(last.value, value), added: added, removed: removed };
+ } else {
+ components.push({value: value, added: added, removed: removed });
+ }
+ },
+ extractCommon: function(basePath, newString, oldString, diagonalPath) {
+ var newLen = newString.length,
+ oldLen = oldString.length,
+ newPos = basePath.newPos,
+ oldPos = newPos - diagonalPath;
+ while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) {
+ newPos++;
+ oldPos++;
+
+ this.pushComponent(basePath.components, newString[newPos], undefined, undefined);
+ }
+ basePath.newPos = newPos;
+ return oldPos;
+ },
+
+ equals: function(left, right) {
+ var reWhitespace = /\S/;
+ if (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right)) {
+ return true;
+ } else {
+ return left == right;
+ }
+ },
+ join: function(left, right) {
+ return left + right;
+ },
+ tokenize: function(value) {
+ return value;
+ }
+ };
+
+ var CharDiff = new fbDiff();
+
+ var WordDiff = new fbDiff(true);
+ WordDiff.tokenize = function(value) {
+ return removeEmpty(value.split(/(\s+|\b)/));
+ };
+
+ var CssDiff = new fbDiff(true);
+ CssDiff.tokenize = function(value) {
+ return removeEmpty(value.split(/([{}:;,]|\s+)/));
+ };
+
+ var LineDiff = new fbDiff();
+ LineDiff.tokenize = function(value) {
+ return value.split(/^/m);
+ };
+
+ return {
+ diffChars: function(oldStr, newStr) { return CharDiff.diff(oldStr, newStr); },
+ diffWords: function(oldStr, newStr) { return WordDiff.diff(oldStr, newStr); },
+ diffLines: function(oldStr, newStr) { return LineDiff.diff(oldStr, newStr); },
+
+ diffCss: function(oldStr, newStr) { return CssDiff.diff(oldStr, newStr); },
+
+ createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) {
+ var ret = [];
+
+ ret.push("Index: " + fileName);
+ ret.push("===================================================================");
+ ret.push("--- " + fileName + (typeof oldHeader === "undefined" ? "" : "\t" + oldHeader));
+ ret.push("+++ " + fileName + (typeof newHeader === "undefined" ? "" : "\t" + newHeader));
+
+ var diff = LineDiff.diff(oldStr, newStr);
+ if (!diff[diff.length-1].value) {
+ diff.pop(); // Remove trailing newline add
+ }
+ diff.push({value: "", lines: []}); // Append an empty value to make cleanup easier
+
+ function contextLines(lines) {
+ return lines.map(function(entry) { return ' ' + entry; });
+ }
+ function eofNL(curRange, i, current) {
+ var last = diff[diff.length-2],
+ isLast = i === diff.length-2,
+ isLastOfType = i === diff.length-3 && (current.added === !last.added || current.removed === !last.removed);
+
+ // Figure out if this is the last line for the given file and missing NL
+ if (!/\n$/.test(current.value) && (isLast || isLastOfType)) {
+ curRange.push('\\ No newline at end of file');
+ }
+ }
+
+ var oldRangeStart = 0, newRangeStart = 0, curRange = [],
+ oldLine = 1, newLine = 1;
+ for (var i = 0; i < diff.length; i++) {
+ var current = diff[i],
+ lines = current.lines || current.value.replace(/\n$/, "").split("\n");
+ current.lines = lines;
+
+ if (current.added || current.removed) {
+ if (!oldRangeStart) {
+ var prev = diff[i-1];
+ oldRangeStart = oldLine;
+ newRangeStart = newLine;
+
+ if (prev) {
+ curRange = contextLines(prev.lines.slice(-4));
+ oldRangeStart -= curRange.length;
+ newRangeStart -= curRange.length;
+ }
+ }
+ curRange.push.apply(curRange, lines.map(function(entry) { return (current.added?"+":"-") + entry; }));
+ eofNL(curRange, i, current);
+
+ if (current.added) {
+ newLine += lines.length;
+ } else {
+ oldLine += lines.length;
+ }
+ } else {
+ if (oldRangeStart) {
+ // Close out any changes that have been output (or join overlapping)
+ if (lines.length <= 8 && i < diff.length-2) {
+ // Overlapping
+ curRange.push.apply(curRange, contextLines(lines));
+ } else {
+ // end the range and output
+ var contextSize = Math.min(lines.length, 4);
+ ret.push(
+ "@@ -" + oldRangeStart + "," + (oldLine-oldRangeStart+contextSize)
+ + " +" + newRangeStart + "," + (newLine-newRangeStart+contextSize)
+ + " @@");
+ ret.push.apply(ret, curRange);
+ ret.push.apply(ret, contextLines(lines.slice(0, contextSize)));
+ if (lines.length <= 4) {
+ eofNL(ret, i, current);
+ }
+
+ oldRangeStart = 0; newRangeStart = 0; curRange = [];
+ }
+ }
+ oldLine += lines.length;
+ newLine += lines.length;
+ }
+ }
+
+ return ret.join('\n') + '\n';
+ },
+
+ convertChangesToXML: function(changes){
+ var ret = [];
+ for ( var i = 0; i < changes.length; i++) {
+ var change = changes[i];
+ if (change.added) {
+ ret.push("<ins>");
+ } else if (change.removed) {
+ ret.push("<del>");
+ }
+
+ ret.push(escapeHTML(change.value));
+
+ if (change.added) {
+ ret.push("</ins>");
+ } else if (change.removed) {
+ ret.push("</del>");
+ }
+ }
+ return ret.join("");
+ }
+ };
+})();
+
+if (typeof module !== "undefined") {
+ module.exports = JsDiff;
+}
178 node_modules/mocha/lib/browser/events.js
@@ -0,0 +1,178 @@
+
+/**
+ * Module exports.
+ */
+
+exports.EventEmitter = EventEmitter;
+
+/**
+ * Check if `obj` is an array.
+ */
+
+function isArray(obj) {
+ return '[object Array]' == {}.toString.call(obj);
+}
+
+/**
+ * Event emitter constructor.
+ *
+ * @api public
+ */
+
+function EventEmitter(){};
+
+/**
+ * Adds a listener.
+ *
+ * @api public
+ */
+
+EventEmitter.prototype.on = function (name, fn) {
+ if (!this.$events) {
+ this.$events = {};
+ }
+
+ if (!this.$events[name]) {
+ this.$events[name] = fn;
+ } else if (isArray(this.$events[name])) {
+ this.$events[name].push(fn);
+ } else {
+ this.$events[name] = [this.$events[name], fn];
+ }
+
+ return this;
+};
+
+EventEmitter.prototype.addListener = EventEmitter.prototype.on;
+
+/**
+ * Adds a volatile listener.
+ *
+ * @api public
+ */
+
+EventEmitter.prototype.once = function (name, fn) {
+ var self = this;
+
+ function on () {
+ self.removeListener(name, on);
+ fn.apply(this, arguments);
+ };
+
+ on.listener = fn;
+ this.on(name, on);
+
+ return this;
+};
+
+/**
+ * Removes a listener.
+ *
+ * @api public
+ */
+
+EventEmitter.prototype.removeListener = function (name, fn) {
+ if (this.$events && this.$events[name]) {
+ var list = this.$events[name];
+
+ if (isArray(list)) {
+ var pos = -1;
+
+ for (var i = 0, l = list.length; i < l; i++) {
+ if (list[i] === fn || (list[i].listener && list[i].listener === fn)) {
+ pos = i;
+ break;
+ }
+ }
+
+ if (pos < 0) {
+ return this;
+ }
+
+ list.splice(pos, 1);
+
+ if (!list.length) {
+ delete this.$events[name];
+ }
+ } else if (list === fn || (list.listener && list.listener === fn)) {
+ delete this.$events[name];
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Removes all listeners for an event.
+ *
+ * @api public
+ */
+
+EventEmitter.prototype.removeAllListeners = function (name) {
+ if (name === undefined) {
+ this.$events = {};
+ return this;
+ }
+
+ if (this.$events && this.$events[name]) {
+ this.$events[name] = null;
+ }
+
+ return this;
+};
+
+/**
+ * Gets all listeners for a certain event.
+ *
+ * @api public
+ */
+
+EventEmitter.prototype.listeners = function (name) {
+ if (!this.$events) {
+ this.$events = {};
+ }
+
+ if (!this.$events[name]) {
+ this.$events[name] = [];
+ }
+
+ if (!isArray(this.$events[name])) {
+ this.$events[name] = [this.$events[name]];
+ }
+
+ return this.$events[name];
+};
+
+/**
+ * Emits an event.
+ *
+ * @api public
+ */
+
+EventEmitter.prototype.emit = function (name) {
+ if (!this.$events) {
+ return false;
+ }
+
+ var handler = this.$events[name];
+
+ if (!handler) {
+ return false;
+ }
+
+ var args = [].slice.call(arguments, 1);
+
+ if ('function' == typeof handler) {
+ handler.apply(this, args);
+ } else if (isArray(handler)) {
+ var listeners = handler.slice();
+
+ for (var i = 0, l = listeners.length; i < l; i++) {
+ listeners[i].apply(this, args);
+ }
+ } else {
+ return false;
+ }
+
+ return true;
+};
0  node_modules/mocha/lib/browser/fs.js
No changes.
0  node_modules/mocha/lib/browser/path.js
No changes.
125 node_modules/mocha/lib/browser/progress.js
@@ -0,0 +1,125 @@
+
+/**
+ * Expose `Progress`.
+ */
+
+module.exports = Progress;
+
+/**
+ * Initialize a new `Progress` indicator.
+ */
+
+function Progress() {
+ this.percent = 0;
+ this.size(0);
+ this.fontSize(11);
+ this.font('helvetica, arial, sans-serif');
+}
+
+/**
+ * Set progress size to `n`.
+ *
+ * @param {Number} n
+ * @return {Progress} for chaining
+ * @api public
+ */
+
+Progress.prototype.size = function(n){
+ this._size = n;
+ return this;
+};
+
+/**
+ * Set text to `str`.
+ *
+ * @param {String} str
+ * @return {Progress} for chaining
+ * @api public
+ */
+
+Progress.prototype.text = function(str){
+ this._text = str;
+ return this;
+};
+
+/**
+ * Set font size to `n`.
+ *
+ * @param {Number} n
+ * @return {Progress} for chaining
+ * @api public
+ */
+
+Progress.prototype.fontSize = function(n){
+ this._fontSize = n;
+ return this;
+};
+
+/**
+ * Set font `family`.
+ *
+ * @param {String} family
+ * @return {Progress} for chaining
+ */
+
+Progress.prototype.font = function(family){
+ this._font = family;
+ return this;
+};
+
+/**
+ * Update percentage to `n`.
+ *
+ * @param {Number} n
+ * @return {Progress} for chaining
+ */
+
+Progress.prototype.update = function(n){
+ this.percent = n;
+ return this;
+};
+
+/**
+ * Draw on `ctx`.
+ *
+ * @param {CanvasRenderingContext2d} ctx
+ * @return {Progress} for chaining
+ */
+
+Progress.prototype.draw = function(ctx){
+ var percent = Math.min(this.percent, 100)
+ , size = this._size
+ , half = size / 2
+ , x = half
+ , y = half
+ , rad = half - 1
+ , fontSize = this._fontSize;
+
+ ctx.font = fontSize + 'px ' + this._font;
+
+ var angle = Math.PI * 2 * (percent / 100);
+ ctx.clearRect(0, 0, size, size);
+
+ // outer circle
+ ctx.strokeStyle = '#9f9f9f';
+ ctx.beginPath();
+ ctx.arc(x, y, rad, 0, angle, false);
+ ctx.stroke();
+
+ // inner circle
+ ctx.strokeStyle = '#eee';
+ ctx.beginPath();
+ ctx.arc(x, y, rad - 1, 0, angle, true);
+ ctx.stroke();
+
+ // text
+ var text = this._text || (percent | 0) + '%'
+ , w = ctx.measureText(text).width;
+
+ ctx.fillText(
+ text
+ , x - w / 2 + 1
+ , y + fontSize / 2 - 1);
+
+ return this;
+};
8 node_modules/mocha/lib/browser/tty.js
@@ -0,0 +1,8 @@
+
+exports.isatty = function(){
+ return true;
+};
+
+exports.getWindowSize = function(){
+ return [window.innerHeight, window.innerWidth];
+};
69 node_modules/mocha/lib/context.js
@@ -0,0 +1,69 @@
+
+/**
+ * Expose `Context`.
+ */
+
+module.exports = Context;
+
+/**
+ * Initialize a new `Context`.
+ *
+ * @api private
+ */
+
+function Context(){}
+
+/**
+ * Set or get the context `Runnable` to `runnable`.
+ *
+ * @param {Runnable} runnable
+ * @return {Context}
+ * @api private
+ */
+
+Context.prototype.runnable = function(runnable){
+ if (0 == arguments.length) return this._runnable;
+ this.test = this._runnable = runnable;
+ return this;
+};
+
+/**
+ * Set test timeout `ms`.
+ *
+ * @param {Number} ms
+ * @return {Context} self
+ * @api private
+ */
+
+Context.prototype.timeout = function(ms){
+ this.runnable().timeout(ms);
+ return this;
+};
+
+/**
+ * Set test slowness threshold `ms`.
+ *
+ * @param {Number} ms
+ * @return {Context} self
+ * @api private
+ */
+
+Context.prototype.slow = function(ms){
+ this.runnable().slow(ms);
+ return this;
+};
+
+/**
+ * Inspect the context void of `._runnable`.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Context.prototype.inspect = function(){
+ return JSON.stringify(this, function(key, val){
+ if ('_runnable' == key) return;
+ if ('test' == key) return;
+ return val;
+ }, 2);
+};
50 node_modules/mocha/lib/hook.js
@@ -0,0 +1,50 @@
+
+/**
+ * Module dependencies.
+ */
+
+var Runnable = require('./runnable');
+
+/**
+ * Expose `Hook`.
+ */
+
+module.exports = Hook;
+
+/**
+ * Initialize a new `Hook` with the given `title` and callback `fn`.
+ *
+ * @param {String} title
+ * @param {Function} fn
+ * @api private
+ */
+
+function Hook(title, fn) {
+ Runnable.call(this, title, fn);
+ this.type = 'hook';
+}
+
+/**
+ * Inherit from `Runnable.prototype`.
+ */
+
+Hook.prototype.__proto__ = Runnable.prototype;
+
+/**
+ * Get or set the test `err`.
+ *
+ * @param {Error} err
+ * @return {Error}
+ * @api public
+ */
+
+Hook.prototype.error = function(err){
+ if (0 == arguments.length) {
+ var err = this._error;
+ this._error = null;
+ return err;
+ }
+
+ this._error = err;
+};