Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/lib/chai-1.9.0/.gitignore22
-rw-r--r--tests/lib/chai-1.9.0/.mailmap1
-rw-r--r--tests/lib/chai-1.9.0/.npmignore14
-rw-r--r--tests/lib/chai-1.9.0/.travis.yml14
-rw-r--r--tests/lib/chai-1.9.0/CONTRIBUTING.md171
-rw-r--r--tests/lib/chai-1.9.0/History.md871
-rw-r--r--tests/lib/chai-1.9.0/Makefile93
-rw-r--r--tests/lib/chai-1.9.0/README.md86
-rw-r--r--tests/lib/chai-1.9.0/ReleaseNotes.md397
-rw-r--r--tests/lib/chai-1.9.0/bower.json27
-rw-r--r--tests/lib/chai-1.9.0/chai.js4682
-rw-r--r--tests/lib/chai-1.9.0/component.json48
-rw-r--r--tests/lib/chai-1.9.0/index.js1
-rw-r--r--tests/lib/chai-1.9.0/karma.conf.js28
-rw-r--r--tests/lib/chai-1.9.0/karma.sauce.js41
-rw-r--r--tests/lib/chai-1.9.0/lib/chai.js80
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/assertion.js134
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/core/assertions.js1294
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/interface/assert.js1055
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/interface/expect.js12
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/interface/should.js76
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/addChainableMethod.js106
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/addMethod.js37
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/addProperty.js40
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/flag.js32
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/getActual.js19
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/getEnumerableProperties.js25
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/getMessage.js49
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/getName.js20
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/getPathValue.js102
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/getProperties.js35
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/index.js114
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/inspect.js315
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/objDisplay.js48
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/overwriteChainableMethod.js53
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/overwriteMethod.js51
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/overwriteProperty.js54
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/test.js26
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/transferFlags.js44
-rw-r--r--tests/lib/chai-1.9.0/lib/chai/utils/type.js45
-rw-r--r--tests/lib/chai-1.9.0/package.json42
-rw-r--r--tests/lib/chai-1.9.0/sauce.browsers.js128
-rw-r--r--tests/lib/chai-1.9.0/support/sauce/sauce_connect_block.sh6
-rw-r--r--tests/lib/chai-1.9.0/support/sauce/sauce_connect_setup.sh52
-rw-r--r--tests/lib/chai-1.9.0/test/assert.js638
-rw-r--r--tests/lib/chai-1.9.0/test/auth/.gitkeep0
-rw-r--r--tests/lib/chai-1.9.0/test/bootstrap/index.js22
-rw-r--r--tests/lib/chai-1.9.0/test/bootstrap/karma.js22
-rw-r--r--tests/lib/chai-1.9.0/test/configuration.js43
-rw-r--r--tests/lib/chai-1.9.0/test/display/errors.js14
-rw-r--r--tests/lib/chai-1.9.0/test/display/message.js40
-rw-r--r--tests/lib/chai-1.9.0/test/expect.js792
-rw-r--r--tests/lib/chai-1.9.0/test/globalShould.js15
-rw-r--r--tests/lib/chai-1.9.0/test/plugins.js24
-rw-r--r--tests/lib/chai-1.9.0/test/should.js744
-rw-r--r--tests/lib/chai-1.9.0/test/utilities.js308
-rw-r--r--tests/lib/jsdoc-toolkit/README.txt183
-rw-r--r--tests/lib/jsdoc-toolkit/app/frame.js33
-rw-r--r--tests/lib/jsdoc-toolkit/app/frame/Chain.js101
-rw-r--r--tests/lib/jsdoc-toolkit/app/frame/Dumper.js144
-rw-r--r--tests/lib/jsdoc-toolkit/app/frame/Hash.js84
-rw-r--r--tests/lib/jsdoc-toolkit/app/frame/Link.js173
-rw-r--r--tests/lib/jsdoc-toolkit/app/frame/Namespace.js10
-rw-r--r--tests/lib/jsdoc-toolkit/app/frame/Opt.js134
-rw-r--r--tests/lib/jsdoc-toolkit/app/frame/Reflection.js26
-rw-r--r--tests/lib/jsdoc-toolkit/app/frame/String.js93
-rw-r--r--tests/lib/jsdoc-toolkit/app/frame/Testrun.js128
-rw-r--r--tests/lib/jsdoc-toolkit/app/handlers/FOODOC.js26
-rw-r--r--tests/lib/jsdoc-toolkit/app/handlers/XMLDOC.js26
-rw-r--r--tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js159
-rw-r--r--tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js16
-rw-r--r--tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js292
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC.js106
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/DocComment.js204
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/DocTag.js294
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js140
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js109
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/Lang.js144
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/Parser.js146
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js32
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/Symbol.js643
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js243
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/TextStream.js41
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/Token.js18
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js332
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js133
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/Util.js32
-rw-r--r--tests/lib/jsdoc-toolkit/app/lib/JSDOC/Walker.js501
-rw-r--r--tests/lib/jsdoc-toolkit/app/main.js111
-rw-r--r--tests/lib/jsdoc-toolkit/app/plugins/commentSrcJson.js20
-rw-r--r--tests/lib/jsdoc-toolkit/app/plugins/frameworkPrototype.js16
-rw-r--r--tests/lib/jsdoc-toolkit/app/plugins/functionCall.js10
-rw-r--r--tests/lib/jsdoc-toolkit/app/plugins/publishSrcHilite.js62
-rw-r--r--tests/lib/jsdoc-toolkit/app/plugins/symbolLink.js10
-rw-r--r--tests/lib/jsdoc-toolkit/app/plugins/tagParamConfig.js31
-rw-r--r--tests/lib/jsdoc-toolkit/app/plugins/tagSynonyms.js43
-rw-r--r--tests/lib/jsdoc-toolkit/app/run.js347
-rw-r--r--tests/lib/jsdoc-toolkit/app/t/TestDoc.js144
-rw-r--r--tests/lib/jsdoc-toolkit/app/t/runner.js13
-rw-r--r--tests/lib/jsdoc-toolkit/app/test.js342
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/addon.js24
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/anon_inner.js14
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/augments.js31
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/augments2.js26
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/borrows.js46
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/borrows2.js23
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/config.js22
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/constructs.js18
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/encoding.js10
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/encoding_other.js12
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/event.js54
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/exports.js14
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/functions_anon.js38
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/functions_nested.js33
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/global.js13
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/globals.js25
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/ignore.js10
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/inner.js16
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/jsdoc_test.js469
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/lend.js33
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/memberof.js19
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/memberof2.js38
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/memberof3.js33
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/memberof_constructor.js16
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/module.js17
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/multi_methods.js25
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/name.js19
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/namespace_nested.js23
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/nocode.js13
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/oblit_anon.js18
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/overview.js20
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/param_inline.js37
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/params_optional.js8
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/prototype.js17
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/prototype_nested.js9
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/prototype_oblit.js13
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/prototype_oblit_constructor.js24
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/public.js10
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/scripts/code.js5
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/scripts/notcode.txt5
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/shared.js41
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/shared2.js2
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/shortcuts.js22
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/static_this.js13
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/synonyms.js31
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/tosource.js23
-rw-r--r--tests/lib/jsdoc-toolkit/app/test/variable_redefine.js14
-rw-r--r--tests/lib/jsdoc-toolkit/changes.txt123
-rw-r--r--tests/lib/jsdoc-toolkit/conf/sample.conf31
-rw-r--r--tests/lib/jsdoc-toolkit/java/build.xml36
-rw-r--r--tests/lib/jsdoc-toolkit/java/build_1.4.xml36
-rw-r--r--tests/lib/jsdoc-toolkit/java/classes/js.jarbin819369 -> 0 bytes
-rw-r--r--tests/lib/jsdoc-toolkit/java/src/JsDebugRun.java21
-rw-r--r--tests/lib/jsdoc-toolkit/java/src/JsRun.java21
-rw-r--r--tests/lib/jsdoc-toolkit/jsdebug.jarbin1307 -> 0 bytes
-rw-r--r--tests/lib/jsdoc-toolkit/jsrun.jarbin1303 -> 0 bytes
-rw-r--r--tests/lib/jsdoc-toolkit/jsrun.sh51
-rw-r--r--tests/lib/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl17
-rw-r--r--tests/lib/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl55
-rw-r--r--tests/lib/jsdoc-toolkit/templates/jsdoc/class.tmpl646
-rw-r--r--tests/lib/jsdoc-toolkit/templates/jsdoc/index.tmpl38
-rw-r--r--tests/lib/jsdoc-toolkit/templates/jsdoc/publish.js200
-rw-r--r--tests/lib/jsdoc-toolkit/templates/jsdoc/static/default.css161
-rw-r--r--tests/lib/jsdoc-toolkit/templates/jsdoc/static/header.html2
-rw-r--r--tests/lib/jsdoc-toolkit/templates/jsdoc/static/index.html18
-rw-r--r--tests/lib/jsdoc-toolkit/templates/jsdoc/symbol.tmpl35
-rw-r--r--tests/lib/mocha-3.1.2/.editorconfig18
-rw-r--r--tests/lib/mocha-3.1.2/.eslintignore2
-rw-r--r--tests/lib/mocha-3.1.2/.eslintrc.yaml11
-rw-r--r--tests/lib/mocha-3.1.2/.gitignore17
-rw-r--r--tests/lib/mocha-3.1.2/.mailmap12
-rw-r--r--tests/lib/mocha-3.1.2/.npmignore2
-rw-r--r--tests/lib/mocha-3.1.2/.travis.yml55
-rw-r--r--tests/lib/mocha-3.1.2/CHANGELOG.md1445
-rw-r--r--tests/lib/mocha-3.1.2/CONTRIBUTING.md49
-rw-r--r--tests/lib/mocha-3.1.2/LICENSE22
-rw-r--r--tests/lib/mocha-3.1.2/Makefile176
-rw-r--r--tests/lib/mocha-3.1.2/README.md84
-rw-r--r--tests/lib/mocha-3.1.2/appveyor.yml26
-rw-r--r--tests/lib/mocha-3.1.2/assets/mocha-banner-192.pngbin15667 -> 0 bytes
-rw-r--r--tests/lib/mocha-3.1.2/assets/mocha-banner.svg160
-rw-r--r--tests/lib/mocha-3.1.2/assets/mocha-logo-128.pngbin7445 -> 0 bytes
-rw-r--r--tests/lib/mocha-3.1.2/assets/mocha-logo-192.pngbin10373 -> 0 bytes
-rw-r--r--tests/lib/mocha-3.1.2/assets/mocha-logo-64.pngbin3275 -> 0 bytes
-rw-r--r--tests/lib/mocha-3.1.2/assets/mocha-logo.svg125
-rw-r--r--tests/lib/mocha-3.1.2/bin/.eslintrc3
-rw-r--r--tests/lib/mocha-3.1.2/bin/_mocha544
-rw-r--r--tests/lib/mocha-3.1.2/bin/mocha83
-rw-r--r--tests/lib/mocha-3.1.2/bin/options.js41
-rw-r--r--tests/lib/mocha-3.1.2/bower.json38
-rw-r--r--tests/lib/mocha-3.1.2/browser-entry.js187
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet18
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet18
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet18
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet18
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - describe.tmSnippet18
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet18
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert.tmSnippet16
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_deepEqual.tmSnippet16
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_equal.tmSnippet16
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_fail.tmSnippet16
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_isFunction.tmSnippet16
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - setup.tmSnippet18
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - suite.tmSnippet18
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - teardown.tmSnippet18
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - test.tmSnippet18
-rw-r--r--tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/info.plist19
-rw-r--r--tests/lib/mocha-3.1.2/images/error.pngbin412 -> 0 bytes
-rw-r--r--tests/lib/mocha-3.1.2/images/ok.pngbin388 -> 0 bytes
-rw-r--r--tests/lib/mocha-3.1.2/index.js3
-rw-r--r--tests/lib/mocha-3.1.2/karma.conf.js180
-rw-r--r--tests/lib/mocha-3.1.2/lib/browser/.eslintrc.yaml4
-rw-r--r--tests/lib/mocha-3.1.2/lib/browser/debug.js7
-rw-r--r--tests/lib/mocha-3.1.2/lib/browser/events.js195
-rw-r--r--tests/lib/mocha-3.1.2/lib/browser/progress.js119
-rw-r--r--tests/lib/mocha-3.1.2/lib/browser/tty.js13
-rw-r--r--tests/lib/mocha-3.1.2/lib/context.js112
-rw-r--r--tests/lib/mocha-3.1.2/lib/hook.js48
-rw-r--r--tests/lib/mocha-3.1.2/lib/interfaces/bdd.js115
-rw-r--r--tests/lib/mocha-3.1.2/lib/interfaces/common.js158
-rw-r--r--tests/lib/mocha-3.1.2/lib/interfaces/exports.js63
-rw-r--r--tests/lib/mocha-3.1.2/lib/interfaces/index.js6
-rw-r--r--tests/lib/mocha-3.1.2/lib/interfaces/qunit.js99
-rw-r--r--tests/lib/mocha-3.1.2/lib/interfaces/tdd.js106
-rw-r--r--tests/lib/mocha-3.1.2/lib/mocha.js522
-rw-r--r--tests/lib/mocha-3.1.2/lib/ms.js130
-rw-r--r--tests/lib/mocha-3.1.2/lib/pending.js16
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/base.js491
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/doc.js64
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/dot.js68
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/html.js346
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/index.js19
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/json-stream.js63
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/json.js92
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/landing.js94
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/list.js63
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/markdown.js99
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/min.js38
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/nyan.js263
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/progress.js91
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/spec.js81
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/tap.js70
-rw-r--r--tests/lib/mocha-3.1.2/lib/reporters/xunit.js168
-rw-r--r--tests/lib/mocha-3.1.2/lib/runnable.js384
-rw-r--r--tests/lib/mocha-3.1.2/lib/runner.js963
-rw-r--r--tests/lib/mocha-3.1.2/lib/suite.js402
-rw-r--r--tests/lib/mocha-3.1.2/lib/template.html18
-rw-r--r--tests/lib/mocha-3.1.2/lib/test.js52
-rw-r--r--tests/lib/mocha-3.1.2/lib/to-iso-string/LICENSE19
-rw-r--r--tests/lib/mocha-3.1.2/lib/to-iso-string/index.js37
-rw-r--r--tests/lib/mocha-3.1.2/lib/utils.js802
-rw-r--r--tests/lib/mocha-3.1.2/media/logo.svg7
-rw-r--r--tests/lib/mocha-3.1.2/mocha.css326
-rw-r--r--tests/lib/mocha-3.1.2/mocha.js15556
-rw-r--r--tests/lib/mocha-3.1.2/package.json364
-rw-r--r--tests/lib/mocha-3.1.2/scripts/dedefine.js26
-rw-r--r--tests/lib/mocha-3.1.2/scripts/travis-after-script.sh9
-rw-r--r--tests/lib/mocha-3.1.2/scripts/travis-before-install.sh5
-rw-r--r--tests/lib/mocha-3.1.2/scripts/travis-before-script.sh7
-rw-r--r--tests/lib/mocha-3.1.2/test/.eslintrc.yaml7
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/context.spec.js73
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/duration.spec.js27
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/fs.spec.js22
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/glob/glob.sh66
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/glob/glob.spec.js7
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/globals.spec.js43
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/http.spec.js18
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/interfaces/bdd.spec.js34
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/interfaces/exports.spec.js48
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/interfaces/qunit.spec.js25
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/interfaces/tdd.spec.js42
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/lookup-files.spec.js90
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/misc/exit.spec.js20
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/misc/many.spec.js28
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/misc/nontty.spec.js11
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/misc/only/bdd-require.spec.js20
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/misc/only/bdd.spec.js127
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/bdd.spec.js14
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/qunit.spec.js14
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/tdd.spec.js14
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/misc/only/qunit.spec.js75
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/misc/only/tdd.spec.js127
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/overspecified-async.spec.js10
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/require/a.js4
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/require/b.coffee2
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/require/c.js4
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/require/d.coffee2
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/require/require.spec.js11
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/required-tokens.spec.js12
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/root.spec.js13
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/test.coffee6
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/test.foo1
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/throw.spec.js108
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/timeout.spec.js79
-rw-r--r--tests/lib/mocha-3.1.2/test/acceptance/utils.spec.js418
-rw-r--r--tests/lib/mocha-3.1.2/test/browser-fixtures/bdd.fixture.js6
-rw-r--r--tests/lib/mocha-3.1.2/test/browser-fixtures/exports.fixture.js6
-rw-r--r--tests/lib/mocha-3.1.2/test/browser-fixtures/qunit.fixture.js6
-rw-r--r--tests/lib/mocha-3.1.2/test/browser-fixtures/tdd.fixture.js6
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/array.spec.js39
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/grep.html51
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/grep.spec.js110
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/index.html33
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/large.html24
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/large.spec.js49
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/multiple-done.spec.js18
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/opts.html30
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/opts.spec.js7
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/stack-trace.html24
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/stack-trace.spec.js22
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/ui.html46
-rw-r--r--tests/lib/mocha-3.1.2/test/browser/ui.spec.js33
-rw-r--r--tests/lib/mocha-3.1.2/test/color.spec.js20
-rw-r--r--tests/lib/mocha-3.1.2/test/compiler/foo.js10
-rw-r--r--tests/lib/mocha-3.1.2/test/grep.spec.js67
-rw-r--r--tests/lib/mocha-3.1.2/test/hook-async.spec.js135
-rw-r--r--tests/lib/mocha-3.1.2/test/hook-sync-nested.spec.js104
-rw-r--r--tests/lib/mocha-3.1.2/test/hook-sync.spec.js103
-rw-r--r--tests/lib/mocha-3.1.2/test/hook-timeout.spec.js10
-rw-r--r--tests/lib/mocha-3.1.2/test/http-meta-2.spec.js92
-rw-r--r--tests/lib/mocha-3.1.2/test/http-meta.spec.js65
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/diffs.spec.js46
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/cascade.fixture.js59
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.css.in9
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.css.out13
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.fixture.js113
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/output91
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-async-error.fixture.js21
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-error.fixture.js19
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-async-error.fixture.js21
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-error.fixture.js19
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error-tip.fixture.js13
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error.fixture.js21
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error-tip.fixture.js11
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error.fixture.js19
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-async-error.fixture.js21
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-error.fixture.js19
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-async-error.fixture.js141
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-error.fixture.js131
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-before.fixture.js12
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-beforeEach.fixture.js16
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-specs.fixture.js12
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done.fixture.js20
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/async-only-async.fixture.js5
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/async-only-sync.fixture.js3
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/bail.fixture.js23
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/delay-fail.fixture.js8
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/delay.fixture.js16
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/grep.fixture.js19
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/bdd.fixture.js72
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/qunit.fixture.js27
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/tdd.fixture.js37
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/retries.fixture.js7
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/sort-alpha.fixture.js9
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/options/sort-beta.fixture.js7
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/passing.fixture.js13
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-before.fixture.js18
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-beforeEach.fixture.js18
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-spec.fixture.js14
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-before.fixture.js15
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-beforeEach.fixture.js15
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-spec.fixture.js12
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/pending/spec.fixture.js5
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/regression/1794/issue-1794.fixture.js5
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/regression/1794/simple-ui.js28
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1327.fixture.js17
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1417.js22
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1991.fixture.js49
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2315.js11
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2406.fixture.js17
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2417.fixture.js9
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/retries/async.fixture.js30
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/retries/early-pass.fixture.js13
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/retries/hooks.fixture.js27
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/retries/nested.fixture.js11
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-no-callback.fixture.js3
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-skipped-callback.fixture.js3
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-skipped-no-callback.fixture.js3
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/timeout.fixture.js19
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/uncaught-hook.fixture.js15
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/fixtures/uncaught.fixture.js22
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/helpers.js193
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/hook-err.spec.js217
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/hooks.spec.js45
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/multiple-done.spec.js98
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/only.spec.js45
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/options.spec.js183
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/pending.spec.js102
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/regression.spec.js119
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/reporters.spec.js63
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/retries.spec.js108
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/suite.spec.js43
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/timeout.spec.js18
-rw-r--r--tests/lib/mocha-3.1.2/test/integration/uncaught.spec.js37
-rw-r--r--tests/lib/mocha-3.1.2/test/jsapi/index.js30
-rw-r--r--tests/lib/mocha-3.1.2/test/mocha.opts8
-rw-r--r--tests/lib/mocha-3.1.2/test/mocha.spec.js35
-rw-r--r--tests/lib/mocha-3.1.2/test/ms.spec.js82
-rw-r--r--tests/lib/mocha-3.1.2/test/reporters/base.spec.js213
-rw-r--r--tests/lib/mocha-3.1.2/test/reporters/json.spec.js63
-rw-r--r--tests/lib/mocha-3.1.2/test/reporters/nyan.spec.js31
-rw-r--r--tests/lib/mocha-3.1.2/test/runnable.spec.js466
-rw-r--r--tests/lib/mocha-3.1.2/test/runner.spec.js436
-rw-r--r--tests/lib/mocha-3.1.2/test/sanity/sanity.spec.js9
-rw-r--r--tests/lib/mocha-3.1.2/test/setup.js4
-rw-r--r--tests/lib/mocha-3.1.2/test/suite.spec.js440
-rw-r--r--tests/lib/mocha-3.1.2/test/test.spec.js77
-rw-r--r--tests/lib/mocha-3.1.2/test/utils.spec.js263
408 files changed, 0 insertions, 56106 deletions
diff --git a/tests/lib/chai-1.9.0/.gitignore b/tests/lib/chai-1.9.0/.gitignore
deleted file mode 100644
index c676de02dd..0000000000
--- a/tests/lib/chai-1.9.0/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-lib-cov
-*.seed
-*.log
-*.csv
-*.dat
-*.out
-*.pid
-*.gz
-
-pids
-logs
-results
-build
-components
-
-node_modules
-npm-debug.log
-
-coverage
-
-test/auth/*
-!test/auth/.gitkeep
diff --git a/tests/lib/chai-1.9.0/.mailmap b/tests/lib/chai-1.9.0/.mailmap
deleted file mode 100644
index 0960904a81..0000000000
--- a/tests/lib/chai-1.9.0/.mailmap
+++ /dev/null
@@ -1 +0,0 @@
-Domenic Denicola <domenic@domenicdenicola.com>
diff --git a/tests/lib/chai-1.9.0/.npmignore b/tests/lib/chai-1.9.0/.npmignore
deleted file mode 100644
index 59f495632e..0000000000
--- a/tests/lib/chai-1.9.0/.npmignore
+++ /dev/null
@@ -1,14 +0,0 @@
-.git*
-docs/
-test/
-support/
-component.json
-components/
-build/
-lib-cov/
-coverage/
-.travis.yml
-.mailmap
-Makefile
-*.swp
-.DS_Store
diff --git a/tests/lib/chai-1.9.0/.travis.yml b/tests/lib/chai-1.9.0/.travis.yml
deleted file mode 100644
index 73bbb974e7..0000000000
--- a/tests/lib/chai-1.9.0/.travis.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-language: node_js
-
-node_js:
-- 0.1
-
-env:
- global:
- - secure: h4eLQ2jkR1p2O5BEyscLtbNT/84LDGFnj977SeKmg3flVTpRR+ZiYb5YvIUIYfnwsw1jlr11xv0cya23nJjJA5DQjrVS1/kg4sWrLD9Gs6TTqpSNSk0HrFpxhrHZ/uSSPfV9fbyxfDLxgq72fc55WCuY5Osy1kXmsPdJX79/cOU=
- - secure: GXrMWPVtgAG4ICawbVdzh3R+Q+tHwYT1FcgtFbn4w7s6NZUKRdDodBM0yuDZA8pxqhQvSj/HlLjkNQI4G1wPhkHESlMWzrH5737eaJ1PHQvYV/XEnpjawQXYTOg3OYEx07mHGm+mqbAaDDHulgkeI5J4NXFMQO+JG7eYTqpotXE=
- - SAUCE_CONNECT_READY_FILE=/tmp/sauce-connect-ready
- - LOGS_DIR=/tmp/chai-build/logs
-
-script:
-- make test-travisci
diff --git a/tests/lib/chai-1.9.0/CONTRIBUTING.md b/tests/lib/chai-1.9.0/CONTRIBUTING.md
deleted file mode 100644
index de9ab906d2..0000000000
--- a/tests/lib/chai-1.9.0/CONTRIBUTING.md
+++ /dev/null
@@ -1,171 +0,0 @@
-# Chai Contribution Guidelines
-
-We like to encourage you to contribute to the Chai.js repository. This should be as easy as possible for you but there are a few things to consider when contributing. The following guidelines for contribution should be followed if you want to submit a pull request or open an issue.
-
-Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
-
-#### Table of Contents
-
-- [TLDR;](#tldr)
-- [Contributing](#contributing)
- - [Bug Reports](#bugs)
- - [Feature Requests](#features)
- - [Pull Requests](#pull-requests)
-- [Support](#support)
- - [Resources](#resources)
- - [Core Contributors](#contributors)
-
-<a name="tldr"></a>
-## TLDR;
-
-- Creating an Issue or Pull Request requires a [GitHub](http://github.com) account.
-- Issue reports should be **clear**, **concise** and **reproducible**. Check to see if your issue has already been resolved in the [master]() branch or already reported in Chai's [GitHub Issue Tracker](https://github.com/chaijs/chai/issues).
-- Pull Requests must adhere to strict [coding style guidelines](https://github.com/chaijs/chai/wiki/Chai-Coding-Style-Guide).
-- In general, avoid submitting PRs for new Assertions without asking core contributors first. More than likely it would be better implemented as a plugin.
-- Additional support is available via the [Google Group](http://groups.google.com/group/chaijs) or on irc.freenode.net#chaijs.
-- **IMPORTANT**: By submitting a patch, you agree to allow the project owner to license your work under the same license as that used by the project.
-
-<a name="contributing"></a>
-## Contributing
-
-The issue tracker is the preferred channel for [bug reports](#bugs),
-[features requests](#features) and [submitting pull
-requests](#pull-requests), but please respect the following restrictions:
-
-* Please **do not** use the issue tracker for personal support requests (use
- [Google Group](https://groups.google.com/forum/#!forum/chaijs) or IRC).
-* Please **do not** derail or troll issues. Keep the discussion on topic and
- respect the opinions of others
-
-<a name="bugs"></a>
-### Bug Reports
-
-A bug is a **demonstrable problem** that is caused by the code in the repository.
-
-Guidelines for bug reports:
-
-1. **Use the GitHub issue search** &mdash; check if the issue has already been reported.
-2. **Check if the issue has been fixed** &mdash; try to reproduce it using the latest `master` or development branch in the repository.
-3. **Isolate the problem** &mdash; create a test case to demonstrate your issue. Provide either a repo, gist, or code sample to demonstrate you problem.
-
-A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and/or Node.js versions experience the problem? What would you expect to be the outcome? All these details will help people to fix any potential bugs.
-
-Example:
-
-> Short and descriptive example bug report title
->
-> A summary of the issue and the browser/OS environment in which it occurs. If suitable, include the steps required to reproduce the bug.
->
-> 1. This is the first step
-> 2. This is the second step
-> 3. Further steps, etc.
->
-> `<url>` - a link to the reduced test case OR
-> ```js
-> expect(a).to.equal('a');
-> // code sample
-> ```
->
-> Any other information you want to share that is relevant to the issue being reported. This might include the lines of code that you have identified as causing the bug, and potential solutions (and your opinions on their merits).
-
-<a name="features"></a>
-### Feature Requests
-
-Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible.
-
-Furthermore, since Chai.js has a [robust plugin API](http://chaijs.com/guide/plugins/), we encourage you to publish **new Assertions** as plugins. If your feature is an enhancement to an **existing Assertion**, please propose your changes as an issue prior to opening a pull request. If the core Chai.js contributors feel your plugin would be better suited as a core assertion, they will invite you to open a PR in [chaijs/chai](https//github.com/chaijs/chai).
-
-<a name="pull-requests"></a>
-### Pull Requests
-
-- PRs for new core-assertions are advised against.
-- PRs for core-assertion bug fixes are always welcome.
-- PRs for enhancing the interfaces are always welcome.
-- PRs that increase test coverage are always welcome.
-- PRs are scrutinized for coding-style.
-
-Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.
-
-**Please ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.
-
-Please adhere to the coding conventions used throughout a project (indentation, accurate comments, etc.) and any other requirements (such as test coverage). Please review the [Chai.js Codeing Style Guide](https://github.com/chaijs/chai/wiki/Chai-Coding-Style-Guide).
-
-Follow this process if you'd like your work considered for inclusion in the project:
-
-1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes:
-
-```bash
-# Clone your fork of the repo into the current directory
-git clone https://github.com/<your-username>/<repo-name>
-# Navigate to the newly cloned directory
-cd <repo-name>
-# Assign the original repo to a remote called "upstream"
-git remote add upstream https://github.com/<upstream-owner>/<repo-name>
-```
-
-2. If you cloned a while ago, get the latest changes from upstream:
-
-```bash
-git checkout <dev-branch>
-git pull upstream <dev-branch>
-```
-
-3. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix:
-
-```bash
-git checkout -b <topic-branch-name>
-```
-
-4. Commit your changes in logical chunks. Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public.
-
-5. Locally merge (or rebase) the upstream development branch into your topic branch:
-
-```bash
-git pull [--rebase] upstream <dev-branch>
-```
-
-6. Push your topic branch up to your fork:
-
-```bash
-git push origin <topic-branch-name>
-```
-
-7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description.
-
-**IMPORTANT**: By submitting a patch, you agree to allow the project owner to license your work under the same license as that used by the project.
-
-<a name="support"></a>
-## Support
-
-<a name="resources"></a>
-### Resources
-
-For most of the documentation you are going to want to visit [ChaiJS.com](http://chaijs.com).
-
-- [Getting Started Guide](http://chaijs.com/guide/)
-- [API Reference](http://chaijs.com/api/)
-- [Plugins](http://chaijs.com/plugins/)
-
-Alternatively, the [wiki](https://github.com/chaijs/chai/wiki) might be what you are looking for.
-
-- [Chai Coding Style Guide](https://github.com/chaijs/chai/wiki/Chai-Coding-Style-Guide)
-- [Third-party Resources](https://github.com/chaijs/chai/wiki/Third-Party-Resources)
-
-Or finally, you may find a core-contributor or like-minded developer in any of our support channels.
-
-- IRC: irc.freenode.org #chaijs
-- [Mailing List / Google Group](https://groups.google.com/forum/#!forum/chaijs)
-
-<a name="contributors"></a>
-### Core Contributors
-
-Feel free to reach out to any of the core-contributors with you questions or concerns. We will do our best to respond in a timely manner.
-
-- Jake Luer
- - GH: [@logicalparadox](https://github.com/logicalparadox)
- - TW: [@jakeluer](http://twitter.com/jakeluer)
- - IRC: logicalparadox
-- Veselin Todorov
- - GH: [@vesln](https://github.com/vesln/)
- - TW: [@vesln](http://twitter.com/vesln)
- - IRC: vesln
diff --git a/tests/lib/chai-1.9.0/History.md b/tests/lib/chai-1.9.0/History.md
deleted file mode 100644
index c769a56a61..0000000000
--- a/tests/lib/chai-1.9.0/History.md
+++ /dev/null
@@ -1,871 +0,0 @@
-
-1.9.0 / 2014-01-29
-==================
-
- * docs: add contributing.md #238
- * assert: .throws() returns thrown error. Closes #185
- * Merge pull request #232 from laconbass/assert-throws
- * assert: .fail() parameter mismatch. Closes #206
- * Merge branch 'karma-fixes'
- * Add karma phantomjs launcher
- * Use latest karma and sauce launcher
- * Karma tweaks
- * Merge pull request #230 from jkroso/include
- * Merge pull request #237 from chaijs/coverage
- * Add coverage to npmignore
- * Remove lib-cov from test-travisci dependents
- * Remove the not longer needed lcov reporter
- * Test coverage with istanbul
- * Remove jscoverage
- * Remove coveralls
- * Merge pull request #226 from duncanbeevers/add_has
- * Avoid error instantiation if possible on assert.throws
- * Merge pull request #231 from duncanbeevers/update_copyright_year
- * Update Copyright notices to 2014
- * handle negation correctly
- * add failing test case
- * support `{a:1,b:2}.should.include({a:1})`
- * Merge pull request #224 from vbardales/master
- * Add `has` to language chains
- * Merge pull request #219 from demands/overwrite_chainable
- * return error on throw method to chain on error properties, possibly different from message
- * util: store chainable behavior in a __methods object on ctx
- * util: code style fix
- * util: add overwriteChainableMethod utility (for #215)
- * Merge pull request #217 from demands/test_cleanup
- * test: make it possible to run utilities tests with --watch
- * makefile: change location of karma-runner bin script
- * Merge pull request #202 from andreineculau/patch-2
- * test: add tests for throwing custom errors
- * Merge pull request #201 from andreineculau/patch-1
- * test: updated for the new assertion errors
- * core: improve message for assertion errors (throw assertion)
-
-1.8.1 / 2013-10-10
-==================
-
- * pkg: update deep-eql version
-
-1.8.0 / 2013-09-18
-==================
-
- * test: [sauce] add a few more browsers
- * Merge branch 'refactor/deep-equal'
- * util: remove embedded deep equal utility
- * util: replace embedded deep equal with external module
- * Merge branch 'feature/karma'
- * docs: add sauce badge to readme [ci skip]
- * test: [sauce] use karma@canary to prevent timeouts
- * travis: only run on node 0.10
- * test: [karma] use karma phantomjs runner
- * Merge pull request #181 from tricknotes/fix-highlight
- * Fix highlight for example code
-
-1.7.2 / 2013-06-27
-==================
-
- * coverage: add coveralls badge
- * test: [coveralls] add coveralls api integration. testing travis-ci integration
- * Merge branch 'master' of github.com:chaijs/chai
- * Merge branch 'feature/bower'
- * Merge pull request #180 from tricknotes/modify-method-title
- * Merge pull request #179 from tricknotes/highlight-code-example
- * Modify method title to include argument name
- * Fix to highlight code example
- * bower: granular ignores
-
-1.7.1 / 2013-06-24
-==================
-
- * Merge branch 'feature/bower'. #175
- * bower: add json file
- * build: browser
-
-1.7.0 / 2013-06-17
-==================
-
- * error: remove internal assertion error constructor
- * core: [assertion-error] replace internal assertion error with dep
- * deps: add chaijs/assertion-error@1.0.0
- * docs: fix typo in source file. #174
- * Merge pull request #174 from piecioshka/master
- * typo
- * Merge branch 'master' of github.com:chaijs/chai
- * pkg: lock mocha/mocha-phantomjs versions (for now)
- * Merge pull request #173 from chaijs/inspect-fix
- * Fix `utils.inspect` with custom object-returning inspect()s.
- * Merge pull request #171 from Bartvds/master
- * replaced tabs with 2 spaces
- * added assert.notOk()
- * Merge pull request #169 from katsgeorgeek/topics/master
- * Fix comparison objects.
-
-1.6.1 / 2013-06-05
-==================
-
- * Merge pull request #168 from katsgeorgeek/topics/master
- * Add test for different RegExp flags.
- * Add test for regexp comparison.
- * Downgrade mocha version for fix running Phantom tests.
- * Fix comparison equality of two regexps.
- * Merge pull request #161 from brandonpayton/master
- * Fix documented name for assert interfaces isDefined method
-
-1.6.0 / 2013-04-29
-==================
-
- * build: browser
- * assert: [(not)include] throw on incompatible haystack. Closes #142
- * assert: [notInclude] add assert.notInclude. Closes #158
- * browser build
- * makefile: force browser build on browser-test
- * makefile: use component for browser build
- * core: [assertions] remove extraneous comments
- * Merge branch 'master' of github.com:chaijs/chai
- * test: [assert] deep equal ordering
- * Merge pull request #153 from NickHeiner/array-assertions
- * giving members a no-flag assertion
- * Code review comments - changing syntax
- * Code review comments
- * Adding members and memberEquals assertions for checking for subsets and set equality. Implements chaijs/chai#148.
- * Merge pull request #140 from RubenVerborgh/function-prototype
- * Restore the `call` and `apply` methods of Function when adding a chainable method.
- * readme: 2013
- * notes: migration notes for deep equal changes
- * test: for ever err() there must be a passing version
-
-1.5.0 / 2013-02-03
-==================
-
- * docs: add Release Notes for non-gitlog summary of changes.
- * lib: update copyright to 2013
- * Merge branch 'refactor/travis'
- * makefile: remove test-component for full test run
- * pkg: script test now runs make test so travis will test browser
- * browser: build
- * tests: refactor some tests to support new objDisplay output
- * test: [bootstrap] normalize boostrap across all test scenarios
- * assertions: refactor some assertions to use objDisplay instead of inspect
- * util: [objDisplay] normalize output of functions
- * makefile: refactor for full build scenarios
- * component: fix build bug where missing util:type file
- * assertions: [throw] code cleanup
- * Merge branch 'refactor/typeDetection'
- * browser: build
- * makefile: chai.js is .PHONY so it builds every time
- * test: [expect] add arguments type detection test
- * core/assertions: [type] (a/an) refactor to use type detection utility
- * util: add cross-browser type detection utility
- * Merge branch 'feature/component'
- * browser: build
- * component: add component.json file
- * makefile: refactor for fine grain control of testing scenarios
- * test: add mochaPhantomJS support and component test file
- * deps: add component and mocha-phantomjs for browser testing
- * ignore: update ignore files for component support
- * travis: run for all branches
- * Merge branch 'feature/showDiff'
- * test: [Assertion] configruable showDiff flag. Closes #132
- * lib: [Assertion] add configurable showDiff flag. #132
- * Merge branch 'feature/saucelabs'
- * Merge branch 'master' into feature/saucelabs
- * browser: build
- * support: add mocha cloud runner, client, and html test page
- * test: [saucelabs] add auth placeholder
- * deps: add mocha-cloud
- * Merge pull request #136 from whatthejeff/message_fix
- * Merge pull request #138 from timnew/master
- * Fix issue #137, test message existence by using message!=null rather than using message
- * Fixed backwards negation messages.
- * Merge pull request #133 from RubenVerborgh/throw
- * Functions throwing strings can reliably be tested.
- * Merge pull request #131 from RubenVerborgh/proto
- * Cache whether __proto__ is supported.
- * Use __proto__ if available.
- * Determine the property names to exclude beforehand.
- * Merge pull request #126 from RubenVerborgh/eqls
- * Add alias eqls for eql.
- * Use inherited enumerable properties in deep equality comparison.
- * Show inherited properties when inspecting an object.
- * Add new getProperties and getEnumerableProperties utils.
- * showDiff: force true for equal and eql
-
-1.4.2 / 2012-12-21
-==================
-
- * browser build: (object diff support when used with mocha) #106
- * test: [display] array test for mocha object diff
- * browser: no longer need different AssertionError constructor
-
-1.4.1 / 2012-12-21
-==================
-
- * showDiff: force diff for equal and eql. #106
- * test: [expect] type null. #122
- * Merge pull request #115 from eshao/fix-assert-Throw
- * FIX: assert.Throw checks error type/message
- * TST: assert.Throw should check error type/message
-
-1.4.0 / 2012-11-29
-==================
-
- * pre-release browser build
- * clean up index.js to not check for cov, revert package.json to use index.js
- * convert tests to use new bootstrap
- * refactor testing bootstrap
- * use spaces (not tabs). Clean up #114
- * Merge pull request #114 from trantorLiu/master
- * Add most() (alias: lte) and least() (alias: gte) to the API with new chainers "at" and "of".
- * Change `main` to ./lib/chai. Fixes #28.
- * Merge pull request #104 from connec/deep_equals_circular_references_
- * Merge pull request #109 from nnarhinen/patch-1
- * Check for 'actual' type
- * Added support for circular references when checking deep (in)equality.
-
-1.3.0 / 2012-10-01
-==================
-
- * browser build w/ folio >= 0.3.4. Closes #99
- * add back buffer test for deep equal
- * do not write flags to assertion.prototype
- * remove buffer test from expect
- * browser build
- * improve documentation of custom error messages
- * Merge branch 'master' of git://github.com/Liffft/chai into Liffft-master
- * browser build
- * improved buffer deep equal checking
- * mocha is npm test command
- * Cleaning up the js style…
- * expect tests now include message pass-through
- * packaging up browser-side changes…
- * Increasing Throws error message verbosity
- * Should syntax: piping message through
- * Make globalShould test work in browser too.
- * Add a setter for `Object.prototype.should`. Closes #86.
-
-1.2.0 / 2012-08-07
-==================
-
- * Merge branch 'feature/errmsg'
- * browser build
- * comment updates for utilities
- * tweak objDislay to only kick in if object inspection is too long
- * Merge branch 'master' into feature/errmsg
- * add display sample for error message refactor
- * first draft of error message refactor. #93
- * add `closeTo` assertion to `assert` interface. Closes #89.
- * update folio build for better require.js handling. Closes #85
- * Merge pull request #92 from paulmillr/topics/add-dom-checks
- * Add check for DOM objects.
- * browser build
- * Merge branch 'master' of github.com:chaijs/chai
- * bug - getActual not defaulting to assertion subject
- * Merge pull request #88 from pwnall/master
- * Don't inspect() assertion arguments if the assertion passes.
-
-1.1.1 / 2012-07-09
-==================
-
- * improve commonjs support on browser build
- * Merge pull request #83 from tkazec/equals
- * Document .equals
- * Add .equals as an alias of .equal
- * remove unused browser prefix/suffix
- * Merge branch 'feature/folio-build'
- * browser build
- * using folio to compile
- * clean up makefile
- * early folio 0.3.x support
-
-1.1.0 / 2012-06-26
-==================
-
- * browser build
- * Disable "Assertion.includeStack is false" test in IE.
- * Use `utils.getName` for all function inspections.
- * Merge pull request #80 from kilianc/closeTo
- * fixes #79
- * browser build
- * expand docs to indicate change of subject for chaining. Closes #78
- * add `that` chain noop
- * Merge branch 'bug/74'
- * comments on how to property use `length` as chain. Closes #74
- * tests for length as chainable property. #74
- * add support for `length` as chainable prop/method.
- * Merge branch 'bug/77'
- * tests for getPathValue when working with nested arrays. Closes #77
- * add getPathValue support for nested arrays
- * browser build
- * fix bug for missing browser utils
- * compile tool aware of new folder layout
- * Merge branch 'refactor/1dot1'
- * move core assertions to own file and refactor all using utils
- * rearrange folder structure
-
-1.0.4 / 2012-06-03
-==================
-
- * Merge pull request #68 from fizker/itself
- * Added itself chain.
- * simplify error inspections for cross browser compatibility
- * fix safari `addChainableMethod` errors. Closes #69
-
-1.0.3 / 2012-05-27
-==================
-
- * Point Travis badge to the right place.
- * Make error message for eql/deep.equal more clear.
- * Fix .not.deep.equal.
- * contributors list
-
-1.0.2 / 2012-05-26
-==================
-
- * Merge pull request #67 from chaijs/chaining-and-flags
- * Browser build.
- * Use `addChainableMethod` to get away from `__proto__` manipulation.
- * New `addChainableMethod` utility.
- * Replace `getAllFlags` with `transferFlags` utility.
- * browser build
- * test - get all flags
- * utility - get all flags
- * Add .mailmap to .npmignore.
- * Add a .mailmap file to fix my name in shortlogs.
-
-1.0.1 / 2012-05-18
-==================
-
- * browser build
- * Fixing "an" vs. "a" grammar in type assertions.
- * Uniformize `assert` interface inline docs.
- * Don't use `instanceof` for `assert.isArray`.
- * Add `deep` flag for equality and property value.
- * Merge pull request #64 from chaijs/assertion-docs
- * Uniformize assertion inline docs.
- * Add npm-debug.log to .gitignore.
- * no reserved words as actuals. #62
-
-1.0.0 / 2012-05-15
-==================
-
- * readme cleanup
- * browser build
- * utility comments
- * removed docs
- * update to package.json
- * docs build
- * comments / docs updates
- * plugins app cleanup
- * Merge pull request #61 from joliss/doc
- * Fix and improve documentation of assert.equal and friends
- * browser build
- * doc checkpoint - texture
- * Update chai-jquery link
- * Use defined return value of Assertion extension functions
- * Update utility docs
-
-1.0.0-rc3 / 2012-05-09
-==================
-
- * Merge branch 'feature/rc3'
- * docs update
- * browser build
- * assert test conformity for minor refactor api
- * assert minor refactor
- * update util tests for new add/overwrite prop/method format
- * added chai.Assertion.add/overwrite prop/method for plugin toolbox
- * add/overwrite prop/method don't make assumptions about context
- * doc test suite
- * docs don't need coverage
- * refactor all simple chains into one forEach loop, for clean documentation
- * updated npm ignore
- * remove old docs
- * docs checkpoint - guide styled
- * Merge pull request #59 from joliss/doc
- * Document how to run the test suite
- * don't need to rebuild docs to view
- * dep update
- * docs checkpoint - api section
- * comment updates for docs
- * new doc site checkpoint - plugin directory!
- * Merge pull request #57 from kossnocorp/patch-1
- * Fix typo: devDependancies → devDependencies
- * Using message flag in `getMessage` util instead of old `msg` property.
- * Adding self to package.json contributors.
- * `getMessage` shouldn't choke on null/omitted messages.
- * `return this` not necessary in example.
- * `return this` not necessary in example.
- * Sinon–Chai has a dash
- * updated plugins list for docs
-
-1.0.0-rc2 / 2012-05-06
-==================
-
- * Merge branch 'feature/test-cov'
- * browser build
- * missing assert tests for ownProperty
- * appropriate assert equivalent for expect.to.have.property(key, val)
- * reset AssertionError to include full stack
- * test for plugin utilities
- * overwrite Property and Method now ensure chain
- * version notes in readme
-
-1.0.0-rc1 / 2012-05-04
-==================
-
- * browser build (rc1)
- * assert match/notMatch tests
- * assert interface - notMatch, ownProperty, notOwnProperty, ownPropertyVal, ownPropertyNotVal
- * cleaner should interface export.
- * added chai.Assertion.prototype._obj (getter) for quick access to object flag
- * moved almostEqual / almostDeepEqual to stats plugin
- * added mocha.opts
- * Add test for `utils.addMethod`
- * Fix a typo
- * Add test for `utils.overwriteMethod`
- * Fix a typo
- * Browser build
- * Add undefined assertion
- * Add null assertion
- * Fix an issue with `mocha --watch`
- * travis no longer tests on node 0.4.x
- * removing unnecissary carbon dep
- * Merge branch 'feature/plugins-app'
- * docs build
- * templates for docs express app for plugin directory
- * express app for plugin and static serving
- * added web server deps
- * Merge pull request #54 from josher19/master
- * Remove old test.assert code
- * Use util.inspect instead of inspect for deepAlmostEqual and almostEqual
- * browser build
- * Added almostEqual and deepAlmostEqual to assert test suite.
- * bug - context determinants for utils
- * dec=0 means rounding, so assert.deepAlmostEqual({pi: 3.1416}, {pi: 3}, 0) is true
- * wrong travis link
- * readme updates for version information
- * travis tests 0.5.x branch as well
- * [bug] util `addProperty` not correctly exporting
- * read me version notes
- * browser build 1.0.0alpha1
- * not using reserved words in internal assertions. #52
- * version tick
- * clean up redundant tests
- * Merge branch 'refs/heads/0.6.x'
- * update version tag in package 1.0.0alpha1
- * browser build
- * added utility tests to browser specs
- * beginning utility testing
- * updated utility comments
- * utility - overwriteMethod
- * utility - overwriteProperty
- * utility - addMethod
- * utility - addProperty
- * missing ;
- * contributors list update
- * Merge branch 'refs/heads/0.6.x-docs' into 0.6.x
- * Added guide link to docs. WIP
- * Include/contain are now both properties and methods
- * Add an alias annotation
- * Remove usless function wrapper
- * Fix a typo
- * A/an are now both properties and methods
- * [docs] new site homepage layout / color checkpoint
- * Ignore IE-specific error properties.
- * Fixing order of error message test.
- * New cross-browser `getName` util.
- * Fixing up `AssertionError` inheritance.
- * backup docs
- * Add doctypes
- * [bug] was still using `constructor.name` in `throw` assertion
- * [bug] flag Object.create(null) instead of new Object
- * [test] browser build
- * [refactor] all usage of Assertion.prototype.assert now uses template tags and flags
- * [refactor] remove Assertion.prototype.inspect for testable object inspection
- * [refactor] object to test is now stored in flag, with ssfi and custom message
- * [bug] flag util - don't return on `set`
- * [docs] comments for getMessage utility
- * [feature] getMessage
- * [feature] testing utilities
- * [refactor] flag doesn't require `call`
- * Make order of source files well-defined
- * Added support for throw(errorInstance).
- * Use a foolproof method of grabbing an error's name.
- * Removed constructor.name check from throw.
- * disabled stackTrack configuration tests until api is stable again
- * first version of line displayed error for node js (unstable)
- * refactor core Assertion to use flag utility for negation
- * added flag utility
- * tests for assert interface negatives. Closed #42
- * added assertion negatives that were missing. #42
- * Support for expected and actual parameters in assert-style error object
- * chai as promised - readme
- * Added assert.fail. Closes #40
- * better error message for assert.operator. Closes #39
- * [refactor] Assertion#property to use getPathValue property
- * added getPathValue utility helper
- * removed todo about browser build
- * version notes
- * version bumb 0.6.0
- * browser build
- * [refactor] browser compile function to replace with `require('./error')' with 'require('./browser/error')'
- * [feature] browser uses different error.js
- * [refactor] error without chai.fail
- * Assertion & interfaces use new utils helper export
- * [refactor] primary export for new plugin util usage
- * added util index.js helper
- * added 2012 to copyright headers
- * Added DeepEqual assertions
-
-0.5.3 / 2012-04-21
-==================
-
- * Merge branch 'refs/heads/jgonera-oldbrowsers'
- * browser build
- * fixed reserved names for old browsers in interface/assert
- * fixed reserved names for old browsers in interface/should
- * fixed: chai.js no longer contains fail()
- * fixed reserved names for old browsers in Assertion
- * Merge pull request #49 from joliss/build-order
- * Make order of source files well-defined
- * Merge pull request #43 from zzen/patch-1
- * Support for expected and actual parameters in assert-style error object
- * chai as promised - readme
-
-0.5.2 / 2012-03-21
-==================
-
- * browser build
- * Merge branch 'feature/assert-fail'
- * Added assert.fail. Closes #40
- * Merge branch 'bug/operator-msg'
- * better error message for assert.operator. Closes #39
- * version notes
-
-0.5.1 / 2012-03-14
-==================
-
- * chai.fail no longer exists
- * Merge branch 'feature/assertdefined'
- * Added asset#isDefined. Closes #37.
- * dev docs update for Assertion#assert
-
-0.5.0 / 2012-03-07
-==================
-
- * [bug] on inspect of reg on n 0.4.12
- * Merge branch 'bug/33-throws'
- * Merge pull request #35 from logicalparadox/empty-object
- * browser build
- * updated #throw docs
- * Assertion#throw `should` tests updated
- * Assertion#throw `expect` tests
- * Should interface supports multiple throw parameters
- * Update Assertion#throw to support strings and type checks.
- * Add more tests for `empty` in `should`.
- * Add more tests for `empty` in `expect`.
- * Merge branch 'master' into empty-object
- * don't switch act/exp
- * Merge pull request #34 from logicalparadox/assert-operator
- * Update the compiled verison.
- * Add `assert.operator`.
- * Notes on messages. #22
- * browser build
- * have been test
- * below tests
- * Merge branch 'feature/actexp'
- * browser build
- * remove unnecessary fail export
- * full support for actual/expected where relevant
- * Assertion.assert support expected value
- * clean up error
- * Update the compiled version.
- * Add object & sane arguments support to `Assertion#empty`.
-
-0.4.2 / 2012-02-28
-==================
-
- * fix for `process` not available in browser when used via browserify. Closes #28
- * Merge pull request #31 from joliss/doc
- * Document that "should" works in browsers other than IE
- * Merge pull request #30 from logicalparadox/assert-tests
- * Update the browser version of chai.
- * Update `assert.doesNotThrow` test in order to check the use case when type is a string.
- * Add test for `assert.ifError`.
- * Falsey -> falsy.
- * Full coverage for `assert.throws` and `assert.doesNotThrow`.
- * Add test for `assert.doesNotThrow`.
- * Add test for `assert.throws`.
- * Add test for `assert.length`.
- * Add test for `assert.include`.
- * Add test for `assert.isBoolean`.
- * Fix the implementation of `assert.isNumber`.
- * Add test for `assert.isNumber`.
- * Add test for `assert.isString`.
- * Add test for `assert.isArray`.
- * Add test for `assert.isUndefined`.
- * Add test for `assert.isNotNull`.
- * Fix `assert.isNotNull` implementation.
- * Fix `assert.isNull` implementation.
- * Add test for `assert.isNull`.
- * Add test for `assert.notDeepEqual`.
- * Add test for `assert.deepEqual`.
- * Add test for `assert.notStrictEqual`.
- * Add test for `assert.strictEqual`.
- * Add test for `assert.notEqual`.
-
-0.4.1 / 2012-02-26
-==================
-
- * Merge pull request #27 from logicalparadox/type-fix
- * Update the browser version.
- * Add should tests for type checks.
- * Add function type check test.
- * Add more type checks tests.
- * Add test for `new Number` type check.
- * Fix type of actual checks.
-
-0.4.0 / 2012-02-25
-==================
-
- * docs and readme for upcoming 0.4.0
- * docs generated
- * putting coverage and tests for docs in docs/out/support
- * make docs
- * makefile copy necessary resources for tests in docs
- * rename configuration test
- * Merge pull request #21 from logicalparadox/close-to
- * Update the browser version.
- * Update `closeTo()` docs.
- * Add `Assertion.closeTo()` method.
- * Add `.closeTo()` should test.
- * Add `.closeTo()` expect test.
- * Merge pull request #20 from logicalparadox/satisfy
- * Update the browser version.
- * `..` -> `()` in `.satisfy()` should test.
- * Update example for `.satisfy()`.
- * Update the compiled browser version.
- * Add `Assertion.satisfy()` method.
- * Add `.satisfy()` should test.
- * Add `.satisfy()` expect test.
- * Merge pull request #19 from logicalparadox/respond-to
- * Update the compiled browser version.
- * Add `respondTo` Assertion.
- * Add `respondTo` should test.
- * Add `respondTo` expect test.
- * Merge branch 'feature/coverage'
- * mocha coverage support
- * doc contributors
- * README contributors
-
-0.3.4 / 2012-02-23
-==================
-
- * inline comment typos for #15
- * Merge branch 'refs/heads/jeffbski-configErrorStackCompat'
- * includeStack documentation for all interfaces
- * suite name more generic
- * Update test to be compatible with browsers that do not support err.stack
- * udpated compiled chai.js and added to browser tests
- * Allow inclusion of stack trace for Assert error messages to be configurable
- * docs sharing buttons
- * sinon-chai link
- * doc updates
- * read me updates include plugins
-
-0.3.3 / 2012-02-12
-==================
-
- * Merge pull request #14 from jfirebaugh/configurable_properties
- * Make Assertion.prototype properties configurable
-
-0.3.2 / 2012-02-10
-==================
-
- * codex version
- * docs
- * docs cleanup
-
-0.3.1 / 2012-02-07
-==================
-
- * node 0.4.x compat
-
-0.3.0 / 2012-02-07
-==================
-
- * Merge branch 'feature/03x'
- * browser build
- * remove html/json/headers testign
- * regex error.message testing
- * tests for using plugins
- * Merge pull request #11 from domenic/master
- * Make `chai.use` a no-op if the function has already been used.
-
-0.2.4 / 2012-02-02
-==================
-
- * added in past tense switch for `been`
-
-0.2.3 / 2012-02-01
-==================
-
- * try that again
-
-0.2.2 / 2012-02-01
-==================
-
- * added `been` (past of `be`) alias
-
-0.2.1 / 2012-01-29
-==================
-
- * added Throw, with a capital T, as an alias to `throw` (#7)
-
-0.2.0 / 2012-01-26
-==================
-
- * update gitignore for vim *.swp
- * Merge branch 'feature/plugins'
- * browser build
- * interfaces now work with use
- * simple .use function. See #9.
- * readme notice on browser compat
-
-0.1.7 / 2012-01-25
-==================
-
- * added assert tests to browser test runner
- * browser update
- * `should` interface patch for primitives support in FF
- * fix isObject() Thanks @milewise
- * travis only on branch `master`
- * add instanceof alias `instanceOf`. #6
- * some tests for assert module
-
-0.1.6 / 2012-01-02
-==================
-
- * commenting for assert interface
- * updated codex dep
-
-0.1.5 / 2012-01-02
-==================
-
- * browser tests pass
- * type in should.not.equal
- * test for should (not) exist
- * added should.exist and should.not.exist
- * browser uses tdd
- * convert tests to tdd
-
-0.1.4 / 2011-12-26
-==================
-
- * browser lib update for new assert interface compatiblitiy
- * inspect typos
- * added strict equal + negatives and ifError
- * interface assert had doesNotThrow
- * added should tests to browser
- * new expect empty tests
- * should test browser compat
- * Fix typo for instanceof docs. Closes #3 [ci skip]
-
-0.1.3 / 2011-12-18
-==================
-
- * much cleaner reporting string on error.
-
-0.1.2 / 2011-12-18
-==================
-
- * [docs] for upcoming 0.1.2
- * browser version built with pre/suffix … all tests passing
- * make / compile now use prefix/suffix correctly
- * code clean
- * prefix/suffix to wrap browser output to prevent conflicts with other `require` methods.
- * Merge branch 'feature/should4xcompatibility'
- * compile for browser tests.. all pass
- * added header/status/html/json
- * throw tests
- * should.throw & should.not.throw shortcuts
- * improved `throw` type detection and messaging
- * contain is now `include` … keys modifier is now `contain`
- * removed object() test
- * removed #respondTo
- * Merge branch 'bug/2'
- * replaced __defineGetter__ with defineProperty for all uses
- * [docs] change mp tracking code
- * docs site updated with assert (TDD) interface
- * updated doc comments for assert interface
-
-0.1.1 / 2011-12-16
-==================
-
- * docs ready for upcoming 0.1.1
- * readme image fixed [ci skip]
- * more readme tweaks [ci skip]
- * réadmet image fixed [ci skip]
- * documentation
- * codex locked in version 0.0.5
- * more comments to assertions for docs
- * assertions fully commented, browser library updated
- * adding codex as doc dependancy
- * prepping for docs
- * assertion component completely commented for documentation
- * added exist test
- * var expect outside of browser if check
- * added keywords to package.json
-
-0.1.0 / 2011-12-15
-==================
-
- * failing on purpose successful .. back to normal
- * testing travis failure
- * assert#arguments getter
- * readme typo
- * updated README
- * added travis and npmignore
- * copyright notices … think i got them all
- * moved expect interface to own file for consistency
- * assert ui deepEqual
- * browser tests expect (all working)
- * browser version built
- * chai.fail (should ui)
- * expect tests browser compatible
- * tests for should and expect (all pass)
- * moved fail to primary export
- * should compatibility testing
- * within, greaterThan, object, keys,
- * Aliases
- * Assertion#property now correctly works with negate and undefined values
- * error message language matches should
- * Assertion#respondTo
- * Assertion now uses inspect util
- * git ignore node modules
- * should is exported
- * AssertionError __proto__ from Error.prototype
- * add should interface for should.js compatibility
- * moved eql to until folder and added inspect from (joyent/node)
- * added mocha for testing
- * browser build for current api
- * multiple .property assertions
- * added deep equal from node
-
-0.0.2 / 2011-12-07
-==================
-
- * cleaner output on error
- * improved exists detection
- * package remnant artifact
- * empty deep equal
- * test browser build
- * assertion cleanup
- * client compile script
- * makefile
- * most of the basic assertions
- * allow no parameters to assertion error
- * name change
- * assertion error instance
- * main exports: assert() & expect()
- * initialize
diff --git a/tests/lib/chai-1.9.0/Makefile b/tests/lib/chai-1.9.0/Makefile
deleted file mode 100644
index 684fe8cfb9..0000000000
--- a/tests/lib/chai-1.9.0/Makefile
+++ /dev/null
@@ -1,93 +0,0 @@
-
-TESTS = test/*.js
-REPORTER = dot
-
-#
-# Browser Build
-#
-
-all: chai.js
-
-chai.js: node_modules lib/* components
- @printf "==> [Browser :: build]\n"
- @./node_modules/.bin/component-build -s chai -o .
- @mv build.js chai.js
-
-#
-# Node Module
-#
-
-node_modules: package.json
- @npm install
-
-#
-# Components
-#
-
-build: components lib/*
- @printf "==> [Component :: build]\n"
- @./node_modules/.bin/component-build --dev
-
-components: node_modules component.json
- @printf "==> [Component :: install]\n"
- @./node_modules/.bin/component-install --dev
-
-#
-# Tests
-#
-
-test: test-node test-phantom
-
-test-node: node_modules
- @printf "==> [Test :: Node.js]\n"
- @NODE_ENV=test ./node_modules/.bin/mocha \
- --require ./test/bootstrap \
- --reporter $(REPORTER) \
- $(TESTS)
-
-test-cov: node_modules
- @NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- \
- --require ./test/bootstrap \
- $(TESTS) \
-
-test-phantom: build
- @printf "==> [Test :: Karma (PhantomJS)]\n"
- @./node_modules/karma/bin/karma start \
- --single-run --browsers PhantomJS
-
-test-sauce: build
- @printf "==> [Test :: Karma (Sauce)]\n"
- @CHAI_TEST_ENV=sauce ./node_modules/karma/bin/karma start \
- --single-run
-
-test-travisci:
- @echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
- @make test-cov
- @make test-sauce
-
-#
-# Clean up
-#
-
-clean: clean-node clean-browser clean-components clean-cov
-
-clean-node:
- @rm -rf node_modules
-
-clean-browser:
- @rm -f chai.js
-
-clean-components:
- @rm -rf build
- @rm -rf components
-
-clean-cov:
- @rm -rf coverage
-
-#
-# Instructions
-#
-
-.PHONY: all
-.PHONY: test test-all test-node test-phantom test-sauce test-cov
-.PHONY: clean clean-node clean-browser clean-components clean-cov
diff --git a/tests/lib/chai-1.9.0/README.md b/tests/lib/chai-1.9.0/README.md
deleted file mode 100644
index 91a68d9ff5..0000000000
--- a/tests/lib/chai-1.9.0/README.md
+++ /dev/null
@@ -1,86 +0,0 @@
-[![Chai Documentation](http://chaijs.com/public/img/chai-logo.png)](http://chaijs.com)
-
-Chai is a BDD / TDD assertion library for [node](http://nodejs.org) and the browser that
-can be delightfully paired with any javascript testing framework.
-
-For more information or to download plugins, view the [documentation](http://chaijs.com).
-
-[![Build Status](https://travis-ci.org/chaijs/chai.png?branch=master)](https://travis-ci.org/chaijs/chai)
-
-[![Selenium Test Status](https://saucelabs.com/browser-matrix/chaijs.svg)](https://saucelabs.com/u/chaijs)
-
-### Related Projects
-
-- [chaijs / assertion-error](https://github.com/chaijs/assertion-error): Custom `Error` constructor thrown upon an assertion failing.
-- [chaijs / deep-eql](https://github.com/chaijs/deep-eql): Improved deep equality testing for Node.js and the browser.
-
-### Contributors
-
- project : chai
- repo age : 2 years, 2 months ago
- commits : 735
- active : 158 days
- files : 56
- authors :
- 532 Jake Luer 72.4%
- 79 Veselin Todorov 10.7%
- 43 Domenic Denicola 5.9%
- 6 Ruben Verborgh 0.8%
- 5 George Kats 0.7%
- 5 Jo Liss 0.7%
- 5 Juliusz Gonera 0.7%
- 5 Scott Nonnenberg 0.7%
- 4 John Firebaugh 0.5%
- 4 Max Edmands 0.5%
- 4 Nick Heiner 0.5%
- 4 josher19 0.5%
- 3 Andrei Neculau 0.4%
- 3 Jake Rosoman 0.4%
- 3 Jeff Barczewski 0.4%
- 3 Ryunosuke SATO 0.4%
- 2 Bartvds 0.3%
- 2 Duncan Beevers 0.3%
- 2 Edwin Shao 0.3%
- 2 Jakub Nešetřil 0.3%
- 2 Teddy Cross 0.3%
- 1 Anand Patil 0.1%
- 1 Benjamin Horsleben 0.1%
- 1 Brandon Payton 0.1%
- 1 Chris Connelly 0.1%
- 1 Chun-Yi 0.1%
- 1 DD 0.1%
- 1 Jeff Welch 0.1%
- 1 Kilian Ciuffolo 0.1%
- 1 Niklas Närhinen 0.1%
- 1 Paul Miller 0.1%
- 1 Sasha Koss 0.1%
- 1 Veselin 0.1%
- 1 Victor Costan 0.1%
- 1 Vinay Pulim 0.1%
- 1 Virginie BARDALES 0.1%
- 1 laconbass 0.1%
- 1 piecioshka 0.1%
-
-## License
-
-(The MIT License)
-
-Copyright (c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
-
-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.
diff --git a/tests/lib/chai-1.9.0/ReleaseNotes.md b/tests/lib/chai-1.9.0/ReleaseNotes.md
deleted file mode 100644
index d39f673f10..0000000000
--- a/tests/lib/chai-1.9.0/ReleaseNotes.md
+++ /dev/null
@@ -1,397 +0,0 @@
-# Release Notes
-
-## 1.9.0 / 2014-01-29
-
-The following changes are required if you are upgrading from the previous version:
-
-- **Users:**
- - No changes required
-- **Plugin Developers:**
- - Review [#219](https://github.com/chaijs/chai/pull/219).
-- **Core Contributors:**
- - Refresh `node_modules` folder for updated dependencies.
-
-### Community Contributions
-
-- [#202](https://github.com/chaijs/chai/pull/201) Improve error message for .throw(). [@andreineculau](https://github.com/andreineculau)
-- [#217](https://github.com/chaijs/chai/pull/217) Chai tests can be run with `--watch`. [@demands](https://github.com/demands)
-- [#219](https://github.com/chaijs/chai/pull/219) Add overwriteChainableMethod utility. [@demands](https://github.com/demands)
-- [#224](https://github.com/chaijs/chai/pull/224) Return error on throw method to chain on error properties. [@vbardales](https://github.com/vbardales)
-- [#226](https://github.com/chaijs/chai/pull/226) Add `has` to language chains. [@duncanbeevers](https://github.com/duncanbeevers)
-- [#230](https://github.com/chaijs/chai/pull/230) Support `{a:1,b:2}.should.include({a:1})` [@jkroso](https://github.com/jkroso)
-- [#231](https://github.com/chaijs/chai/pull/231) Update Copyright notices to 2014 [@duncanbeevers](https://github.com/duncanbeevers)
-- [#232](https://github.com/chaijs/chai/pull/232) Avoid error instantiation if possible on assert.throws. [@laconbass](https://github.com/laconbass)
-
-Thank you to all who took time to contribute!
-
-### Other Bug Fixes
-
-- [#225](https://github.com/chaijs/chai/pull/225) Improved AMD wrapper provided by upstream `component(1)`.
-- [#185](https://github.com/chaijs/chai/issues/185) `assert.throws()` returns thrown error for further assertions.
-- [#237](https://github.com/chaijs/chai/pull/237) Remove coveralls/jscoverage, include istanbul coverage report in travis test.
-- Update Karma and Sauce runner versions for consistent CI results. No more karma@canary.
-
-## 1.8.1 / 2013-10-10
-
-The following changes are required if you are upgrading from the previous version:
-
-- **Users:**
- - Refresh `node_modules` folder for updated dependencies.
-- **Plugin Developers:**
- - No changes required
-- **Core Contributors:**
- - Refresh `node_modules` folder for updated dependencies.
-
-### Browserify
-
-This is a small patch that updates the dependency tree so browserify users can install
-chai. (Remove conditional requires)
-
-## 1.8.0 / 2013-09-18
-
-The following changes are required if you are upgrading from the previous version:
-
-- **Users:**
- - See `deep.equal` notes.
-- **Plugin Developers:**
- - No changes required
-- **Core Contributors:**
- - Refresh `node_modules` folder for updated dependencies.
-
-### Deep Equals
-
-This version of Chai focused on a overhaul to the deep equal utility. The code for this
-tool has been removed from the core lib and can now be found at:
-[chai / deep-eql](https://github.com/chaijs/deep-eql). As stated in previous releases,
-this is part of a larger initiative to provide transparency, independent testing, and coverage for
-some of the more complicated internal tools.
-
-For the most part `.deep.equal` will behave the same as it has. However, in order to provide a
-consistent ruleset across all types being tested, the following changes have been made and _might_
-require changes to your tests.
-
-**1.** Strict equality for non-traversable nodes according to [egal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
-
-_Previously:_ Non-traversable equal via `===`.
-
-```js
-expect(NaN).to.deep.equal(NaN);
-expect(-0).to.not.deep.equal(+0);
-```
-
-**2.** Arguments are not Arrays (and all types must be equal):
-
-_Previously:_ Some crazy nonsense that led to empty arrays deep equaling empty objects deep equaling dates.
-
-```js
-expect(arguments).to.not.deep.equal([]);
-expect(Array.prototype.slice.call(arguments)).to.deep.equal([]);
-```
-
-- [#156](https://github.com/chaijs/chai/issues/156) Empty object is eql to empty array
-- [#192](https://github.com/chaijs/chai/issues/192) empty object is eql to a Date object
-- [#194](https://github.com/chaijs/chai/issues/194) refactor deep-equal utility
-
-### CI and Browser Testing
-
-Chai now runs the browser CI suite using [Karma](http://karma-runner.github.io/) directed at
-[SauceLabs](https://saucelabs.com/). This means we get to know where our browser support stands...
-and we get a cool badge:
-
-[![Selenium Test Status](https://saucelabs.com/browser-matrix/logicalparadox.svg)](https://saucelabs.com/u/logicalparadox)
-
-Look for the list of browsers/versions to expand over the coming releases.
-
-- [#195](https://github.com/chaijs/chai/issues/195) karma test framework
-
-## 1.7.2 / 2013-06-27
-
-The following changes are required if you are upgrading from the previous version:
-
-- **Users:**
- - No changes required.
-- **Plugin Developers:**
- - No changes required
-- **Core Contributors:**
- - Refresh `node_modules` folder for updated dependencies.
-
-### Coverage Reporting
-
-Coverage reporting has always been available for core-developers but the data has never been published
-for our end users. In our ongoing effort to improve accountability this data will now be published via
-the [coveralls.io](https://coveralls.io/) service. A badge has been added to the README and the full report
-can be viewed online at the [chai coveralls project](https://coveralls.io/r/chaijs/chai). Furthermore, PRs
-will receive automated messages indicating how their PR impacts test coverage. This service is tied to TravisCI.
-
-### Other Fixes
-
-- [#175](https://github.com/chaijs/chai/issues/175) Add `bower.json`. (Fix ignore all)
-
-## 1.7.1 / 2013-06-24
-
-The following changes are required if you are upgrading from the previous version:
-
-- **Users:**
- - No changes required.
-- **Plugin Developers:**
- - No changes required
-- **Core Contributors:**
- - Refresh `node_modules` folder for updated dependencies.
-
-### Official Bower Support
-
-Support has been added for the Bower Package Manager ([bower.io])(http://bower.io/). Though
-Chai could be installed via Bower in the past, this update adds official support via the `bower.json`
-specification file.
-
-- [#175](https://github.com/chaijs/chai/issues/175) Add `bower.json`.
-
-## 1.7.0 / 2013-06-17
-
-The following changes are required if you are upgrading from the previous version:
-
-- **Users:**
- - No changes required.
-- **Plugin Developers:**
- - Review AssertionError update notice.
-- **Core Contributors:**
- - Refresh `node_modules` folder for updated dependencies.
-
-### AssertionError Update Notice
-
-Chai now uses [chaijs/assertion-error](https://github.com/chaijs/assertion-error) instead an internal
-constructor. This will allow for further iteration/experimentation of the AssertionError constructor
-independant of Chai. Future plans include stack parsing for callsite support.
-
-This update constructor has a different constructor param signature that conforms more with the standard
-`Error` object. If your plugin throws and `AssertionError` directly you will need to update your plugin
-with the new signature.
-
-```js
-var AssertionError = require('chai').AssertionError;
-
-/**
- * previous
- *
- * @param {Object} options
- */
-
-throw new AssertionError({
- message: 'An assertion error occurred'
- , actual: actual
- , expect: expect
- , startStackFunction: arguments.callee
- , showStack: true
-});
-
-/**
- * new
- *
- * @param {String} message
- * @param {Object} options
- * @param {Function} start stack function
- */
-
-throw new AssertionError('An assertion error occurred', {
- actual: actual
- , expect: expect
- , showStack: true
-}, arguments.callee);
-
-// other signatures
-throw new AssertionError('An assertion error occurred');
-throw new AssertionError('An assertion error occurred', null, arguments.callee);
-```
-
-#### External Dependencies
-
-This is the first non-developement dependency for Chai. As Chai continues to evolve we will begin adding
-more; the next will likely be improved type detection and deep equality. With Chai's userbase continually growing
-there is an higher need for accountability and documentation. External dependencies will allow us to iterate and
-test on features independent from our interfaces.
-
-Note: The browser packaged version `chai.js` will ALWAYS contain all dependencies needed to run Chai.
-
-### Community Contributions
-
-- [#169](https://github.com/chaijs/chai/pull/169) Fix deep equal comparison for Date/Regexp types. [@katsgeorgeek](https://github.com/katsgeorgeek)
-- [#171](https://github.com/chaijs/chai/pull/171) Add `assert.notOk()`. [@Bartvds](https://github.com/Bartvds)
-- [#173](https://github.com/chaijs/chai/pull/173) Fix `inspect` utility. [@domenic](https://github.com/domenic)
-
-Thank you to all who took the time to contribute!
-
-## 1.6.1 / 2013-06-05
-
-The following changes are required if you are upgrading from the previous version:
-
-- **Users:**
- - No changes required.
-- **Plugin Developers:**
- - No changes required.
-- **Core Contributors:**
- - Refresh `node_modules` folder for updated developement dependencies.
-
-### Deep Equality
-
-Regular Expressions are now tested as part of all deep equality assertions. In previous versions
-they silently passed for all scenarios. Thanks to [@katsgeorgeek](https://github.com/katsgeorgeek) for the contribution.
-
-### Community Contributions
-
-- [#161](https://github.com/chaijs/chai/pull/161) Fix documented name for assert interface's isDefined method. [@brandonpayton](https://github.com/brandonpayton)
-- [#168](https://github.com/chaijs/chai/pull/168) Fix comparison equality of two regexps for when using deep equality. [@katsgeorgeek](https://github.com/katsgeorgeek)
-
-Thank you to all who took the time to contribute!
-
-### Additional Notes
-
-- Mocha has been locked at version `1.8.x` to ensure `mocha-phantomjs` compatibility.
-
-## 1.6.0 / 2013-04-29
-
-The following changes are required if you are upgrading from the previous version:
-
-- **Users:**
- - No changes required.
-- **Plugin Developers:**
- - No changes required.
-- **Core Contributors:**
- - Refresh `node_modules` folder for updated developement dependencies.
-
-### New Assertions
-
-#### Array Members Inclusion
-
-Asserts that the target is a superset of `set`, or that the target and `set` have the same members.
-Order is not taken into account. Thanks to [@NickHeiner](https://github.com/NickHeiner) for the contribution.
-
-```js
-// (expect/should) full set
-expect([4, 2]).to.have.members([2, 4]);
-expect([5, 2]).to.not.have.members([5, 2, 1]);
-
-// (expect/should) inclusion
-expect([1, 2, 3]).to.include.members([3, 2]);
-expect([1, 2, 3]).to.not.include.members([3, 2, 8]);
-
-// (assert) full set
-assert.sameMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'same members');
-
-// (assert) inclusion
-assert.includeMembers([ 1, 2, 3 ], [ 2, 1 ], 'include members');
-
-```
-
-#### Non-inclusion for Assert Interface
-
-Most `assert` functions have a negative version, like `instanceOf()` has a corresponding `notInstaceOf()`.
-However `include()` did not have a corresponding `notInclude()`. This has been added.
-
-```js
-assert.notInclude([ 1, 2, 3 ], 8);
-assert.notInclude('foobar', 'baz');
-```
-
-### Community Contributions
-
-- [#140](https://github.com/chaijs/chai/pull/140) Restore `call`/`apply` methods for plugin interface. [@RubenVerborgh](https://github.com/RubenVerborgh)
-- [#148](https://github.com/chaijs/chai/issues/148)/[#153](https://github.com/chaijs/chai/pull/153) Add `members` and `include.members` assertions. [#NickHeiner](https://github.com/NickHeiner)
-
-Thank you to all who took time to contribute!
-
-### Other Bug Fixes
-
-- [#142](https://github.com/chaijs/chai/issues/142) `assert#include` will no longer silently pass on wrong-type haystack.
-- [#158](https://github.com/chaijs/chai/issues/158) `assert#notInclude` has been added.
-- Travis-CI now tests Node.js `v0.10.x`. Support for `v0.6.x` has been removed. `v0.8.x` is still tested as before.
-
-## 1.5.0 / 2013-02-03
-
-### Migration Requirements
-
-The following changes are required if you are upgrading from the previous version:
-
-- **Users:**
- - _Update [2013-02-04]:_ Some users may notice a small subset of deep equality assertions will no longer pass. This is the result of
- [#120](https://github.com/chaijs/chai/issues/120), an improvement to our deep equality algorithm. Users will need to revise their assertions
- to be more granular should this occur. Further information: [#139](https://github.com/chaijs/chai/issues/139).
-- **Plugin Developers:**
- - No changes required.
-- **Core Contributors:**
- - Refresh `node_modules` folder for updated developement dependencies.
-
-### Community Contributions
-
-- [#126](https://github.com/chaijs/chai/pull/126): Add `eqls` alias for `eql`. [@RubenVerborgh](https://github.com/RubenVerborgh)
-- [#127](https://github.com/chaijs/chai/issues/127): Performance refactor for chainable methods. [@RubenVerborgh](https://github.com/RubenVerborgh)
-- [#133](https://github.com/chaijs/chai/pull/133): Assertion `.throw` support for primitives. [@RubenVerborgh](https://github.com/RubenVerborgh)
-- [#137](https://github.com/chaijs/chai/issues/137): Assertion `.throw` support for empty messages. [@timnew](https://github.com/timnew)
-- [#136](https://github.com/chaijs/chai/pull/136): Fix backward negation messages when using `.above()` and `.below()`. [@whatthejeff](https://github.com/whatthejeff)
-
-Thank you to all who took time to contribute!
-
-### Other Bug Fixes
-
-- Improve type detection of `.a()`/`.an()` to work in cross-browser scenarios.
-- [#116](https://github.com/chaijs/chai/issues/116): `.throw()` has cleaner display of errors when WebKit browsers.
-- [#120](https://github.com/chaijs/chai/issues/120): `.eql()` now works to compare dom nodes in browsers.
-
-### Usage Updates
-
-#### For Users
-
-**1. Component Support:** Chai now included the proper configuration to be installed as a
-[component](https://github.com/component/component). Component users are encouraged to consult
-[chaijs.com](http://chaijs.com) for the latest version number as using the master branch
-does not gaurantee stability.
-
-```js
-// relevant component.json
- devDependencies: {
- "chaijs/chai": "1.5.0"
- }
-```
-
-Alternatively, bleeding-edge is available:
-
- $ component install chaijs/chai
-
-**2. Configurable showDiff:** Some test runners (such as [mocha](http://visionmedia.github.com/mocha/))
-include support for showing the diff of strings and objects when an equality error occurs. Chai has
-already included support for this, however some users may not prefer this display behavior. To revert to
-no diff display, the following configuration is available:
-
-```js
-chai.Assertion.showDiff = false; // diff output disabled
-chai.Assertion.showDiff = true; // default, diff output enabled
-```
-
-#### For Plugin Developers
-
-**1. New Utility - type**: The new utility `.type()` is available as a better implementation of `typeof`
-that can be used cross-browser. It handles the inconsistencies of Array, `null`, and `undefined` detection.
-
-- **@param** _{Mixed}_ object to detect type of
-- **@return** _{String}_ object type
-
-```js
-chai.use(function (c, utils) {
- // some examples
- utils.type({}); // 'object'
- utils.type(null); // `null'
- utils.type(undefined); // `undefined`
- utils.type([]); // `array`
-});
-```
-
-#### For Core Contributors
-
-**1. Browser Testing**: Browser testing of the `./chai.js` file is now available in the command line
-via PhantomJS. `make test` and Travis-CI will now also rebuild and test `./chai.js`. Consequently, all
-pull requests will now be browser tested in this way.
-
-_Note: Contributors opening pull requests should still NOT include the browser build._
-
-**2. SauceLabs Testing**: Early SauceLab support has been enabled with the file `./support/mocha-cloud.js`.
-Those interested in trying it out should create a free [Open Sauce](https://saucelabs.com/signup/plan) account
-and include their credentials in `./test/auth/sauce.json`.
diff --git a/tests/lib/chai-1.9.0/bower.json b/tests/lib/chai-1.9.0/bower.json
deleted file mode 100644
index f38a5f10a2..0000000000
--- a/tests/lib/chai-1.9.0/bower.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "name": "chai"
- , "version": "1.9.0"
- , "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic."
- , "license": "MIT"
- , "keywords": [
- "test"
- , "assertion"
- , "assert"
- , "testing"
- , "chai"
- ]
- , "main": "chai.js"
- , "ignore": [
- "build"
- , "components"
- , "lib"
- , "node_modules"
- , "support"
- , "test"
- , "index.js"
- , "Makefile"
- , ".*"
- ]
- , "dependencies": {}
- , "devDependencies": {}
-}
diff --git a/tests/lib/chai-1.9.0/chai.js b/tests/lib/chai-1.9.0/chai.js
deleted file mode 100644
index 80e31b6eef..0000000000
--- a/tests/lib/chai-1.9.0/chai.js
+++ /dev/null
@@ -1,4682 +0,0 @@
-;(function(){
-
-/**
- * Require the given path.
- *
- * @param {String} path
- * @return {Object} exports
- * @api public
- */
-
-function require(path, parent, orig) {
- var resolved = require.resolve(path);
-
- // lookup failed
- if (null == resolved) {
- orig = orig || path;
- parent = parent || 'root';
- var err = new Error('Failed to require "' + orig + '" from "' + parent + '"');
- err.path = orig;
- err.parent = parent;
- err.require = true;
- throw err;
- }
-
- var module = require.modules[resolved];
-
- // perform real require()
- // by invoking the module's
- // registered function
- if (!module._resolving && !module.exports) {
- var mod = {};
- mod.exports = {};
- mod.client = mod.component = true;
- module._resolving = true;
- module.call(this, mod.exports, require.relative(resolved), mod);
- delete module._resolving;
- module.exports = mod.exports;
- }
-
- return module.exports;
-}
-
-/**
- * Registered modules.
- */
-
-require.modules = {};
-
-/**
- * Registered aliases.
- */
-
-require.aliases = {};
-
-/**
- * Resolve `path`.
- *
- * Lookup:
- *
- * - PATH/index.js
- * - PATH.js
- * - PATH
- *
- * @param {String} path
- * @return {String} path or null
- * @api private
- */
-
-require.resolve = function(path) {
- if (path.charAt(0) === '/') path = path.slice(1);
-
- var paths = [
- path,
- path + '.js',
- path + '.json',
- path + '/index.js',
- path + '/index.json'
- ];
-
- for (var i = 0; i < paths.length; i++) {
- var path = paths[i];
- if (require.modules.hasOwnProperty(path)) return path;
- if (require.aliases.hasOwnProperty(path)) return require.aliases[path];
- }
-};
-
-/**
- * Normalize `path` relative to the current path.
- *
- * @param {String} curr
- * @param {String} path
- * @return {String}
- * @api private
- */
-
-require.normalize = function(curr, path) {
- var segs = [];
-
- if ('.' != path.charAt(0)) return path;
-
- curr = curr.split('/');
- path = path.split('/');
-
- for (var i = 0; i < path.length; ++i) {
- if ('..' == path[i]) {
- curr.pop();
- } else if ('.' != path[i] && '' != path[i]) {
- segs.push(path[i]);
- }
- }
-
- return curr.concat(segs).join('/');
-};
-
-/**
- * Register module at `path` with callback `definition`.
- *
- * @param {String} path
- * @param {Function} definition
- * @api private
- */
-
-require.register = function(path, definition) {
- require.modules[path] = definition;
-};
-
-/**
- * Alias a module definition.
- *
- * @param {String} from
- * @param {String} to
- * @api private
- */
-
-require.alias = function(from, to) {
- if (!require.modules.hasOwnProperty(from)) {
- throw new Error('Failed to alias "' + from + '", it does not exist');
- }
- require.aliases[to] = from;
-};
-
-/**
- * Return a require function relative to the `parent` path.
- *
- * @param {String} parent
- * @return {Function}
- * @api private
- */
-
-require.relative = function(parent) {
- var p = require.normalize(parent, '..');
-
- /**
- * lastIndexOf helper.
- */
-
- function lastIndexOf(arr, obj) {
- var i = arr.length;
- while (i--) {
- if (arr[i] === obj) return i;
- }
- return -1;
- }
-
- /**
- * The relative require() itself.
- */
-
- function localRequire(path) {
- var resolved = localRequire.resolve(path);
- return require(resolved, parent, path);
- }
-
- /**
- * Resolve relative to the parent.
- */
-
- localRequire.resolve = function(path) {
- var c = path.charAt(0);
- if ('/' == c) return path.slice(1);
- if ('.' == c) return require.normalize(p, path);
-
- // resolve deps by returning
- // the dep in the nearest "deps"
- // directory
- var segs = parent.split('/');
- var i = lastIndexOf(segs, 'deps') + 1;
- if (!i) i = 0;
- path = segs.slice(0, i + 1).join('/') + '/deps/' + path;
- return path;
- };
-
- /**
- * Check if module is defined at `path`.
- */
-
- localRequire.exists = function(path) {
- return require.modules.hasOwnProperty(localRequire.resolve(path));
- };
-
- return localRequire;
-};
-require.register("chaijs-assertion-error/index.js", function(exports, require, module){
-/*!
- * assertion-error
- * Copyright(c) 2013 Jake Luer <jake@qualiancy.com>
- * MIT Licensed
- */
-
-/*!
- * Return a function that will copy properties from
- * one object to another excluding any originally
- * listed. Returned function will create a new `{}`.
- *
- * @param {String} excluded properties ...
- * @return {Function}
- */
-
-function exclude () {
- var excludes = [].slice.call(arguments);
-
- function excludeProps (res, obj) {
- Object.keys(obj).forEach(function (key) {
- if (!~excludes.indexOf(key)) res[key] = obj[key];
- });
- }
-
- return function extendExclude () {
- var args = [].slice.call(arguments)
- , i = 0
- , res = {};
-
- for (; i < args.length; i++) {
- excludeProps(res, args[i]);
- }
-
- return res;
- };
-};
-
-/*!
- * Primary Exports
- */
-
-module.exports = AssertionError;
-
-/**
- * ### AssertionError
- *
- * An extension of the JavaScript `Error` constructor for
- * assertion and validation scenarios.
- *
- * @param {String} message
- * @param {Object} properties to include (optional)
- * @param {callee} start stack function (optional)
- */
-
-function AssertionError (message, _props, ssf) {
- var extend = exclude('name', 'message', 'stack', 'constructor', 'toJSON')
- , props = extend(_props || {});
-
- // default values
- this.message = message || 'Unspecified AssertionError';
- this.showDiff = false;
-
- // copy from properties
- for (var key in props) {
- this[key] = props[key];
- }
-
- // capture stack trace
- ssf = ssf || arguments.callee;
- if (ssf && Error.captureStackTrace) {
- Error.captureStackTrace(this, ssf);
- }
-}
-
-/*!
- * Inherit from Error.prototype
- */
-
-AssertionError.prototype = Object.create(Error.prototype);
-
-/*!
- * Statically set name
- */
-
-AssertionError.prototype.name = 'AssertionError';
-
-/*!
- * Ensure correct constructor
- */
-
-AssertionError.prototype.constructor = AssertionError;
-
-/**
- * Allow errors to be converted to JSON for static transfer.
- *
- * @param {Boolean} include stack (default: `true`)
- * @return {Object} object that can be `JSON.stringify`
- */
-
-AssertionError.prototype.toJSON = function (stack) {
- var extend = exclude('constructor', 'toJSON', 'stack')
- , props = extend({ name: this.name }, this);
-
- // include stack if exists and not turned off
- if (false !== stack && this.stack) {
- props.stack = this.stack;
- }
-
- return props;
-};
-
-});
-require.register("chaijs-type-detect/lib/type.js", function(exports, require, module){
-/*!
- * type-detect
- * Copyright(c) 2013 jake luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Primary Exports
- */
-
-var exports = module.exports = getType;
-
-/*!
- * Detectable javascript natives
- */
-
-var natives = {
- '[object Array]': 'array'
- , '[object RegExp]': 'regexp'
- , '[object Function]': 'function'
- , '[object Arguments]': 'arguments'
- , '[object Date]': 'date'
-};
-
-/**
- * ### typeOf (obj)
- *
- * Use several different techniques to determine
- * the type of object being tested.
- *
- *
- * @param {Mixed} object
- * @return {String} object type
- * @api public
- */
-
-function getType (obj) {
- var str = Object.prototype.toString.call(obj);
- if (natives[str]) return natives[str];
- if (obj === null) return 'null';
- if (obj === undefined) return 'undefined';
- if (obj === Object(obj)) return 'object';
- return typeof obj;
-}
-
-exports.Library = Library;
-
-/**
- * ### Library
- *
- * Create a repository for custom type detection.
- *
- * ```js
- * var lib = new type.Library;
- * ```
- *
- */
-
-function Library () {
- this.tests = {};
-}
-
-/**
- * #### .of (obj)
- *
- * Expose replacement `typeof` detection to the library.
- *
- * ```js
- * if ('string' === lib.of('hello world')) {
- * // ...
- * }
- * ```
- *
- * @param {Mixed} object to test
- * @return {String} type
- */
-
-Library.prototype.of = getType;
-
-/**
- * #### .define (type, test)
- *
- * Add a test to for the `.test()` assertion.
- *
- * Can be defined as a regular expression:
- *
- * ```js
- * lib.define('int', /^[0-9]+$/);
- * ```
- *
- * ... or as a function:
- *
- * ```js
- * lib.define('bln', function (obj) {
- * if ('boolean' === lib.of(obj)) return true;
- * var blns = [ 'yes', 'no', 'true', 'false', 1, 0 ];
- * if ('string' === lib.of(obj)) obj = obj.toLowerCase();
- * return !! ~blns.indexOf(obj);
- * });
- * ```
- *
- * @param {String} type
- * @param {RegExp|Function} test
- * @api public
- */
-
-Library.prototype.define = function (type, test) {
- if (arguments.length === 1) return this.tests[type];
- this.tests[type] = test;
- return this;
-};
-
-/**
- * #### .test (obj, test)
- *
- * Assert that an object is of type. Will first
- * check natives, and if that does not pass it will
- * use the user defined custom tests.
- *
- * ```js
- * assert(lib.test('1', 'int'));
- * assert(lib.test('yes', 'bln'));
- * ```
- *
- * @param {Mixed} object
- * @param {String} type
- * @return {Boolean} result
- * @api public
- */
-
-Library.prototype.test = function (obj, type) {
- if (type === getType(obj)) return true;
- var test = this.tests[type];
-
- if (test && 'regexp' === getType(test)) {
- return test.test(obj);
- } else if (test && 'function' === getType(test)) {
- return test(obj);
- } else {
- throw new ReferenceError('Type test "' + type + '" not defined or invalid.');
- }
-};
-
-});
-require.register("chaijs-deep-eql/lib/eql.js", function(exports, require, module){
-/*!
- * deep-eql
- * Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependencies
- */
-
-var type = require('type-detect');
-
-/*!
- * Buffer.isBuffer browser shim
- */
-
-var Buffer;
-try { Buffer = require('buffer').Buffer; }
-catch(ex) {
- Buffer = {};
- Buffer.isBuffer = function() { return false; }
-}
-
-/*!
- * Primary Export
- */
-
-module.exports = deepEqual;
-
-/**
- * Assert super-strict (egal) equality between
- * two objects of any type.
- *
- * @param {Mixed} a
- * @param {Mixed} b
- * @param {Array} memoised (optional)
- * @return {Boolean} equal match
- */
-
-function deepEqual(a, b, m) {
- if (sameValue(a, b)) {
- return true;
- } else if ('date' === type(a)) {
- return dateEqual(a, b);
- } else if ('regexp' === type(a)) {
- return regexpEqual(a, b);
- } else if (Buffer.isBuffer(a)) {
- return bufferEqual(a, b);
- } else if ('arguments' === type(a)) {
- return argumentsEqual(a, b, m);
- } else if (!typeEqual(a, b)) {
- return false;
- } else if (('object' !== type(a) && 'object' !== type(b))
- && ('array' !== type(a) && 'array' !== type(b))) {
- return sameValue(a, b);
- } else {
- return objectEqual(a, b, m);
- }
-}
-
-/*!
- * Strict (egal) equality test. Ensures that NaN always
- * equals NaN and `-0` does not equal `+0`.
- *
- * @param {Mixed} a
- * @param {Mixed} b
- * @return {Boolean} equal match
- */
-
-function sameValue(a, b) {
- if (a === b) return a !== 0 || 1 / a === 1 / b;
- return a !== a && b !== b;
-}
-
-/*!
- * Compare the types of two given objects and
- * return if they are equal. Note that an Array
- * has a type of `array` (not `object`) and arguments
- * have a type of `arguments` (not `array`/`object`).
- *
- * @param {Mixed} a
- * @param {Mixed} b
- * @return {Boolean} result
- */
-
-function typeEqual(a, b) {
- return type(a) === type(b);
-}
-
-/*!
- * Compare two Date objects by asserting that
- * the time values are equal using `saveValue`.
- *
- * @param {Date} a
- * @param {Date} b
- * @return {Boolean} result
- */
-
-function dateEqual(a, b) {
- if ('date' !== type(b)) return false;
- return sameValue(a.getTime(), b.getTime());
-}
-
-/*!
- * Compare two regular expressions by converting them
- * to string and checking for `sameValue`.
- *
- * @param {RegExp} a
- * @param {RegExp} b
- * @return {Boolean} result
- */
-
-function regexpEqual(a, b) {
- if ('regexp' !== type(b)) return false;
- return sameValue(a.toString(), b.toString());
-}
-
-/*!
- * Assert deep equality of two `arguments` objects.
- * Unfortunately, these must be sliced to arrays
- * prior to test to ensure no bad behavior.
- *
- * @param {Arguments} a
- * @param {Arguments} b
- * @param {Array} memoize (optional)
- * @return {Boolean} result
- */
-
-function argumentsEqual(a, b, m) {
- if ('arguments' !== type(b)) return false;
- a = [].slice.call(a);
- b = [].slice.call(b);
- return deepEqual(a, b, m);
-}
-
-/*!
- * Get enumerable properties of a given object.
- *
- * @param {Object} a
- * @return {Array} property names
- */
-
-function enumerable(a) {
- var res = [];
- for (var key in a) res.push(key);
- return res;
-}
-
-/*!
- * Simple equality for flat iterable objects
- * such as Arrays or Node.js buffers.
- *
- * @param {Iterable} a
- * @param {Iterable} b
- * @return {Boolean} result
- */
-
-function iterableEqual(a, b) {
- if (a.length !== b.length) return false;
-
- var i = 0;
- var match = true;
-
- for (; i < a.length; i++) {
- if (a[i] !== b[i]) {
- match = false;
- break;
- }
- }
-
- return match;
-}
-
-/*!
- * Extension to `iterableEqual` specifically
- * for Node.js Buffers.
- *
- * @param {Buffer} a
- * @param {Mixed} b
- * @return {Boolean} result
- */
-
-function bufferEqual(a, b) {
- if (!Buffer.isBuffer(b)) return false;
- return iterableEqual(a, b);
-}
-
-/*!
- * Block for `objectEqual` ensuring non-existing
- * values don't get in.
- *
- * @param {Mixed} object
- * @return {Boolean} result
- */
-
-function isValue(a) {
- return a !== null && a !== undefined;
-}
-
-/*!
- * Recursively check the equality of two objects.
- * Once basic sameness has been established it will
- * defer to `deepEqual` for each enumerable key
- * in the object.
- *
- * @param {Mixed} a
- * @param {Mixed} b
- * @return {Boolean} result
- */
-
-function objectEqual(a, b, m) {
- if (!isValue(a) || !isValue(b)) {
- return false;
- }
-
- if (a.prototype !== b.prototype) {
- return false;
- }
-
- var i;
- if (m) {
- for (i = 0; i < m.length; i++) {
- if ((m[i][0] === a && m[i][1] === b)
- || (m[i][0] === b && m[i][1] === a)) {
- return true;
- }
- }
- } else {
- m = [];
- }
-
- try {
- var ka = enumerable(a);
- var kb = enumerable(b);
- } catch (ex) {
- return false;
- }
-
- ka.sort();
- kb.sort();
-
- if (!iterableEqual(ka, kb)) {
- return false;
- }
-
- m.push([ a, b ]);
-
- var key;
- for (i = ka.length - 1; i >= 0; i--) {
- key = ka[i];
- if (!deepEqual(a[key], b[key], m)) {
- return false;
- }
- }
-
- return true;
-}
-
-});
-require.register("chai/index.js", function(exports, require, module){
-module.exports = require('./lib/chai');
-
-});
-require.register("chai/lib/chai.js", function(exports, require, module){
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-var used = []
- , exports = module.exports = {};
-
-/*!
- * Chai version
- */
-
-exports.version = '1.8.1';
-
-/*!
- * Assertion Error
- */
-
-exports.AssertionError = require('assertion-error');
-
-/*!
- * Utils for plugins (not exported)
- */
-
-var util = require('./chai/utils');
-
-/**
- * # .use(function)
- *
- * Provides a way to extend the internals of Chai
- *
- * @param {Function}
- * @returns {this} for chaining
- * @api public
- */
-
-exports.use = function (fn) {
- if (!~used.indexOf(fn)) {
- fn(this, util);
- used.push(fn);
- }
-
- return this;
-};
-
-/*!
- * Primary `Assertion` prototype
- */
-
-var assertion = require('./chai/assertion');
-exports.use(assertion);
-
-/*!
- * Core Assertions
- */
-
-var core = require('./chai/core/assertions');
-exports.use(core);
-
-/*!
- * Expect interface
- */
-
-var expect = require('./chai/interface/expect');
-exports.use(expect);
-
-/*!
- * Should interface
- */
-
-var should = require('./chai/interface/should');
-exports.use(should);
-
-/*!
- * Assert interface
- */
-
-var assert = require('./chai/interface/assert');
-exports.use(assert);
-
-});
-require.register("chai/lib/chai/assertion.js", function(exports, require, module){
-/*!
- * chai
- * http://chaijs.com
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (_chai, util) {
- /*!
- * Module dependencies.
- */
-
- var AssertionError = _chai.AssertionError
- , flag = util.flag;
-
- /*!
- * Module export.
- */
-
- _chai.Assertion = Assertion;
-
- /*!
- * Assertion Constructor
- *
- * Creates object for chaining.
- *
- * @api private
- */
-
- function Assertion (obj, msg, stack) {
- flag(this, 'ssfi', stack || arguments.callee);
- flag(this, 'object', obj);
- flag(this, 'message', msg);
- }
-
- /*!
- * ### Assertion.includeStack
- *
- * User configurable property, influences whether stack trace
- * is included in Assertion error message. Default of false
- * suppresses stack trace in the error message
- *
- * Assertion.includeStack = true; // enable stack on error
- *
- * @api public
- */
-
- Assertion.includeStack = false;
-
- /*!
- * ### Assertion.showDiff
- *
- * User configurable property, influences whether or not
- * the `showDiff` flag should be included in the thrown
- * AssertionErrors. `false` will always be `false`; `true`
- * will be true when the assertion has requested a diff
- * be shown.
- *
- * @api public
- */
-
- Assertion.showDiff = true;
-
- Assertion.addProperty = function (name, fn) {
- util.addProperty(this.prototype, name, fn);
- };
-
- Assertion.addMethod = function (name, fn) {
- util.addMethod(this.prototype, name, fn);
- };
-
- Assertion.addChainableMethod = function (name, fn, chainingBehavior) {
- util.addChainableMethod(this.prototype, name, fn, chainingBehavior);
- };
-
- Assertion.overwriteProperty = function (name, fn) {
- util.overwriteProperty(this.prototype, name, fn);
- };
-
- Assertion.overwriteMethod = function (name, fn) {
- util.overwriteMethod(this.prototype, name, fn);
- };
-
- Assertion.overwriteChainableMethod = function (name, fn, chainingBehavior) {
- util.overwriteChainableMethod(this.prototype, name, fn, chainingBehavior);
- };
-
- /*!
- * ### .assert(expression, message, negateMessage, expected, actual)
- *
- * Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass.
- *
- * @name assert
- * @param {Philosophical} expression to be tested
- * @param {String} message to display if fails
- * @param {String} negatedMessage to display if negated expression fails
- * @param {Mixed} expected value (remember to check for negation)
- * @param {Mixed} actual (optional) will default to `this.obj`
- * @api private
- */
-
- Assertion.prototype.assert = function (expr, msg, negateMsg, expected, _actual, showDiff) {
- var ok = util.test(this, arguments);
- if (true !== showDiff) showDiff = false;
- if (true !== Assertion.showDiff) showDiff = false;
-
- if (!ok) {
- var msg = util.getMessage(this, arguments)
- , actual = util.getActual(this, arguments);
- throw new AssertionError(msg, {
- actual: actual
- , expected: expected
- , showDiff: showDiff
- }, (Assertion.includeStack) ? this.assert : flag(this, 'ssfi'));
- }
- };
-
- /*!
- * ### ._obj
- *
- * Quick reference to stored `actual` value for plugin developers.
- *
- * @api private
- */
-
- Object.defineProperty(Assertion.prototype, '_obj',
- { get: function () {
- return flag(this, 'object');
- }
- , set: function (val) {
- flag(this, 'object', val);
- }
- });
-};
-
-});
-require.register("chai/lib/chai/core/assertions.js", function(exports, require, module){
-/*!
- * chai
- * http://chaijs.com
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (chai, _) {
- var Assertion = chai.Assertion
- , toString = Object.prototype.toString
- , flag = _.flag;
-
- /**
- * ### Language Chains
- *
- * The following are provided as chainable getters to
- * improve the readability of your assertions. They
- * do not provide an testing capability unless they
- * have been overwritten by a plugin.
- *
- * **Chains**
- *
- * - to
- * - be
- * - been
- * - is
- * - that
- * - and
- * - has
- * - have
- * - with
- * - at
- * - of
- * - same
- *
- * @name language chains
- * @api public
- */
-
- [ 'to', 'be', 'been'
- , 'is', 'and', 'has', 'have'
- , 'with', 'that', 'at'
- , 'of', 'same' ].forEach(function (chain) {
- Assertion.addProperty(chain, function () {
- return this;
- });
- });
-
- /**
- * ### .not
- *
- * Negates any of assertions following in the chain.
- *
- * expect(foo).to.not.equal('bar');
- * expect(goodFn).to.not.throw(Error);
- * expect({ foo: 'baz' }).to.have.property('foo')
- * .and.not.equal('bar');
- *
- * @name not
- * @api public
- */
-
- Assertion.addProperty('not', function () {
- flag(this, 'negate', true);
- });
-
- /**
- * ### .deep
- *
- * Sets the `deep` flag, later used by the `equal` and
- * `property` assertions.
- *
- * expect(foo).to.deep.equal({ bar: 'baz' });
- * expect({ foo: { bar: { baz: 'quux' } } })
- * .to.have.deep.property('foo.bar.baz', 'quux');
- *
- * @name deep
- * @api public
- */
-
- Assertion.addProperty('deep', function () {
- flag(this, 'deep', true);
- });
-
- /**
- * ### .a(type)
- *
- * The `a` and `an` assertions are aliases that can be
- * used either as language chains or to assert a value's
- * type.
- *
- * // typeof
- * expect('test').to.be.a('string');
- * expect({ foo: 'bar' }).to.be.an('object');
- * expect(null).to.be.a('null');
- * expect(undefined).to.be.an('undefined');
- *
- * // language chain
- * expect(foo).to.be.an.instanceof(Foo);
- *
- * @name a
- * @alias an
- * @param {String} type
- * @param {String} message _optional_
- * @api public
- */
-
- function an (type, msg) {
- if (msg) flag(this, 'message', msg);
- type = type.toLowerCase();
- var obj = flag(this, 'object')
- , article = ~[ 'a', 'e', 'i', 'o', 'u' ].indexOf(type.charAt(0)) ? 'an ' : 'a ';
-
- this.assert(
- type === _.type(obj)
- , 'expected #{this} to be ' + article + type
- , 'expected #{this} not to be ' + article + type
- );
- }
-
- Assertion.addChainableMethod('an', an);
- Assertion.addChainableMethod('a', an);
-
- /**
- * ### .include(value)
- *
- * The `include` and `contain` assertions can be used as either property
- * based language chains or as methods to assert the inclusion of an object
- * in an array or a substring in a string. When used as language chains,
- * they toggle the `contain` flag for the `keys` assertion.
- *
- * expect([1,2,3]).to.include(2);
- * expect('foobar').to.contain('foo');
- * expect({ foo: 'bar', hello: 'universe' }).to.include.keys('foo');
- *
- * @name include
- * @alias contain
- * @param {Object|String|Number} obj
- * @param {String} message _optional_
- * @api public
- */
-
- function includeChainingBehavior () {
- flag(this, 'contains', true);
- }
-
- function include (val, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
-
- if (_.type(val) === 'object') {
- if (!flag(this, 'negate')) {
- for (var k in val) new Assertion(obj).property(k, val[k]);
- return;
- }
- var subset = {}
- for (var k in val) subset[k] = obj[k]
- var expected = _.eql(subset, val);
- } else {
- var expected = obj && ~obj.indexOf(val)
- }
- this.assert(
- expected
- , 'expected #{this} to include ' + _.inspect(val)
- , 'expected #{this} to not include ' + _.inspect(val));
- }
-
- Assertion.addChainableMethod('include', include, includeChainingBehavior);
- Assertion.addChainableMethod('contain', include, includeChainingBehavior);
-
- /**
- * ### .ok
- *
- * Asserts that the target is truthy.
- *
- * expect('everthing').to.be.ok;
- * expect(1).to.be.ok;
- * expect(false).to.not.be.ok;
- * expect(undefined).to.not.be.ok;
- * expect(null).to.not.be.ok;
- *
- * @name ok
- * @api public
- */
-
- Assertion.addProperty('ok', function () {
- this.assert(
- flag(this, 'object')
- , 'expected #{this} to be truthy'
- , 'expected #{this} to be falsy');
- });
-
- /**
- * ### .true
- *
- * Asserts that the target is `true`.
- *
- * expect(true).to.be.true;
- * expect(1).to.not.be.true;
- *
- * @name true
- * @api public
- */
-
- Assertion.addProperty('true', function () {
- this.assert(
- true === flag(this, 'object')
- , 'expected #{this} to be true'
- , 'expected #{this} to be false'
- , this.negate ? false : true
- );
- });
-
- /**
- * ### .false
- *
- * Asserts that the target is `false`.
- *
- * expect(false).to.be.false;
- * expect(0).to.not.be.false;
- *
- * @name false
- * @api public
- */
-
- Assertion.addProperty('false', function () {
- this.assert(
- false === flag(this, 'object')
- , 'expected #{this} to be false'
- , 'expected #{this} to be true'
- , this.negate ? true : false
- );
- });
-
- /**
- * ### .null
- *
- * Asserts that the target is `null`.
- *
- * expect(null).to.be.null;
- * expect(undefined).not.to.be.null;
- *
- * @name null
- * @api public
- */
-
- Assertion.addProperty('null', function () {
- this.assert(
- null === flag(this, 'object')
- , 'expected #{this} to be null'
- , 'expected #{this} not to be null'
- );
- });
-
- /**
- * ### .undefined
- *
- * Asserts that the target is `undefined`.
- *
- * expect(undefined).to.be.undefined;
- * expect(null).to.not.be.undefined;
- *
- * @name undefined
- * @api public
- */
-
- Assertion.addProperty('undefined', function () {
- this.assert(
- undefined === flag(this, 'object')
- , 'expected #{this} to be undefined'
- , 'expected #{this} not to be undefined'
- );
- });
-
- /**
- * ### .exist
- *
- * Asserts that the target is neither `null` nor `undefined`.
- *
- * var foo = 'hi'
- * , bar = null
- * , baz;
- *
- * expect(foo).to.exist;
- * expect(bar).to.not.exist;
- * expect(baz).to.not.exist;
- *
- * @name exist
- * @api public
- */
-
- Assertion.addProperty('exist', function () {
- this.assert(
- null != flag(this, 'object')
- , 'expected #{this} to exist'
- , 'expected #{this} to not exist'
- );
- });
-
- /**
- * ### .empty
- *
- * Asserts that the target's length is `0`. For arrays, it checks
- * the `length` property. For objects, it gets the count of
- * enumerable keys.
- *
- * expect([]).to.be.empty;
- * expect('').to.be.empty;
- * expect({}).to.be.empty;
- *
- * @name empty
- * @api public
- */
-
- Assertion.addProperty('empty', function () {
- var obj = flag(this, 'object')
- , expected = obj;
-
- if (Array.isArray(obj) || 'string' === typeof object) {
- expected = obj.length;
- } else if (typeof obj === 'object') {
- expected = Object.keys(obj).length;
- }
-
- this.assert(
- !expected
- , 'expected #{this} to be empty'
- , 'expected #{this} not to be empty'
- );
- });
-
- /**
- * ### .arguments
- *
- * Asserts that the target is an arguments object.
- *
- * function test () {
- * expect(arguments).to.be.arguments;
- * }
- *
- * @name arguments
- * @alias Arguments
- * @api public
- */
-
- function checkArguments () {
- var obj = flag(this, 'object')
- , type = Object.prototype.toString.call(obj);
- this.assert(
- '[object Arguments]' === type
- , 'expected #{this} to be arguments but got ' + type
- , 'expected #{this} to not be arguments'
- );
- }
-
- Assertion.addProperty('arguments', checkArguments);
- Assertion.addProperty('Arguments', checkArguments);
-
- /**
- * ### .equal(value)
- *
- * Asserts that the target is strictly equal (`===`) to `value`.
- * Alternately, if the `deep` flag is set, asserts that
- * the target is deeply equal to `value`.
- *
- * expect('hello').to.equal('hello');
- * expect(42).to.equal(42);
- * expect(1).to.not.equal(true);
- * expect({ foo: 'bar' }).to.not.equal({ foo: 'bar' });
- * expect({ foo: 'bar' }).to.deep.equal({ foo: 'bar' });
- *
- * @name equal
- * @alias equals
- * @alias eq
- * @alias deep.equal
- * @param {Mixed} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertEqual (val, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'deep')) {
- return this.eql(val);
- } else {
- this.assert(
- val === obj
- , 'expected #{this} to equal #{exp}'
- , 'expected #{this} to not equal #{exp}'
- , val
- , this._obj
- , true
- );
- }
- }
-
- Assertion.addMethod('equal', assertEqual);
- Assertion.addMethod('equals', assertEqual);
- Assertion.addMethod('eq', assertEqual);
-
- /**
- * ### .eql(value)
- *
- * Asserts that the target is deeply equal to `value`.
- *
- * expect({ foo: 'bar' }).to.eql({ foo: 'bar' });
- * expect([ 1, 2, 3 ]).to.eql([ 1, 2, 3 ]);
- *
- * @name eql
- * @alias eqls
- * @param {Mixed} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertEql(obj, msg) {
- if (msg) flag(this, 'message', msg);
- this.assert(
- _.eql(obj, flag(this, 'object'))
- , 'expected #{this} to deeply equal #{exp}'
- , 'expected #{this} to not deeply equal #{exp}'
- , obj
- , this._obj
- , true
- );
- }
-
- Assertion.addMethod('eql', assertEql);
- Assertion.addMethod('eqls', assertEql);
-
- /**
- * ### .above(value)
- *
- * Asserts that the target is greater than `value`.
- *
- * expect(10).to.be.above(5);
- *
- * Can also be used in conjunction with `length` to
- * assert a minimum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.above(2);
- * expect([ 1, 2, 3 ]).to.have.length.above(2);
- *
- * @name above
- * @alias gt
- * @alias greaterThan
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertAbove (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len > n
- , 'expected #{this} to have a length above #{exp} but got #{act}'
- , 'expected #{this} to not have a length above #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj > n
- , 'expected #{this} to be above ' + n
- , 'expected #{this} to be at most ' + n
- );
- }
- }
-
- Assertion.addMethod('above', assertAbove);
- Assertion.addMethod('gt', assertAbove);
- Assertion.addMethod('greaterThan', assertAbove);
-
- /**
- * ### .least(value)
- *
- * Asserts that the target is greater than or equal to `value`.
- *
- * expect(10).to.be.at.least(10);
- *
- * Can also be used in conjunction with `length` to
- * assert a minimum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.of.at.least(2);
- * expect([ 1, 2, 3 ]).to.have.length.of.at.least(3);
- *
- * @name least
- * @alias gte
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertLeast (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len >= n
- , 'expected #{this} to have a length at least #{exp} but got #{act}'
- , 'expected #{this} to have a length below #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj >= n
- , 'expected #{this} to be at least ' + n
- , 'expected #{this} to be below ' + n
- );
- }
- }
-
- Assertion.addMethod('least', assertLeast);
- Assertion.addMethod('gte', assertLeast);
-
- /**
- * ### .below(value)
- *
- * Asserts that the target is less than `value`.
- *
- * expect(5).to.be.below(10);
- *
- * Can also be used in conjunction with `length` to
- * assert a maximum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.below(4);
- * expect([ 1, 2, 3 ]).to.have.length.below(4);
- *
- * @name below
- * @alias lt
- * @alias lessThan
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertBelow (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len < n
- , 'expected #{this} to have a length below #{exp} but got #{act}'
- , 'expected #{this} to not have a length below #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj < n
- , 'expected #{this} to be below ' + n
- , 'expected #{this} to be at least ' + n
- );
- }
- }
-
- Assertion.addMethod('below', assertBelow);
- Assertion.addMethod('lt', assertBelow);
- Assertion.addMethod('lessThan', assertBelow);
-
- /**
- * ### .most(value)
- *
- * Asserts that the target is less than or equal to `value`.
- *
- * expect(5).to.be.at.most(5);
- *
- * Can also be used in conjunction with `length` to
- * assert a maximum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.of.at.most(4);
- * expect([ 1, 2, 3 ]).to.have.length.of.at.most(3);
- *
- * @name most
- * @alias lte
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertMost (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len <= n
- , 'expected #{this} to have a length at most #{exp} but got #{act}'
- , 'expected #{this} to have a length above #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj <= n
- , 'expected #{this} to be at most ' + n
- , 'expected #{this} to be above ' + n
- );
- }
- }
-
- Assertion.addMethod('most', assertMost);
- Assertion.addMethod('lte', assertMost);
-
- /**
- * ### .within(start, finish)
- *
- * Asserts that the target is within a range.
- *
- * expect(7).to.be.within(5,10);
- *
- * Can also be used in conjunction with `length` to
- * assert a length range. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.within(2,4);
- * expect([ 1, 2, 3 ]).to.have.length.within(2,4);
- *
- * @name within
- * @param {Number} start lowerbound inclusive
- * @param {Number} finish upperbound inclusive
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('within', function (start, finish, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object')
- , range = start + '..' + finish;
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len >= start && len <= finish
- , 'expected #{this} to have a length within ' + range
- , 'expected #{this} to not have a length within ' + range
- );
- } else {
- this.assert(
- obj >= start && obj <= finish
- , 'expected #{this} to be within ' + range
- , 'expected #{this} to not be within ' + range
- );
- }
- });
-
- /**
- * ### .instanceof(constructor)
- *
- * Asserts that the target is an instance of `constructor`.
- *
- * var Tea = function (name) { this.name = name; }
- * , Chai = new Tea('chai');
- *
- * expect(Chai).to.be.an.instanceof(Tea);
- * expect([ 1, 2, 3 ]).to.be.instanceof(Array);
- *
- * @name instanceof
- * @param {Constructor} constructor
- * @param {String} message _optional_
- * @alias instanceOf
- * @api public
- */
-
- function assertInstanceOf (constructor, msg) {
- if (msg) flag(this, 'message', msg);
- var name = _.getName(constructor);
- this.assert(
- flag(this, 'object') instanceof constructor
- , 'expected #{this} to be an instance of ' + name
- , 'expected #{this} to not be an instance of ' + name
- );
- };
-
- Assertion.addMethod('instanceof', assertInstanceOf);
- Assertion.addMethod('instanceOf', assertInstanceOf);
-
- /**
- * ### .property(name, [value])
- *
- * Asserts that the target has a property `name`, optionally asserting that
- * the value of that property is strictly equal to `value`.
- * If the `deep` flag is set, you can use dot- and bracket-notation for deep
- * references into objects and arrays.
- *
- * // simple referencing
- * var obj = { foo: 'bar' };
- * expect(obj).to.have.property('foo');
- * expect(obj).to.have.property('foo', 'bar');
- *
- * // deep referencing
- * var deepObj = {
- * green: { tea: 'matcha' }
- * , teas: [ 'chai', 'matcha', { tea: 'konacha' } ]
- * };
-
- * expect(deepObj).to.have.deep.property('green.tea', 'matcha');
- * expect(deepObj).to.have.deep.property('teas[1]', 'matcha');
- * expect(deepObj).to.have.deep.property('teas[2].tea', 'konacha');
- *
- * You can also use an array as the starting point of a `deep.property`
- * assertion, or traverse nested arrays.
- *
- * var arr = [
- * [ 'chai', 'matcha', 'konacha' ]
- * , [ { tea: 'chai' }
- * , { tea: 'matcha' }
- * , { tea: 'konacha' } ]
- * ];
- *
- * expect(arr).to.have.deep.property('[0][1]', 'matcha');
- * expect(arr).to.have.deep.property('[1][2].tea', 'konacha');
- *
- * Furthermore, `property` changes the subject of the assertion
- * to be the value of that property from the original object. This
- * permits for further chainable assertions on that property.
- *
- * expect(obj).to.have.property('foo')
- * .that.is.a('string');
- * expect(deepObj).to.have.property('green')
- * .that.is.an('object')
- * .that.deep.equals({ tea: 'matcha' });
- * expect(deepObj).to.have.property('teas')
- * .that.is.an('array')
- * .with.deep.property('[2]')
- * .that.deep.equals({ tea: 'konacha' });
- *
- * @name property
- * @alias deep.property
- * @param {String} name
- * @param {Mixed} value (optional)
- * @param {String} message _optional_
- * @returns value of property for chaining
- * @api public
- */
-
- Assertion.addMethod('property', function (name, val, msg) {
- if (msg) flag(this, 'message', msg);
-
- var descriptor = flag(this, 'deep') ? 'deep property ' : 'property '
- , negate = flag(this, 'negate')
- , obj = flag(this, 'object')
- , value = flag(this, 'deep')
- ? _.getPathValue(name, obj)
- : obj[name];
-
- if (negate && undefined !== val) {
- if (undefined === value) {
- msg = (msg != null) ? msg + ': ' : '';
- throw new Error(msg + _.inspect(obj) + ' has no ' + descriptor + _.inspect(name));
- }
- } else {
- this.assert(
- undefined !== value
- , 'expected #{this} to have a ' + descriptor + _.inspect(name)
- , 'expected #{this} to not have ' + descriptor + _.inspect(name));
- }
-
- if (undefined !== val) {
- this.assert(
- val === value
- , 'expected #{this} to have a ' + descriptor + _.inspect(name) + ' of #{exp}, but got #{act}'
- , 'expected #{this} to not have a ' + descriptor + _.inspect(name) + ' of #{act}'
- , val
- , value
- );
- }
-
- flag(this, 'object', value);
- });
-
- /**
- * ### .ownProperty(name)
- *
- * Asserts that the target has an own property `name`.
- *
- * expect('test').to.have.ownProperty('length');
- *
- * @name ownProperty
- * @alias haveOwnProperty
- * @param {String} name
- * @param {String} message _optional_
- * @api public
- */
-
- function assertOwnProperty (name, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- this.assert(
- obj.hasOwnProperty(name)
- , 'expected #{this} to have own property ' + _.inspect(name)
- , 'expected #{this} to not have own property ' + _.inspect(name)
- );
- }
-
- Assertion.addMethod('ownProperty', assertOwnProperty);
- Assertion.addMethod('haveOwnProperty', assertOwnProperty);
-
- /**
- * ### .length(value)
- *
- * Asserts that the target's `length` property has
- * the expected value.
- *
- * expect([ 1, 2, 3]).to.have.length(3);
- * expect('foobar').to.have.length(6);
- *
- * Can also be used as a chain precursor to a value
- * comparison for the length property.
- *
- * expect('foo').to.have.length.above(2);
- * expect([ 1, 2, 3 ]).to.have.length.above(2);
- * expect('foo').to.have.length.below(4);
- * expect([ 1, 2, 3 ]).to.have.length.below(4);
- * expect('foo').to.have.length.within(2,4);
- * expect([ 1, 2, 3 ]).to.have.length.within(2,4);
- *
- * @name length
- * @alias lengthOf
- * @param {Number} length
- * @param {String} message _optional_
- * @api public
- */
-
- function assertLengthChain () {
- flag(this, 'doLength', true);
- }
-
- function assertLength (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
-
- this.assert(
- len == n
- , 'expected #{this} to have a length of #{exp} but got #{act}'
- , 'expected #{this} to not have a length of #{act}'
- , n
- , len
- );
- }
-
- Assertion.addChainableMethod('length', assertLength, assertLengthChain);
- Assertion.addMethod('lengthOf', assertLength, assertLengthChain);
-
- /**
- * ### .match(regexp)
- *
- * Asserts that the target matches a regular expression.
- *
- * expect('foobar').to.match(/^foo/);
- *
- * @name match
- * @param {RegExp} RegularExpression
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('match', function (re, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- this.assert(
- re.exec(obj)
- , 'expected #{this} to match ' + re
- , 'expected #{this} not to match ' + re
- );
- });
-
- /**
- * ### .string(string)
- *
- * Asserts that the string target contains another string.
- *
- * expect('foobar').to.have.string('bar');
- *
- * @name string
- * @param {String} string
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('string', function (str, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- new Assertion(obj, msg).is.a('string');
-
- this.assert(
- ~obj.indexOf(str)
- , 'expected #{this} to contain ' + _.inspect(str)
- , 'expected #{this} to not contain ' + _.inspect(str)
- );
- });
-
- /**
- * ### .keys(key1, [key2], [...])
- *
- * Asserts that the target has exactly the given keys, or
- * asserts the inclusion of some keys when using the
- * `include` or `contain` modifiers.
- *
- * expect({ foo: 1, bar: 2 }).to.have.keys(['foo', 'bar']);
- * expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('foo', 'bar');
- *
- * @name keys
- * @alias key
- * @param {String...|Array} keys
- * @api public
- */
-
- function assertKeys (keys) {
- var obj = flag(this, 'object')
- , str
- , ok = true;
-
- keys = keys instanceof Array
- ? keys
- : Array.prototype.slice.call(arguments);
-
- if (!keys.length) throw new Error('keys required');
-
- var actual = Object.keys(obj)
- , len = keys.length;
-
- // Inclusion
- ok = keys.every(function(key){
- return ~actual.indexOf(key);
- });
-
- // Strict
- if (!flag(this, 'negate') && !flag(this, 'contains')) {
- ok = ok && keys.length == actual.length;
- }
-
- // Key string
- if (len > 1) {
- keys = keys.map(function(key){
- return _.inspect(key);
- });
- var last = keys.pop();
- str = keys.join(', ') + ', and ' + last;
- } else {
- str = _.inspect(keys[0]);
- }
-
- // Form
- str = (len > 1 ? 'keys ' : 'key ') + str;
-
- // Have / include
- str = (flag(this, 'contains') ? 'contain ' : 'have ') + str;
-
- // Assertion
- this.assert(
- ok
- , 'expected #{this} to ' + str
- , 'expected #{this} to not ' + str
- );
- }
-
- Assertion.addMethod('keys', assertKeys);
- Assertion.addMethod('key', assertKeys);
-
- /**
- * ### .throw(constructor)
- *
- * Asserts that the function target will throw a specific error, or specific type of error
- * (as determined using `instanceof`), optionally with a RegExp or string inclusion test
- * for the error's message.
- *
- * var err = new ReferenceError('This is a bad function.');
- * var fn = function () { throw err; }
- * expect(fn).to.throw(ReferenceError);
- * expect(fn).to.throw(Error);
- * expect(fn).to.throw(/bad function/);
- * expect(fn).to.not.throw('good function');
- * expect(fn).to.throw(ReferenceError, /bad function/);
- * expect(fn).to.throw(err);
- * expect(fn).to.not.throw(new RangeError('Out of range.'));
- *
- * Please note that when a throw expectation is negated, it will check each
- * parameter independently, starting with error constructor type. The appropriate way
- * to check for the existence of a type of error but for a message that does not match
- * is to use `and`.
- *
- * expect(fn).to.throw(ReferenceError)
- * .and.not.throw(/good function/);
- *
- * @name throw
- * @alias throws
- * @alias Throw
- * @param {ErrorConstructor} constructor
- * @param {String|RegExp} expected error message
- * @param {String} message _optional_
- * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
- * @returns error for chaining (null if no error)
- * @api public
- */
-
- function assertThrows (constructor, errMsg, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- new Assertion(obj, msg).is.a('function');
-
- var thrown = false
- , desiredError = null
- , name = null
- , thrownError = null;
-
- if (arguments.length === 0) {
- errMsg = null;
- constructor = null;
- } else if (constructor && (constructor instanceof RegExp || 'string' === typeof constructor)) {
- errMsg = constructor;
- constructor = null;
- } else if (constructor && constructor instanceof Error) {
- desiredError = constructor;
- constructor = null;
- errMsg = null;
- } else if (typeof constructor === 'function') {
- name = constructor.prototype.name || constructor.name;
- if (name === 'Error' && constructor !== Error) {
- name = (new constructor()).name;
- }
- } else {
- constructor = null;
- }
-
- try {
- obj();
- } catch (err) {
- // first, check desired error
- if (desiredError) {
- this.assert(
- err === desiredError
- , 'expected #{this} to throw #{exp} but #{act} was thrown'
- , 'expected #{this} to not throw #{exp}'
- , (desiredError instanceof Error ? desiredError.toString() : desiredError)
- , (err instanceof Error ? err.toString() : err)
- );
-
- flag(this, 'object', err);
- return this;
- }
-
- // next, check constructor
- if (constructor) {
- this.assert(
- err instanceof constructor
- , 'expected #{this} to throw #{exp} but #{act} was thrown'
- , 'expected #{this} to not throw #{exp} but #{act} was thrown'
- , name
- , (err instanceof Error ? err.toString() : err)
- );
-
- if (!errMsg) {
- flag(this, 'object', err);
- return this;
- }
- }
-
- // next, check message
- var message = 'object' === _.type(err) && "message" in err
- ? err.message
- : '' + err;
-
- if ((message != null) && errMsg && errMsg instanceof RegExp) {
- this.assert(
- errMsg.exec(message)
- , 'expected #{this} to throw error matching #{exp} but got #{act}'
- , 'expected #{this} to throw error not matching #{exp}'
- , errMsg
- , message
- );
-
- flag(this, 'object', err);
- return this;
- } else if ((message != null) && errMsg && 'string' === typeof errMsg) {
- this.assert(
- ~message.indexOf(errMsg)
- , 'expected #{this} to throw error including #{exp} but got #{act}'
- , 'expected #{this} to throw error not including #{act}'
- , errMsg
- , message
- );
-
- flag(this, 'object', err);
- return this;
- } else {
- thrown = true;
- thrownError = err;
- }
- }
-
- var actuallyGot = ''
- , expectedThrown = name !== null
- ? name
- : desiredError
- ? '#{exp}' //_.inspect(desiredError)
- : 'an error';
-
- if (thrown) {
- actuallyGot = ' but #{act} was thrown'
- }
-
- this.assert(
- thrown === true
- , 'expected #{this} to throw ' + expectedThrown + actuallyGot
- , 'expected #{this} to not throw ' + expectedThrown + actuallyGot
- , (desiredError instanceof Error ? desiredError.toString() : desiredError)
- , (thrownError instanceof Error ? thrownError.toString() : thrownError)
- );
-
- flag(this, 'object', thrownError);
- };
-
- Assertion.addMethod('throw', assertThrows);
- Assertion.addMethod('throws', assertThrows);
- Assertion.addMethod('Throw', assertThrows);
-
- /**
- * ### .respondTo(method)
- *
- * Asserts that the object or class target will respond to a method.
- *
- * Klass.prototype.bar = function(){};
- * expect(Klass).to.respondTo('bar');
- * expect(obj).to.respondTo('bar');
- *
- * To check if a constructor will respond to a static function,
- * set the `itself` flag.
- *
- * Klass.baz = function(){};
- * expect(Klass).itself.to.respondTo('baz');
- *
- * @name respondTo
- * @param {String} method
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('respondTo', function (method, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object')
- , itself = flag(this, 'itself')
- , context = ('function' === _.type(obj) && !itself)
- ? obj.prototype[method]
- : obj[method];
-
- this.assert(
- 'function' === typeof context
- , 'expected #{this} to respond to ' + _.inspect(method)
- , 'expected #{this} to not respond to ' + _.inspect(method)
- );
- });
-
- /**
- * ### .itself
- *
- * Sets the `itself` flag, later used by the `respondTo` assertion.
- *
- * function Foo() {}
- * Foo.bar = function() {}
- * Foo.prototype.baz = function() {}
- *
- * expect(Foo).itself.to.respondTo('bar');
- * expect(Foo).itself.not.to.respondTo('baz');
- *
- * @name itself
- * @api public
- */
-
- Assertion.addProperty('itself', function () {
- flag(this, 'itself', true);
- });
-
- /**
- * ### .satisfy(method)
- *
- * Asserts that the target passes a given truth test.
- *
- * expect(1).to.satisfy(function(num) { return num > 0; });
- *
- * @name satisfy
- * @param {Function} matcher
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('satisfy', function (matcher, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- this.assert(
- matcher(obj)
- , 'expected #{this} to satisfy ' + _.objDisplay(matcher)
- , 'expected #{this} to not satisfy' + _.objDisplay(matcher)
- , this.negate ? false : true
- , matcher(obj)
- );
- });
-
- /**
- * ### .closeTo(expected, delta)
- *
- * Asserts that the target is equal `expected`, to within a +/- `delta` range.
- *
- * expect(1.5).to.be.closeTo(1, 0.5);
- *
- * @name closeTo
- * @param {Number} expected
- * @param {Number} delta
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('closeTo', function (expected, delta, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- this.assert(
- Math.abs(obj - expected) <= delta
- , 'expected #{this} to be close to ' + expected + ' +/- ' + delta
- , 'expected #{this} not to be close to ' + expected + ' +/- ' + delta
- );
- });
-
- function isSubsetOf(subset, superset) {
- return subset.every(function(elem) {
- return superset.indexOf(elem) !== -1;
- })
- }
-
- /**
- * ### .members(set)
- *
- * Asserts that the target is a superset of `set`,
- * or that the target and `set` have the same members.
- *
- * expect([1, 2, 3]).to.include.members([3, 2]);
- * expect([1, 2, 3]).to.not.include.members([3, 2, 8]);
- *
- * expect([4, 2]).to.have.members([2, 4]);
- * expect([5, 2]).to.not.have.members([5, 2, 1]);
- *
- * @name members
- * @param {Array} set
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('members', function (subset, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
-
- new Assertion(obj).to.be.an('array');
- new Assertion(subset).to.be.an('array');
-
- if (flag(this, 'contains')) {
- return this.assert(
- isSubsetOf(subset, obj)
- , 'expected #{this} to be a superset of #{act}'
- , 'expected #{this} to not be a superset of #{act}'
- , obj
- , subset
- );
- }
-
- this.assert(
- isSubsetOf(obj, subset) && isSubsetOf(subset, obj)
- , 'expected #{this} to have the same members as #{act}'
- , 'expected #{this} to not have the same members as #{act}'
- , obj
- , subset
- );
- });
-};
-
-});
-require.register("chai/lib/chai/interface/assert.js", function(exports, require, module){
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (chai, util) {
-
- /*!
- * Chai dependencies.
- */
-
- var Assertion = chai.Assertion
- , flag = util.flag;
-
- /*!
- * Module export.
- */
-
- /**
- * ### assert(expression, message)
- *
- * Write your own test expressions.
- *
- * assert('foo' !== 'bar', 'foo is not bar');
- * assert(Array.isArray([]), 'empty arrays are arrays');
- *
- * @param {Mixed} expression to test for truthiness
- * @param {String} message to display on error
- * @name assert
- * @api public
- */
-
- var assert = chai.assert = function (express, errmsg) {
- var test = new Assertion(null);
- test.assert(
- express
- , errmsg
- , '[ negation message unavailable ]'
- );
- };
-
- /**
- * ### .fail(actual, expected, [message], [operator])
- *
- * Throw a failure. Node.js `assert` module-compatible.
- *
- * @name fail
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @param {String} operator
- * @api public
- */
-
- assert.fail = function (actual, expected, message, operator) {
- message = message || 'assert.fail()';
- throw new chai.AssertionError(message, {
- actual: actual
- , expected: expected
- , operator: operator
- }, assert.fail);
- };
-
- /**
- * ### .ok(object, [message])
- *
- * Asserts that `object` is truthy.
- *
- * assert.ok('everything', 'everything is ok');
- * assert.ok(false, 'this will fail');
- *
- * @name ok
- * @param {Mixed} object to test
- * @param {String} message
- * @api public
- */
-
- assert.ok = function (val, msg) {
- new Assertion(val, msg).is.ok;
- };
-
- /**
- * ### .notOk(object, [message])
- *
- * Asserts that `object` is falsy.
- *
- * assert.notOk('everything', 'this will fail');
- * assert.notOk(false, 'this will pass');
- *
- * @name notOk
- * @param {Mixed} object to test
- * @param {String} message
- * @api public
- */
-
- assert.notOk = function (val, msg) {
- new Assertion(val, msg).is.not.ok;
- };
-
- /**
- * ### .equal(actual, expected, [message])
- *
- * Asserts non-strict equality (`==`) of `actual` and `expected`.
- *
- * assert.equal(3, '3', '== coerces values to strings');
- *
- * @name equal
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.equal = function (act, exp, msg) {
- var test = new Assertion(act, msg);
-
- test.assert(
- exp == flag(test, 'object')
- , 'expected #{this} to equal #{exp}'
- , 'expected #{this} to not equal #{act}'
- , exp
- , act
- );
- };
-
- /**
- * ### .notEqual(actual, expected, [message])
- *
- * Asserts non-strict inequality (`!=`) of `actual` and `expected`.
- *
- * assert.notEqual(3, 4, 'these numbers are not equal');
- *
- * @name notEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.notEqual = function (act, exp, msg) {
- var test = new Assertion(act, msg);
-
- test.assert(
- exp != flag(test, 'object')
- , 'expected #{this} to not equal #{exp}'
- , 'expected #{this} to equal #{act}'
- , exp
- , act
- );
- };
-
- /**
- * ### .strictEqual(actual, expected, [message])
- *
- * Asserts strict equality (`===`) of `actual` and `expected`.
- *
- * assert.strictEqual(true, true, 'these booleans are strictly equal');
- *
- * @name strictEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.strictEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.equal(exp);
- };
-
- /**
- * ### .notStrictEqual(actual, expected, [message])
- *
- * Asserts strict inequality (`!==`) of `actual` and `expected`.
- *
- * assert.notStrictEqual(3, '3', 'no coercion for strict equality');
- *
- * @name notStrictEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.notStrictEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.not.equal(exp);
- };
-
- /**
- * ### .deepEqual(actual, expected, [message])
- *
- * Asserts that `actual` is deeply equal to `expected`.
- *
- * assert.deepEqual({ tea: 'green' }, { tea: 'green' });
- *
- * @name deepEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.deepEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.eql(exp);
- };
-
- /**
- * ### .notDeepEqual(actual, expected, [message])
- *
- * Assert that `actual` is not deeply equal to `expected`.
- *
- * assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' });
- *
- * @name notDeepEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.notDeepEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.not.eql(exp);
- };
-
- /**
- * ### .isTrue(value, [message])
- *
- * Asserts that `value` is true.
- *
- * var teaServed = true;
- * assert.isTrue(teaServed, 'the tea has been served');
- *
- * @name isTrue
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isTrue = function (val, msg) {
- new Assertion(val, msg).is['true'];
- };
-
- /**
- * ### .isFalse(value, [message])
- *
- * Asserts that `value` is false.
- *
- * var teaServed = false;
- * assert.isFalse(teaServed, 'no tea yet? hmm...');
- *
- * @name isFalse
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isFalse = function (val, msg) {
- new Assertion(val, msg).is['false'];
- };
-
- /**
- * ### .isNull(value, [message])
- *
- * Asserts that `value` is null.
- *
- * assert.isNull(err, 'there was no error');
- *
- * @name isNull
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNull = function (val, msg) {
- new Assertion(val, msg).to.equal(null);
- };
-
- /**
- * ### .isNotNull(value, [message])
- *
- * Asserts that `value` is not null.
- *
- * var tea = 'tasty chai';
- * assert.isNotNull(tea, 'great, time for tea!');
- *
- * @name isNotNull
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotNull = function (val, msg) {
- new Assertion(val, msg).to.not.equal(null);
- };
-
- /**
- * ### .isUndefined(value, [message])
- *
- * Asserts that `value` is `undefined`.
- *
- * var tea;
- * assert.isUndefined(tea, 'no tea defined');
- *
- * @name isUndefined
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isUndefined = function (val, msg) {
- new Assertion(val, msg).to.equal(undefined);
- };
-
- /**
- * ### .isDefined(value, [message])
- *
- * Asserts that `value` is not `undefined`.
- *
- * var tea = 'cup of chai';
- * assert.isDefined(tea, 'tea has been defined');
- *
- * @name isDefined
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isDefined = function (val, msg) {
- new Assertion(val, msg).to.not.equal(undefined);
- };
-
- /**
- * ### .isFunction(value, [message])
- *
- * Asserts that `value` is a function.
- *
- * function serveTea() { return 'cup of tea'; };
- * assert.isFunction(serveTea, 'great, we can have tea now');
- *
- * @name isFunction
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isFunction = function (val, msg) {
- new Assertion(val, msg).to.be.a('function');
- };
-
- /**
- * ### .isNotFunction(value, [message])
- *
- * Asserts that `value` is _not_ a function.
- *
- * var serveTea = [ 'heat', 'pour', 'sip' ];
- * assert.isNotFunction(serveTea, 'great, we have listed the steps');
- *
- * @name isNotFunction
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotFunction = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('function');
- };
-
- /**
- * ### .isObject(value, [message])
- *
- * Asserts that `value` is an object (as revealed by
- * `Object.prototype.toString`).
- *
- * var selection = { name: 'Chai', serve: 'with spices' };
- * assert.isObject(selection, 'tea selection is an object');
- *
- * @name isObject
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isObject = function (val, msg) {
- new Assertion(val, msg).to.be.a('object');
- };
-
- /**
- * ### .isNotObject(value, [message])
- *
- * Asserts that `value` is _not_ an object.
- *
- * var selection = 'chai'
- * assert.isObject(selection, 'tea selection is not an object');
- * assert.isObject(null, 'null is not an object');
- *
- * @name isNotObject
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotObject = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('object');
- };
-
- /**
- * ### .isArray(value, [message])
- *
- * Asserts that `value` is an array.
- *
- * var menu = [ 'green', 'chai', 'oolong' ];
- * assert.isArray(menu, 'what kind of tea do we want?');
- *
- * @name isArray
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isArray = function (val, msg) {
- new Assertion(val, msg).to.be.an('array');
- };
-
- /**
- * ### .isNotArray(value, [message])
- *
- * Asserts that `value` is _not_ an array.
- *
- * var menu = 'green|chai|oolong';
- * assert.isNotArray(menu, 'what kind of tea do we want?');
- *
- * @name isNotArray
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotArray = function (val, msg) {
- new Assertion(val, msg).to.not.be.an('array');
- };
-
- /**
- * ### .isString(value, [message])
- *
- * Asserts that `value` is a string.
- *
- * var teaOrder = 'chai';
- * assert.isString(teaOrder, 'order placed');
- *
- * @name isString
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isString = function (val, msg) {
- new Assertion(val, msg).to.be.a('string');
- };
-
- /**
- * ### .isNotString(value, [message])
- *
- * Asserts that `value` is _not_ a string.
- *
- * var teaOrder = 4;
- * assert.isNotString(teaOrder, 'order placed');
- *
- * @name isNotString
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotString = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('string');
- };
-
- /**
- * ### .isNumber(value, [message])
- *
- * Asserts that `value` is a number.
- *
- * var cups = 2;
- * assert.isNumber(cups, 'how many cups');
- *
- * @name isNumber
- * @param {Number} value
- * @param {String} message
- * @api public
- */
-
- assert.isNumber = function (val, msg) {
- new Assertion(val, msg).to.be.a('number');
- };
-
- /**
- * ### .isNotNumber(value, [message])
- *
- * Asserts that `value` is _not_ a number.
- *
- * var cups = '2 cups please';
- * assert.isNotNumber(cups, 'how many cups');
- *
- * @name isNotNumber
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotNumber = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('number');
- };
-
- /**
- * ### .isBoolean(value, [message])
- *
- * Asserts that `value` is a boolean.
- *
- * var teaReady = true
- * , teaServed = false;
- *
- * assert.isBoolean(teaReady, 'is the tea ready');
- * assert.isBoolean(teaServed, 'has tea been served');
- *
- * @name isBoolean
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isBoolean = function (val, msg) {
- new Assertion(val, msg).to.be.a('boolean');
- };
-
- /**
- * ### .isNotBoolean(value, [message])
- *
- * Asserts that `value` is _not_ a boolean.
- *
- * var teaReady = 'yep'
- * , teaServed = 'nope';
- *
- * assert.isNotBoolean(teaReady, 'is the tea ready');
- * assert.isNotBoolean(teaServed, 'has tea been served');
- *
- * @name isNotBoolean
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotBoolean = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('boolean');
- };
-
- /**
- * ### .typeOf(value, name, [message])
- *
- * Asserts that `value`'s type is `name`, as determined by
- * `Object.prototype.toString`.
- *
- * assert.typeOf({ tea: 'chai' }, 'object', 'we have an object');
- * assert.typeOf(['chai', 'jasmine'], 'array', 'we have an array');
- * assert.typeOf('tea', 'string', 'we have a string');
- * assert.typeOf(/tea/, 'regexp', 'we have a regular expression');
- * assert.typeOf(null, 'null', 'we have a null');
- * assert.typeOf(undefined, 'undefined', 'we have an undefined');
- *
- * @name typeOf
- * @param {Mixed} value
- * @param {String} name
- * @param {String} message
- * @api public
- */
-
- assert.typeOf = function (val, type, msg) {
- new Assertion(val, msg).to.be.a(type);
- };
-
- /**
- * ### .notTypeOf(value, name, [message])
- *
- * Asserts that `value`'s type is _not_ `name`, as determined by
- * `Object.prototype.toString`.
- *
- * assert.notTypeOf('tea', 'number', 'strings are not numbers');
- *
- * @name notTypeOf
- * @param {Mixed} value
- * @param {String} typeof name
- * @param {String} message
- * @api public
- */
-
- assert.notTypeOf = function (val, type, msg) {
- new Assertion(val, msg).to.not.be.a(type);
- };
-
- /**
- * ### .instanceOf(object, constructor, [message])
- *
- * Asserts that `value` is an instance of `constructor`.
- *
- * var Tea = function (name) { this.name = name; }
- * , chai = new Tea('chai');
- *
- * assert.instanceOf(chai, Tea, 'chai is an instance of tea');
- *
- * @name instanceOf
- * @param {Object} object
- * @param {Constructor} constructor
- * @param {String} message
- * @api public
- */
-
- assert.instanceOf = function (val, type, msg) {
- new Assertion(val, msg).to.be.instanceOf(type);
- };
-
- /**
- * ### .notInstanceOf(object, constructor, [message])
- *
- * Asserts `value` is not an instance of `constructor`.
- *
- * var Tea = function (name) { this.name = name; }
- * , chai = new String('chai');
- *
- * assert.notInstanceOf(chai, Tea, 'chai is not an instance of tea');
- *
- * @name notInstanceOf
- * @param {Object} object
- * @param {Constructor} constructor
- * @param {String} message
- * @api public
- */
-
- assert.notInstanceOf = function (val, type, msg) {
- new Assertion(val, msg).to.not.be.instanceOf(type);
- };
-
- /**
- * ### .include(haystack, needle, [message])
- *
- * Asserts that `haystack` includes `needle`. Works
- * for strings and arrays.
- *
- * assert.include('foobar', 'bar', 'foobar contains string "bar"');
- * assert.include([ 1, 2, 3 ], 3, 'array contains value');
- *
- * @name include
- * @param {Array|String} haystack
- * @param {Mixed} needle
- * @param {String} message
- * @api public
- */
-
- assert.include = function (exp, inc, msg) {
- new Assertion(exp, msg).include(inc);
- };
-
- /**
- * ### .notInclude(haystack, needle, [message])
- *
- * Asserts that `haystack` does not include `needle`. Works
- * for strings and arrays.
- *i
- * assert.notInclude('foobar', 'baz', 'string not include substring');
- * assert.notInclude([ 1, 2, 3 ], 4, 'array not include contain value');
- *
- * @name notInclude
- * @param {Array|String} haystack
- * @param {Mixed} needle
- * @param {String} message
- * @api public
- */
-
- assert.notInclude = function (exp, inc, msg) {
- new Assertion(exp, msg).not.include(inc);
- };
-
- /**
- * ### .match(value, regexp, [message])
- *
- * Asserts that `value` matches the regular expression `regexp`.
- *
- * assert.match('foobar', /^foo/, 'regexp matches');
- *
- * @name match
- * @param {Mixed} value
- * @param {RegExp} regexp
- * @param {String} message
- * @api public
- */
-
- assert.match = function (exp, re, msg) {
- new Assertion(exp, msg).to.match(re);
- };
-
- /**
- * ### .notMatch(value, regexp, [message])
- *
- * Asserts that `value` does not match the regular expression `regexp`.
- *
- * assert.notMatch('foobar', /^foo/, 'regexp does not match');
- *
- * @name notMatch
- * @param {Mixed} value
- * @param {RegExp} regexp
- * @param {String} message
- * @api public
- */
-
- assert.notMatch = function (exp, re, msg) {
- new Assertion(exp, msg).to.not.match(re);
- };
-
- /**
- * ### .property(object, property, [message])
- *
- * Asserts that `object` has a property named by `property`.
- *
- * assert.property({ tea: { green: 'matcha' }}, 'tea');
- *
- * @name property
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.property = function (obj, prop, msg) {
- new Assertion(obj, msg).to.have.property(prop);
- };
-
- /**
- * ### .notProperty(object, property, [message])
- *
- * Asserts that `object` does _not_ have a property named by `property`.
- *
- * assert.notProperty({ tea: { green: 'matcha' }}, 'coffee');
- *
- * @name notProperty
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.notProperty = function (obj, prop, msg) {
- new Assertion(obj, msg).to.not.have.property(prop);
- };
-
- /**
- * ### .deepProperty(object, property, [message])
- *
- * Asserts that `object` has a property named by `property`, which can be a
- * string using dot- and bracket-notation for deep reference.
- *
- * assert.deepProperty({ tea: { green: 'matcha' }}, 'tea.green');
- *
- * @name deepProperty
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.deepProperty = function (obj, prop, msg) {
- new Assertion(obj, msg).to.have.deep.property(prop);
- };
-
- /**
- * ### .notDeepProperty(object, property, [message])
- *
- * Asserts that `object` does _not_ have a property named by `property`, which
- * can be a string using dot- and bracket-notation for deep reference.
- *
- * assert.notDeepProperty({ tea: { green: 'matcha' }}, 'tea.oolong');
- *
- * @name notDeepProperty
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.notDeepProperty = function (obj, prop, msg) {
- new Assertion(obj, msg).to.not.have.deep.property(prop);
- };
-
- /**
- * ### .propertyVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property` with value given
- * by `value`.
- *
- * assert.propertyVal({ tea: 'is good' }, 'tea', 'is good');
- *
- * @name propertyVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.propertyVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.have.property(prop, val);
- };
-
- /**
- * ### .propertyNotVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property`, but with a value
- * different from that given by `value`.
- *
- * assert.propertyNotVal({ tea: 'is good' }, 'tea', 'is bad');
- *
- * @name propertyNotVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.propertyNotVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.not.have.property(prop, val);
- };
-
- /**
- * ### .deepPropertyVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property` with value given
- * by `value`. `property` can use dot- and bracket-notation for deep
- * reference.
- *
- * assert.deepPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'matcha');
- *
- * @name deepPropertyVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.deepPropertyVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.have.deep.property(prop, val);
- };
-
- /**
- * ### .deepPropertyNotVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property`, but with a value
- * different from that given by `value`. `property` can use dot- and
- * bracket-notation for deep reference.
- *
- * assert.deepPropertyNotVal({ tea: { green: 'matcha' }}, 'tea.green', 'konacha');
- *
- * @name deepPropertyNotVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.deepPropertyNotVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.not.have.deep.property(prop, val);
- };
-
- /**
- * ### .lengthOf(object, length, [message])
- *
- * Asserts that `object` has a `length` property with the expected value.
- *
- * assert.lengthOf([1,2,3], 3, 'array has length of 3');
- * assert.lengthOf('foobar', 5, 'string has length of 6');
- *
- * @name lengthOf
- * @param {Mixed} object
- * @param {Number} length
- * @param {String} message
- * @api public
- */
-
- assert.lengthOf = function (exp, len, msg) {
- new Assertion(exp, msg).to.have.length(len);
- };
-
- /**
- * ### .throws(function, [constructor/string/regexp], [string/regexp], [message])
- *
- * Asserts that `function` will throw an error that is an instance of
- * `constructor`, or alternately that it will throw an error with message
- * matching `regexp`.
- *
- * assert.throw(fn, 'function throws a reference error');
- * assert.throw(fn, /function throws a reference error/);
- * assert.throw(fn, ReferenceError);
- * assert.throw(fn, ReferenceError, 'function throws a reference error');
- * assert.throw(fn, ReferenceError, /function throws a reference error/);
- *
- * @name throws
- * @alias throw
- * @alias Throw
- * @param {Function} function
- * @param {ErrorConstructor} constructor
- * @param {RegExp} regexp
- * @param {String} message
- * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
- * @api public
- */
-
- assert.Throw = function (fn, errt, errs, msg) {
- if ('string' === typeof errt || errt instanceof RegExp) {
- errs = errt;
- errt = null;
- }
-
- var assertErr = new Assertion(fn, msg).to.Throw(errt, errs);
- return flag(assertErr, 'object');
- };
-
- /**
- * ### .doesNotThrow(function, [constructor/regexp], [message])
- *
- * Asserts that `function` will _not_ throw an error that is an instance of
- * `constructor`, or alternately that it will not throw an error with message
- * matching `regexp`.
- *
- * assert.doesNotThrow(fn, Error, 'function does not throw');
- *
- * @name doesNotThrow
- * @param {Function} function
- * @param {ErrorConstructor} constructor
- * @param {RegExp} regexp
- * @param {String} message
- * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
- * @api public
- */
-
- assert.doesNotThrow = function (fn, type, msg) {
- if ('string' === typeof type) {
- msg = type;
- type = null;
- }
-
- new Assertion(fn, msg).to.not.Throw(type);
- };
-
- /**
- * ### .operator(val1, operator, val2, [message])
- *
- * Compares two values using `operator`.
- *
- * assert.operator(1, '<', 2, 'everything is ok');
- * assert.operator(1, '>', 2, 'this will fail');
- *
- * @name operator
- * @param {Mixed} val1
- * @param {String} operator
- * @param {Mixed} val2
- * @param {String} message
- * @api public
- */
-
- assert.operator = function (val, operator, val2, msg) {
- if (!~['==', '===', '>', '>=', '<', '<=', '!=', '!=='].indexOf(operator)) {
- throw new Error('Invalid operator "' + operator + '"');
- }
- var test = new Assertion(eval(val + operator + val2), msg);
- test.assert(
- true === flag(test, 'object')
- , 'expected ' + util.inspect(val) + ' to be ' + operator + ' ' + util.inspect(val2)
- , 'expected ' + util.inspect(val) + ' to not be ' + operator + ' ' + util.inspect(val2) );
- };
-
- /**
- * ### .closeTo(actual, expected, delta, [message])
- *
- * Asserts that the target is equal `expected`, to within a +/- `delta` range.
- *
- * assert.closeTo(1.5, 1, 0.5, 'numbers are close');
- *
- * @name closeTo
- * @param {Number} actual
- * @param {Number} expected
- * @param {Number} delta
- * @param {String} message
- * @api public
- */
-
- assert.closeTo = function (act, exp, delta, msg) {
- new Assertion(act, msg).to.be.closeTo(exp, delta);
- };
-
- /**
- * ### .sameMembers(set1, set2, [message])
- *
- * Asserts that `set1` and `set2` have the same members.
- * Order is not taken into account.
- *
- * assert.sameMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'same members');
- *
- * @name sameMembers
- * @param {Array} superset
- * @param {Array} subset
- * @param {String} message
- * @api public
- */
-
- assert.sameMembers = function (set1, set2, msg) {
- new Assertion(set1, msg).to.have.same.members(set2);
- }
-
- /**
- * ### .includeMembers(superset, subset, [message])
- *
- * Asserts that `subset` is included in `superset`.
- * Order is not taken into account.
- *
- * assert.includeMembers([ 1, 2, 3 ], [ 2, 1 ], 'include members');
- *
- * @name includeMembers
- * @param {Array} superset
- * @param {Array} subset
- * @param {String} message
- * @api public
- */
-
- assert.includeMembers = function (superset, subset, msg) {
- new Assertion(superset, msg).to.include.members(subset);
- }
-
- /*!
- * Undocumented / untested
- */
-
- assert.ifError = function (val, msg) {
- new Assertion(val, msg).to.not.be.ok;
- };
-
- /*!
- * Aliases.
- */
-
- (function alias(name, as){
- assert[as] = assert[name];
- return alias;
- })
- ('Throw', 'throw')
- ('Throw', 'throws');
-};
-
-});
-require.register("chai/lib/chai/interface/expect.js", function(exports, require, module){
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (chai, util) {
- chai.expect = function (val, message) {
- return new chai.Assertion(val, message);
- };
-};
-
-});
-require.register("chai/lib/chai/interface/should.js", function(exports, require, module){
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (chai, util) {
- var Assertion = chai.Assertion;
-
- function loadShould () {
- // modify Object.prototype to have `should`
- Object.defineProperty(Object.prototype, 'should',
- {
- set: function (value) {
- // See https://github.com/chaijs/chai/issues/86: this makes
- // `whatever.should = someValue` actually set `someValue`, which is
- // especially useful for `global.should = require('chai').should()`.
- //
- // Note that we have to use [[DefineProperty]] instead of [[Put]]
- // since otherwise we would trigger this very setter!
- Object.defineProperty(this, 'should', {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- }
- , get: function(){
- if (this instanceof String || this instanceof Number) {
- return new Assertion(this.constructor(this));
- } else if (this instanceof Boolean) {
- return new Assertion(this == true);
- }
- return new Assertion(this);
- }
- , configurable: true
- });
-
- var should = {};
-
- should.equal = function (val1, val2, msg) {
- new Assertion(val1, msg).to.equal(val2);
- };
-
- should.Throw = function (fn, errt, errs, msg) {
- new Assertion(fn, msg).to.Throw(errt, errs);
- };
-
- should.exist = function (val, msg) {
- new Assertion(val, msg).to.exist;
- }
-
- // negation
- should.not = {}
-
- should.not.equal = function (val1, val2, msg) {
- new Assertion(val1, msg).to.not.equal(val2);
- };
-
- should.not.Throw = function (fn, errt, errs, msg) {
- new Assertion(fn, msg).to.not.Throw(errt, errs);
- };
-
- should.not.exist = function (val, msg) {
- new Assertion(val, msg).to.not.exist;
- }
-
- should['throw'] = should['Throw'];
- should.not['throw'] = should.not['Throw'];
-
- return should;
- };
-
- chai.should = loadShould;
- chai.Should = loadShould;
-};
-
-});
-require.register("chai/lib/chai/utils/addChainableMethod.js", function(exports, require, module){
-/*!
- * Chai - addChainingMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependencies
- */
-
-var transferFlags = require('./transferFlags');
-
-/*!
- * Module variables
- */
-
-// Check whether `__proto__` is supported
-var hasProtoSupport = '__proto__' in Object;
-
-// Without `__proto__` support, this module will need to add properties to a function.
-// However, some Function.prototype methods cannot be overwritten,
-// and there seems no easy cross-platform way to detect them (@see chaijs/chai/issues/69).
-var excludeNames = /^(?:length|name|arguments|caller)$/;
-
-// Cache `Function` properties
-var call = Function.prototype.call,
- apply = Function.prototype.apply;
-
-/**
- * ### addChainableMethod (ctx, name, method, chainingBehavior)
- *
- * Adds a method to an object, such that the method can also be chained.
- *
- * utils.addChainableMethod(chai.Assertion.prototype, 'foo', function (str) {
- * var obj = utils.flag(this, 'object');
- * new chai.Assertion(obj).to.be.equal(str);
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.addChainableMethod('foo', fn, chainingBehavior);
- *
- * The result can then be used as both a method assertion, executing both `method` and
- * `chainingBehavior`, or as a language chain, which only executes `chainingBehavior`.
- *
- * expect(fooStr).to.be.foo('bar');
- * expect(fooStr).to.be.foo.equal('foo');
- *
- * @param {Object} ctx object to which the method is added
- * @param {String} name of method to add
- * @param {Function} method function to be used for `name`, when called
- * @param {Function} chainingBehavior function to be called every time the property is accessed
- * @name addChainableMethod
- * @api public
- */
-
-module.exports = function (ctx, name, method, chainingBehavior) {
- if (typeof chainingBehavior !== 'function') {
- chainingBehavior = function () { };
- }
-
- var chainableBehavior = {
- method: method
- , chainingBehavior: chainingBehavior
- };
-
- // save the methods so we can overwrite them later, if we need to.
- if (!ctx.__methods) {
- ctx.__methods = {};
- }
- ctx.__methods[name] = chainableBehavior;
-
- Object.defineProperty(ctx, name,
- { get: function () {
- chainableBehavior.chainingBehavior.call(this);
-
- var assert = function () {
- var result = chainableBehavior.method.apply(this, arguments);
- return result === undefined ? this : result;
- };
-
- // Use `__proto__` if available
- if (hasProtoSupport) {
- // Inherit all properties from the object by replacing the `Function` prototype
- var prototype = assert.__proto__ = Object.create(this);
- // Restore the `call` and `apply` methods from `Function`
- prototype.call = call;
- prototype.apply = apply;
- }
- // Otherwise, redefine all properties (slow!)
- else {
- var asserterNames = Object.getOwnPropertyNames(ctx);
- asserterNames.forEach(function (asserterName) {
- if (!excludeNames.test(asserterName)) {
- var pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
- Object.defineProperty(assert, asserterName, pd);
- }
- });
- }
-
- transferFlags(this, assert);
- return assert;
- }
- , configurable: true
- });
-};
-
-});
-require.register("chai/lib/chai/utils/addMethod.js", function(exports, require, module){
-/*!
- * Chai - addMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### .addMethod (ctx, name, method)
- *
- * Adds a method to the prototype of an object.
- *
- * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) {
- * var obj = utils.flag(this, 'object');
- * new chai.Assertion(obj).to.be.equal(str);
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.addMethod('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(fooStr).to.be.foo('bar');
- *
- * @param {Object} ctx object to which the method is added
- * @param {String} name of method to add
- * @param {Function} method function to be used for name
- * @name addMethod
- * @api public
- */
-
-module.exports = function (ctx, name, method) {
- ctx[name] = function () {
- var result = method.apply(this, arguments);
- return result === undefined ? this : result;
- };
-};
-
-});
-require.register("chai/lib/chai/utils/addProperty.js", function(exports, require, module){
-/*!
- * Chai - addProperty utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### addProperty (ctx, name, getter)
- *
- * Adds a property to the prototype of an object.
- *
- * utils.addProperty(chai.Assertion.prototype, 'foo', function () {
- * var obj = utils.flag(this, 'object');
- * new chai.Assertion(obj).to.be.instanceof(Foo);
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.addProperty('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.be.foo;
- *
- * @param {Object} ctx object to which the property is added
- * @param {String} name of property to add
- * @param {Function} getter function to be used for name
- * @name addProperty
- * @api public
- */
-
-module.exports = function (ctx, name, getter) {
- Object.defineProperty(ctx, name,
- { get: function () {
- var result = getter.call(this);
- return result === undefined ? this : result;
- }
- , configurable: true
- });
-};
-
-});
-require.register("chai/lib/chai/utils/flag.js", function(exports, require, module){
-/*!
- * Chai - flag utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### flag(object ,key, [value])
- *
- * Get or set a flag value on an object. If a
- * value is provided it will be set, else it will
- * return the currently set value or `undefined` if
- * the value is not set.
- *
- * utils.flag(this, 'foo', 'bar'); // setter
- * utils.flag(this, 'foo'); // getter, returns `bar`
- *
- * @param {Object} object (constructed Assertion
- * @param {String} key
- * @param {Mixed} value (optional)
- * @name flag
- * @api private
- */
-
-module.exports = function (obj, key, value) {
- var flags = obj.__flags || (obj.__flags = Object.create(null));
- if (arguments.length === 3) {
- flags[key] = value;
- } else {
- return flags[key];
- }
-};
-
-});
-require.register("chai/lib/chai/utils/getActual.js", function(exports, require, module){
-/*!
- * Chai - getActual utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * # getActual(object, [actual])
- *
- * Returns the `actual` value for an Assertion
- *
- * @param {Object} object (constructed Assertion)
- * @param {Arguments} chai.Assertion.prototype.assert arguments
- */
-
-module.exports = function (obj, args) {
- var actual = args[4];
- return 'undefined' !== typeof actual ? actual : obj._obj;
-};
-
-});
-require.register("chai/lib/chai/utils/getEnumerableProperties.js", function(exports, require, module){
-/*!
- * Chai - getEnumerableProperties utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### .getEnumerableProperties(object)
- *
- * This allows the retrieval of enumerable property names of an object,
- * inherited or not.
- *
- * @param {Object} object
- * @returns {Array}
- * @name getEnumerableProperties
- * @api public
- */
-
-module.exports = function getEnumerableProperties(object) {
- var result = [];
- for (var name in object) {
- result.push(name);
- }
- return result;
-};
-
-});
-require.register("chai/lib/chai/utils/getMessage.js", function(exports, require, module){
-/*!
- * Chai - message composition utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependancies
- */
-
-var flag = require('./flag')
- , getActual = require('./getActual')
- , inspect = require('./inspect')
- , objDisplay = require('./objDisplay');
-
-/**
- * ### .getMessage(object, message, negateMessage)
- *
- * Construct the error message based on flags
- * and template tags. Template tags will return
- * a stringified inspection of the object referenced.
- *
- * Message template tags:
- * - `#{this}` current asserted object
- * - `#{act}` actual value
- * - `#{exp}` expected value
- *
- * @param {Object} object (constructed Assertion)
- * @param {Arguments} chai.Assertion.prototype.assert arguments
- * @name getMessage
- * @api public
- */
-
-module.exports = function (obj, args) {
- var negate = flag(obj, 'negate')
- , val = flag(obj, 'object')
- , expected = args[3]
- , actual = getActual(obj, args)
- , msg = negate ? args[2] : args[1]
- , flagMsg = flag(obj, 'message');
-
- msg = msg || '';
- msg = msg
- .replace(/#{this}/g, objDisplay(val))
- .replace(/#{act}/g, objDisplay(actual))
- .replace(/#{exp}/g, objDisplay(expected));
-
- return flagMsg ? flagMsg + ': ' + msg : msg;
-};
-
-});
-require.register("chai/lib/chai/utils/getName.js", function(exports, require, module){
-/*!
- * Chai - getName utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * # getName(func)
- *
- * Gets the name of a function, in a cross-browser way.
- *
- * @param {Function} a function (usually a constructor)
- */
-
-module.exports = function (func) {
- if (func.name) return func.name;
-
- var match = /^\s?function ([^(]*)\(/.exec(func);
- return match && match[1] ? match[1] : "";
-};
-
-});
-require.register("chai/lib/chai/utils/getPathValue.js", function(exports, require, module){
-/*!
- * Chai - getPathValue utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * @see https://github.com/logicalparadox/filtr
- * MIT Licensed
- */
-
-/**
- * ### .getPathValue(path, object)
- *
- * This allows the retrieval of values in an
- * object given a string path.
- *
- * var obj = {
- * prop1: {
- * arr: ['a', 'b', 'c']
- * , str: 'Hello'
- * }
- * , prop2: {
- * arr: [ { nested: 'Universe' } ]
- * , str: 'Hello again!'
- * }
- * }
- *
- * The following would be the results.
- *
- * getPathValue('prop1.str', obj); // Hello
- * getPathValue('prop1.att[2]', obj); // b
- * getPathValue('prop2.arr[0].nested', obj); // Universe
- *
- * @param {String} path
- * @param {Object} object
- * @returns {Object} value or `undefined`
- * @name getPathValue
- * @api public
- */
-
-var getPathValue = module.exports = function (path, obj) {
- var parsed = parsePath(path);
- return _getPathValue(parsed, obj);
-};
-
-/*!
- * ## parsePath(path)
- *
- * Helper function used to parse string object
- * paths. Use in conjunction with `_getPathValue`.
- *
- * var parsed = parsePath('myobject.property.subprop');
- *
- * ### Paths:
- *
- * * Can be as near infinitely deep and nested
- * * Arrays are also valid using the formal `myobject.document[3].property`.
- *
- * @param {String} path
- * @returns {Object} parsed
- * @api private
- */
-
-function parsePath (path) {
- var str = path.replace(/\[/g, '.[')
- , parts = str.match(/(\\\.|[^.]+?)+/g);
- return parts.map(function (value) {
- var re = /\[(\d+)\]$/
- , mArr = re.exec(value)
- if (mArr) return { i: parseFloat(mArr[1]) };
- else return { p: value };
- });
-};
-
-/*!
- * ## _getPathValue(parsed, obj)
- *
- * Helper companion function for `.parsePath` that returns
- * the value located at the parsed address.
- *
- * var value = getPathValue(parsed, obj);
- *
- * @param {Object} parsed definition from `parsePath`.
- * @param {Object} object to search against
- * @returns {Object|Undefined} value
- * @api private
- */
-
-function _getPathValue (parsed, obj) {
- var tmp = obj
- , res;
- for (var i = 0, l = parsed.length; i < l; i++) {
- var part = parsed[i];
- if (tmp) {
- if ('undefined' !== typeof part.p)
- tmp = tmp[part.p];
- else if ('undefined' !== typeof part.i)
- tmp = tmp[part.i];
- if (i == (l - 1)) res = tmp;
- } else {
- res = undefined;
- }
- }
- return res;
-};
-
-});
-require.register("chai/lib/chai/utils/getProperties.js", function(exports, require, module){
-/*!
- * Chai - getProperties utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### .getProperties(object)
- *
- * This allows the retrieval of property names of an object, enumerable or not,
- * inherited or not.
- *
- * @param {Object} object
- * @returns {Array}
- * @name getProperties
- * @api public
- */
-
-module.exports = function getProperties(object) {
- var result = Object.getOwnPropertyNames(subject);
-
- function addProperty(property) {
- if (result.indexOf(property) === -1) {
- result.push(property);
- }
- }
-
- var proto = Object.getPrototypeOf(subject);
- while (proto !== null) {
- Object.getOwnPropertyNames(proto).forEach(addProperty);
- proto = Object.getPrototypeOf(proto);
- }
-
- return result;
-};
-
-});
-require.register("chai/lib/chai/utils/index.js", function(exports, require, module){
-/*!
- * chai
- * Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Main exports
- */
-
-var exports = module.exports = {};
-
-/*!
- * test utility
- */
-
-exports.test = require('./test');
-
-/*!
- * type utility
- */
-
-exports.type = require('./type');
-
-/*!
- * message utility
- */
-
-exports.getMessage = require('./getMessage');
-
-/*!
- * actual utility
- */
-
-exports.getActual = require('./getActual');
-
-/*!
- * Inspect util
- */
-
-exports.inspect = require('./inspect');
-
-/*!
- * Object Display util
- */
-
-exports.objDisplay = require('./objDisplay');
-
-/*!
- * Flag utility
- */
-
-exports.flag = require('./flag');
-
-/*!
- * Flag transferring utility
- */
-
-exports.transferFlags = require('./transferFlags');
-
-/*!
- * Deep equal utility
- */
-
-exports.eql = require('deep-eql');
-
-/*!
- * Deep path value
- */
-
-exports.getPathValue = require('./getPathValue');
-
-/*!
- * Function name
- */
-
-exports.getName = require('./getName');
-
-/*!
- * add Property
- */
-
-exports.addProperty = require('./addProperty');
-
-/*!
- * add Method
- */
-
-exports.addMethod = require('./addMethod');
-
-/*!
- * overwrite Property
- */
-
-exports.overwriteProperty = require('./overwriteProperty');
-
-/*!
- * overwrite Method
- */
-
-exports.overwriteMethod = require('./overwriteMethod');
-
-/*!
- * Add a chainable method
- */
-
-exports.addChainableMethod = require('./addChainableMethod');
-
-/*!
- * Overwrite chainable method
- */
-
-exports.overwriteChainableMethod = require('./overwriteChainableMethod');
-
-});
-require.register("chai/lib/chai/utils/inspect.js", function(exports, require, module){
-// This is (almost) directly from Node.js utils
-// https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/util.js
-
-var getName = require('./getName');
-var getProperties = require('./getProperties');
-var getEnumerableProperties = require('./getEnumerableProperties');
-
-module.exports = inspect;
-
-/**
- * Echos the value of a value. Trys to print the value out
- * in the best way possible given the different types.
- *
- * @param {Object} obj The object to print out.
- * @param {Boolean} showHidden Flag that shows hidden (not enumerable)
- * properties of objects.
- * @param {Number} depth Depth in which to descend in object. Default is 2.
- * @param {Boolean} colors Flag to turn on ANSI escape codes to color the
- * output. Default is false (no coloring).
- */
-function inspect(obj, showHidden, depth, colors) {
- var ctx = {
- showHidden: showHidden,
- seen: [],
- stylize: function (str) { return str; }
- };
- return formatValue(ctx, obj, (typeof depth === 'undefined' ? 2 : depth));
-}
-
-// https://gist.github.com/1044128/
-var getOuterHTML = function(element) {
- if ('outerHTML' in element) return element.outerHTML;
- var ns = "http://www.w3.org/1999/xhtml";
- var container = document.createElementNS(ns, '_');
- var elemProto = (window.HTMLElement || window.Element).prototype;
- var xmlSerializer = new XMLSerializer();
- var html;
- if (document.xmlVersion) {
- return xmlSerializer.serializeToString(element);
- } else {
- container.appendChild(element.cloneNode(false));
- html = container.innerHTML.replace('><', '>' + element.innerHTML + '<');
- container.innerHTML = '';
- return html;
- }
-};
-
-// Returns true if object is a DOM element.
-var isDOMElement = function (object) {
- if (typeof HTMLElement === 'object') {
- return object instanceof HTMLElement;
- } else {
- return object &&
- typeof object === 'object' &&
- object.nodeType === 1 &&
- typeof object.nodeName === 'string';
- }
-};
-
-function formatValue(ctx, value, recurseTimes) {
- // Provide a hook for user-specified inspect functions.
- // Check that value is an object with an inspect function on it
- if (value && typeof value.inspect === 'function' &&
- // Filter out the util module, it's inspect function is special
- value.inspect !== exports.inspect &&
- // Also filter out any prototype objects using the circular check.
- !(value.constructor && value.constructor.prototype === value)) {
- var ret = value.inspect(recurseTimes);
- if (typeof ret !== 'string') {
- ret = formatValue(ctx, ret, recurseTimes);
- }
- return ret;
- }
-
- // Primitive types cannot have properties
- var primitive = formatPrimitive(ctx, value);
- if (primitive) {
- return primitive;
- }
-
- // If it's DOM elem, get outer HTML.
- if (isDOMElement(value)) {
- return getOuterHTML(value);
- }
-
- // Look up the keys of the object.
- var visibleKeys = getEnumerableProperties(value);
- var keys = ctx.showHidden ? getProperties(value) : visibleKeys;
-
- // Some type of object without properties can be shortcutted.
- // In IE, errors have a single `stack` property, or if they are vanilla `Error`,
- // a `stack` plus `description` property; ignore those for consistency.
- if (keys.length === 0 || (isError(value) && (
- (keys.length === 1 && keys[0] === 'stack') ||
- (keys.length === 2 && keys[0] === 'description' && keys[1] === 'stack')
- ))) {
- if (typeof value === 'function') {
- var name = getName(value);
- var nameSuffix = name ? ': ' + name : '';
- return ctx.stylize('[Function' + nameSuffix + ']', 'special');
- }
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- }
- if (isDate(value)) {
- return ctx.stylize(Date.prototype.toUTCString.call(value), 'date');
- }
- if (isError(value)) {
- return formatError(value);
- }
- }
-
- var base = '', array = false, braces = ['{', '}'];
-
- // Make Array say that they are Array
- if (isArray(value)) {
- array = true;
- braces = ['[', ']'];
- }
-
- // Make functions say that they are functions
- if (typeof value === 'function') {
- var name = getName(value);
- var nameSuffix = name ? ': ' + name : '';
- base = ' [Function' + nameSuffix + ']';
- }
-
- // Make RegExps say that they are RegExps
- if (isRegExp(value)) {
- base = ' ' + RegExp.prototype.toString.call(value);
- }
-
- // Make dates with properties first say the date
- if (isDate(value)) {
- base = ' ' + Date.prototype.toUTCString.call(value);
- }
-
- // Make error with message first say the error
- if (isError(value)) {
- return formatError(value);
- }
-
- if (keys.length === 0 && (!array || value.length == 0)) {
- return braces[0] + base + braces[1];
- }
-
- if (recurseTimes < 0) {
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- } else {
- return ctx.stylize('[Object]', 'special');
- }
- }
-
- ctx.seen.push(value);
-
- var output;
- if (array) {
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
- } else {
- output = keys.map(function(key) {
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
- });
- }
-
- ctx.seen.pop();
-
- return reduceToSingleString(output, base, braces);
-}
-
-function formatPrimitive(ctx, value) {
- switch (typeof value) {
- case 'undefined':
- return ctx.stylize('undefined', 'undefined');
-
- case 'string':
- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
- .replace(/'/g, "\\'")
- .replace(/\\"/g, '"') + '\'';
- return ctx.stylize(simple, 'string');
-
- case 'number':
- return ctx.stylize('' + value, 'number');
-
- case 'boolean':
- return ctx.stylize('' + value, 'boolean');
- }
- // For some reason typeof null is "object", so special case here.
- if (value === null) {
- return ctx.stylize('null', 'null');
- }
-}
-
-function formatError(value) {
- return '[' + Error.prototype.toString.call(value) + ']';
-}
-
-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
- var output = [];
- for (var i = 0, l = value.length; i < l; ++i) {
- if (Object.prototype.hasOwnProperty.call(value, String(i))) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- String(i), true));
- } else {
- output.push('');
- }
- }
- keys.forEach(function(key) {
- if (!key.match(/^\d+$/)) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- key, true));
- }
- });
- return output;
-}
-
-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- var name, str;
- if (value.__lookupGetter__) {
- if (value.__lookupGetter__(key)) {
- if (value.__lookupSetter__(key)) {
- str = ctx.stylize('[Getter/Setter]', 'special');
- } else {
- str = ctx.stylize('[Getter]', 'special');
- }
- } else {
- if (value.__lookupSetter__(key)) {
- str = ctx.stylize('[Setter]', 'special');
- }
- }
- }
- if (visibleKeys.indexOf(key) < 0) {
- name = '[' + key + ']';
- }
- if (!str) {
- if (ctx.seen.indexOf(value[key]) < 0) {
- if (recurseTimes === null) {
- str = formatValue(ctx, value[key], null);
- } else {
- str = formatValue(ctx, value[key], recurseTimes - 1);
- }
- if (str.indexOf('\n') > -1) {
- if (array) {
- str = str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n').substr(2);
- } else {
- str = '\n' + str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n');
- }
- }
- } else {
- str = ctx.stylize('[Circular]', 'special');
- }
- }
- if (typeof name === 'undefined') {
- if (array && key.match(/^\d+$/)) {
- return str;
- }
- name = JSON.stringify('' + key);
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
- name = name.substr(1, name.length - 2);
- name = ctx.stylize(name, 'name');
- } else {
- name = name.replace(/'/g, "\\'")
- .replace(/\\"/g, '"')
- .replace(/(^"|"$)/g, "'");
- name = ctx.stylize(name, 'string');
- }
- }
-
- return name + ': ' + str;
-}
-
-function reduceToSingleString(output, base, braces) {
- var numLinesEst = 0;
- var length = output.reduce(function(prev, cur) {
- numLinesEst++;
- if (cur.indexOf('\n') >= 0) numLinesEst++;
- return prev + cur.length + 1;
- }, 0);
-
- if (length > 60) {
- return braces[0] +
- (base === '' ? '' : base + '\n ') +
- ' ' +
- output.join(',\n ') +
- ' ' +
- braces[1];
- }
-
- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
-}
-
-function isArray(ar) {
- return Array.isArray(ar) ||
- (typeof ar === 'object' && objectToString(ar) === '[object Array]');
-}
-
-function isRegExp(re) {
- return typeof re === 'object' && objectToString(re) === '[object RegExp]';
-}
-
-function isDate(d) {
- return typeof d === 'object' && objectToString(d) === '[object Date]';
-}
-
-function isError(e) {
- return typeof e === 'object' && objectToString(e) === '[object Error]';
-}
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
-
-});
-require.register("chai/lib/chai/utils/objDisplay.js", function(exports, require, module){
-/*!
- * Chai - flag utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependancies
- */
-
-var inspect = require('./inspect');
-
-/**
- * ### .objDisplay (object)
- *
- * Determines if an object or an array matches
- * criteria to be inspected in-line for error
- * messages or should be truncated.
- *
- * @param {Mixed} javascript object to inspect
- * @name objDisplay
- * @api public
- */
-
-module.exports = function (obj) {
- var str = inspect(obj)
- , type = Object.prototype.toString.call(obj);
-
- if (str.length >= 40) {
- if (type === '[object Function]') {
- return !obj.name || obj.name === ''
- ? '[Function]'
- : '[Function: ' + obj.name + ']';
- } else if (type === '[object Array]') {
- return '[ Array(' + obj.length + ') ]';
- } else if (type === '[object Object]') {
- var keys = Object.keys(obj)
- , kstr = keys.length > 2
- ? keys.splice(0, 2).join(', ') + ', ...'
- : keys.join(', ');
- return '{ Object (' + kstr + ') }';
- } else {
- return str;
- }
- } else {
- return str;
- }
-};
-
-});
-require.register("chai/lib/chai/utils/overwriteMethod.js", function(exports, require, module){
-/*!
- * Chai - overwriteMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### overwriteMethod (ctx, name, fn)
- *
- * Overwites an already existing method and provides
- * access to previous function. Must return function
- * to be used for name.
- *
- * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) {
- * return function (str) {
- * var obj = utils.flag(this, 'object');
- * if (obj instanceof Foo) {
- * new chai.Assertion(obj.value).to.equal(str);
- * } else {
- * _super.apply(this, arguments);
- * }
- * }
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.overwriteMethod('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.equal('bar');
- *
- * @param {Object} ctx object whose method is to be overwritten
- * @param {String} name of method to overwrite
- * @param {Function} method function that returns a function to be used for name
- * @name overwriteMethod
- * @api public
- */
-
-module.exports = function (ctx, name, method) {
- var _method = ctx[name]
- , _super = function () { return this; };
-
- if (_method && 'function' === typeof _method)
- _super = _method;
-
- ctx[name] = function () {
- var result = method(_super).apply(this, arguments);
- return result === undefined ? this : result;
- }
-};
-
-});
-require.register("chai/lib/chai/utils/overwriteProperty.js", function(exports, require, module){
-/*!
- * Chai - overwriteProperty utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### overwriteProperty (ctx, name, fn)
- *
- * Overwites an already existing property getter and provides
- * access to previous value. Must return function to use as getter.
- *
- * utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) {
- * return function () {
- * var obj = utils.flag(this, 'object');
- * if (obj instanceof Foo) {
- * new chai.Assertion(obj.name).to.equal('bar');
- * } else {
- * _super.call(this);
- * }
- * }
- * });
- *
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.overwriteProperty('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.be.ok;
- *
- * @param {Object} ctx object whose property is to be overwritten
- * @param {String} name of property to overwrite
- * @param {Function} getter function that returns a getter function to be used for name
- * @name overwriteProperty
- * @api public
- */
-
-module.exports = function (ctx, name, getter) {
- var _get = Object.getOwnPropertyDescriptor(ctx, name)
- , _super = function () {};
-
- if (_get && 'function' === typeof _get.get)
- _super = _get.get
-
- Object.defineProperty(ctx, name,
- { get: function () {
- var result = getter(_super).call(this);
- return result === undefined ? this : result;
- }
- , configurable: true
- });
-};
-
-});
-require.register("chai/lib/chai/utils/overwriteChainableMethod.js", function(exports, require, module){
-/*!
- * Chai - overwriteChainableMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### overwriteChainableMethod (ctx, name, fn)
- *
- * Overwites an already existing chainable method
- * and provides access to the previous function or
- * property. Must return functions to be used for
- * name.
- *
- * utils.overwriteChainableMethod(chai.Assertion.prototype, 'length',
- * function (_super) {
- * }
- * , function (_super) {
- * }
- * );
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.overwriteChainableMethod('foo', fn, fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.have.length(3);
- * expect(myFoo).to.have.length.above(3);
- *
- * @param {Object} ctx object whose method / property is to be overwritten
- * @param {String} name of method / property to overwrite
- * @param {Function} method function that returns a function to be used for name
- * @param {Function} chainingBehavior function that returns a function to be used for property
- * @name overwriteChainableMethod
- * @api public
- */
-
-module.exports = function (ctx, name, method, chainingBehavior) {
- var chainableBehavior = ctx.__methods[name];
-
- var _chainingBehavior = chainableBehavior.chainingBehavior;
- chainableBehavior.chainingBehavior = function () {
- var result = chainingBehavior(_chainingBehavior).call(this);
- return result === undefined ? this : result;
- };
-
- var _method = chainableBehavior.method;
- chainableBehavior.method = function () {
- var result = method(_method).apply(this, arguments);
- return result === undefined ? this : result;
- };
-};
-
-});
-require.register("chai/lib/chai/utils/test.js", function(exports, require, module){
-/*!
- * Chai - test utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependancies
- */
-
-var flag = require('./flag');
-
-/**
- * # test(object, expression)
- *
- * Test and object for expression.
- *
- * @param {Object} object (constructed Assertion)
- * @param {Arguments} chai.Assertion.prototype.assert arguments
- */
-
-module.exports = function (obj, args) {
- var negate = flag(obj, 'negate')
- , expr = args[0];
- return negate ? !expr : expr;
-};
-
-});
-require.register("chai/lib/chai/utils/transferFlags.js", function(exports, require, module){
-/*!
- * Chai - transferFlags utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### transferFlags(assertion, object, includeAll = true)
- *
- * Transfer all the flags for `assertion` to `object`. If
- * `includeAll` is set to `false`, then the base Chai
- * assertion flags (namely `object`, `ssfi`, and `message`)
- * will not be transferred.
- *
- *
- * var newAssertion = new Assertion();
- * utils.transferFlags(assertion, newAssertion);
- *
- * var anotherAsseriton = new Assertion(myObj);
- * utils.transferFlags(assertion, anotherAssertion, false);
- *
- * @param {Assertion} assertion the assertion to transfer the flags from
- * @param {Object} object the object to transfer the flags too; usually a new assertion
- * @param {Boolean} includeAll
- * @name getAllFlags
- * @api private
- */
-
-module.exports = function (assertion, object, includeAll) {
- var flags = assertion.__flags || (assertion.__flags = Object.create(null));
-
- if (!object.__flags) {
- object.__flags = Object.create(null);
- }
-
- includeAll = arguments.length === 3 ? includeAll : true;
-
- for (var flag in flags) {
- if (includeAll ||
- (flag !== 'object' && flag !== 'ssfi' && flag != 'message')) {
- object.__flags[flag] = flags[flag];
- }
- }
-};
-
-});
-require.register("chai/lib/chai/utils/type.js", function(exports, require, module){
-/*!
- * Chai - type utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Detectable javascript natives
- */
-
-var natives = {
- '[object Arguments]': 'arguments'
- , '[object Array]': 'array'
- , '[object Date]': 'date'
- , '[object Function]': 'function'
- , '[object Number]': 'number'
- , '[object RegExp]': 'regexp'
- , '[object String]': 'string'
-};
-
-/**
- * ### type(object)
- *
- * Better implementation of `typeof` detection that can
- * be used cross-browser. Handles the inconsistencies of
- * Array, `null`, and `undefined` detection.
- *
- * utils.type({}) // 'object'
- * utils.type(null) // `null'
- * utils.type(undefined) // `undefined`
- * utils.type([]) // `array`
- *
- * @param {Mixed} object to detect type of
- * @name type
- * @api private
- */
-
-module.exports = function (obj) {
- var str = Object.prototype.toString.call(obj);
- if (natives[str]) return natives[str];
- if (obj === null) return 'null';
- if (obj === undefined) return 'undefined';
- if (obj === Object(obj)) return 'object';
- return typeof obj;
-};
-
-});
-
-require.alias("chaijs-assertion-error/index.js", "chai/deps/assertion-error/index.js");
-require.alias("chaijs-assertion-error/index.js", "chai/deps/assertion-error/index.js");
-require.alias("chaijs-assertion-error/index.js", "assertion-error/index.js");
-require.alias("chaijs-assertion-error/index.js", "chaijs-assertion-error/index.js");
-require.alias("chaijs-deep-eql/lib/eql.js", "chai/deps/deep-eql/lib/eql.js");
-require.alias("chaijs-deep-eql/lib/eql.js", "chai/deps/deep-eql/index.js");
-require.alias("chaijs-deep-eql/lib/eql.js", "deep-eql/index.js");
-require.alias("chaijs-type-detect/lib/type.js", "chaijs-deep-eql/deps/type-detect/lib/type.js");
-require.alias("chaijs-type-detect/lib/type.js", "chaijs-deep-eql/deps/type-detect/index.js");
-require.alias("chaijs-type-detect/lib/type.js", "chaijs-type-detect/index.js");
-require.alias("chaijs-deep-eql/lib/eql.js", "chaijs-deep-eql/index.js");
-require.alias("chai/index.js", "chai/index.js");if (typeof exports == "object") {
- module.exports = require("chai");
-} else if (typeof define == "function" && define.amd) {
- define([], function(){ return require("chai"); });
-} else {
- this["chai"] = require("chai");
-}})(); \ No newline at end of file
diff --git a/tests/lib/chai-1.9.0/component.json b/tests/lib/chai-1.9.0/component.json
deleted file mode 100644
index f0c1ddbe2f..0000000000
--- a/tests/lib/chai-1.9.0/component.json
+++ /dev/null
@@ -1,48 +0,0 @@
-{
- "name": "chai"
- , "repo": "chaijs/chai"
- , "version": "1.9.0"
- , "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic."
- , "license": "MIT"
- , "keywords": [
- "test"
- , "assertion"
- , "assert"
- , "testing"
- , "chai"
- ]
- , "main": "index.js"
- , "scripts": [
- "index.js"
- , "lib/chai.js"
- , "lib/chai/assertion.js"
- , "lib/chai/core/assertions.js"
- , "lib/chai/interface/assert.js"
- , "lib/chai/interface/expect.js"
- , "lib/chai/interface/should.js"
- , "lib/chai/utils/addChainableMethod.js"
- , "lib/chai/utils/addMethod.js"
- , "lib/chai/utils/addProperty.js"
- , "lib/chai/utils/flag.js"
- , "lib/chai/utils/getActual.js"
- , "lib/chai/utils/getEnumerableProperties.js"
- , "lib/chai/utils/getMessage.js"
- , "lib/chai/utils/getName.js"
- , "lib/chai/utils/getPathValue.js"
- , "lib/chai/utils/getProperties.js"
- , "lib/chai/utils/index.js"
- , "lib/chai/utils/inspect.js"
- , "lib/chai/utils/objDisplay.js"
- , "lib/chai/utils/overwriteMethod.js"
- , "lib/chai/utils/overwriteProperty.js"
- , "lib/chai/utils/overwriteChainableMethod.js"
- , "lib/chai/utils/test.js"
- , "lib/chai/utils/transferFlags.js"
- , "lib/chai/utils/type.js"
- ]
- , "dependencies": {
- "chaijs/assertion-error": "1.0.0"
- , "chaijs/deep-eql": "0.1.3"
- }
- , "development": {}
-}
diff --git a/tests/lib/chai-1.9.0/index.js b/tests/lib/chai-1.9.0/index.js
deleted file mode 100644
index 634483b026..0000000000
--- a/tests/lib/chai-1.9.0/index.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports = require('./lib/chai');
diff --git a/tests/lib/chai-1.9.0/karma.conf.js b/tests/lib/chai-1.9.0/karma.conf.js
deleted file mode 100644
index b0dfe6aeac..0000000000
--- a/tests/lib/chai-1.9.0/karma.conf.js
+++ /dev/null
@@ -1,28 +0,0 @@
-module.exports = function(config) {
- config.set({
- frameworks: [ 'mocha' ]
- , files: [
- 'build/build.js'
- , 'test/bootstrap/karma.js'
- , 'test/*.js'
- ]
- , reporters: [ 'progress' ]
- , colors: true
- , logLevel: config.LOG_INFO
- , autoWatch: false
- , browsers: [ 'PhantomJS' ]
- , browserDisconnectTimeout: 10000
- , browserDisconnectTolerance: 2
- , browserNoActivityTimeout: 20000
- , singleRun: true
- });
-
- switch (process.env.CHAI_TEST_ENV) {
- case 'sauce':
- require('./karma.sauce')(config);
- break;
- default:
- // ...
- break;
- };
-};
diff --git a/tests/lib/chai-1.9.0/karma.sauce.js b/tests/lib/chai-1.9.0/karma.sauce.js
deleted file mode 100644
index e57d5e0db8..0000000000
--- a/tests/lib/chai-1.9.0/karma.sauce.js
+++ /dev/null
@@ -1,41 +0,0 @@
-var version = require('./package.json').version;
-var ts = new Date().getTime();
-
-module.exports = function(config) {
- var auth;
-
- try {
- auth = require('./test/auth/index');
- } catch(ex) {
- auth = {};
- auth.SAUCE_USERNAME = process.env.SAUCE_USERNAME || null;
- auth.SAUCE_ACCESS_KEY = process.env.SAUCE_ACCESS_KEY || null;
- }
-
- if (!auth.SAUCE_USERNAME || !auth.SAUCE_ACCESS_KEY) return;
- if (process.env.SKIP_SAUCE) return;
-
- var branch = process.env.TRAVIS_BRANCH || 'local'
- var browserConfig = require('./sauce.browsers');
- var browsers = Object.keys(browserConfig);
- var tags = [ 'chaijs_' + version, auth.SAUCE_USERNAME + '@' + branch ];
- var tunnel = process.env.TRAVIS_JOB_NUMBER || ts;
-
- if (process.env.TRAVIS_JOB_NUMBER) {
- tags.push('travis@' + process.env.TRAVIS_JOB_NUMBER);
- }
-
- config.browsers = config.browsers.concat(browsers);
- config.customLaunchers = browserConfig;
- config.reporters.push('saucelabs');
- config.transports = [ 'xhr-polling' ];
-
- config.sauceLabs = {
- username: auth.SAUCE_USERNAME
- , accessKey: auth.SAUCE_ACCESS_KEY
- , startConnect: true
- , tags: tags
- , testName: 'ChaiJS'
- , tunnelIdentifier: tunnel
- };
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai.js b/tests/lib/chai-1.9.0/lib/chai.js
deleted file mode 100644
index f9ea2bb1e8..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-var used = []
- , exports = module.exports = {};
-
-/*!
- * Chai version
- */
-
-exports.version = '1.8.1';
-
-/*!
- * Assertion Error
- */
-
-exports.AssertionError = require('assertion-error');
-
-/*!
- * Utils for plugins (not exported)
- */
-
-var util = require('./chai/utils');
-
-/**
- * # .use(function)
- *
- * Provides a way to extend the internals of Chai
- *
- * @param {Function}
- * @returns {this} for chaining
- * @api public
- */
-
-exports.use = function (fn) {
- if (!~used.indexOf(fn)) {
- fn(this, util);
- used.push(fn);
- }
-
- return this;
-};
-
-/*!
- * Primary `Assertion` prototype
- */
-
-var assertion = require('./chai/assertion');
-exports.use(assertion);
-
-/*!
- * Core Assertions
- */
-
-var core = require('./chai/core/assertions');
-exports.use(core);
-
-/*!
- * Expect interface
- */
-
-var expect = require('./chai/interface/expect');
-exports.use(expect);
-
-/*!
- * Should interface
- */
-
-var should = require('./chai/interface/should');
-exports.use(should);
-
-/*!
- * Assert interface
- */
-
-var assert = require('./chai/interface/assert');
-exports.use(assert);
diff --git a/tests/lib/chai-1.9.0/lib/chai/assertion.js b/tests/lib/chai-1.9.0/lib/chai/assertion.js
deleted file mode 100644
index a0933cf0ca..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/assertion.js
+++ /dev/null
@@ -1,134 +0,0 @@
-/*!
- * chai
- * http://chaijs.com
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (_chai, util) {
- /*!
- * Module dependencies.
- */
-
- var AssertionError = _chai.AssertionError
- , flag = util.flag;
-
- /*!
- * Module export.
- */
-
- _chai.Assertion = Assertion;
-
- /*!
- * Assertion Constructor
- *
- * Creates object for chaining.
- *
- * @api private
- */
-
- function Assertion (obj, msg, stack) {
- flag(this, 'ssfi', stack || arguments.callee);
- flag(this, 'object', obj);
- flag(this, 'message', msg);
- }
-
- /*!
- * ### Assertion.includeStack
- *
- * User configurable property, influences whether stack trace
- * is included in Assertion error message. Default of false
- * suppresses stack trace in the error message
- *
- * Assertion.includeStack = true; // enable stack on error
- *
- * @api public
- */
-
- Assertion.includeStack = false;
-
- /*!
- * ### Assertion.showDiff
- *
- * User configurable property, influences whether or not
- * the `showDiff` flag should be included in the thrown
- * AssertionErrors. `false` will always be `false`; `true`
- * will be true when the assertion has requested a diff
- * be shown.
- *
- * @api public
- */
-
- Assertion.showDiff = true;
-
- Assertion.addProperty = function (name, fn) {
- util.addProperty(this.prototype, name, fn);
- };
-
- Assertion.addMethod = function (name, fn) {
- util.addMethod(this.prototype, name, fn);
- };
-
- Assertion.addChainableMethod = function (name, fn, chainingBehavior) {
- util.addChainableMethod(this.prototype, name, fn, chainingBehavior);
- };
-
- Assertion.overwriteProperty = function (name, fn) {
- util.overwriteProperty(this.prototype, name, fn);
- };
-
- Assertion.overwriteMethod = function (name, fn) {
- util.overwriteMethod(this.prototype, name, fn);
- };
-
- Assertion.overwriteChainableMethod = function (name, fn, chainingBehavior) {
- util.overwriteChainableMethod(this.prototype, name, fn, chainingBehavior);
- };
-
- /*!
- * ### .assert(expression, message, negateMessage, expected, actual)
- *
- * Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass.
- *
- * @name assert
- * @param {Philosophical} expression to be tested
- * @param {String} message to display if fails
- * @param {String} negatedMessage to display if negated expression fails
- * @param {Mixed} expected value (remember to check for negation)
- * @param {Mixed} actual (optional) will default to `this.obj`
- * @api private
- */
-
- Assertion.prototype.assert = function (expr, msg, negateMsg, expected, _actual, showDiff) {
- var ok = util.test(this, arguments);
- if (true !== showDiff) showDiff = false;
- if (true !== Assertion.showDiff) showDiff = false;
-
- if (!ok) {
- var msg = util.getMessage(this, arguments)
- , actual = util.getActual(this, arguments);
- throw new AssertionError(msg, {
- actual: actual
- , expected: expected
- , showDiff: showDiff
- }, (Assertion.includeStack) ? this.assert : flag(this, 'ssfi'));
- }
- };
-
- /*!
- * ### ._obj
- *
- * Quick reference to stored `actual` value for plugin developers.
- *
- * @api private
- */
-
- Object.defineProperty(Assertion.prototype, '_obj',
- { get: function () {
- return flag(this, 'object');
- }
- , set: function (val) {
- flag(this, 'object', val);
- }
- });
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/core/assertions.js b/tests/lib/chai-1.9.0/lib/chai/core/assertions.js
deleted file mode 100644
index ef3d50a97c..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/core/assertions.js
+++ /dev/null
@@ -1,1294 +0,0 @@
-/*!
- * chai
- * http://chaijs.com
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (chai, _) {
- var Assertion = chai.Assertion
- , toString = Object.prototype.toString
- , flag = _.flag;
-
- /**
- * ### Language Chains
- *
- * The following are provided as chainable getters to
- * improve the readability of your assertions. They
- * do not provide an testing capability unless they
- * have been overwritten by a plugin.
- *
- * **Chains**
- *
- * - to
- * - be
- * - been
- * - is
- * - that
- * - and
- * - has
- * - have
- * - with
- * - at
- * - of
- * - same
- *
- * @name language chains
- * @api public
- */
-
- [ 'to', 'be', 'been'
- , 'is', 'and', 'has', 'have'
- , 'with', 'that', 'at'
- , 'of', 'same' ].forEach(function (chain) {
- Assertion.addProperty(chain, function () {
- return this;
- });
- });
-
- /**
- * ### .not
- *
- * Negates any of assertions following in the chain.
- *
- * expect(foo).to.not.equal('bar');
- * expect(goodFn).to.not.throw(Error);
- * expect({ foo: 'baz' }).to.have.property('foo')
- * .and.not.equal('bar');
- *
- * @name not
- * @api public
- */
-
- Assertion.addProperty('not', function () {
- flag(this, 'negate', true);
- });
-
- /**
- * ### .deep
- *
- * Sets the `deep` flag, later used by the `equal` and
- * `property` assertions.
- *
- * expect(foo).to.deep.equal({ bar: 'baz' });
- * expect({ foo: { bar: { baz: 'quux' } } })
- * .to.have.deep.property('foo.bar.baz', 'quux');
- *
- * @name deep
- * @api public
- */
-
- Assertion.addProperty('deep', function () {
- flag(this, 'deep', true);
- });
-
- /**
- * ### .a(type)
- *
- * The `a` and `an` assertions are aliases that can be
- * used either as language chains or to assert a value's
- * type.
- *
- * // typeof
- * expect('test').to.be.a('string');
- * expect({ foo: 'bar' }).to.be.an('object');
- * expect(null).to.be.a('null');
- * expect(undefined).to.be.an('undefined');
- *
- * // language chain
- * expect(foo).to.be.an.instanceof(Foo);
- *
- * @name a
- * @alias an
- * @param {String} type
- * @param {String} message _optional_
- * @api public
- */
-
- function an (type, msg) {
- if (msg) flag(this, 'message', msg);
- type = type.toLowerCase();
- var obj = flag(this, 'object')
- , article = ~[ 'a', 'e', 'i', 'o', 'u' ].indexOf(type.charAt(0)) ? 'an ' : 'a ';
-
- this.assert(
- type === _.type(obj)
- , 'expected #{this} to be ' + article + type
- , 'expected #{this} not to be ' + article + type
- );
- }
-
- Assertion.addChainableMethod('an', an);
- Assertion.addChainableMethod('a', an);
-
- /**
- * ### .include(value)
- *
- * The `include` and `contain` assertions can be used as either property
- * based language chains or as methods to assert the inclusion of an object
- * in an array or a substring in a string. When used as language chains,
- * they toggle the `contain` flag for the `keys` assertion.
- *
- * expect([1,2,3]).to.include(2);
- * expect('foobar').to.contain('foo');
- * expect({ foo: 'bar', hello: 'universe' }).to.include.keys('foo');
- *
- * @name include
- * @alias contain
- * @param {Object|String|Number} obj
- * @param {String} message _optional_
- * @api public
- */
-
- function includeChainingBehavior () {
- flag(this, 'contains', true);
- }
-
- function include (val, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
-
- if (_.type(val) === 'object') {
- if (!flag(this, 'negate')) {
- for (var k in val) new Assertion(obj).property(k, val[k]);
- return;
- }
- var subset = {}
- for (var k in val) subset[k] = obj[k]
- var expected = _.eql(subset, val);
- } else {
- var expected = obj && ~obj.indexOf(val)
- }
- this.assert(
- expected
- , 'expected #{this} to include ' + _.inspect(val)
- , 'expected #{this} to not include ' + _.inspect(val));
- }
-
- Assertion.addChainableMethod('include', include, includeChainingBehavior);
- Assertion.addChainableMethod('contain', include, includeChainingBehavior);
-
- /**
- * ### .ok
- *
- * Asserts that the target is truthy.
- *
- * expect('everthing').to.be.ok;
- * expect(1).to.be.ok;
- * expect(false).to.not.be.ok;
- * expect(undefined).to.not.be.ok;
- * expect(null).to.not.be.ok;
- *
- * @name ok
- * @api public
- */
-
- Assertion.addProperty('ok', function () {
- this.assert(
- flag(this, 'object')
- , 'expected #{this} to be truthy'
- , 'expected #{this} to be falsy');
- });
-
- /**
- * ### .true
- *
- * Asserts that the target is `true`.
- *
- * expect(true).to.be.true;
- * expect(1).to.not.be.true;
- *
- * @name true
- * @api public
- */
-
- Assertion.addProperty('true', function () {
- this.assert(
- true === flag(this, 'object')
- , 'expected #{this} to be true'
- , 'expected #{this} to be false'
- , this.negate ? false : true
- );
- });
-
- /**
- * ### .false
- *
- * Asserts that the target is `false`.
- *
- * expect(false).to.be.false;
- * expect(0).to.not.be.false;
- *
- * @name false
- * @api public
- */
-
- Assertion.addProperty('false', function () {
- this.assert(
- false === flag(this, 'object')
- , 'expected #{this} to be false'
- , 'expected #{this} to be true'
- , this.negate ? true : false
- );
- });
-
- /**
- * ### .null
- *
- * Asserts that the target is `null`.
- *
- * expect(null).to.be.null;
- * expect(undefined).not.to.be.null;
- *
- * @name null
- * @api public
- */
-
- Assertion.addProperty('null', function () {
- this.assert(
- null === flag(this, 'object')
- , 'expected #{this} to be null'
- , 'expected #{this} not to be null'
- );
- });
-
- /**
- * ### .undefined
- *
- * Asserts that the target is `undefined`.
- *
- * expect(undefined).to.be.undefined;
- * expect(null).to.not.be.undefined;
- *
- * @name undefined
- * @api public
- */
-
- Assertion.addProperty('undefined', function () {
- this.assert(
- undefined === flag(this, 'object')
- , 'expected #{this} to be undefined'
- , 'expected #{this} not to be undefined'
- );
- });
-
- /**
- * ### .exist
- *
- * Asserts that the target is neither `null` nor `undefined`.
- *
- * var foo = 'hi'
- * , bar = null
- * , baz;
- *
- * expect(foo).to.exist;
- * expect(bar).to.not.exist;
- * expect(baz).to.not.exist;
- *
- * @name exist
- * @api public
- */
-
- Assertion.addProperty('exist', function () {
- this.assert(
- null != flag(this, 'object')
- , 'expected #{this} to exist'
- , 'expected #{this} to not exist'
- );
- });
-
- /**
- * ### .empty
- *
- * Asserts that the target's length is `0`. For arrays, it checks
- * the `length` property. For objects, it gets the count of
- * enumerable keys.
- *
- * expect([]).to.be.empty;
- * expect('').to.be.empty;
- * expect({}).to.be.empty;
- *
- * @name empty
- * @api public
- */
-
- Assertion.addProperty('empty', function () {
- var obj = flag(this, 'object')
- , expected = obj;
-
- if (Array.isArray(obj) || 'string' === typeof object) {
- expected = obj.length;
- } else if (typeof obj === 'object') {
- expected = Object.keys(obj).length;
- }
-
- this.assert(
- !expected
- , 'expected #{this} to be empty'
- , 'expected #{this} not to be empty'
- );
- });
-
- /**
- * ### .arguments
- *
- * Asserts that the target is an arguments object.
- *
- * function test () {
- * expect(arguments).to.be.arguments;
- * }
- *
- * @name arguments
- * @alias Arguments
- * @api public
- */
-
- function checkArguments () {
- var obj = flag(this, 'object')
- , type = Object.prototype.toString.call(obj);
- this.assert(
- '[object Arguments]' === type
- , 'expected #{this} to be arguments but got ' + type
- , 'expected #{this} to not be arguments'
- );
- }
-
- Assertion.addProperty('arguments', checkArguments);
- Assertion.addProperty('Arguments', checkArguments);
-
- /**
- * ### .equal(value)
- *
- * Asserts that the target is strictly equal (`===`) to `value`.
- * Alternately, if the `deep` flag is set, asserts that
- * the target is deeply equal to `value`.
- *
- * expect('hello').to.equal('hello');
- * expect(42).to.equal(42);
- * expect(1).to.not.equal(true);
- * expect({ foo: 'bar' }).to.not.equal({ foo: 'bar' });
- * expect({ foo: 'bar' }).to.deep.equal({ foo: 'bar' });
- *
- * @name equal
- * @alias equals
- * @alias eq
- * @alias deep.equal
- * @param {Mixed} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertEqual (val, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'deep')) {
- return this.eql(val);
- } else {
- this.assert(
- val === obj
- , 'expected #{this} to equal #{exp}'
- , 'expected #{this} to not equal #{exp}'
- , val
- , this._obj
- , true
- );
- }
- }
-
- Assertion.addMethod('equal', assertEqual);
- Assertion.addMethod('equals', assertEqual);
- Assertion.addMethod('eq', assertEqual);
-
- /**
- * ### .eql(value)
- *
- * Asserts that the target is deeply equal to `value`.
- *
- * expect({ foo: 'bar' }).to.eql({ foo: 'bar' });
- * expect([ 1, 2, 3 ]).to.eql([ 1, 2, 3 ]);
- *
- * @name eql
- * @alias eqls
- * @param {Mixed} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertEql(obj, msg) {
- if (msg) flag(this, 'message', msg);
- this.assert(
- _.eql(obj, flag(this, 'object'))
- , 'expected #{this} to deeply equal #{exp}'
- , 'expected #{this} to not deeply equal #{exp}'
- , obj
- , this._obj
- , true
- );
- }
-
- Assertion.addMethod('eql', assertEql);
- Assertion.addMethod('eqls', assertEql);
-
- /**
- * ### .above(value)
- *
- * Asserts that the target is greater than `value`.
- *
- * expect(10).to.be.above(5);
- *
- * Can also be used in conjunction with `length` to
- * assert a minimum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.above(2);
- * expect([ 1, 2, 3 ]).to.have.length.above(2);
- *
- * @name above
- * @alias gt
- * @alias greaterThan
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertAbove (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len > n
- , 'expected #{this} to have a length above #{exp} but got #{act}'
- , 'expected #{this} to not have a length above #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj > n
- , 'expected #{this} to be above ' + n
- , 'expected #{this} to be at most ' + n
- );
- }
- }
-
- Assertion.addMethod('above', assertAbove);
- Assertion.addMethod('gt', assertAbove);
- Assertion.addMethod('greaterThan', assertAbove);
-
- /**
- * ### .least(value)
- *
- * Asserts that the target is greater than or equal to `value`.
- *
- * expect(10).to.be.at.least(10);
- *
- * Can also be used in conjunction with `length` to
- * assert a minimum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.of.at.least(2);
- * expect([ 1, 2, 3 ]).to.have.length.of.at.least(3);
- *
- * @name least
- * @alias gte
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertLeast (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len >= n
- , 'expected #{this} to have a length at least #{exp} but got #{act}'
- , 'expected #{this} to have a length below #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj >= n
- , 'expected #{this} to be at least ' + n
- , 'expected #{this} to be below ' + n
- );
- }
- }
-
- Assertion.addMethod('least', assertLeast);
- Assertion.addMethod('gte', assertLeast);
-
- /**
- * ### .below(value)
- *
- * Asserts that the target is less than `value`.
- *
- * expect(5).to.be.below(10);
- *
- * Can also be used in conjunction with `length` to
- * assert a maximum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.below(4);
- * expect([ 1, 2, 3 ]).to.have.length.below(4);
- *
- * @name below
- * @alias lt
- * @alias lessThan
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertBelow (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len < n
- , 'expected #{this} to have a length below #{exp} but got #{act}'
- , 'expected #{this} to not have a length below #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj < n
- , 'expected #{this} to be below ' + n
- , 'expected #{this} to be at least ' + n
- );
- }
- }
-
- Assertion.addMethod('below', assertBelow);
- Assertion.addMethod('lt', assertBelow);
- Assertion.addMethod('lessThan', assertBelow);
-
- /**
- * ### .most(value)
- *
- * Asserts that the target is less than or equal to `value`.
- *
- * expect(5).to.be.at.most(5);
- *
- * Can also be used in conjunction with `length` to
- * assert a maximum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.of.at.most(4);
- * expect([ 1, 2, 3 ]).to.have.length.of.at.most(3);
- *
- * @name most
- * @alias lte
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertMost (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len <= n
- , 'expected #{this} to have a length at most #{exp} but got #{act}'
- , 'expected #{this} to have a length above #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj <= n
- , 'expected #{this} to be at most ' + n
- , 'expected #{this} to be above ' + n
- );
- }
- }
-
- Assertion.addMethod('most', assertMost);
- Assertion.addMethod('lte', assertMost);
-
- /**
- * ### .within(start, finish)
- *
- * Asserts that the target is within a range.
- *
- * expect(7).to.be.within(5,10);
- *
- * Can also be used in conjunction with `length` to
- * assert a length range. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.within(2,4);
- * expect([ 1, 2, 3 ]).to.have.length.within(2,4);
- *
- * @name within
- * @param {Number} start lowerbound inclusive
- * @param {Number} finish upperbound inclusive
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('within', function (start, finish, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object')
- , range = start + '..' + finish;
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len >= start && len <= finish
- , 'expected #{this} to have a length within ' + range
- , 'expected #{this} to not have a length within ' + range
- );
- } else {
- this.assert(
- obj >= start && obj <= finish
- , 'expected #{this} to be within ' + range
- , 'expected #{this} to not be within ' + range
- );
- }
- });
-
- /**
- * ### .instanceof(constructor)
- *
- * Asserts that the target is an instance of `constructor`.
- *
- * var Tea = function (name) { this.name = name; }
- * , Chai = new Tea('chai');
- *
- * expect(Chai).to.be.an.instanceof(Tea);
- * expect([ 1, 2, 3 ]).to.be.instanceof(Array);
- *
- * @name instanceof
- * @param {Constructor} constructor
- * @param {String} message _optional_
- * @alias instanceOf
- * @api public
- */
-
- function assertInstanceOf (constructor, msg) {
- if (msg) flag(this, 'message', msg);
- var name = _.getName(constructor);
- this.assert(
- flag(this, 'object') instanceof constructor
- , 'expected #{this} to be an instance of ' + name
- , 'expected #{this} to not be an instance of ' + name
- );
- };
-
- Assertion.addMethod('instanceof', assertInstanceOf);
- Assertion.addMethod('instanceOf', assertInstanceOf);
-
- /**
- * ### .property(name, [value])
- *
- * Asserts that the target has a property `name`, optionally asserting that
- * the value of that property is strictly equal to `value`.
- * If the `deep` flag is set, you can use dot- and bracket-notation for deep
- * references into objects and arrays.
- *
- * // simple referencing
- * var obj = { foo: 'bar' };
- * expect(obj).to.have.property('foo');
- * expect(obj).to.have.property('foo', 'bar');
- *
- * // deep referencing
- * var deepObj = {
- * green: { tea: 'matcha' }
- * , teas: [ 'chai', 'matcha', { tea: 'konacha' } ]
- * };
-
- * expect(deepObj).to.have.deep.property('green.tea', 'matcha');
- * expect(deepObj).to.have.deep.property('teas[1]', 'matcha');
- * expect(deepObj).to.have.deep.property('teas[2].tea', 'konacha');
- *
- * You can also use an array as the starting point of a `deep.property`
- * assertion, or traverse nested arrays.
- *
- * var arr = [
- * [ 'chai', 'matcha', 'konacha' ]
- * , [ { tea: 'chai' }
- * , { tea: 'matcha' }
- * , { tea: 'konacha' } ]
- * ];
- *
- * expect(arr).to.have.deep.property('[0][1]', 'matcha');
- * expect(arr).to.have.deep.property('[1][2].tea', 'konacha');
- *
- * Furthermore, `property` changes the subject of the assertion
- * to be the value of that property from the original object. This
- * permits for further chainable assertions on that property.
- *
- * expect(obj).to.have.property('foo')
- * .that.is.a('string');
- * expect(deepObj).to.have.property('green')
- * .that.is.an('object')
- * .that.deep.equals({ tea: 'matcha' });
- * expect(deepObj).to.have.property('teas')
- * .that.is.an('array')
- * .with.deep.property('[2]')
- * .that.deep.equals({ tea: 'konacha' });
- *
- * @name property
- * @alias deep.property
- * @param {String} name
- * @param {Mixed} value (optional)
- * @param {String} message _optional_
- * @returns value of property for chaining
- * @api public
- */
-
- Assertion.addMethod('property', function (name, val, msg) {
- if (msg) flag(this, 'message', msg);
-
- var descriptor = flag(this, 'deep') ? 'deep property ' : 'property '
- , negate = flag(this, 'negate')
- , obj = flag(this, 'object')
- , value = flag(this, 'deep')
- ? _.getPathValue(name, obj)
- : obj[name];
-
- if (negate && undefined !== val) {
- if (undefined === value) {
- msg = (msg != null) ? msg + ': ' : '';
- throw new Error(msg + _.inspect(obj) + ' has no ' + descriptor + _.inspect(name));
- }
- } else {
- this.assert(
- undefined !== value
- , 'expected #{this} to have a ' + descriptor + _.inspect(name)
- , 'expected #{this} to not have ' + descriptor + _.inspect(name));
- }
-
- if (undefined !== val) {
- this.assert(
- val === value
- , 'expected #{this} to have a ' + descriptor + _.inspect(name) + ' of #{exp}, but got #{act}'
- , 'expected #{this} to not have a ' + descriptor + _.inspect(name) + ' of #{act}'
- , val
- , value
- );
- }
-
- flag(this, 'object', value);
- });
-
- /**
- * ### .ownProperty(name)
- *
- * Asserts that the target has an own property `name`.
- *
- * expect('test').to.have.ownProperty('length');
- *
- * @name ownProperty
- * @alias haveOwnProperty
- * @param {String} name
- * @param {String} message _optional_
- * @api public
- */
-
- function assertOwnProperty (name, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- this.assert(
- obj.hasOwnProperty(name)
- , 'expected #{this} to have own property ' + _.inspect(name)
- , 'expected #{this} to not have own property ' + _.inspect(name)
- );
- }
-
- Assertion.addMethod('ownProperty', assertOwnProperty);
- Assertion.addMethod('haveOwnProperty', assertOwnProperty);
-
- /**
- * ### .length(value)
- *
- * Asserts that the target's `length` property has
- * the expected value.
- *
- * expect([ 1, 2, 3]).to.have.length(3);
- * expect('foobar').to.have.length(6);
- *
- * Can also be used as a chain precursor to a value
- * comparison for the length property.
- *
- * expect('foo').to.have.length.above(2);
- * expect([ 1, 2, 3 ]).to.have.length.above(2);
- * expect('foo').to.have.length.below(4);
- * expect([ 1, 2, 3 ]).to.have.length.below(4);
- * expect('foo').to.have.length.within(2,4);
- * expect([ 1, 2, 3 ]).to.have.length.within(2,4);
- *
- * @name length
- * @alias lengthOf
- * @param {Number} length
- * @param {String} message _optional_
- * @api public
- */
-
- function assertLengthChain () {
- flag(this, 'doLength', true);
- }
-
- function assertLength (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
-
- this.assert(
- len == n
- , 'expected #{this} to have a length of #{exp} but got #{act}'
- , 'expected #{this} to not have a length of #{act}'
- , n
- , len
- );
- }
-
- Assertion.addChainableMethod('length', assertLength, assertLengthChain);
- Assertion.addMethod('lengthOf', assertLength, assertLengthChain);
-
- /**
- * ### .match(regexp)
- *
- * Asserts that the target matches a regular expression.
- *
- * expect('foobar').to.match(/^foo/);
- *
- * @name match
- * @param {RegExp} RegularExpression
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('match', function (re, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- this.assert(
- re.exec(obj)
- , 'expected #{this} to match ' + re
- , 'expected #{this} not to match ' + re
- );
- });
-
- /**
- * ### .string(string)
- *
- * Asserts that the string target contains another string.
- *
- * expect('foobar').to.have.string('bar');
- *
- * @name string
- * @param {String} string
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('string', function (str, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- new Assertion(obj, msg).is.a('string');
-
- this.assert(
- ~obj.indexOf(str)
- , 'expected #{this} to contain ' + _.inspect(str)
- , 'expected #{this} to not contain ' + _.inspect(str)
- );
- });
-
- /**
- * ### .keys(key1, [key2], [...])
- *
- * Asserts that the target has exactly the given keys, or
- * asserts the inclusion of some keys when using the
- * `include` or `contain` modifiers.
- *
- * expect({ foo: 1, bar: 2 }).to.have.keys(['foo', 'bar']);
- * expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('foo', 'bar');
- *
- * @name keys
- * @alias key
- * @param {String...|Array} keys
- * @api public
- */
-
- function assertKeys (keys) {
- var obj = flag(this, 'object')
- , str
- , ok = true;
-
- keys = keys instanceof Array
- ? keys
- : Array.prototype.slice.call(arguments);
-
- if (!keys.length) throw new Error('keys required');
-
- var actual = Object.keys(obj)
- , len = keys.length;
-
- // Inclusion
- ok = keys.every(function(key){
- return ~actual.indexOf(key);
- });
-
- // Strict
- if (!flag(this, 'negate') && !flag(this, 'contains')) {
- ok = ok && keys.length == actual.length;
- }
-
- // Key string
- if (len > 1) {
- keys = keys.map(function(key){
- return _.inspect(key);
- });
- var last = keys.pop();
- str = keys.join(', ') + ', and ' + last;
- } else {
- str = _.inspect(keys[0]);
- }
-
- // Form
- str = (len > 1 ? 'keys ' : 'key ') + str;
-
- // Have / include
- str = (flag(this, 'contains') ? 'contain ' : 'have ') + str;
-
- // Assertion
- this.assert(
- ok
- , 'expected #{this} to ' + str
- , 'expected #{this} to not ' + str
- );
- }
-
- Assertion.addMethod('keys', assertKeys);
- Assertion.addMethod('key', assertKeys);
-
- /**
- * ### .throw(constructor)
- *
- * Asserts that the function target will throw a specific error, or specific type of error
- * (as determined using `instanceof`), optionally with a RegExp or string inclusion test
- * for the error's message.
- *
- * var err = new ReferenceError('This is a bad function.');
- * var fn = function () { throw err; }
- * expect(fn).to.throw(ReferenceError);
- * expect(fn).to.throw(Error);
- * expect(fn).to.throw(/bad function/);
- * expect(fn).to.not.throw('good function');
- * expect(fn).to.throw(ReferenceError, /bad function/);
- * expect(fn).to.throw(err);
- * expect(fn).to.not.throw(new RangeError('Out of range.'));
- *
- * Please note that when a throw expectation is negated, it will check each
- * parameter independently, starting with error constructor type. The appropriate way
- * to check for the existence of a type of error but for a message that does not match
- * is to use `and`.
- *
- * expect(fn).to.throw(ReferenceError)
- * .and.not.throw(/good function/);
- *
- * @name throw
- * @alias throws
- * @alias Throw
- * @param {ErrorConstructor} constructor
- * @param {String|RegExp} expected error message
- * @param {String} message _optional_
- * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
- * @returns error for chaining (null if no error)
- * @api public
- */
-
- function assertThrows (constructor, errMsg, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- new Assertion(obj, msg).is.a('function');
-
- var thrown = false
- , desiredError = null
- , name = null
- , thrownError = null;
-
- if (arguments.length === 0) {
- errMsg = null;
- constructor = null;
- } else if (constructor && (constructor instanceof RegExp || 'string' === typeof constructor)) {
- errMsg = constructor;
- constructor = null;
- } else if (constructor && constructor instanceof Error) {
- desiredError = constructor;
- constructor = null;
- errMsg = null;
- } else if (typeof constructor === 'function') {
- name = constructor.prototype.name || constructor.name;
- if (name === 'Error' && constructor !== Error) {
- name = (new constructor()).name;
- }
- } else {
- constructor = null;
- }
-
- try {
- obj();
- } catch (err) {
- // first, check desired error
- if (desiredError) {
- this.assert(
- err === desiredError
- , 'expected #{this} to throw #{exp} but #{act} was thrown'
- , 'expected #{this} to not throw #{exp}'
- , (desiredError instanceof Error ? desiredError.toString() : desiredError)
- , (err instanceof Error ? err.toString() : err)
- );
-
- flag(this, 'object', err);
- return this;
- }
-
- // next, check constructor
- if (constructor) {
- this.assert(
- err instanceof constructor
- , 'expected #{this} to throw #{exp} but #{act} was thrown'
- , 'expected #{this} to not throw #{exp} but #{act} was thrown'
- , name
- , (err instanceof Error ? err.toString() : err)
- );
-
- if (!errMsg) {
- flag(this, 'object', err);
- return this;
- }
- }
-
- // next, check message
- var message = 'object' === _.type(err) && "message" in err
- ? err.message
- : '' + err;
-
- if ((message != null) && errMsg && errMsg instanceof RegExp) {
- this.assert(
- errMsg.exec(message)
- , 'expected #{this} to throw error matching #{exp} but got #{act}'
- , 'expected #{this} to throw error not matching #{exp}'
- , errMsg
- , message
- );
-
- flag(this, 'object', err);
- return this;
- } else if ((message != null) && errMsg && 'string' === typeof errMsg) {
- this.assert(
- ~message.indexOf(errMsg)
- , 'expected #{this} to throw error including #{exp} but got #{act}'
- , 'expected #{this} to throw error not including #{act}'
- , errMsg
- , message
- );
-
- flag(this, 'object', err);
- return this;
- } else {
- thrown = true;
- thrownError = err;
- }
- }
-
- var actuallyGot = ''
- , expectedThrown = name !== null
- ? name
- : desiredError
- ? '#{exp}' //_.inspect(desiredError)
- : 'an error';
-
- if (thrown) {
- actuallyGot = ' but #{act} was thrown'
- }
-
- this.assert(
- thrown === true
- , 'expected #{this} to throw ' + expectedThrown + actuallyGot
- , 'expected #{this} to not throw ' + expectedThrown + actuallyGot
- , (desiredError instanceof Error ? desiredError.toString() : desiredError)
- , (thrownError instanceof Error ? thrownError.toString() : thrownError)
- );
-
- flag(this, 'object', thrownError);
- };
-
- Assertion.addMethod('throw', assertThrows);
- Assertion.addMethod('throws', assertThrows);
- Assertion.addMethod('Throw', assertThrows);
-
- /**
- * ### .respondTo(method)
- *
- * Asserts that the object or class target will respond to a method.
- *
- * Klass.prototype.bar = function(){};
- * expect(Klass).to.respondTo('bar');
- * expect(obj).to.respondTo('bar');
- *
- * To check if a constructor will respond to a static function,
- * set the `itself` flag.
- *
- * Klass.baz = function(){};
- * expect(Klass).itself.to.respondTo('baz');
- *
- * @name respondTo
- * @param {String} method
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('respondTo', function (method, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object')
- , itself = flag(this, 'itself')
- , context = ('function' === _.type(obj) && !itself)
- ? obj.prototype[method]
- : obj[method];
-
- this.assert(
- 'function' === typeof context
- , 'expected #{this} to respond to ' + _.inspect(method)
- , 'expected #{this} to not respond to ' + _.inspect(method)
- );
- });
-
- /**
- * ### .itself
- *
- * Sets the `itself` flag, later used by the `respondTo` assertion.
- *
- * function Foo() {}
- * Foo.bar = function() {}
- * Foo.prototype.baz = function() {}
- *
- * expect(Foo).itself.to.respondTo('bar');
- * expect(Foo).itself.not.to.respondTo('baz');
- *
- * @name itself
- * @api public
- */
-
- Assertion.addProperty('itself', function () {
- flag(this, 'itself', true);
- });
-
- /**
- * ### .satisfy(method)
- *
- * Asserts that the target passes a given truth test.
- *
- * expect(1).to.satisfy(function(num) { return num > 0; });
- *
- * @name satisfy
- * @param {Function} matcher
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('satisfy', function (matcher, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- this.assert(
- matcher(obj)
- , 'expected #{this} to satisfy ' + _.objDisplay(matcher)
- , 'expected #{this} to not satisfy' + _.objDisplay(matcher)
- , this.negate ? false : true
- , matcher(obj)
- );
- });
-
- /**
- * ### .closeTo(expected, delta)
- *
- * Asserts that the target is equal `expected`, to within a +/- `delta` range.
- *
- * expect(1.5).to.be.closeTo(1, 0.5);
- *
- * @name closeTo
- * @param {Number} expected
- * @param {Number} delta
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('closeTo', function (expected, delta, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- this.assert(
- Math.abs(obj - expected) <= delta
- , 'expected #{this} to be close to ' + expected + ' +/- ' + delta
- , 'expected #{this} not to be close to ' + expected + ' +/- ' + delta
- );
- });
-
- function isSubsetOf(subset, superset) {
- return subset.every(function(elem) {
- return superset.indexOf(elem) !== -1;
- })
- }
-
- /**
- * ### .members(set)
- *
- * Asserts that the target is a superset of `set`,
- * or that the target and `set` have the same members.
- *
- * expect([1, 2, 3]).to.include.members([3, 2]);
- * expect([1, 2, 3]).to.not.include.members([3, 2, 8]);
- *
- * expect([4, 2]).to.have.members([2, 4]);
- * expect([5, 2]).to.not.have.members([5, 2, 1]);
- *
- * @name members
- * @param {Array} set
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('members', function (subset, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
-
- new Assertion(obj).to.be.an('array');
- new Assertion(subset).to.be.an('array');
-
- if (flag(this, 'contains')) {
- return this.assert(
- isSubsetOf(subset, obj)
- , 'expected #{this} to be a superset of #{act}'
- , 'expected #{this} to not be a superset of #{act}'
- , obj
- , subset
- );
- }
-
- this.assert(
- isSubsetOf(obj, subset) && isSubsetOf(subset, obj)
- , 'expected #{this} to have the same members as #{act}'
- , 'expected #{this} to not have the same members as #{act}'
- , obj
- , subset
- );
- });
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/interface/assert.js b/tests/lib/chai-1.9.0/lib/chai/interface/assert.js
deleted file mode 100644
index 1a3b3f01b5..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/interface/assert.js
+++ /dev/null
@@ -1,1055 +0,0 @@
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (chai, util) {
-
- /*!
- * Chai dependencies.
- */
-
- var Assertion = chai.Assertion
- , flag = util.flag;
-
- /*!
- * Module export.
- */
-
- /**
- * ### assert(expression, message)
- *
- * Write your own test expressions.
- *
- * assert('foo' !== 'bar', 'foo is not bar');
- * assert(Array.isArray([]), 'empty arrays are arrays');
- *
- * @param {Mixed} expression to test for truthiness
- * @param {String} message to display on error
- * @name assert
- * @api public
- */
-
- var assert = chai.assert = function (express, errmsg) {
- var test = new Assertion(null);
- test.assert(
- express
- , errmsg
- , '[ negation message unavailable ]'
- );
- };
-
- /**
- * ### .fail(actual, expected, [message], [operator])
- *
- * Throw a failure. Node.js `assert` module-compatible.
- *
- * @name fail
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @param {String} operator
- * @api public
- */
-
- assert.fail = function (actual, expected, message, operator) {
- message = message || 'assert.fail()';
- throw new chai.AssertionError(message, {
- actual: actual
- , expected: expected
- , operator: operator
- }, assert.fail);
- };
-
- /**
- * ### .ok(object, [message])
- *
- * Asserts that `object` is truthy.
- *
- * assert.ok('everything', 'everything is ok');
- * assert.ok(false, 'this will fail');
- *
- * @name ok
- * @param {Mixed} object to test
- * @param {String} message
- * @api public
- */
-
- assert.ok = function (val, msg) {
- new Assertion(val, msg).is.ok;
- };
-
- /**
- * ### .notOk(object, [message])
- *
- * Asserts that `object` is falsy.
- *
- * assert.notOk('everything', 'this will fail');
- * assert.notOk(false, 'this will pass');
- *
- * @name notOk
- * @param {Mixed} object to test
- * @param {String} message
- * @api public
- */
-
- assert.notOk = function (val, msg) {
- new Assertion(val, msg).is.not.ok;
- };
-
- /**
- * ### .equal(actual, expected, [message])
- *
- * Asserts non-strict equality (`==`) of `actual` and `expected`.
- *
- * assert.equal(3, '3', '== coerces values to strings');
- *
- * @name equal
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.equal = function (act, exp, msg) {
- var test = new Assertion(act, msg);
-
- test.assert(
- exp == flag(test, 'object')
- , 'expected #{this} to equal #{exp}'
- , 'expected #{this} to not equal #{act}'
- , exp
- , act
- );
- };
-
- /**
- * ### .notEqual(actual, expected, [message])
- *
- * Asserts non-strict inequality (`!=`) of `actual` and `expected`.
- *
- * assert.notEqual(3, 4, 'these numbers are not equal');
- *
- * @name notEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.notEqual = function (act, exp, msg) {
- var test = new Assertion(act, msg);
-
- test.assert(
- exp != flag(test, 'object')
- , 'expected #{this} to not equal #{exp}'
- , 'expected #{this} to equal #{act}'
- , exp
- , act
- );
- };
-
- /**
- * ### .strictEqual(actual, expected, [message])
- *
- * Asserts strict equality (`===`) of `actual` and `expected`.
- *
- * assert.strictEqual(true, true, 'these booleans are strictly equal');
- *
- * @name strictEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.strictEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.equal(exp);
- };
-
- /**
- * ### .notStrictEqual(actual, expected, [message])
- *
- * Asserts strict inequality (`!==`) of `actual` and `expected`.
- *
- * assert.notStrictEqual(3, '3', 'no coercion for strict equality');
- *
- * @name notStrictEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.notStrictEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.not.equal(exp);
- };
-
- /**
- * ### .deepEqual(actual, expected, [message])
- *
- * Asserts that `actual` is deeply equal to `expected`.
- *
- * assert.deepEqual({ tea: 'green' }, { tea: 'green' });
- *
- * @name deepEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.deepEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.eql(exp);
- };
-
- /**
- * ### .notDeepEqual(actual, expected, [message])
- *
- * Assert that `actual` is not deeply equal to `expected`.
- *
- * assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' });
- *
- * @name notDeepEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.notDeepEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.not.eql(exp);
- };
-
- /**
- * ### .isTrue(value, [message])
- *
- * Asserts that `value` is true.
- *
- * var teaServed = true;
- * assert.isTrue(teaServed, 'the tea has been served');
- *
- * @name isTrue
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isTrue = function (val, msg) {
- new Assertion(val, msg).is['true'];
- };
-
- /**
- * ### .isFalse(value, [message])
- *
- * Asserts that `value` is false.
- *
- * var teaServed = false;
- * assert.isFalse(teaServed, 'no tea yet? hmm...');
- *
- * @name isFalse
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isFalse = function (val, msg) {
- new Assertion(val, msg).is['false'];
- };
-
- /**
- * ### .isNull(value, [message])
- *
- * Asserts that `value` is null.
- *
- * assert.isNull(err, 'there was no error');
- *
- * @name isNull
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNull = function (val, msg) {
- new Assertion(val, msg).to.equal(null);
- };
-
- /**
- * ### .isNotNull(value, [message])
- *
- * Asserts that `value` is not null.
- *
- * var tea = 'tasty chai';
- * assert.isNotNull(tea, 'great, time for tea!');
- *
- * @name isNotNull
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotNull = function (val, msg) {
- new Assertion(val, msg).to.not.equal(null);
- };
-
- /**
- * ### .isUndefined(value, [message])
- *
- * Asserts that `value` is `undefined`.
- *
- * var tea;
- * assert.isUndefined(tea, 'no tea defined');
- *
- * @name isUndefined
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isUndefined = function (val, msg) {
- new Assertion(val, msg).to.equal(undefined);
- };
-
- /**
- * ### .isDefined(value, [message])
- *
- * Asserts that `value` is not `undefined`.
- *
- * var tea = 'cup of chai';
- * assert.isDefined(tea, 'tea has been defined');
- *
- * @name isDefined
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isDefined = function (val, msg) {
- new Assertion(val, msg).to.not.equal(undefined);
- };
-
- /**
- * ### .isFunction(value, [message])
- *
- * Asserts that `value` is a function.
- *
- * function serveTea() { return 'cup of tea'; };
- * assert.isFunction(serveTea, 'great, we can have tea now');
- *
- * @name isFunction
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isFunction = function (val, msg) {
- new Assertion(val, msg).to.be.a('function');
- };
-
- /**
- * ### .isNotFunction(value, [message])
- *
- * Asserts that `value` is _not_ a function.
- *
- * var serveTea = [ 'heat', 'pour', 'sip' ];
- * assert.isNotFunction(serveTea, 'great, we have listed the steps');
- *
- * @name isNotFunction
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotFunction = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('function');
- };
-
- /**
- * ### .isObject(value, [message])
- *
- * Asserts that `value` is an object (as revealed by
- * `Object.prototype.toString`).
- *
- * var selection = { name: 'Chai', serve: 'with spices' };
- * assert.isObject(selection, 'tea selection is an object');
- *
- * @name isObject
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isObject = function (val, msg) {
- new Assertion(val, msg).to.be.a('object');
- };
-
- /**
- * ### .isNotObject(value, [message])
- *
- * Asserts that `value` is _not_ an object.
- *
- * var selection = 'chai'
- * assert.isObject(selection, 'tea selection is not an object');
- * assert.isObject(null, 'null is not an object');
- *
- * @name isNotObject
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotObject = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('object');
- };
-
- /**
- * ### .isArray(value, [message])
- *
- * Asserts that `value` is an array.
- *
- * var menu = [ 'green', 'chai', 'oolong' ];
- * assert.isArray(menu, 'what kind of tea do we want?');
- *
- * @name isArray
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isArray = function (val, msg) {
- new Assertion(val, msg).to.be.an('array');
- };
-
- /**
- * ### .isNotArray(value, [message])
- *
- * Asserts that `value` is _not_ an array.
- *
- * var menu = 'green|chai|oolong';
- * assert.isNotArray(menu, 'what kind of tea do we want?');
- *
- * @name isNotArray
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotArray = function (val, msg) {
- new Assertion(val, msg).to.not.be.an('array');
- };
-
- /**
- * ### .isString(value, [message])
- *
- * Asserts that `value` is a string.
- *
- * var teaOrder = 'chai';
- * assert.isString(teaOrder, 'order placed');
- *
- * @name isString
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isString = function (val, msg) {
- new Assertion(val, msg).to.be.a('string');
- };
-
- /**
- * ### .isNotString(value, [message])
- *
- * Asserts that `value` is _not_ a string.
- *
- * var teaOrder = 4;
- * assert.isNotString(teaOrder, 'order placed');
- *
- * @name isNotString
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotString = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('string');
- };
-
- /**
- * ### .isNumber(value, [message])
- *
- * Asserts that `value` is a number.
- *
- * var cups = 2;
- * assert.isNumber(cups, 'how many cups');
- *
- * @name isNumber
- * @param {Number} value
- * @param {String} message
- * @api public
- */
-
- assert.isNumber = function (val, msg) {
- new Assertion(val, msg).to.be.a('number');
- };
-
- /**
- * ### .isNotNumber(value, [message])
- *
- * Asserts that `value` is _not_ a number.
- *
- * var cups = '2 cups please';
- * assert.isNotNumber(cups, 'how many cups');
- *
- * @name isNotNumber
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotNumber = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('number');
- };
-
- /**
- * ### .isBoolean(value, [message])
- *
- * Asserts that `value` is a boolean.
- *
- * var teaReady = true
- * , teaServed = false;
- *
- * assert.isBoolean(teaReady, 'is the tea ready');
- * assert.isBoolean(teaServed, 'has tea been served');
- *
- * @name isBoolean
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isBoolean = function (val, msg) {
- new Assertion(val, msg).to.be.a('boolean');
- };
-
- /**
- * ### .isNotBoolean(value, [message])
- *
- * Asserts that `value` is _not_ a boolean.
- *
- * var teaReady = 'yep'
- * , teaServed = 'nope';
- *
- * assert.isNotBoolean(teaReady, 'is the tea ready');
- * assert.isNotBoolean(teaServed, 'has tea been served');
- *
- * @name isNotBoolean
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotBoolean = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('boolean');
- };
-
- /**
- * ### .typeOf(value, name, [message])
- *
- * Asserts that `value`'s type is `name`, as determined by
- * `Object.prototype.toString`.
- *
- * assert.typeOf({ tea: 'chai' }, 'object', 'we have an object');
- * assert.typeOf(['chai', 'jasmine'], 'array', 'we have an array');
- * assert.typeOf('tea', 'string', 'we have a string');
- * assert.typeOf(/tea/, 'regexp', 'we have a regular expression');
- * assert.typeOf(null, 'null', 'we have a null');
- * assert.typeOf(undefined, 'undefined', 'we have an undefined');
- *
- * @name typeOf
- * @param {Mixed} value
- * @param {String} name
- * @param {String} message
- * @api public
- */
-
- assert.typeOf = function (val, type, msg) {
- new Assertion(val, msg).to.be.a(type);
- };
-
- /**
- * ### .notTypeOf(value, name, [message])
- *
- * Asserts that `value`'s type is _not_ `name`, as determined by
- * `Object.prototype.toString`.
- *
- * assert.notTypeOf('tea', 'number', 'strings are not numbers');
- *
- * @name notTypeOf
- * @param {Mixed} value
- * @param {String} typeof name
- * @param {String} message
- * @api public
- */
-
- assert.notTypeOf = function (val, type, msg) {
- new Assertion(val, msg).to.not.be.a(type);
- };
-
- /**
- * ### .instanceOf(object, constructor, [message])
- *
- * Asserts that `value` is an instance of `constructor`.
- *
- * var Tea = function (name) { this.name = name; }
- * , chai = new Tea('chai');
- *
- * assert.instanceOf(chai, Tea, 'chai is an instance of tea');
- *
- * @name instanceOf
- * @param {Object} object
- * @param {Constructor} constructor
- * @param {String} message
- * @api public
- */
-
- assert.instanceOf = function (val, type, msg) {
- new Assertion(val, msg).to.be.instanceOf(type);
- };
-
- /**
- * ### .notInstanceOf(object, constructor, [message])
- *
- * Asserts `value` is not an instance of `constructor`.
- *
- * var Tea = function (name) { this.name = name; }
- * , chai = new String('chai');
- *
- * assert.notInstanceOf(chai, Tea, 'chai is not an instance of tea');
- *
- * @name notInstanceOf
- * @param {Object} object
- * @param {Constructor} constructor
- * @param {String} message
- * @api public
- */
-
- assert.notInstanceOf = function (val, type, msg) {
- new Assertion(val, msg).to.not.be.instanceOf(type);
- };
-
- /**
- * ### .include(haystack, needle, [message])
- *
- * Asserts that `haystack` includes `needle`. Works
- * for strings and arrays.
- *
- * assert.include('foobar', 'bar', 'foobar contains string "bar"');
- * assert.include([ 1, 2, 3 ], 3, 'array contains value');
- *
- * @name include
- * @param {Array|String} haystack
- * @param {Mixed} needle
- * @param {String} message
- * @api public
- */
-
- assert.include = function (exp, inc, msg) {
- new Assertion(exp, msg).include(inc);
- };
-
- /**
- * ### .notInclude(haystack, needle, [message])
- *
- * Asserts that `haystack` does not include `needle`. Works
- * for strings and arrays.
- *i
- * assert.notInclude('foobar', 'baz', 'string not include substring');
- * assert.notInclude([ 1, 2, 3 ], 4, 'array not include contain value');
- *
- * @name notInclude
- * @param {Array|String} haystack
- * @param {Mixed} needle
- * @param {String} message
- * @api public
- */
-
- assert.notInclude = function (exp, inc, msg) {
- new Assertion(exp, msg).not.include(inc);
- };
-
- /**
- * ### .match(value, regexp, [message])
- *
- * Asserts that `value` matches the regular expression `regexp`.
- *
- * assert.match('foobar', /^foo/, 'regexp matches');
- *
- * @name match
- * @param {Mixed} value
- * @param {RegExp} regexp
- * @param {String} message
- * @api public
- */
-
- assert.match = function (exp, re, msg) {
- new Assertion(exp, msg).to.match(re);
- };
-
- /**
- * ### .notMatch(value, regexp, [message])
- *
- * Asserts that `value` does not match the regular expression `regexp`.
- *
- * assert.notMatch('foobar', /^foo/, 'regexp does not match');
- *
- * @name notMatch
- * @param {Mixed} value
- * @param {RegExp} regexp
- * @param {String} message
- * @api public
- */
-
- assert.notMatch = function (exp, re, msg) {
- new Assertion(exp, msg).to.not.match(re);
- };
-
- /**
- * ### .property(object, property, [message])
- *
- * Asserts that `object` has a property named by `property`.
- *
- * assert.property({ tea: { green: 'matcha' }}, 'tea');
- *
- * @name property
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.property = function (obj, prop, msg) {
- new Assertion(obj, msg).to.have.property(prop);
- };
-
- /**
- * ### .notProperty(object, property, [message])
- *
- * Asserts that `object` does _not_ have a property named by `property`.
- *
- * assert.notProperty({ tea: { green: 'matcha' }}, 'coffee');
- *
- * @name notProperty
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.notProperty = function (obj, prop, msg) {
- new Assertion(obj, msg).to.not.have.property(prop);
- };
-
- /**
- * ### .deepProperty(object, property, [message])
- *
- * Asserts that `object` has a property named by `property`, which can be a
- * string using dot- and bracket-notation for deep reference.
- *
- * assert.deepProperty({ tea: { green: 'matcha' }}, 'tea.green');
- *
- * @name deepProperty
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.deepProperty = function (obj, prop, msg) {
- new Assertion(obj, msg).to.have.deep.property(prop);
- };
-
- /**
- * ### .notDeepProperty(object, property, [message])
- *
- * Asserts that `object` does _not_ have a property named by `property`, which
- * can be a string using dot- and bracket-notation for deep reference.
- *
- * assert.notDeepProperty({ tea: { green: 'matcha' }}, 'tea.oolong');
- *
- * @name notDeepProperty
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.notDeepProperty = function (obj, prop, msg) {
- new Assertion(obj, msg).to.not.have.deep.property(prop);
- };
-
- /**
- * ### .propertyVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property` with value given
- * by `value`.
- *
- * assert.propertyVal({ tea: 'is good' }, 'tea', 'is good');
- *
- * @name propertyVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.propertyVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.have.property(prop, val);
- };
-
- /**
- * ### .propertyNotVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property`, but with a value
- * different from that given by `value`.
- *
- * assert.propertyNotVal({ tea: 'is good' }, 'tea', 'is bad');
- *
- * @name propertyNotVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.propertyNotVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.not.have.property(prop, val);
- };
-
- /**
- * ### .deepPropertyVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property` with value given
- * by `value`. `property` can use dot- and bracket-notation for deep
- * reference.
- *
- * assert.deepPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'matcha');
- *
- * @name deepPropertyVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.deepPropertyVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.have.deep.property(prop, val);
- };
-
- /**
- * ### .deepPropertyNotVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property`, but with a value
- * different from that given by `value`. `property` can use dot- and
- * bracket-notation for deep reference.
- *
- * assert.deepPropertyNotVal({ tea: { green: 'matcha' }}, 'tea.green', 'konacha');
- *
- * @name deepPropertyNotVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.deepPropertyNotVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.not.have.deep.property(prop, val);
- };
-
- /**
- * ### .lengthOf(object, length, [message])
- *
- * Asserts that `object` has a `length` property with the expected value.
- *
- * assert.lengthOf([1,2,3], 3, 'array has length of 3');
- * assert.lengthOf('foobar', 5, 'string has length of 6');
- *
- * @name lengthOf
- * @param {Mixed} object
- * @param {Number} length
- * @param {String} message
- * @api public
- */
-
- assert.lengthOf = function (exp, len, msg) {
- new Assertion(exp, msg).to.have.length(len);
- };
-
- /**
- * ### .throws(function, [constructor/string/regexp], [string/regexp], [message])
- *
- * Asserts that `function` will throw an error that is an instance of
- * `constructor`, or alternately that it will throw an error with message
- * matching `regexp`.
- *
- * assert.throw(fn, 'function throws a reference error');
- * assert.throw(fn, /function throws a reference error/);
- * assert.throw(fn, ReferenceError);
- * assert.throw(fn, ReferenceError, 'function throws a reference error');
- * assert.throw(fn, ReferenceError, /function throws a reference error/);
- *
- * @name throws
- * @alias throw
- * @alias Throw
- * @param {Function} function
- * @param {ErrorConstructor} constructor
- * @param {RegExp} regexp
- * @param {String} message
- * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
- * @api public
- */
-
- assert.Throw = function (fn, errt, errs, msg) {
- if ('string' === typeof errt || errt instanceof RegExp) {
- errs = errt;
- errt = null;
- }
-
- var assertErr = new Assertion(fn, msg).to.Throw(errt, errs);
- return flag(assertErr, 'object');
- };
-
- /**
- * ### .doesNotThrow(function, [constructor/regexp], [message])
- *
- * Asserts that `function` will _not_ throw an error that is an instance of
- * `constructor`, or alternately that it will not throw an error with message
- * matching `regexp`.
- *
- * assert.doesNotThrow(fn, Error, 'function does not throw');
- *
- * @name doesNotThrow
- * @param {Function} function
- * @param {ErrorConstructor} constructor
- * @param {RegExp} regexp
- * @param {String} message
- * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
- * @api public
- */
-
- assert.doesNotThrow = function (fn, type, msg) {
- if ('string' === typeof type) {
- msg = type;
- type = null;
- }
-
- new Assertion(fn, msg).to.not.Throw(type);
- };
-
- /**
- * ### .operator(val1, operator, val2, [message])
- *
- * Compares two values using `operator`.
- *
- * assert.operator(1, '<', 2, 'everything is ok');
- * assert.operator(1, '>', 2, 'this will fail');
- *
- * @name operator
- * @param {Mixed} val1
- * @param {String} operator
- * @param {Mixed} val2
- * @param {String} message
- * @api public
- */
-
- assert.operator = function (val, operator, val2, msg) {
- if (!~['==', '===', '>', '>=', '<', '<=', '!=', '!=='].indexOf(operator)) {
- throw new Error('Invalid operator "' + operator + '"');
- }
- var test = new Assertion(eval(val + operator + val2), msg);
- test.assert(
- true === flag(test, 'object')
- , 'expected ' + util.inspect(val) + ' to be ' + operator + ' ' + util.inspect(val2)
- , 'expected ' + util.inspect(val) + ' to not be ' + operator + ' ' + util.inspect(val2) );
- };
-
- /**
- * ### .closeTo(actual, expected, delta, [message])
- *
- * Asserts that the target is equal `expected`, to within a +/- `delta` range.
- *
- * assert.closeTo(1.5, 1, 0.5, 'numbers are close');
- *
- * @name closeTo
- * @param {Number} actual
- * @param {Number} expected
- * @param {Number} delta
- * @param {String} message
- * @api public
- */
-
- assert.closeTo = function (act, exp, delta, msg) {
- new Assertion(act, msg).to.be.closeTo(exp, delta);
- };
-
- /**
- * ### .sameMembers(set1, set2, [message])
- *
- * Asserts that `set1` and `set2` have the same members.
- * Order is not taken into account.
- *
- * assert.sameMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'same members');
- *
- * @name sameMembers
- * @param {Array} superset
- * @param {Array} subset
- * @param {String} message
- * @api public
- */
-
- assert.sameMembers = function (set1, set2, msg) {
- new Assertion(set1, msg).to.have.same.members(set2);
- }
-
- /**
- * ### .includeMembers(superset, subset, [message])
- *
- * Asserts that `subset` is included in `superset`.
- * Order is not taken into account.
- *
- * assert.includeMembers([ 1, 2, 3 ], [ 2, 1 ], 'include members');
- *
- * @name includeMembers
- * @param {Array} superset
- * @param {Array} subset
- * @param {String} message
- * @api public
- */
-
- assert.includeMembers = function (superset, subset, msg) {
- new Assertion(superset, msg).to.include.members(subset);
- }
-
- /*!
- * Undocumented / untested
- */
-
- assert.ifError = function (val, msg) {
- new Assertion(val, msg).to.not.be.ok;
- };
-
- /*!
- * Aliases.
- */
-
- (function alias(name, as){
- assert[as] = assert[name];
- return alias;
- })
- ('Throw', 'throw')
- ('Throw', 'throws');
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/interface/expect.js b/tests/lib/chai-1.9.0/lib/chai/interface/expect.js
deleted file mode 100644
index b827df7da7..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/interface/expect.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (chai, util) {
- chai.expect = function (val, message) {
- return new chai.Assertion(val, message);
- };
-};
-
diff --git a/tests/lib/chai-1.9.0/lib/chai/interface/should.js b/tests/lib/chai-1.9.0/lib/chai/interface/should.js
deleted file mode 100644
index bd5bb9a42f..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/interface/should.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (chai, util) {
- var Assertion = chai.Assertion;
-
- function loadShould () {
- // modify Object.prototype to have `should`
- Object.defineProperty(Object.prototype, 'should',
- {
- set: function (value) {
- // See https://github.com/chaijs/chai/issues/86: this makes
- // `whatever.should = someValue` actually set `someValue`, which is
- // especially useful for `global.should = require('chai').should()`.
- //
- // Note that we have to use [[DefineProperty]] instead of [[Put]]
- // since otherwise we would trigger this very setter!
- Object.defineProperty(this, 'should', {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- }
- , get: function(){
- if (this instanceof String || this instanceof Number) {
- return new Assertion(this.constructor(this));
- } else if (this instanceof Boolean) {
- return new Assertion(this == true);
- }
- return new Assertion(this);
- }
- , configurable: true
- });
-
- var should = {};
-
- should.equal = function (val1, val2, msg) {
- new Assertion(val1, msg).to.equal(val2);
- };
-
- should.Throw = function (fn, errt, errs, msg) {
- new Assertion(fn, msg).to.Throw(errt, errs);
- };
-
- should.exist = function (val, msg) {
- new Assertion(val, msg).to.exist;
- }
-
- // negation
- should.not = {}
-
- should.not.equal = function (val1, val2, msg) {
- new Assertion(val1, msg).to.not.equal(val2);
- };
-
- should.not.Throw = function (fn, errt, errs, msg) {
- new Assertion(fn, msg).to.not.Throw(errt, errs);
- };
-
- should.not.exist = function (val, msg) {
- new Assertion(val, msg).to.not.exist;
- }
-
- should['throw'] = should['Throw'];
- should.not['throw'] = should.not['Throw'];
-
- return should;
- };
-
- chai.should = loadShould;
- chai.Should = loadShould;
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/addChainableMethod.js b/tests/lib/chai-1.9.0/lib/chai/utils/addChainableMethod.js
deleted file mode 100644
index a8276cf2f5..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/addChainableMethod.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/*!
- * Chai - addChainingMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependencies
- */
-
-var transferFlags = require('./transferFlags');
-
-/*!
- * Module variables
- */
-
-// Check whether `__proto__` is supported
-var hasProtoSupport = '__proto__' in Object;
-
-// Without `__proto__` support, this module will need to add properties to a function.
-// However, some Function.prototype methods cannot be overwritten,
-// and there seems no easy cross-platform way to detect them (@see chaijs/chai/issues/69).
-var excludeNames = /^(?:length|name|arguments|caller)$/;
-
-// Cache `Function` properties
-var call = Function.prototype.call,
- apply = Function.prototype.apply;
-
-/**
- * ### addChainableMethod (ctx, name, method, chainingBehavior)
- *
- * Adds a method to an object, such that the method can also be chained.
- *
- * utils.addChainableMethod(chai.Assertion.prototype, 'foo', function (str) {
- * var obj = utils.flag(this, 'object');
- * new chai.Assertion(obj).to.be.equal(str);
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.addChainableMethod('foo', fn, chainingBehavior);
- *
- * The result can then be used as both a method assertion, executing both `method` and
- * `chainingBehavior`, or as a language chain, which only executes `chainingBehavior`.
- *
- * expect(fooStr).to.be.foo('bar');
- * expect(fooStr).to.be.foo.equal('foo');
- *
- * @param {Object} ctx object to which the method is added
- * @param {String} name of method to add
- * @param {Function} method function to be used for `name`, when called
- * @param {Function} chainingBehavior function to be called every time the property is accessed
- * @name addChainableMethod
- * @api public
- */
-
-module.exports = function (ctx, name, method, chainingBehavior) {
- if (typeof chainingBehavior !== 'function') {
- chainingBehavior = function () { };
- }
-
- var chainableBehavior = {
- method: method
- , chainingBehavior: chainingBehavior
- };
-
- // save the methods so we can overwrite them later, if we need to.
- if (!ctx.__methods) {
- ctx.__methods = {};
- }
- ctx.__methods[name] = chainableBehavior;
-
- Object.defineProperty(ctx, name,
- { get: function () {
- chainableBehavior.chainingBehavior.call(this);
-
- var assert = function () {
- var result = chainableBehavior.method.apply(this, arguments);
- return result === undefined ? this : result;
- };
-
- // Use `__proto__` if available
- if (hasProtoSupport) {
- // Inherit all properties from the object by replacing the `Function` prototype
- var prototype = assert.__proto__ = Object.create(this);
- // Restore the `call` and `apply` methods from `Function`
- prototype.call = call;
- prototype.apply = apply;
- }
- // Otherwise, redefine all properties (slow!)
- else {
- var asserterNames = Object.getOwnPropertyNames(ctx);
- asserterNames.forEach(function (asserterName) {
- if (!excludeNames.test(asserterName)) {
- var pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
- Object.defineProperty(assert, asserterName, pd);
- }
- });
- }
-
- transferFlags(this, assert);
- return assert;
- }
- , configurable: true
- });
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/addMethod.js b/tests/lib/chai-1.9.0/lib/chai/utils/addMethod.js
deleted file mode 100644
index d19ca31200..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/addMethod.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*!
- * Chai - addMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### .addMethod (ctx, name, method)
- *
- * Adds a method to the prototype of an object.
- *
- * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) {
- * var obj = utils.flag(this, 'object');
- * new chai.Assertion(obj).to.be.equal(str);
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.addMethod('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(fooStr).to.be.foo('bar');
- *
- * @param {Object} ctx object to which the method is added
- * @param {String} name of method to add
- * @param {Function} method function to be used for name
- * @name addMethod
- * @api public
- */
-
-module.exports = function (ctx, name, method) {
- ctx[name] = function () {
- var result = method.apply(this, arguments);
- return result === undefined ? this : result;
- };
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/addProperty.js b/tests/lib/chai-1.9.0/lib/chai/utils/addProperty.js
deleted file mode 100644
index a34b3f4d30..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/addProperty.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*!
- * Chai - addProperty utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### addProperty (ctx, name, getter)
- *
- * Adds a property to the prototype of an object.
- *
- * utils.addProperty(chai.Assertion.prototype, 'foo', function () {
- * var obj = utils.flag(this, 'object');
- * new chai.Assertion(obj).to.be.instanceof(Foo);
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.addProperty('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.be.foo;
- *
- * @param {Object} ctx object to which the property is added
- * @param {String} name of property to add
- * @param {Function} getter function to be used for name
- * @name addProperty
- * @api public
- */
-
-module.exports = function (ctx, name, getter) {
- Object.defineProperty(ctx, name,
- { get: function () {
- var result = getter.call(this);
- return result === undefined ? this : result;
- }
- , configurable: true
- });
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/flag.js b/tests/lib/chai-1.9.0/lib/chai/utils/flag.js
deleted file mode 100644
index 3b1089b685..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/flag.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/*!
- * Chai - flag utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### flag(object ,key, [value])
- *
- * Get or set a flag value on an object. If a
- * value is provided it will be set, else it will
- * return the currently set value or `undefined` if
- * the value is not set.
- *
- * utils.flag(this, 'foo', 'bar'); // setter
- * utils.flag(this, 'foo'); // getter, returns `bar`
- *
- * @param {Object} object (constructed Assertion
- * @param {String} key
- * @param {Mixed} value (optional)
- * @name flag
- * @api private
- */
-
-module.exports = function (obj, key, value) {
- var flags = obj.__flags || (obj.__flags = Object.create(null));
- if (arguments.length === 3) {
- flags[key] = value;
- } else {
- return flags[key];
- }
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/getActual.js b/tests/lib/chai-1.9.0/lib/chai/utils/getActual.js
deleted file mode 100644
index 422491e60a..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/getActual.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/*!
- * Chai - getActual utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * # getActual(object, [actual])
- *
- * Returns the `actual` value for an Assertion
- *
- * @param {Object} object (constructed Assertion)
- * @param {Arguments} chai.Assertion.prototype.assert arguments
- */
-
-module.exports = function (obj, args) {
- var actual = args[4];
- return 'undefined' !== typeof actual ? actual : obj._obj;
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/getEnumerableProperties.js b/tests/lib/chai-1.9.0/lib/chai/utils/getEnumerableProperties.js
deleted file mode 100644
index 56578028db..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/getEnumerableProperties.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*!
- * Chai - getEnumerableProperties utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### .getEnumerableProperties(object)
- *
- * This allows the retrieval of enumerable property names of an object,
- * inherited or not.
- *
- * @param {Object} object
- * @returns {Array}
- * @name getEnumerableProperties
- * @api public
- */
-
-module.exports = function getEnumerableProperties(object) {
- var result = [];
- for (var name in object) {
- result.push(name);
- }
- return result;
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/getMessage.js b/tests/lib/chai-1.9.0/lib/chai/utils/getMessage.js
deleted file mode 100644
index 700554668f..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/getMessage.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*!
- * Chai - message composition utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependancies
- */
-
-var flag = require('./flag')
- , getActual = require('./getActual')
- , inspect = require('./inspect')
- , objDisplay = require('./objDisplay');
-
-/**
- * ### .getMessage(object, message, negateMessage)
- *
- * Construct the error message based on flags
- * and template tags. Template tags will return
- * a stringified inspection of the object referenced.
- *
- * Message template tags:
- * - `#{this}` current asserted object
- * - `#{act}` actual value
- * - `#{exp}` expected value
- *
- * @param {Object} object (constructed Assertion)
- * @param {Arguments} chai.Assertion.prototype.assert arguments
- * @name getMessage
- * @api public
- */
-
-module.exports = function (obj, args) {
- var negate = flag(obj, 'negate')
- , val = flag(obj, 'object')
- , expected = args[3]
- , actual = getActual(obj, args)
- , msg = negate ? args[2] : args[1]
- , flagMsg = flag(obj, 'message');
-
- msg = msg || '';
- msg = msg
- .replace(/#{this}/g, objDisplay(val))
- .replace(/#{act}/g, objDisplay(actual))
- .replace(/#{exp}/g, objDisplay(expected));
-
- return flagMsg ? flagMsg + ': ' + msg : msg;
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/getName.js b/tests/lib/chai-1.9.0/lib/chai/utils/getName.js
deleted file mode 100644
index b8d3ed2de1..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/getName.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*!
- * Chai - getName utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * # getName(func)
- *
- * Gets the name of a function, in a cross-browser way.
- *
- * @param {Function} a function (usually a constructor)
- */
-
-module.exports = function (func) {
- if (func.name) return func.name;
-
- var match = /^\s?function ([^(]*)\(/.exec(func);
- return match && match[1] ? match[1] : "";
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/getPathValue.js b/tests/lib/chai-1.9.0/lib/chai/utils/getPathValue.js
deleted file mode 100644
index 23b31df062..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/getPathValue.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/*!
- * Chai - getPathValue utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * @see https://github.com/logicalparadox/filtr
- * MIT Licensed
- */
-
-/**
- * ### .getPathValue(path, object)
- *
- * This allows the retrieval of values in an
- * object given a string path.
- *
- * var obj = {
- * prop1: {
- * arr: ['a', 'b', 'c']
- * , str: 'Hello'
- * }
- * , prop2: {
- * arr: [ { nested: 'Universe' } ]
- * , str: 'Hello again!'
- * }
- * }
- *
- * The following would be the results.
- *
- * getPathValue('prop1.str', obj); // Hello
- * getPathValue('prop1.att[2]', obj); // b
- * getPathValue('prop2.arr[0].nested', obj); // Universe
- *
- * @param {String} path
- * @param {Object} object
- * @returns {Object} value or `undefined`
- * @name getPathValue
- * @api public
- */
-
-var getPathValue = module.exports = function (path, obj) {
- var parsed = parsePath(path);
- return _getPathValue(parsed, obj);
-};
-
-/*!
- * ## parsePath(path)
- *
- * Helper function used to parse string object
- * paths. Use in conjunction with `_getPathValue`.
- *
- * var parsed = parsePath('myobject.property.subprop');
- *
- * ### Paths:
- *
- * * Can be as near infinitely deep and nested
- * * Arrays are also valid using the formal `myobject.document[3].property`.
- *
- * @param {String} path
- * @returns {Object} parsed
- * @api private
- */
-
-function parsePath (path) {
- var str = path.replace(/\[/g, '.[')
- , parts = str.match(/(\\\.|[^.]+?)+/g);
- return parts.map(function (value) {
- var re = /\[(\d+)\]$/
- , mArr = re.exec(value)
- if (mArr) return { i: parseFloat(mArr[1]) };
- else return { p: value };
- });
-};
-
-/*!
- * ## _getPathValue(parsed, obj)
- *
- * Helper companion function for `.parsePath` that returns
- * the value located at the parsed address.
- *
- * var value = getPathValue(parsed, obj);
- *
- * @param {Object} parsed definition from `parsePath`.
- * @param {Object} object to search against
- * @returns {Object|Undefined} value
- * @api private
- */
-
-function _getPathValue (parsed, obj) {
- var tmp = obj
- , res;
- for (var i = 0, l = parsed.length; i < l; i++) {
- var part = parsed[i];
- if (tmp) {
- if ('undefined' !== typeof part.p)
- tmp = tmp[part.p];
- else if ('undefined' !== typeof part.i)
- tmp = tmp[part.i];
- if (i == (l - 1)) res = tmp;
- } else {
- res = undefined;
- }
- }
- return res;
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/getProperties.js b/tests/lib/chai-1.9.0/lib/chai/utils/getProperties.js
deleted file mode 100644
index dbdc9c1198..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/getProperties.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/*!
- * Chai - getProperties utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### .getProperties(object)
- *
- * This allows the retrieval of property names of an object, enumerable or not,
- * inherited or not.
- *
- * @param {Object} object
- * @returns {Array}
- * @name getProperties
- * @api public
- */
-
-module.exports = function getProperties(object) {
- var result = Object.getOwnPropertyNames(subject);
-
- function addProperty(property) {
- if (result.indexOf(property) === -1) {
- result.push(property);
- }
- }
-
- var proto = Object.getPrototypeOf(subject);
- while (proto !== null) {
- Object.getOwnPropertyNames(proto).forEach(addProperty);
- proto = Object.getPrototypeOf(proto);
- }
-
- return result;
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/index.js b/tests/lib/chai-1.9.0/lib/chai/utils/index.js
deleted file mode 100644
index 974c7afea3..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/index.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/*!
- * chai
- * Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Main exports
- */
-
-var exports = module.exports = {};
-
-/*!
- * test utility
- */
-
-exports.test = require('./test');
-
-/*!
- * type utility
- */
-
-exports.type = require('./type');
-
-/*!
- * message utility
- */
-
-exports.getMessage = require('./getMessage');
-
-/*!
- * actual utility
- */
-
-exports.getActual = require('./getActual');
-
-/*!
- * Inspect util
- */
-
-exports.inspect = require('./inspect');
-
-/*!
- * Object Display util
- */
-
-exports.objDisplay = require('./objDisplay');
-
-/*!
- * Flag utility
- */
-
-exports.flag = require('./flag');
-
-/*!
- * Flag transferring utility
- */
-
-exports.transferFlags = require('./transferFlags');
-
-/*!
- * Deep equal utility
- */
-
-exports.eql = require('deep-eql');
-
-/*!
- * Deep path value
- */
-
-exports.getPathValue = require('./getPathValue');
-
-/*!
- * Function name
- */
-
-exports.getName = require('./getName');
-
-/*!
- * add Property
- */
-
-exports.addProperty = require('./addProperty');
-
-/*!
- * add Method
- */
-
-exports.addMethod = require('./addMethod');
-
-/*!
- * overwrite Property
- */
-
-exports.overwriteProperty = require('./overwriteProperty');
-
-/*!
- * overwrite Method
- */
-
-exports.overwriteMethod = require('./overwriteMethod');
-
-/*!
- * Add a chainable method
- */
-
-exports.addChainableMethod = require('./addChainableMethod');
-
-/*!
- * Overwrite chainable method
- */
-
-exports.overwriteChainableMethod = require('./overwriteChainableMethod');
-
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/inspect.js b/tests/lib/chai-1.9.0/lib/chai/utils/inspect.js
deleted file mode 100644
index e19b8aaeeb..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/inspect.js
+++ /dev/null
@@ -1,315 +0,0 @@
-// This is (almost) directly from Node.js utils
-// https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/util.js
-
-var getName = require('./getName');
-var getProperties = require('./getProperties');
-var getEnumerableProperties = require('./getEnumerableProperties');
-
-module.exports = inspect;
-
-/**
- * Echos the value of a value. Trys to print the value out
- * in the best way possible given the different types.
- *
- * @param {Object} obj The object to print out.
- * @param {Boolean} showHidden Flag that shows hidden (not enumerable)
- * properties of objects.
- * @param {Number} depth Depth in which to descend in object. Default is 2.
- * @param {Boolean} colors Flag to turn on ANSI escape codes to color the
- * output. Default is false (no coloring).
- */
-function inspect(obj, showHidden, depth, colors) {
- var ctx = {
- showHidden: showHidden,
- seen: [],
- stylize: function (str) { return str; }
- };
- return formatValue(ctx, obj, (typeof depth === 'undefined' ? 2 : depth));
-}
-
-// https://gist.github.com/1044128/
-var getOuterHTML = function(element) {
- if ('outerHTML' in element) return element.outerHTML;
- var ns = "http://www.w3.org/1999/xhtml";
- var container = document.createElementNS(ns, '_');
- var elemProto = (window.HTMLElement || window.Element).prototype;
- var xmlSerializer = new XMLSerializer();
- var html;
- if (document.xmlVersion) {
- return xmlSerializer.serializeToString(element);
- } else {
- container.appendChild(element.cloneNode(false));
- html = container.innerHTML.replace('><', '>' + element.innerHTML + '<');
- container.innerHTML = '';
- return html;
- }
-};
-
-// Returns true if object is a DOM element.
-var isDOMElement = function (object) {
- if (typeof HTMLElement === 'object') {
- return object instanceof HTMLElement;
- } else {
- return object &&
- typeof object === 'object' &&
- object.nodeType === 1 &&
- typeof object.nodeName === 'string';
- }
-};
-
-function formatValue(ctx, value, recurseTimes) {
- // Provide a hook for user-specified inspect functions.
- // Check that value is an object with an inspect function on it
- if (value && typeof value.inspect === 'function' &&
- // Filter out the util module, it's inspect function is special
- value.inspect !== exports.inspect &&
- // Also filter out any prototype objects using the circular check.
- !(value.constructor && value.constructor.prototype === value)) {
- var ret = value.inspect(recurseTimes);
- if (typeof ret !== 'string') {
- ret = formatValue(ctx, ret, recurseTimes);
- }
- return ret;
- }
-
- // Primitive types cannot have properties
- var primitive = formatPrimitive(ctx, value);
- if (primitive) {
- return primitive;
- }
-
- // If it's DOM elem, get outer HTML.
- if (isDOMElement(value)) {
- return getOuterHTML(value);
- }
-
- // Look up the keys of the object.
- var visibleKeys = getEnumerableProperties(value);
- var keys = ctx.showHidden ? getProperties(value) : visibleKeys;
-
- // Some type of object without properties can be shortcutted.
- // In IE, errors have a single `stack` property, or if they are vanilla `Error`,
- // a `stack` plus `description` property; ignore those for consistency.
- if (keys.length === 0 || (isError(value) && (
- (keys.length === 1 && keys[0] === 'stack') ||
- (keys.length === 2 && keys[0] === 'description' && keys[1] === 'stack')
- ))) {
- if (typeof value === 'function') {
- var name = getName(value);
- var nameSuffix = name ? ': ' + name : '';
- return ctx.stylize('[Function' + nameSuffix + ']', 'special');
- }
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- }
- if (isDate(value)) {
- return ctx.stylize(Date.prototype.toUTCString.call(value), 'date');
- }
- if (isError(value)) {
- return formatError(value);
- }
- }
-
- var base = '', array = false, braces = ['{', '}'];
-
- // Make Array say that they are Array
- if (isArray(value)) {
- array = true;
- braces = ['[', ']'];
- }
-
- // Make functions say that they are functions
- if (typeof value === 'function') {
- var name = getName(value);
- var nameSuffix = name ? ': ' + name : '';
- base = ' [Function' + nameSuffix + ']';
- }
-
- // Make RegExps say that they are RegExps
- if (isRegExp(value)) {
- base = ' ' + RegExp.prototype.toString.call(value);
- }
-
- // Make dates with properties first say the date
- if (isDate(value)) {
- base = ' ' + Date.prototype.toUTCString.call(value);
- }
-
- // Make error with message first say the error
- if (isError(value)) {
- return formatError(value);
- }
-
- if (keys.length === 0 && (!array || value.length == 0)) {
- return braces[0] + base + braces[1];
- }
-
- if (recurseTimes < 0) {
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- } else {
- return ctx.stylize('[Object]', 'special');
- }
- }
-
- ctx.seen.push(value);
-
- var output;
- if (array) {
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
- } else {
- output = keys.map(function(key) {
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
- });
- }
-
- ctx.seen.pop();
-
- return reduceToSingleString(output, base, braces);
-}
-
-function formatPrimitive(ctx, value) {
- switch (typeof value) {
- case 'undefined':
- return ctx.stylize('undefined', 'undefined');
-
- case 'string':
- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
- .replace(/'/g, "\\'")
- .replace(/\\"/g, '"') + '\'';
- return ctx.stylize(simple, 'string');
-
- case 'number':
- return ctx.stylize('' + value, 'number');
-
- case 'boolean':
- return ctx.stylize('' + value, 'boolean');
- }
- // For some reason typeof null is "object", so special case here.
- if (value === null) {
- return ctx.stylize('null', 'null');
- }
-}
-
-function formatError(value) {
- return '[' + Error.prototype.toString.call(value) + ']';
-}
-
-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
- var output = [];
- for (var i = 0, l = value.length; i < l; ++i) {
- if (Object.prototype.hasOwnProperty.call(value, String(i))) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- String(i), true));
- } else {
- output.push('');
- }
- }
- keys.forEach(function(key) {
- if (!key.match(/^\d+$/)) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- key, true));
- }
- });
- return output;
-}
-
-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- var name, str;
- if (value.__lookupGetter__) {
- if (value.__lookupGetter__(key)) {
- if (value.__lookupSetter__(key)) {
- str = ctx.stylize('[Getter/Setter]', 'special');
- } else {
- str = ctx.stylize('[Getter]', 'special');
- }
- } else {
- if (value.__lookupSetter__(key)) {
- str = ctx.stylize('[Setter]', 'special');
- }
- }
- }
- if (visibleKeys.indexOf(key) < 0) {
- name = '[' + key + ']';
- }
- if (!str) {
- if (ctx.seen.indexOf(value[key]) < 0) {
- if (recurseTimes === null) {
- str = formatValue(ctx, value[key], null);
- } else {
- str = formatValue(ctx, value[key], recurseTimes - 1);
- }
- if (str.indexOf('\n') > -1) {
- if (array) {
- str = str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n').substr(2);
- } else {
- str = '\n' + str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n');
- }
- }
- } else {
- str = ctx.stylize('[Circular]', 'special');
- }
- }
- if (typeof name === 'undefined') {
- if (array && key.match(/^\d+$/)) {
- return str;
- }
- name = JSON.stringify('' + key);
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
- name = name.substr(1, name.length - 2);
- name = ctx.stylize(name, 'name');
- } else {
- name = name.replace(/'/g, "\\'")
- .replace(/\\"/g, '"')
- .replace(/(^"|"$)/g, "'");
- name = ctx.stylize(name, 'string');
- }
- }
-
- return name + ': ' + str;
-}
-
-function reduceToSingleString(output, base, braces) {
- var numLinesEst = 0;
- var length = output.reduce(function(prev, cur) {
- numLinesEst++;
- if (cur.indexOf('\n') >= 0) numLinesEst++;
- return prev + cur.length + 1;
- }, 0);
-
- if (length > 60) {
- return braces[0] +
- (base === '' ? '' : base + '\n ') +
- ' ' +
- output.join(',\n ') +
- ' ' +
- braces[1];
- }
-
- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
-}
-
-function isArray(ar) {
- return Array.isArray(ar) ||
- (typeof ar === 'object' && objectToString(ar) === '[object Array]');
-}
-
-function isRegExp(re) {
- return typeof re === 'object' && objectToString(re) === '[object RegExp]';
-}
-
-function isDate(d) {
- return typeof d === 'object' && objectToString(d) === '[object Date]';
-}
-
-function isError(e) {
- return typeof e === 'object' && objectToString(e) === '[object Error]';
-}
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/objDisplay.js b/tests/lib/chai-1.9.0/lib/chai/utils/objDisplay.js
deleted file mode 100644
index 0d26cda8e4..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/objDisplay.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/*!
- * Chai - flag utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependancies
- */
-
-var inspect = require('./inspect');
-
-/**
- * ### .objDisplay (object)
- *
- * Determines if an object or an array matches
- * criteria to be inspected in-line for error
- * messages or should be truncated.
- *
- * @param {Mixed} javascript object to inspect
- * @name objDisplay
- * @api public
- */
-
-module.exports = function (obj) {
- var str = inspect(obj)
- , type = Object.prototype.toString.call(obj);
-
- if (str.length >= 40) {
- if (type === '[object Function]') {
- return !obj.name || obj.name === ''
- ? '[Function]'
- : '[Function: ' + obj.name + ']';
- } else if (type === '[object Array]') {
- return '[ Array(' + obj.length + ') ]';
- } else if (type === '[object Object]') {
- var keys = Object.keys(obj)
- , kstr = keys.length > 2
- ? keys.splice(0, 2).join(', ') + ', ...'
- : keys.join(', ');
- return '{ Object (' + kstr + ') }';
- } else {
- return str;
- }
- } else {
- return str;
- }
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/overwriteChainableMethod.js b/tests/lib/chai-1.9.0/lib/chai/utils/overwriteChainableMethod.js
deleted file mode 100644
index e0b613d7ad..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/overwriteChainableMethod.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/*!
- * Chai - overwriteChainableMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### overwriteChainableMethod (ctx, name, fn)
- *
- * Overwites an already existing chainable method
- * and provides access to the previous function or
- * property. Must return functions to be used for
- * name.
- *
- * utils.overwriteChainableMethod(chai.Assertion.prototype, 'length',
- * function (_super) {
- * }
- * , function (_super) {
- * }
- * );
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.overwriteChainableMethod('foo', fn, fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.have.length(3);
- * expect(myFoo).to.have.length.above(3);
- *
- * @param {Object} ctx object whose method / property is to be overwritten
- * @param {String} name of method / property to overwrite
- * @param {Function} method function that returns a function to be used for name
- * @param {Function} chainingBehavior function that returns a function to be used for property
- * @name overwriteChainableMethod
- * @api public
- */
-
-module.exports = function (ctx, name, method, chainingBehavior) {
- var chainableBehavior = ctx.__methods[name];
-
- var _chainingBehavior = chainableBehavior.chainingBehavior;
- chainableBehavior.chainingBehavior = function () {
- var result = chainingBehavior(_chainingBehavior).call(this);
- return result === undefined ? this : result;
- };
-
- var _method = chainableBehavior.method;
- chainableBehavior.method = function () {
- var result = method(_method).apply(this, arguments);
- return result === undefined ? this : result;
- };
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/overwriteMethod.js b/tests/lib/chai-1.9.0/lib/chai/utils/overwriteMethod.js
deleted file mode 100644
index 66b1589163..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/overwriteMethod.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/*!
- * Chai - overwriteMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### overwriteMethod (ctx, name, fn)
- *
- * Overwites an already existing method and provides
- * access to previous function. Must return function
- * to be used for name.
- *
- * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) {
- * return function (str) {
- * var obj = utils.flag(this, 'object');
- * if (obj instanceof Foo) {
- * new chai.Assertion(obj.value).to.equal(str);
- * } else {
- * _super.apply(this, arguments);
- * }
- * }
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.overwriteMethod('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.equal('bar');
- *
- * @param {Object} ctx object whose method is to be overwritten
- * @param {String} name of method to overwrite
- * @param {Function} method function that returns a function to be used for name
- * @name overwriteMethod
- * @api public
- */
-
-module.exports = function (ctx, name, method) {
- var _method = ctx[name]
- , _super = function () { return this; };
-
- if (_method && 'function' === typeof _method)
- _super = _method;
-
- ctx[name] = function () {
- var result = method(_super).apply(this, arguments);
- return result === undefined ? this : result;
- }
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/overwriteProperty.js b/tests/lib/chai-1.9.0/lib/chai/utils/overwriteProperty.js
deleted file mode 100644
index a23ba59421..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/overwriteProperty.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/*!
- * Chai - overwriteProperty utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### overwriteProperty (ctx, name, fn)
- *
- * Overwites an already existing property getter and provides
- * access to previous value. Must return function to use as getter.
- *
- * utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) {
- * return function () {
- * var obj = utils.flag(this, 'object');
- * if (obj instanceof Foo) {
- * new chai.Assertion(obj.name).to.equal('bar');
- * } else {
- * _super.call(this);
- * }
- * }
- * });
- *
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.overwriteProperty('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.be.ok;
- *
- * @param {Object} ctx object whose property is to be overwritten
- * @param {String} name of property to overwrite
- * @param {Function} getter function that returns a getter function to be used for name
- * @name overwriteProperty
- * @api public
- */
-
-module.exports = function (ctx, name, getter) {
- var _get = Object.getOwnPropertyDescriptor(ctx, name)
- , _super = function () {};
-
- if (_get && 'function' === typeof _get.get)
- _super = _get.get
-
- Object.defineProperty(ctx, name,
- { get: function () {
- var result = getter(_super).call(this);
- return result === undefined ? this : result;
- }
- , configurable: true
- });
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/test.js b/tests/lib/chai-1.9.0/lib/chai/utils/test.js
deleted file mode 100644
index 22cbb95438..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/test.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/*!
- * Chai - test utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependancies
- */
-
-var flag = require('./flag');
-
-/**
- * # test(object, expression)
- *
- * Test and object for expression.
- *
- * @param {Object} object (constructed Assertion)
- * @param {Arguments} chai.Assertion.prototype.assert arguments
- */
-
-module.exports = function (obj, args) {
- var negate = flag(obj, 'negate')
- , expr = args[0];
- return negate ? !expr : expr;
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/transferFlags.js b/tests/lib/chai-1.9.0/lib/chai/utils/transferFlags.js
deleted file mode 100644
index a7a1b20c2e..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/transferFlags.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*!
- * Chai - transferFlags utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### transferFlags(assertion, object, includeAll = true)
- *
- * Transfer all the flags for `assertion` to `object`. If
- * `includeAll` is set to `false`, then the base Chai
- * assertion flags (namely `object`, `ssfi`, and `message`)
- * will not be transferred.
- *
- *
- * var newAssertion = new Assertion();
- * utils.transferFlags(assertion, newAssertion);
- *
- * var anotherAsseriton = new Assertion(myObj);
- * utils.transferFlags(assertion, anotherAssertion, false);
- *
- * @param {Assertion} assertion the assertion to transfer the flags from
- * @param {Object} object the object to transfer the flags too; usually a new assertion
- * @param {Boolean} includeAll
- * @name getAllFlags
- * @api private
- */
-
-module.exports = function (assertion, object, includeAll) {
- var flags = assertion.__flags || (assertion.__flags = Object.create(null));
-
- if (!object.__flags) {
- object.__flags = Object.create(null);
- }
-
- includeAll = arguments.length === 3 ? includeAll : true;
-
- for (var flag in flags) {
- if (includeAll ||
- (flag !== 'object' && flag !== 'ssfi' && flag != 'message')) {
- object.__flags[flag] = flags[flag];
- }
- }
-};
diff --git a/tests/lib/chai-1.9.0/lib/chai/utils/type.js b/tests/lib/chai-1.9.0/lib/chai/utils/type.js
deleted file mode 100644
index 99392d0ad2..0000000000
--- a/tests/lib/chai-1.9.0/lib/chai/utils/type.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*!
- * Chai - type utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Detectable javascript natives
- */
-
-var natives = {
- '[object Arguments]': 'arguments'
- , '[object Array]': 'array'
- , '[object Date]': 'date'
- , '[object Function]': 'function'
- , '[object Number]': 'number'
- , '[object RegExp]': 'regexp'
- , '[object String]': 'string'
-};
-
-/**
- * ### type(object)
- *
- * Better implementation of `typeof` detection that can
- * be used cross-browser. Handles the inconsistencies of
- * Array, `null`, and `undefined` detection.
- *
- * utils.type({}) // 'object'
- * utils.type(null) // `null'
- * utils.type(undefined) // `undefined`
- * utils.type([]) // `array`
- *
- * @param {Mixed} object to detect type of
- * @name type
- * @api private
- */
-
-module.exports = function (obj) {
- var str = Object.prototype.toString.call(obj);
- if (natives[str]) return natives[str];
- if (obj === null) return 'null';
- if (obj === undefined) return 'undefined';
- if (obj === Object(obj)) return 'object';
- return typeof obj;
-};
diff --git a/tests/lib/chai-1.9.0/package.json b/tests/lib/chai-1.9.0/package.json
deleted file mode 100644
index 27d6a1fea6..0000000000
--- a/tests/lib/chai-1.9.0/package.json
+++ /dev/null
@@ -1,42 +0,0 @@
-{
- "author": "Jake Luer <jake@alogicalparadox.com>",
- "name": "chai",
- "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.",
- "keywords": [ "test", "assertion", "assert", "testing", "chai" ],
- "homepage": "http://chaijs.com",
- "license": "MIT",
- "contributors": [
- "Jake Luer <jake@alogicalparadox.com>",
- "Domenic Denicola <domenic@domenicdenicola.com> (http://domenicdenicola.com)",
- "Veselin Todorov <hi@vesln.com>",
- "John Firebaugh <john.firebaugh@gmail.com>"
- ],
- "version": "1.9.0",
- "repository": {
- "type": "git",
- "url": "https://github.com/chaijs/chai"
- },
- "bugs": {
- "url": "https://github.com/chaijs/chai/issues"
- },
- "main": "./index",
- "scripts": {
- "test": "make test"
- },
- "engines": {
- "node": ">= 0.4.0"
- },
- "dependencies": {
- "assertion-error": "1.0.0"
- , "deep-eql": "0.1.3"
- },
- "devDependencies": {
- "component": "*"
- , "karma": "0.11.12"
- , "karma-mocha": "*"
- , "karma-sauce-launcher": "0.2.0"
- , "karma-phantomjs-launcher": "0.1.1"
- , "mocha": "1.8.2"
- , "istanbul": "~0.1.44"
- }
-}
diff --git a/tests/lib/chai-1.9.0/sauce.browsers.js b/tests/lib/chai-1.9.0/sauce.browsers.js
deleted file mode 100644
index 690c7cca1c..0000000000
--- a/tests/lib/chai-1.9.0/sauce.browsers.js
+++ /dev/null
@@ -1,128 +0,0 @@
-
-/*!
- * Chrome
- */
-
-exports['SL_Chrome'] = {
- base: 'SauceLabs'
- , browserName: 'chrome'
-};
-
-/*!
- * Firefox
- */
-
-/*!
- * TODO: Karma doesn't seem to like this, though sauce boots its up
- *
-
-exports['SL_Firefox_23'] = {
- base: 'SauceLabs'
- , browserName: 'firefox'
- , platform: 'Windows XP'
- , version: '23'
-};
-
-*/
-
-exports['SL_Firefox_22'] = {
- base: 'SauceLabs'
- , browserName: 'firefox'
- , platform: 'Windows 7'
- , version: '22'
-};
-
-/*!
- * Opera
- */
-
-exports['SL_Opera_12'] = {
- base: 'SauceLabs'
- , browserName: 'opera'
- , platform: 'Windows 7'
- , version: '12'
-};
-
-exports['SL_Opera_11'] = {
- base: 'SauceLabs'
- , browserName: 'opera'
- , platform: 'Windows 7'
- , version: '11'
-};
-
-/*!
- * Internet Explorer
- */
-
-exports['SL_IE_10'] = {
- base: 'SauceLabs'
- , browserName: 'internet explorer'
- , platform: 'Windows 2012'
- , version: '10'
-};
-
-/*!
- * Safari
- */
-
-exports['SL_Safari_6'] = {
- base: 'SauceLabs'
- , browserName: 'safari'
- , platform: 'Mac 10.8'
- , version: '6'
-};
-
-exports['SL_Safari_5'] = {
- base: 'SauceLabs'
- , browserName: 'safari'
- , platform: 'Mac 10.6'
- , version: '5'
-};
-
-/*!
- * iPhone
- */
-
-/*!
- * TODO: These take forever to boot or shut down. Causes timeout.
- *
-
-exports['SL_iPhone_6'] = {
- base: 'SauceLabs'
- , browserName: 'iphone'
- , platform: 'Mac 10.8'
- , version: '6'
-};
-
-exports['SL_iPhone_5-1'] = {
- base: 'SauceLabs'
- , browserName: 'iphone'
- , platform: 'Mac 10.8'
- , version: '5.1'
-};
-
-exports['SL_iPhone_5'] = {
- base: 'SauceLabs'
- , browserName: 'iphone'
- , platform: 'Mac 10.6'
- , version: '5'
-};
-
-*/
-
-/*!
- * Android
- */
-
-/*!
- * TODO: fails because of error serialization
- *
-
-exports['SL_Android_4'] = {
- base: 'SauceLabs'
- , browserName: 'android'
- , platform: 'Linux'
- , version: '4'
-};
-
-*/
diff --git a/tests/lib/chai-1.9.0/support/sauce/sauce_connect_block.sh b/tests/lib/chai-1.9.0/support/sauce/sauce_connect_block.sh
deleted file mode 100644
index 5c8108d49e..0000000000
--- a/tests/lib/chai-1.9.0/support/sauce/sauce_connect_block.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-# Wait for Connect to be ready before exiting
-while [ ! -f $SAUCE_CONNECT_READY_FILE ]; do
- sleep .5
-done
diff --git a/tests/lib/chai-1.9.0/support/sauce/sauce_connect_setup.sh b/tests/lib/chai-1.9.0/support/sauce/sauce_connect_setup.sh
deleted file mode 100644
index c497d02acb..0000000000
--- a/tests/lib/chai-1.9.0/support/sauce/sauce_connect_setup.sh
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-
-set -e
-
-# Setup and start Sauce Connect for your TravisCI build
-# This script requires your .travis.yml to include the following two private env variables:
-# SAUCE_USERNAME
-# SAUCE_ACCESS_KEY
-# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
-#
-# Curl and run this script as part of your .travis.yml before_script section:
-# before_script:
-# - curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash
-
-CONNECT_URL="http://saucelabs.com/downloads/Sauce-Connect-latest.zip"
-CONNECT_DIR="/tmp/sauce-connect-$RANDOM"
-CONNECT_DOWNLOAD="Sauce_Connect.zip"
-
-mkdir -p $LOGS_DIR
-CONNECT_LOG="$LOGS_DIR/sauce-connect"
-CONNECT_STDOUT="$LOGS_DIR/sauce-connect.stdout"
-CONNECT_STDERR="$LOGS_DIR/sauce-connect.stderr"
-
-# Get Connect and start it
-mkdir -p $CONNECT_DIR
-cd $CONNECT_DIR
-curl $CONNECT_URL -o $CONNECT_DOWNLOAD 2> /dev/null 1> /dev/null
-unzip $CONNECT_DOWNLOAD > /dev/null
-rm $CONNECT_DOWNLOAD
-
-SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev`
-
-ARGS=""
-
-# Set tunnel-id only on Travis, to make local testing easier.
-if [ ! -z "$TRAVIS_JOB_NUMBER" ]; then
- ARGS="$ARGS --tunnel-identifier $TRAVIS_JOB_NUMBER"
-fi
-if [ ! -z "$SAUCE_CONNECT_READY_FILE" ]; then
- ARGS="$ARGS --readyfile $SAUCE_CONNECT_READY_FILE"
-fi
-
-echo "Starting Sauce Connect in the background:"
-echo " Arg: $ARGS"
-echo "Logging into:"
-echo " Log: $CONNECT_LOG"
-echo " Out: $CONNECT_STDOUT"
-echo " Err: $CONNECT_STDERR"
-java -jar Sauce-Connect.jar $ARGS $SAUCE_USERNAME $SAUCE_ACCESS_KEY \
- --logfile $CONNECT_LOG 2> $CONNECT_STDERR 1> $CONNECT_STDOUT &
-CONNECT_PID=$!
-echo " Pid: $CONNECT_PID"
diff --git a/tests/lib/chai-1.9.0/test/assert.js b/tests/lib/chai-1.9.0/test/assert.js
deleted file mode 100644
index 62260ede09..0000000000
--- a/tests/lib/chai-1.9.0/test/assert.js
+++ /dev/null
@@ -1,638 +0,0 @@
-describe('assert', function () {
- var assert = chai.assert;
-
- it('assert', function () {
- var foo = 'bar';
- assert(foo == 'bar', "expected foo to equal `bar`");
-
- err(function () {
- assert(foo == 'baz', "expected foo to equal `bar`");
- }, "expected foo to equal `bar`");
- });
-
- it('fail', function () {
- chai.expect(function () {
- assert.fail(0, 1, 'this has failed');
- }).to.throw(chai.AssertionError, /this has failed/);
- });
-
- it('isTrue', function () {
- assert.isTrue(true);
-
- err(function() {
- assert.isTrue(false);
- }, "expected false to be true");
-
- err(function() {
- assert.isTrue(1);
- }, "expected 1 to be true");
-
- err(function() {
- assert.isTrue('test');
- }, "expected 'test' to be true");
- });
-
- it('ok', function () {
- assert.ok(true);
- assert.ok(1);
- assert.ok('test');
-
- err(function () {
- assert.ok(false);
- }, "expected false to be truthy");
-
- err(function () {
- assert.ok(0);
- }, "expected 0 to be truthy");
-
- err(function () {
- assert.ok('');
- }, "expected '' to be truthy");
- });
-
- it('notOk', function () {
- assert.notOk(false);
- assert.notOk(0);
- assert.notOk('');
-
- err(function () {
- assert.notOk(true);
- }, "expected true to be falsy");
-
- err(function () {
- assert.notOk(1);
- }, "expected 1 to be falsy");
-
- err(function () {
- assert.notOk('test');
- }, "expected 'test' to be falsy");
- });
-
- it('isFalse', function () {
- assert.isFalse(false);
-
- err(function() {
- assert.isFalse(true);
- }, "expected true to be false");
-
- err(function() {
- assert.isFalse(0);
- }, "expected 0 to be false");
- });
-
- it('equal', function () {
- var foo;
- assert.equal(foo, undefined);
- });
-
- it('typeof / notTypeOf', function () {
- assert.typeOf('test', 'string');
- assert.typeOf(true, 'boolean');
- assert.typeOf(5, 'number');
-
- err(function () {
- assert.typeOf(5, 'string');
- }, "expected 5 to be a string");
-
- });
-
- it('notTypeOf', function () {
- assert.notTypeOf('test', 'number');
-
- err(function () {
- assert.notTypeOf(5, 'number');
- }, "expected 5 not to be a number");
- });
-
- it('instanceOf', function() {
- function Foo(){}
- assert.instanceOf(new Foo(), Foo);
-
- err(function () {
- assert.instanceOf(5, Foo);
- }, "expected 5 to be an instance of Foo");
-
- function CrashyObject() {};
- CrashyObject.prototype.inspect = function () {
- throw new Error("Arg's inspect() called even though the test passed");
- };
- assert.instanceOf(new CrashyObject(), CrashyObject);
- });
-
- it('notInstanceOf', function () {
- function Foo(){}
- assert.notInstanceOf(new Foo(), String);
-
- err(function () {
- assert.notInstanceOf(new Foo(), Foo);
- }, "expected {} to not be an instance of Foo");
- });
-
- it('isObject', function () {
- function Foo(){}
- assert.isObject({});
- assert.isObject(new Foo());
-
- err(function() {
- assert.isObject(true);
- }, "expected true to be an object");
-
- err(function() {
- assert.isObject(Foo);
- }, "expected [Function: Foo] to be an object");
-
- err(function() {
- assert.isObject('foo');
- }, "expected 'foo' to be an object");
- });
-
- it('isNotObject', function () {
- function Foo(){}
- assert.isNotObject(5);
-
- err(function() {
- assert.isNotObject({});
- }, "expected {} not to be an object");
- });
-
- it('notEqual', function() {
- assert.notEqual(3, 4);
-
- err(function () {
- assert.notEqual(5, 5);
- }, "expected 5 to not equal 5");
- });
-
- it('strictEqual', function() {
- assert.strictEqual('foo', 'foo');
-
- err(function () {
- assert.strictEqual('5', 5);
- }, "expected \'5\' to equal 5");
- });
-
- it('notStrictEqual', function() {
- assert.notStrictEqual(5, '5');
-
- err(function () {
- assert.notStrictEqual(5, 5);
- }, "expected 5 to not equal 5");
- });
-
- it('deepEqual', function() {
- assert.deepEqual({tea: 'chai'}, {tea: 'chai'});
-
- err(function () {
- assert.deepEqual({tea: 'chai'}, {tea: 'black'});
- }, "expected { tea: \'chai\' } to deeply equal { tea: \'black\' }");
-
- var obja = Object.create({ tea: 'chai' })
- , objb = Object.create({ tea: 'chai' });
-
- assert.deepEqual(obja, objb);
-
- var obj1 = Object.create({tea: 'chai'})
- , obj2 = Object.create({tea: 'black'});
-
- err(function () {
- assert.deepEqual(obj1, obj2);
- }, "expected { tea: \'chai\' } to deeply equal { tea: \'black\' }");
- });
-
- it('deepEqual (ordering)', function() {
- var a = { a: 'b', c: 'd' }
- , b = { c: 'd', a: 'b' };
- assert.deepEqual(a, b);
- });
-
- it('deepEqual /regexp/', function() {
- assert.deepEqual(/a/, /a/);
- assert.notDeepEqual(/a/, /b/);
- assert.notDeepEqual(/a/, {});
- assert.deepEqual(/a/g, /a/g);
- assert.notDeepEqual(/a/g, /b/g);
- assert.deepEqual(/a/i, /a/i);
- assert.notDeepEqual(/a/i, /b/i);
- assert.deepEqual(/a/m, /a/m);
- assert.notDeepEqual(/a/m, /b/m);
- });
-
- it('deepEqual (Date)', function() {
- var a = new Date(1, 2, 3)
- , b = new Date(4, 5, 6);
- assert.deepEqual(a, a);
- assert.notDeepEqual(a, b);
- assert.notDeepEqual(a, {});
- });
-
- it('deepEqual (circular)', function() {
- var circularObject = {}
- , secondCircularObject = {};
- circularObject.field = circularObject;
- secondCircularObject.field = secondCircularObject;
-
- assert.deepEqual(circularObject, secondCircularObject);
-
- err(function() {
- secondCircularObject.field2 = secondCircularObject;
- assert.deepEqual(circularObject, secondCircularObject);
- }, "expected { field: [Circular] } to deeply equal { Object (field, field2) }");
- });
-
- it('notDeepEqual', function() {
- assert.notDeepEqual({tea: 'jasmine'}, {tea: 'chai'});
-
- err(function () {
- assert.notDeepEqual({tea: 'chai'}, {tea: 'chai'});
- }, "expected { tea: \'chai\' } to not deeply equal { tea: \'chai\' }");
- });
-
- it('notDeepEqual (circular)', function() {
- var circularObject = {}
- , secondCircularObject = { tea: 'jasmine' };
- circularObject.field = circularObject;
- secondCircularObject.field = secondCircularObject;
-
- assert.notDeepEqual(circularObject, secondCircularObject);
-
- err(function() {
- delete secondCircularObject.tea;
- assert.notDeepEqual(circularObject, secondCircularObject);
- }, "expected { field: [Circular] } to not deeply equal { field: [Circular] }");
- });
-
- it('isNull', function() {
- assert.isNull(null);
-
- err(function () {
- assert.isNull(undefined);
- }, "expected undefined to equal null");
- });
-
- it('isNotNull', function() {
- assert.isNotNull(undefined);
-
- err(function () {
- assert.isNotNull(null);
- }, "expected null to not equal null");
- });
-
- it('isUndefined', function() {
- assert.isUndefined(undefined);
-
- err(function () {
- assert.isUndefined(null);
- }, "expected null to equal undefined");
- });
-
- it('isDefined', function() {
- assert.isDefined(null);
-
- err(function () {
- assert.isDefined(undefined);
- }, "expected undefined to not equal undefined");
- });
-
- it('isFunction', function() {
- var func = function() {};
- assert.isFunction(func);
-
- err(function () {
- assert.isFunction({});
- }, "expected {} to be a function");
- });
-
- it('isNotFunction', function () {
- assert.isNotFunction(5);
-
- err(function () {
- assert.isNotFunction(function () {});
- }, "expected [Function] not to be a function");
- });
-
- it('isArray', function() {
- assert.isArray([]);
- assert.isArray(new Array);
-
- err(function () {
- assert.isArray({});
- }, "expected {} to be an array");
- });
-
- it('isNotArray', function () {
- assert.isNotArray(3);
-
- err(function () {
- assert.isNotArray([]);
- }, "expected [] not to be an array");
-
- err(function () {
- assert.isNotArray(new Array);
- }, "expected [] not to be an array");
- });
-
- it('isString', function() {
- assert.isString('Foo');
- assert.isString(new String('foo'));
-
- err(function () {
- assert.isString(1);
- }, "expected 1 to be a string");
- });
-
- it('isNotString', function () {
- assert.isNotString(3);
- assert.isNotString([ 'hello' ]);
-
- err(function () {
- assert.isNotString('hello');
- }, "expected 'hello' not to be a string");
- });
-
- it('isNumber', function() {
- assert.isNumber(1);
- assert.isNumber(Number('3'));
-
- err(function () {
- assert.isNumber('1');
- }, "expected \'1\' to be a number");
- });
-
- it('isNotNumber', function () {
- assert.isNotNumber('hello');
- assert.isNotNumber([ 5 ]);
-
- err(function () {
- assert.isNotNumber(4);
- }, "expected 4 not to be a number");
- });
-
- it('isBoolean', function() {
- assert.isBoolean(true);
- assert.isBoolean(false);
-
- err(function () {
- assert.isBoolean('1');
- }, "expected \'1\' to be a boolean");
- });
-
- it('isNotBoolean', function () {
- assert.isNotBoolean('true');
-
- err(function () {
- assert.isNotBoolean(true);
- }, "expected true not to be a boolean");
-
- err(function () {
- assert.isNotBoolean(false);
- }, "expected false not to be a boolean");
- });
-
- it('include', function() {
- assert.include('foobar', 'bar');
- assert.include([ 1, 2, 3], 3);
- assert.include({a:1, b:2}, {b:2});
-
- err(function () {
- assert.include('foobar', 'baz');
- }, "expected \'foobar\' to include \'baz\'");
-
- err(function () {
- assert.include(undefined, 'bar');
- }, "expected undefined to include 'bar'");
- });
-
- it('notInclude', function () {
- assert.notInclude('foobar', 'baz');
- assert.notInclude([ 1, 2, 3 ], 4);
- assert.notInclude(undefined, 'bar');
-
- err(function () {
- assert.notInclude('foobar', 'bar');
- }, "expected \'foobar\' to not include \'bar\'");
- });
-
- it('lengthOf', function() {
- assert.lengthOf([1,2,3], 3);
- assert.lengthOf('foobar', 6);
-
- err(function () {
- assert.lengthOf('foobar', 5);
- }, "expected 'foobar' to have a length of 5 but got 6");
-
- err(function () {
- assert.lengthOf(1, 5);
- }, "expected 1 to have a property \'length\'");
- });
-
- it('match', function () {
- assert.match('foobar', /^foo/);
- assert.notMatch('foobar', /^bar/);
-
- err(function () {
- assert.match('foobar', /^bar/i);
- }, "expected 'foobar' to match /^bar/i");
-
- err(function () {
- assert.notMatch('foobar', /^foo/i);
- }, "expected 'foobar' not to match /^foo/i");
- });
-
- it('property', function () {
- var obj = { foo: { bar: 'baz' } };
- var simpleObj = { foo: 'bar' };
- assert.property(obj, 'foo');
- assert.deepProperty(obj, 'foo.bar');
- assert.notProperty(obj, 'baz');
- assert.notProperty(obj, 'foo.bar');
- assert.notDeepProperty(obj, 'foo.baz');
- assert.deepPropertyVal(obj, 'foo.bar', 'baz');
- assert.deepPropertyNotVal(obj, 'foo.bar', 'flow');
-
- err(function () {
- assert.property(obj, 'baz');
- }, "expected { foo: { bar: 'baz' } } to have a property 'baz'");
-
- err(function () {
- assert.deepProperty(obj, 'foo.baz');
- }, "expected { foo: { bar: 'baz' } } to have a deep property 'foo.baz'");
-
- err(function () {
- assert.notProperty(obj, 'foo');
- }, "expected { foo: { bar: 'baz' } } to not have property 'foo'");
-
- err(function () {
- assert.notDeepProperty(obj, 'foo.bar');
- }, "expected { foo: { bar: 'baz' } } to not have deep property 'foo.bar'");
-
- err(function () {
- assert.propertyVal(simpleObj, 'foo', 'ball');
- }, "expected { foo: 'bar' } to have a property 'foo' of 'ball', but got 'bar'");
-
- err(function () {
- assert.deepPropertyVal(obj, 'foo.bar', 'ball');
- }, "expected { foo: { bar: 'baz' } } to have a deep property 'foo.bar' of 'ball', but got 'baz'");
-
- err(function () {
- assert.propertyNotVal(simpleObj, 'foo', 'bar');
- }, "expected { foo: 'bar' } to not have a property 'foo' of 'bar'");
-
- err(function () {
- assert.deepPropertyNotVal(obj, 'foo.bar', 'baz');
- }, "expected { foo: { bar: 'baz' } } to not have a deep property 'foo.bar' of 'baz'");
- });
-
- it('throws', function() {
- assert.throws(function() { throw new Error('foo'); });
- assert.throws(function() { throw new Error('bar'); }, 'bar');
- assert.throws(function() { throw new Error('bar'); }, /bar/);
- assert.throws(function() { throw new Error('bar'); }, Error);
- assert.throws(function() { throw new Error('bar'); }, Error, 'bar');
-
- var thrownErr = assert.throws(function() { throw new Error('foo'); });
- assert(thrownErr instanceof Error, 'assert.throws returns error');
- assert(thrownErr.message === 'foo', 'assert.throws returns error message');
-
- err(function () {
- assert.throws(function() { throw new Error('foo') }, TypeError);
- }, "expected [Function] to throw 'TypeError' but 'Error: foo' was thrown")
-
- err(function () {
- assert.throws(function() { throw new Error('foo') }, 'bar');
- }, "expected [Function] to throw error including 'bar' but got 'foo'")
-
- err(function () {
- assert.throws(function() { throw new Error('foo') }, Error, 'bar');
- }, "expected [Function] to throw error including 'bar' but got 'foo'")
-
- err(function () {
- assert.throws(function() { throw new Error('foo') }, TypeError, 'bar');
- }, "expected [Function] to throw 'TypeError' but 'Error: foo' was thrown")
-
- err(function () {
- assert.throws(function() {});
- }, "expected [Function] to throw an error");
-
- err(function () {
- assert.throws(function() { throw new Error('') }, 'bar');
- }, "expected [Function] to throw error including 'bar' but got ''");
-
- err(function () {
- assert.throws(function() { throw new Error('') }, /bar/);
- }, "expected [Function] to throw error matching /bar/ but got ''");
- });
-
- it('doesNotThrow', function() {
- function CustomError(message) {
- this.name = 'CustomError';
- this.message = message;
- }
- CustomError.prototype = Error.prototype;
-
- assert.doesNotThrow(function() { });
- assert.doesNotThrow(function() { }, 'foo');
-
- err(function () {
- assert.doesNotThrow(function() { throw new Error('foo'); });
- }, "expected [Function] to not throw an error but 'Error: foo' was thrown");
-
- err(function () {
- assert.doesNotThrow(function() { throw new CustomError('foo'); });
- }, "expected [Function] to not throw an error but 'CustomError: foo' was thrown");
- });
-
- it('ifError', function() {
- assert.ifError(false);
- assert.ifError(null);
- assert.ifError(undefined);
-
- err(function () {
- assert.ifError('foo');
- }, "expected \'foo\' to be falsy");
- });
-
- it('operator', function() {
- assert.operator(1, '<', 2);
- assert.operator(2, '>', 1);
- assert.operator(1, '==', 1);
- assert.operator(1, '<=', 1);
- assert.operator(1, '>=', 1);
- assert.operator(1, '!=', 2);
- assert.operator(1, '!==', 2);
-
- err(function () {
- assert.operator(1, '=', 2);
- }, 'Invalid operator "="');
-
- err(function () {
- assert.operator(2, '<', 1);
- }, "expected 2 to be < 1");
-
- err(function () {
- assert.operator(1, '>', 2);
- }, "expected 1 to be > 2");
-
- err(function () {
- assert.operator(1, '==', 2);
- }, "expected 1 to be == 2");
-
- err(function () {
- assert.operator(2, '<=', 1);
- }, "expected 2 to be <= 1");
-
- err(function () {
- assert.operator(1, '>=', 2);
- }, "expected 1 to be >= 2");
-
- err(function () {
- assert.operator(1, '!=', 1);
- }, "expected 1 to be != 1");
-
- err(function () {
- assert.operator(1, '!==', '1');
- }, "expected 1 to be !== \'1\'");
- });
-
- it('closeTo', function(){
- assert.closeTo(1.5, 1.0, 0.5);
- assert.closeTo(10, 20, 20);
- assert.closeTo(-10, 20, 30);
-
- err(function(){
- assert.closeTo(2, 1.0, 0.5);
- }, "expected 2 to be close to 1 +/- 0.5");
-
- err(function(){
- assert.closeTo(-10, 20, 29);
- }, "expected -10 to be close to 20 +/- 29");
- });
-
- it('members', function() {
- assert.includeMembers([1, 2, 3], [2, 3]);
- assert.includeMembers([1, 2, 3], []);
- assert.includeMembers([1, 2, 3], [3]);
-
- err(function() {
- assert.includeMembers([5, 6], [7, 8]);
- }, 'expected [ 5, 6 ] to be a superset of [ 7, 8 ]');
-
- err(function() {
- assert.includeMembers([5, 6], [5, 6, 0]);
- }, 'expected [ 5, 6 ] to be a superset of [ 5, 6, 0 ]');
- });
-
- it('memberEquals', function() {
- assert.sameMembers([], []);
- assert.sameMembers([1, 2, 3], [3, 2, 1]);
- assert.sameMembers([4, 2], [4, 2]);
-
- err(function() {
- assert.sameMembers([], [1, 2]);
- }, 'expected [] to have the same members as [ 1, 2 ]');
-
- err(function() {
- assert.sameMembers([1, 54], [6, 1, 54]);
- }, 'expected [ 1, 54 ] to have the same members as [ 6, 1, 54 ]');
- });
-
-});
diff --git a/tests/lib/chai-1.9.0/test/auth/.gitkeep b/tests/lib/chai-1.9.0/test/auth/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
--- a/tests/lib/chai-1.9.0/test/auth/.gitkeep
+++ /dev/null
diff --git a/tests/lib/chai-1.9.0/test/bootstrap/index.js b/tests/lib/chai-1.9.0/test/bootstrap/index.js
deleted file mode 100644
index 0c998f4fcd..0000000000
--- a/tests/lib/chai-1.9.0/test/bootstrap/index.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*!
- * Attach chai to global
- */
-
-global.chai = require('../..');
-
-/*!
- * Provide check for fail function.
- */
-
-global.err = function (fn, msg) {
- try {
- fn();
- throw new chai.AssertionError({ message: 'Expected an error' });
- } catch (err) {
- if ('string' === typeof msg) {
- chai.expect(err.message).to.equal(msg);
- } else {
- chai.expect(err.message).to.match(msg);
- }
- }
-};
diff --git a/tests/lib/chai-1.9.0/test/bootstrap/karma.js b/tests/lib/chai-1.9.0/test/bootstrap/karma.js
deleted file mode 100644
index 8e3e3f53e7..0000000000
--- a/tests/lib/chai-1.9.0/test/bootstrap/karma.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*!
- * Attach chai to global
- */
-
-global.chai = require('chai');
-
-/*!
- * Provide check for fail function.
- */
-
-global.err = function (fn, msg) {
- try {
- fn();
- throw new chai.AssertionError('Expected an error');
- } catch (err) {
- if ('string' === typeof msg) {
- chai.expect(err.message).to.equal(msg);
- } else {
- chai.expect(err.message).to.match(msg);
- }
- }
-};
diff --git a/tests/lib/chai-1.9.0/test/configuration.js b/tests/lib/chai-1.9.0/test/configuration.js
deleted file mode 100644
index dfeba008d9..0000000000
--- a/tests/lib/chai-1.9.0/test/configuration.js
+++ /dev/null
@@ -1,43 +0,0 @@
-describe('configuration', function () {
- var assert = chai.assert;
-
- function fooThrows () {
- assert.equal('foo', 'bar');
- }
-
- it('Assertion.includeStack is true', function () {
- var orig = chai.Assertion.includeStack;
- chai.Assertion.includeStack = true;
-
- try {
- fooThrows();
- assert.ok(false, 'should not get here because error thrown');
- } catch (err) {
- chai.Assertion.includeStack = orig;
- // not all browsers support err.stack
- if ('undefined' !== typeof err.stack) {
- assert.include(err.stack, 'fooThrows', 'should have stack trace in error message');
- }
- }
-
- });
-
- it('Assertion.includeStack is false', function () {
- var orig = chai.Assertion.includeStack;
- chai.Assertion.includeStack = false;
-
- try {
- fooThrows();
- assert.ok(false, 'should not get here because error thrown');
- } catch (err) {
- chai.Assertion.includeStack = orig;
-
- // IE 10 supports err.stack in Chrome format, but without
- // `Error.captureStackTrace` support that allows tuning of the error
- // message.
- if ('undefined' !== typeof Error.captureStackTrace) {
- assert.ok(!err.stack || err.stack.indexOf('at fooThrows') === -1, 'should not have stack trace in error message');
- }
- }
- });
-});
diff --git a/tests/lib/chai-1.9.0/test/display/errors.js b/tests/lib/chai-1.9.0/test/display/errors.js
deleted file mode 100644
index f182f1e5c1..0000000000
--- a/tests/lib/chai-1.9.0/test/display/errors.js
+++ /dev/null
@@ -1,14 +0,0 @@
-if (!chai)
- var chai = require('../..');
-
-var expect = chai.expect;
-
-chai.Assertion.includeStack = true;
-
-suite('error display', function () {
-
- test('show error line', function () {
- expect(4).to.equal(2);
- });
-
-});
diff --git a/tests/lib/chai-1.9.0/test/display/message.js b/tests/lib/chai-1.9.0/test/display/message.js
deleted file mode 100644
index 2c069df922..0000000000
--- a/tests/lib/chai-1.9.0/test/display/message.js
+++ /dev/null
@@ -1,40 +0,0 @@
-var chai = require('../..')
- , should = chai.should();
-
-var deepObj = {
- green: { tea: 'matcha' }
- , teas: [
- 'chai'
- , 'matcha'
- , { tea: 'konacha' }
- ]
-};
-
-var deepObj2 = {
- green: { tea: 'matcha' }
- , teas: [
- 'chai'
- , 'oolong'
- , { tea: 'konacha' }
- ]
-};
-
-chai.Assertion.includeStack = true;
-
-suite('object display', function () {
-
- test('property', function () {
- deepObj.should.have.property('chai');
- });
-
- test('deep equal', function () {
- deepObj.should.deep.equal(deepObj2);
- });
-
- test('deep equal no diff', function () {
- chai.Assertion.showDiff = false;
- deepObj.should.deep.equal(deepObj2);
- chai.Assertion.showDiff = true;
- });
-
-});
diff --git a/tests/lib/chai-1.9.0/test/expect.js b/tests/lib/chai-1.9.0/test/expect.js
deleted file mode 100644
index 2a33efb606..0000000000
--- a/tests/lib/chai-1.9.0/test/expect.js
+++ /dev/null
@@ -1,792 +0,0 @@
-describe('expect', function () {
- var expect = chai.expect;
-
- it('chai.version', function() {
- expect(chai).to.have.property('version');
- });
-
- it('assertion', function(){
- expect('test').to.be.a('string');
- expect('foo').to.equal('foo');
- });
-
- it('true', function(){
- expect(true).to.be.true;
- expect(false).to.not.be.true;
- expect(1).to.not.be.true;
-
- err(function(){
- expect('test').to.be.true;
- }, "expected 'test' to be true")
- });
-
- it('ok', function(){
- expect(true).to.be.ok;
- expect(false).to.not.be.ok;
- expect(1).to.be.ok;
- expect(0).to.not.be.ok;
-
- err(function(){
- expect('').to.be.ok;
- }, "expected '' to be truthy");
-
- err(function(){
- expect('test').to.not.be.ok;
- }, "expected 'test' to be falsy");
- });
-
- it('false', function(){
- expect(false).to.be.false;
- expect(true).to.not.be.false;
- expect(0).to.not.be.false;
-
- err(function(){
- expect('').to.be.false;
- }, "expected '' to be false")
- });
-
- it('null', function(){
- expect(null).to.be.null;
- expect(false).to.not.be.null;
-
- err(function(){
- expect('').to.be.null;
- }, "expected '' to be null")
- });
-
- it('undefined', function(){
- expect(undefined).to.be.undefined;
- expect(null).to.not.be.undefined;
-
- err(function(){
- expect('').to.be.undefined;
- }, "expected '' to be undefined")
- });
-
- it('exist', function(){
- var foo = 'bar'
- , bar;
- expect(foo).to.exist;
- expect(bar).to.not.exist;
- });
-
- it('arguments', function(){
- var args = (function(){ return arguments; })(1,2,3);
- expect(args).to.be.arguments;
- expect([]).to.not.be.arguments;
- expect(args).to.be.an('arguments').and.be.arguments;
- expect([]).to.be.an('array').and.not.be.Arguments;
- });
-
- it('.equal()', function(){
- var foo;
- expect(undefined).to.equal(foo);
- });
-
- it('typeof', function(){
- expect('test').to.be.a('string');
-
- err(function(){
- expect('test').to.not.be.a('string');
- }, "expected 'test' not to be a string");
-
- (function () {
- expect(arguments).to.be.an('arguments');
- })(1, 2);
-
- expect(5).to.be.a('number');
- expect(new Number(1)).to.be.a('number');
- expect(Number(1)).to.be.a('number');
- expect(true).to.be.a('boolean');
- expect(new Array()).to.be.a('array');
- expect(new Object()).to.be.a('object');
- expect({}).to.be.a('object');
- expect([]).to.be.a('array');
- expect(function() {}).to.be.a('function');
- expect(null).to.be.a('null');
-
- err(function(){
- expect(5).to.not.be.a('number', 'blah');
- }, "blah: expected 5 not to be a number");
- });
-
- it('instanceof', function(){
- function Foo(){}
- expect(new Foo()).to.be.an.instanceof(Foo);
-
- err(function(){
- expect(3).to.an.instanceof(Foo, 'blah');
- }, "blah: expected 3 to be an instance of Foo");
- });
-
- it('within(start, finish)', function(){
- expect(5).to.be.within(5, 10);
- expect(5).to.be.within(3,6);
- expect(5).to.be.within(3,5);
- expect(5).to.not.be.within(1,3);
- expect('foo').to.have.length.within(2,4);
- expect([ 1, 2, 3 ]).to.have.length.within(2,4);
-
- err(function(){
- expect(5).to.not.be.within(4,6, 'blah');
- }, "blah: expected 5 to not be within 4..6", 'blah');
-
- err(function(){
- expect(10).to.be.within(50,100, 'blah');
- }, "blah: expected 10 to be within 50..100");
-
- err(function () {
- expect('foo').to.have.length.within(5,7, 'blah');
- }, "blah: expected \'foo\' to have a length within 5..7");
-
- err(function () {
- expect([ 1, 2, 3 ]).to.have.length.within(5,7, 'blah');
- }, "blah: expected [ 1, 2, 3 ] to have a length within 5..7");
- });
-
- it('above(n)', function(){
- expect(5).to.be.above(2);
- expect(5).to.be.greaterThan(2);
- expect(5).to.not.be.above(5);
- expect(5).to.not.be.above(6);
- expect('foo').to.have.length.above(2);
- expect([ 1, 2, 3 ]).to.have.length.above(2);
-
- err(function(){
- expect(5).to.be.above(6, 'blah');
- }, "blah: expected 5 to be above 6", 'blah');
-
- err(function(){
- expect(10).to.not.be.above(6, 'blah');
- }, "blah: expected 10 to be at most 6");
-
- err(function () {
- expect('foo').to.have.length.above(4, 'blah');
- }, "blah: expected \'foo\' to have a length above 4 but got 3");
-
- err(function () {
- expect([ 1, 2, 3 ]).to.have.length.above(4, 'blah');
- }, "blah: expected [ 1, 2, 3 ] to have a length above 4 but got 3");
- });
-
- it('least(n)', function(){
- expect(5).to.be.at.least(2);
- expect(5).to.be.at.least(5);
- expect(5).to.not.be.at.least(6);
- expect('foo').to.have.length.of.at.least(2);
- expect([ 1, 2, 3 ]).to.have.length.of.at.least(2);
-
- err(function(){
- expect(5).to.be.at.least(6, 'blah');
- }, "blah: expected 5 to be at least 6", 'blah');
-
- err(function(){
- expect(10).to.not.be.at.least(6, 'blah');
- }, "blah: expected 10 to be below 6");
-
- err(function () {
- expect('foo').to.have.length.of.at.least(4, 'blah');
- }, "blah: expected \'foo\' to have a length at least 4 but got 3");
-
- err(function () {
- expect([ 1, 2, 3 ]).to.have.length.of.at.least(4, 'blah');
- }, "blah: expected [ 1, 2, 3 ] to have a length at least 4 but got 3");
-
- err(function () {
- expect([ 1, 2, 3, 4 ]).to.not.have.length.of.at.least(4, 'blah');
- }, "blah: expected [ 1, 2, 3, 4 ] to have a length below 4");
- });
-
- it('below(n)', function(){
- expect(2).to.be.below(5);
- expect(2).to.be.lessThan(5);
- expect(2).to.not.be.below(2);
- expect(2).to.not.be.below(1);
- expect('foo').to.have.length.below(4);
- expect([ 1, 2, 3 ]).to.have.length.below(4);
-
- err(function(){
- expect(6).to.be.below(5, 'blah');
- }, "blah: expected 6 to be below 5");
-
- err(function(){
- expect(6).to.not.be.below(10, 'blah');
- }, "blah: expected 6 to be at least 10");
-
- err(function () {
- expect('foo').to.have.length.below(2, 'blah');
- }, "blah: expected \'foo\' to have a length below 2 but got 3");
-
- err(function () {
- expect([ 1, 2, 3 ]).to.have.length.below(2, 'blah');
- }, "blah: expected [ 1, 2, 3 ] to have a length below 2 but got 3");
- });
-
- it('most(n)', function(){
- expect(2).to.be.at.most(5);
- expect(2).to.be.at.most(2);
- expect(2).to.not.be.at.most(1);
- expect(2).to.not.be.at.most(1);
- expect('foo').to.have.length.of.at.most(4);
- expect([ 1, 2, 3 ]).to.have.length.of.at.most(4);
-
- err(function(){
- expect(6).to.be.at.most(5, 'blah');
- }, "blah: expected 6 to be at most 5");
-
- err(function(){
- expect(6).to.not.be.at.most(10, 'blah');
- }, "blah: expected 6 to be above 10");
-
- err(function () {
- expect('foo').to.have.length.of.at.most(2, 'blah');
- }, "blah: expected \'foo\' to have a length at most 2 but got 3");
-
- err(function () {
- expect([ 1, 2, 3 ]).to.have.length.of.at.most(2, 'blah');
- }, "blah: expected [ 1, 2, 3 ] to have a length at most 2 but got 3");
-
- err(function () {
- expect([ 1, 2 ]).to.not.have.length.of.at.most(2, 'blah');
- }, "blah: expected [ 1, 2 ] to have a length above 2");
- });
-
- it('match(regexp)', function(){
- expect('foobar').to.match(/^foo/)
- expect('foobar').to.not.match(/^bar/)
-
- err(function(){
- expect('foobar').to.match(/^bar/i, 'blah')
- }, "blah: expected 'foobar' to match /^bar/i");
-
- err(function(){
- expect('foobar').to.not.match(/^foo/i, 'blah')
- }, "blah: expected 'foobar' not to match /^foo/i");
- });
-
- it('length(n)', function(){
- expect('test').to.have.length(4);
- expect('test').to.not.have.length(3);
- expect([1,2,3]).to.have.length(3);
-
- err(function(){
- expect(4).to.have.length(3, 'blah');
- }, 'blah: expected 4 to have a property \'length\'');
-
- err(function(){
- expect('asd').to.not.have.length(3, 'blah');
- }, "blah: expected 'asd' to not have a length of 3");
- });
-
- it('eql(val)', function(){
- expect('test').to.eql('test');
- expect({ foo: 'bar' }).to.eql({ foo: 'bar' });
- expect(1).to.eql(1);
- expect('4').to.not.eql(4);
-
- err(function(){
- expect(4).to.eql(3, 'blah');
- }, 'blah: expected 4 to deeply equal 3');
- });
-
- if ('undefined' !== typeof Buffer) {
- it('Buffer eql()', function () {
- expect(new Buffer([ 1 ])).to.eql(new Buffer([ 1 ]));
-
- err(function () {
- expect(new Buffer([ 0 ])).to.eql(new Buffer([ 1 ]));
- }, 'expected <Buffer 00> to deeply equal <Buffer 01>');
- });
- }
-
- it('equal(val)', function(){
- expect('test').to.equal('test');
- expect(1).to.equal(1);
-
- err(function(){
- expect(4).to.equal(3, 'blah');
- }, 'blah: expected 4 to equal 3');
-
- err(function(){
- expect('4').to.equal(4, 'blah');
- }, "blah: expected '4' to equal 4");
- });
-
- it('deep.equal(val)', function(){
- expect({ foo: 'bar' }).to.deep.equal({ foo: 'bar' });
- expect({ foo: 'bar' }).not.to.deep.equal({ foo: 'baz' });
- });
-
- it('deep.equal(/regexp/)', function(){
- expect(/a/).to.deep.equal(/a/);
- expect(/a/).not.to.deep.equal(/b/);
- expect(/a/).not.to.deep.equal({});
- expect(/a/g).to.deep.equal(/a/g);
- expect(/a/g).not.to.deep.equal(/b/g);
- expect(/a/i).to.deep.equal(/a/i);
- expect(/a/i).not.to.deep.equal(/b/i);
- expect(/a/m).to.deep.equal(/a/m);
- expect(/a/m).not.to.deep.equal(/b/m);
- });
-
- it('deep.equal(Date)', function(){
- var a = new Date(1, 2, 3)
- , b = new Date(4, 5, 6);
- expect(a).to.deep.equal(a);
- expect(a).not.to.deep.equal(b);
- expect(a).not.to.deep.equal({});
- });
-
- it('empty', function(){
- function FakeArgs() {};
- FakeArgs.prototype.length = 0;
-
- expect('').to.be.empty;
- expect('foo').not.to.be.empty;
- expect([]).to.be.empty;
- expect(['foo']).not.to.be.empty;
- expect(new FakeArgs).to.be.empty;
- expect({arguments: 0}).not.to.be.empty;
- expect({}).to.be.empty;
- expect({foo: 'bar'}).not.to.be.empty;
-
- err(function(){
- expect('').not.to.be.empty;
- }, "expected \'\' not to be empty");
-
- err(function(){
- expect('foo').to.be.empty;
- }, "expected \'foo\' to be empty");
-
- err(function(){
- expect([]).not.to.be.empty;
- }, "expected [] not to be empty");
-
- err(function(){
- expect(['foo']).to.be.empty;
- }, "expected [ \'foo\' ] to be empty");
-
- err(function(){
- expect(new FakeArgs).not.to.be.empty;
- }, "expected { length: 0 } not to be empty");
-
- err(function(){
- expect({arguments: 0}).to.be.empty;
- }, "expected { arguments: 0 } to be empty");
-
- err(function(){
- expect({}).not.to.be.empty;
- }, "expected {} not to be empty");
-
- err(function(){
- expect({foo: 'bar'}).to.be.empty;
- }, "expected { foo: \'bar\' } to be empty");
- });
-
- it('property(name)', function(){
- expect('test').to.have.property('length');
- expect(4).to.not.have.property('length');
-
- expect({ 'foo.bar': 'baz' })
- .to.have.property('foo.bar');
- expect({ foo: { bar: 'baz' } })
- .to.not.have.property('foo.bar');
-
- err(function(){
- expect('asd').to.have.property('foo');
- }, "expected 'asd' to have a property 'foo'");
- err(function(){
- expect({ foo: { bar: 'baz' } })
- .to.have.property('foo.bar');
- }, "expected { foo: { bar: 'baz' } } to have a property 'foo.bar'");
- });
-
- it('deep.property(name)', function(){
- expect({ 'foo.bar': 'baz'})
- .to.not.have.deep.property('foo.bar');
- expect({ foo: { bar: 'baz' } })
- .to.have.deep.property('foo.bar');
-
- err(function(){
- expect({ 'foo.bar': 'baz' })
- .to.have.deep.property('foo.bar');
- }, "expected { 'foo.bar': 'baz' } to have a deep property 'foo.bar'");
- });
-
- it('property(name, val)', function(){
- expect('test').to.have.property('length', 4);
- expect('asd').to.have.property('constructor', String);
-
- err(function(){
- expect('asd').to.have.property('length', 4, 'blah');
- }, "blah: expected 'asd' to have a property 'length' of 4, but got 3");
-
- err(function(){
- expect('asd').to.not.have.property('length', 3, 'blah');
- }, "blah: expected 'asd' to not have a property 'length' of 3");
-
- err(function(){
- expect('asd').to.not.have.property('foo', 3, 'blah');
- }, "blah: 'asd' has no property 'foo'");
-
- err(function(){
- expect('asd').to.have.property('constructor', Number, 'blah');
- }, "blah: expected 'asd' to have a property 'constructor' of [Function: Number], but got [Function: String]");
- });
-
- it('deep.property(name, val)', function(){
- expect({ foo: { bar: 'baz' } })
- .to.have.deep.property('foo.bar', 'baz');
-
- err(function(){
- expect({ foo: { bar: 'baz' } })
- .to.have.deep.property('foo.bar', 'quux', 'blah');
- }, "blah: expected { foo: { bar: 'baz' } } to have a deep property 'foo.bar' of 'quux', but got 'baz'");
- err(function(){
- expect({ foo: { bar: 'baz' } })
- .to.not.have.deep.property('foo.bar', 'baz', 'blah');
- }, "blah: expected { foo: { bar: 'baz' } } to not have a deep property 'foo.bar' of 'baz'");
- err(function(){
- expect({ foo: 5 })
- .to.not.have.deep.property('foo.bar', 'baz', 'blah');
- }, "blah: { foo: 5 } has no deep property 'foo.bar'");
- });
-
- it('ownProperty(name)', function(){
- expect('test').to.have.ownProperty('length');
- expect('test').to.haveOwnProperty('length');
- expect({ length: 12 }).to.have.ownProperty('length');
-
- err(function(){
- expect({ length: 12 }).to.not.have.ownProperty('length', 'blah');
- }, "blah: expected { length: 12 } to not have own property 'length'");
- });
-
- it('string()', function(){
- expect('foobar').to.have.string('bar');
- expect('foobar').to.have.string('foo');
- expect('foobar').to.not.have.string('baz');
-
- err(function(){
- expect(3).to.have.string('baz');
- }, "expected 3 to be a string");
-
- err(function(){
- expect('foobar').to.have.string('baz', 'blah');
- }, "blah: expected 'foobar' to contain 'baz'");
-
- err(function(){
- expect('foobar').to.not.have.string('bar', 'blah');
- }, "blah: expected 'foobar' to not contain 'bar'");
- });
-
- it('include()', function(){
- expect(['foo', 'bar']).to.include('foo');
- expect(['foo', 'bar']).to.include('foo');
- expect(['foo', 'bar']).to.include('bar');
- expect([1,2]).to.include(1);
- expect(['foo', 'bar']).to.not.include('baz');
- expect(['foo', 'bar']).to.not.include(1);
- expect({a:1,b:2}).to.include({b:2});
- expect({a:1,b:2}).to.not.include({b:3});
- expect({a:1,b:2}).to.include({a:1,b:2});
- expect({a:1,b:2}).to.not.include({a:1,c:2});
-
- err(function(){
- expect(['foo']).to.include('bar', 'blah');
- }, "blah: expected [ 'foo' ] to include 'bar'");
-
- err(function(){
- expect(['bar', 'foo']).to.not.include('foo', 'blah');
- }, "blah: expected [ 'bar', 'foo' ] to not include 'foo'");
-
- err(function(){
- expect({a:1}).to.include({b:2});
- }, "expected { a: 1 } to have a property 'b'");
-
- err(function(){
- expect({a:1,b:2}).to.not.include({b:2});
- }, "expected { a: 1, b: 2 } to not include { b: 2 }");
- });
-
- it('keys(array)', function(){
- expect({ foo: 1 }).to.have.keys(['foo']);
- expect({ foo: 1, bar: 2 }).to.have.keys(['foo', 'bar']);
- expect({ foo: 1, bar: 2 }).to.have.keys('foo', 'bar');
- expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('foo', 'bar');
- expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('bar', 'foo');
- expect({ foo: 1, bar: 2, baz: 3 }).to.contain.keys('baz');
-
- expect({ foo: 1, bar: 2 }).to.contain.keys('foo');
- expect({ foo: 1, bar: 2 }).to.contain.keys('bar', 'foo');
- expect({ foo: 1, bar: 2 }).to.contain.keys(['foo']);
- expect({ foo: 1, bar: 2 }).to.contain.keys(['bar']);
- expect({ foo: 1, bar: 2 }).to.contain.keys(['bar', 'foo']);
-
- expect({ foo: 1, bar: 2 }).to.not.have.keys('baz');
- expect({ foo: 1, bar: 2 }).to.not.have.keys('foo', 'baz');
- expect({ foo: 1, bar: 2 }).to.not.contain.keys('baz');
- expect({ foo: 1, bar: 2 }).to.not.contain.keys('foo', 'baz');
- expect({ foo: 1, bar: 2 }).to.not.contain.keys('baz', 'foo');
-
- err(function(){
- expect({ foo: 1 }).to.have.keys();
- }, "keys required");
-
- err(function(){
- expect({ foo: 1 }).to.have.keys([]);
- }, "keys required");
-
- err(function(){
- expect({ foo: 1 }).to.not.have.keys([]);
- }, "keys required");
-
- err(function(){
- expect({ foo: 1 }).to.contain.keys([]);
- }, "keys required");
-
- err(function(){
- expect({ foo: 1 }).to.have.keys(['bar']);
- }, "expected { foo: 1 } to have key 'bar'");
-
- err(function(){
- expect({ foo: 1 }).to.have.keys(['bar', 'baz']);
- }, "expected { foo: 1 } to have keys 'bar', and 'baz'");
-
- err(function(){
- expect({ foo: 1 }).to.have.keys(['foo', 'bar', 'baz']);
- }, "expected { foo: 1 } to have keys 'foo', 'bar', and 'baz'");
-
- err(function(){
- expect({ foo: 1 }).to.not.have.keys(['foo']);
- }, "expected { foo: 1 } to not have key 'foo'");
-
- err(function(){
- expect({ foo: 1 }).to.not.have.keys(['foo']);
- }, "expected { foo: 1 } to not have key 'foo'");
-
- err(function(){
- expect({ foo: 1, bar: 2 }).to.not.have.keys(['foo', 'bar']);
- }, "expected { foo: 1, bar: 2 } to not have keys 'foo', and 'bar'");
-
- err(function(){
- expect({ foo: 1 }).to.not.contain.keys(['foo']);
- }, "expected { foo: 1 } to not contain key 'foo'");
-
- err(function(){
- expect({ foo: 1 }).to.contain.keys('foo', 'bar');
- }, "expected { foo: 1 } to contain keys 'foo', and 'bar'");
- });
-
- it('chaining', function(){
- var tea = { name: 'chai', extras: ['milk', 'sugar', 'smile'] };
- expect(tea).to.have.property('extras').with.lengthOf(3);
-
- err(function(){
- expect(tea).to.have.property('extras').with.lengthOf(4);
- }, "expected [ 'milk', 'sugar', 'smile' ] to have a length of 4 but got 3");
-
- expect(tea).to.be.a('object').and.have.property('name', 'chai');
-
- var badFn = function () { throw new Error('testing'); };
-
- expect(badFn).to.throw(Error).with.property('message', 'testing');
- });
-
- it('throw', function () {
- // See GH-45: some poorly-constructed custom errors don't have useful names
- // on either their constructor or their constructor prototype, but instead
- // only set the name inside the constructor itself.
- var PoorlyConstructedError = function () {
- this.name = 'PoorlyConstructedError';
- };
- PoorlyConstructedError.prototype = Object.create(Error.prototype);
-
- function CustomError(message) {
- this.name = 'CustomError';
- this.message = message;
- }
- CustomError.prototype = Error.prototype;
-
- var specificError = new RangeError('boo');
-
- var goodFn = function () { 1==1; }
- , badFn = function () { throw new Error('testing'); }
- , refErrFn = function () { throw new ReferenceError('hello'); }
- , ickyErrFn = function () { throw new PoorlyConstructedError(); }
- , specificErrFn = function () { throw specificError; }
- , customErrFn = function() { throw new CustomError('foo'); };
-
- expect(goodFn).to.not.throw();
- expect(goodFn).to.not.throw(Error);
- expect(goodFn).to.not.throw(specificError);
- expect(badFn).to.throw();
- expect(badFn).to.throw(Error);
- expect(badFn).to.not.throw(ReferenceError);
- expect(badFn).to.not.throw(specificError);
- expect(refErrFn).to.throw();
- expect(refErrFn).to.throw(ReferenceError);
- expect(refErrFn).to.throw(Error);
- expect(refErrFn).to.not.throw(TypeError);
- expect(refErrFn).to.not.throw(specificError);
- expect(ickyErrFn).to.throw();
- expect(ickyErrFn).to.throw(PoorlyConstructedError);
- expect(ickyErrFn).to.throw(Error);
- expect(ickyErrFn).to.not.throw(specificError);
- expect(specificErrFn).to.throw(specificError);
-
- expect(badFn).to.throw(/testing/);
- expect(badFn).to.not.throw(/hello/);
- expect(badFn).to.throw('testing');
- expect(badFn).to.not.throw('hello');
-
- expect(badFn).to.throw(Error, /testing/);
- expect(badFn).to.throw(Error, 'testing');
-
- err(function(){
- expect(goodFn).to.throw();
- }, "expected [Function] to throw an error");
-
- err(function(){
- expect(goodFn).to.throw(ReferenceError);
- }, "expected [Function] to throw ReferenceError");
-
- err(function(){
- expect(goodFn).to.throw(specificError);
- }, "expected [Function] to throw 'RangeError: boo'");
-
- err(function(){
- expect(badFn).to.not.throw();
- }, "expected [Function] to not throw an error but 'Error: testing' was thrown");
-
- err(function(){
- expect(badFn).to.throw(ReferenceError);
- }, "expected [Function] to throw 'ReferenceError' but 'Error: testing' was thrown");
-
- err(function(){
- expect(badFn).to.throw(specificError);
- }, "expected [Function] to throw 'RangeError: boo' but 'Error: testing' was thrown");
-
- err(function(){
- expect(badFn).to.not.throw(Error);
- }, "expected [Function] to not throw 'Error' but 'Error: testing' was thrown");
-
- err(function(){
- expect(refErrFn).to.not.throw(ReferenceError);
- }, "expected [Function] to not throw 'ReferenceError' but 'ReferenceError: hello' was thrown");
-
- err(function(){
- expect(badFn).to.throw(PoorlyConstructedError);
- }, "expected [Function] to throw 'PoorlyConstructedError' but 'Error: testing' was thrown");
-
- err(function(){
- expect(ickyErrFn).to.not.throw(PoorlyConstructedError);
- }, /^(expected \[Function\] to not throw 'PoorlyConstructedError' but)(.*)(PoorlyConstructedError|\{ Object \()(.*)(was thrown)$/);
-
- err(function(){
- expect(ickyErrFn).to.throw(ReferenceError);
- }, /^(expected \[Function\] to throw 'ReferenceError' but)(.*)(PoorlyConstructedError|\{ Object \()(.*)(was thrown)$/);
-
- err(function(){
- expect(specificErrFn).to.throw(new ReferenceError('eek'));
- }, "expected [Function] to throw 'ReferenceError: eek' but 'RangeError: boo' was thrown");
-
- err(function(){
- expect(specificErrFn).to.not.throw(specificError);
- }, "expected [Function] to not throw 'RangeError: boo'");
-
- err(function (){
- expect(badFn).to.not.throw(/testing/);
- }, "expected [Function] to throw error not matching /testing/");
-
- err(function () {
- expect(badFn).to.throw(/hello/);
- }, "expected [Function] to throw error matching /hello/ but got 'testing'");
-
- err(function () {
- expect(badFn).to.throw(Error, /hello/, 'blah');
- }, "blah: expected [Function] to throw error matching /hello/ but got 'testing'");
-
- err(function () {
- expect(badFn).to.throw(Error, 'hello', 'blah');
- }, "blah: expected [Function] to throw error including 'hello' but got 'testing'");
-
- err(function () {
- (customErrFn).should.not.throw();
- }, "expected [Function] to not throw an error but 'CustomError: foo' was thrown");
- });
-
- it('respondTo', function(){
- function Foo(){};
- Foo.prototype.bar = function(){};
- Foo.func = function() {};
-
- var bar = {};
- bar.foo = function(){};
-
- expect(Foo).to.respondTo('bar');
- expect(Foo).to.not.respondTo('foo');
- expect(Foo).itself.to.respondTo('func');
- expect(Foo).itself.not.to.respondTo('bar');
-
- expect(bar).to.respondTo('foo');
-
- err(function(){
- expect(Foo).to.respondTo('baz', 'constructor');
- }, /^(constructor: expected)(.*)(\[Function: Foo\])(.*)(to respond to \'baz\')$/);
-
- err(function(){
- expect(bar).to.respondTo('baz', 'object');
- }, /^(object: expected)(.*)(\{ foo: \[Function\] \}|\{ Object \()(.*)(to respond to \'baz\')$/);
- });
-
- it('satisfy', function(){
- var matcher = function (num) {
- return num === 1;
- };
-
- expect(1).to.satisfy(matcher);
-
- err(function(){
- expect(2).to.satisfy(matcher, 'blah');
- }, "blah: expected 2 to satisfy [Function]");
- });
-
- it('closeTo', function(){
- expect(1.5).to.be.closeTo(1.0, 0.5);
- expect(10).to.be.closeTo(20, 20);
- expect(-10).to.be.closeTo(20, 30);
-
- err(function(){
- expect(2).to.be.closeTo(1.0, 0.5, 'blah');
- }, "blah: expected 2 to be close to 1 +/- 0.5");
-
- err(function(){
- expect(-10).to.be.closeTo(20, 29, 'blah');
- }, "blah: expected -10 to be close to 20 +/- 29");
- });
-
- it('include.members', function() {
- expect([1, 2, 3]).to.include.members([]);
- expect([1, 2, 3]).to.include.members([3, 2]);
- expect([1, 2, 3]).to.not.include.members([8, 4]);
- expect([1, 2, 3]).to.not.include.members([1, 2, 3, 4]);
- });
-
- it('same.members', function() {
- expect([5, 4]).to.have.same.members([4, 5]);
- expect([5, 4]).to.have.same.members([5, 4]);
- expect([5, 4]).to.not.have.same.members([]);
- expect([5, 4]).to.not.have.same.members([6, 3]);
- expect([5, 4]).to.not.have.same.members([5, 4, 2]);
- });
-
- it('members', function() {
- expect([5, 4]).members([4, 5]);
- expect([5, 4]).members([5, 4]);
- expect([5, 4]).not.members([]);
- expect([5, 4]).not.members([6, 3]);
- expect([5, 4]).not.members([5, 4, 2]);
- })
-
-});
diff --git a/tests/lib/chai-1.9.0/test/globalShould.js b/tests/lib/chai-1.9.0/test/globalShould.js
deleted file mode 100644
index 5054da840b..0000000000
--- a/tests/lib/chai-1.9.0/test/globalShould.js
+++ /dev/null
@@ -1,15 +0,0 @@
-describe('global should', function () {
- it('works', function () {
- var theGlobal = typeof window !== 'undefined'
- ? window
- : global;
-
- theGlobal.globalShould = chai.should();
-
- try {
- globalShould.not.exist(undefined);
- } finally {
- delete theGlobal.globalShould;
- }
- });
-});
diff --git a/tests/lib/chai-1.9.0/test/plugins.js b/tests/lib/chai-1.9.0/test/plugins.js
deleted file mode 100644
index c6df554edd..0000000000
--- a/tests/lib/chai-1.9.0/test/plugins.js
+++ /dev/null
@@ -1,24 +0,0 @@
-describe('plugins', function () {
-
- function plugin (chai) {
- if (chai.Assertion.prototype.testing) return;
-
- Object.defineProperty(chai.Assertion.prototype, 'testing', {
- get: function () {
- return 'successful';
- }
- });
- }
-
- it('basic usage', function () {
- chai.use(plugin);
- var expect = chai.expect;
- expect(expect('').testing).to.equal('successful');
- });
-
- it('double plugin', function () {
- chai.expect(function () {
- chai.use(plugin);
- }).to.not.throw();
- });
-});
diff --git a/tests/lib/chai-1.9.0/test/should.js b/tests/lib/chai-1.9.0/test/should.js
deleted file mode 100644
index 26a78beaee..0000000000
--- a/tests/lib/chai-1.9.0/test/should.js
+++ /dev/null
@@ -1,744 +0,0 @@
-describe('should', function() {
- var should = chai.Should();
-
- it('assertion', function(){
- 'test'.should.be.a('string');
- should.equal('foo', 'foo');
- should.not.equal('foo', 'bar');
- });
-
- it('root exist', function () {
- var foo = 'foo'
- , bar = undefined;
- should.exist(foo);
- should.not.exist(bar);
-
- err(function () {
- should.exist(bar, 'blah');
- }, "blah: expected undefined to exist");
-
- err(function () {
- should.not.exist(foo, 'blah');
- }, "blah: expected 'foo' to not exist")
- });
-
- it('root equal', function () {
- var value1 = 'value'
- , value2 = 'value'
- , foo = 'foo';
- should.equal(value1, value2);
- should.not.equal(value1, foo);
-
- err(function () {
- should.equal(value1, foo, 'blah');
- }, "blah: expected 'value' to equal 'foo'");
-
- err(function () {
- should.not.equal(value1, value2, 'blah');
- }, "blah: expected 'value' to not equal 'value'")
- });
-
- it('root Throw', function () {
- should.Throw(function() { throw new Error('error!') }, Error, 'error!');
- should.not.Throw(function () { });
-
- err(function () {
- should.Throw(function () { throw new Error('error!') }, Error, 'needed user!', 'blah');
- }, "blah: expected [Function] to throw error including 'needed user!' but got 'error!'");
-
- err(function () {
- should.not.Throw(function () { throw new Error('error!') }, Error, 'error!', 'blah');
- }, "blah: expected [Function] to not throw 'Error' but 'Error: error!' was thrown");
- });
-
- it('true', function(){
- (true).should.be.true;
- false.should.not.be.true;
- (1).should.not.be.true;false
- false.should.have.been.false;
-
- err(function(){
- 'test'.should.be.true;
- }, "expected 'test' to be true")
- });
-
- it('ok', function(){
- true.should.be.ok;
- false.should.not.be.ok;
- (1).should.be.ok;
- (0).should.not.be.ok;
-
- err(function(){
- ''.should.be.ok;
- }, "expected '' to be truthy");
-
- err(function(){
- 'test'.should.not.be.ok;
- }, "expected 'test' to be falsy");
- });
-
- it('false', function(){
- false.should.be.false;
- true.should.not.be.false;
- (0).should.not.be.false;
-
- err(function(){
- ''.should.be.false;
- }, "expected '' to be false")
- });
-
- it('null', function(){
- (0).should.not.be.null;
-
- err(function(){
- ''.should.be.null;
- }, "expected '' to be null")
- });
-
- it('undefined', function(){
- (0).should.not.be.undefined;
-
- err(function(){
- ''.should.be.undefined;
- }, "expected '' to be undefined")
- });
-
- it('arguments', function(){
- var args = (function(){ return arguments; })(1,2,3);
- args.should.be.arguments;
- [].should.not.be.arguments;
- });
-
- it('.equal()', function(){
- var foo;
- should.equal(undefined, foo);
- });
-
- it('typeof', function(){
- 'test'.should.be.a('string');
-
- err(function(){
- 'test'.should.not.be.a('string');
- }, "expected 'test' not to be a string");
-
- (5).should.be.a('number');
- (new Number(1)).should.be.a('number');
- Number(1).should.be.a('number');
- (true).should.be.a('boolean');
- (new Array()).should.be.a('array');
- (new Object()).should.be.a('object');
- ({}).should.be.a('object');
- ([]).should.be.a('array');
- (function() {}).should.be.a('function');
-
- (5).should.be.a('number');
-
- err(function(){
- (5).should.not.be.a('number');
- }, "expected 5 not to be a number");
- });
-
- it('instanceof', function(){
- function Foo(){}
- new Foo().should.be.an.instanceof(Foo);
-
- err(function(){
- (3).should.an.instanceof(Foo, 'blah');
- }, "blah: expected 3 to be an instance of Foo");
- });
-
- it('within(start, finish)', function(){
- (5).should.be.within(5, 10);
- (5).should.be.within(3,6);
- (5).should.be.within(3,5);
- (5).should.not.be.within(1,3);
-
- err(function(){
- (5).should.not.be.within(4,6, 'blah');
- }, "blah: expected 5 to not be within 4..6");
-
- err(function(){
- (10).should.be.within(50,100, 'blah');
- }, "blah: expected 10 to be within 50..100");
-
- err(function(){
- ({ foo: 1 }).should.have.length.within(50,100, 'blah');
- }, "blah: expected { foo: 1 } to have a property 'length'");
- });
-
- it('above(n)', function(){
- (5).should.be.above(2);
- (5).should.be.greaterThan(2);
- (5).should.not.be.above(5);
- (5).should.not.be.above(6);
-
- err(function(){
- (5).should.be.above(6, 'blah');
- }, "blah: expected 5 to be above 6");
-
- err(function(){
- (10).should.not.be.above(6, 'blah');
- }, "blah: expected 10 to be at most 6");
-
- err(function(){
- ({foo: 1}).should.have.length.above(3, 'blah');
- }, "blah: expected { foo: 1 } to have a property 'length'");
- });
-
- it('least(n)', function(){
- (5).should.be.at.least(5);
- (5).should.not.be.at.least(6);
-
- err(function(){
- (5).should.be.at.least(6, 'blah');
- }, "blah: expected 5 to be at least 6");
-
- err(function(){
- (10).should.not.be.at.least(6, 'blah');
- }, "blah: expected 10 to be below 6");
-
- err(function(){
- ({foo: 1}).should.have.length.of.at.least(3, 'blah');
- }, "blah: expected { foo: 1 } to have a property 'length'");
- });
-
- it('below(n)', function(){
- (2).should.be.below(5);
- (2).should.be.lessThan(5);
- (2).should.not.be.below(2);
- (2).should.not.be.below(1);
-
- err(function(){
- (6).should.be.below(5, 'blah');
- }, "blah: expected 6 to be below 5");
-
- err(function(){
- (6).should.not.be.below(10, 'blah');
- }, "blah: expected 6 to be at least 10");
-
- err(function(){
- ({foo: 1}).should.have.length.below(3, 'blah');
- }, "blah: expected { foo: 1 } to have a property 'length'");
- });
-
- it('most(n)', function(){
- (2).should.be.at.most(2);
- (2).should.not.be.at.most(1);
-
- err(function(){
- (6).should.be.at.most(5, 'blah');
- }, "blah: expected 6 to be at most 5");
-
- err(function(){
- (6).should.not.be.at.most(10, 'blah');
- }, "blah: expected 6 to be above 10");
-
- err(function(){
- ({foo: 1}).should.have.length.of.at.most(3, 'blah');
- }, "blah: expected { foo: 1 } to have a property 'length'");
- });
-
- it('match(regexp)', function(){
- 'foobar'.should.match(/^foo/)
- 'foobar'.should.not.match(/^bar/)
-
- err(function(){
- 'foobar'.should.match(/^bar/i, 'blah')
- }, "blah: expected 'foobar' to match /^bar/i");
-
- err(function(){
- 'foobar'.should.not.match(/^foo/i, 'blah')
- }, "blah: expected 'foobar' not to match /^foo/i");
- });
-
- it('length(n)', function(){
- 'test'.should.have.length(4);
- 'test'.should.not.have.length(3);
- [1,2,3].should.have.length(3);
-
- err(function(){
- (4).should.have.length(3, 'blah');
- }, 'blah: expected 4 to have a property \'length\'');
-
- err(function(){
- 'asd'.should.not.have.length(3, 'blah');
- }, "blah: expected 'asd' to not have a length of 3");
- });
-
- it('eql(val)', function(){
- var a = new Date(1, 2, 3)
- , b = new Date(4, 5, 6);
-
- a.should.eql(a);
- a.should.not.eql(b);
- a.should.not.eql({});
- 'test'.should.eql('test');
- ({ foo: 'bar' }).should.eql({ foo: 'bar' });
- /a/.should.eql(/a/);
- /a/.should.not.eql(/b/);
- /a/.should.not.eql({});
- /a/g.should.eql(/a/g);
- /a/g.should.not.eql(/b/g);
- /a/i.should.eql(/a/i);
- /a/i.should.not.eql(/b/i);
- /a/m.should.eql(/a/m);
- /a/m.should.not.eql(/b/m);
- (1).should.eql(1);
- '4'.should.not.eql(4);
-
- err(function(){
- (4).should.eql(3, 'blah');
- }, 'blah: expected 4 to deeply equal 3');
- });
-
- it('equal(val)', function(){
- 'test'.should.equal('test');
- (1).should.equal(1);
-
- err(function(){
- (4).should.equal(3, 'blah');
- }, 'blah: expected 4 to equal 3');
-
- err(function(){
- '4'.should.equal(4, 'blah');
- }, "blah: expected '4' to equal 4");
- });
-
- it('empty', function(){
- function FakeArgs() {};
- FakeArgs.prototype.length = 0;
-
- ''.should.be.empty;
- 'foo'.should.not.be.empty;
- ([]).should.be.empty;
- (['foo']).should.not.be.empty;
- (new FakeArgs).should.be.empty;
- ({arguments: 0}).should.not.be.empty;
- ({}).should.be.empty;
- ({foo: 'bar'}).should.not.be.empty;
-
- err(function(){
- ''.should.not.be.empty;
- }, "expected \'\' not to be empty");
-
- err(function(){
- 'foo'.should.be.empty;
- }, "expected \'foo\' to be empty");
-
- err(function(){
- ([]).should.not.be.empty;
- }, "expected [] not to be empty");
-
- err(function(){
- (['foo']).should.be.empty;
- }, "expected [ \'foo\' ] to be empty");
-
- err(function(){
- (new FakeArgs).should.not.be.empty;
- }, "expected { length: 0 } not to be empty");
-
- err(function(){
- ({arguments: 0}).should.be.empty;
- }, "expected { arguments: 0 } to be empty");
-
- err(function(){
- ({}).should.not.be.empty;
- }, "expected {} not to be empty");
-
- err(function(){
- ({foo: 'bar'}).should.be.empty;
- }, "expected { foo: \'bar\' } to be empty");
- });
-
- it('property(name)', function(){
- 'test'.should.have.property('length');
- (4).should.not.have.property('length');
-
- err(function(){
- 'asd'.should.have.property('foo');
- }, "expected 'asd' to have a property 'foo'");
- });
-
- it('property(name, val)', function(){
- 'test'.should.have.property('length', 4);
- 'asd'.should.have.property('constructor', String);
-
- err(function(){
- 'asd'.should.have.property('length', 4, 'blah');
- }, "blah: expected 'asd' to have a property 'length' of 4, but got 3");
-
- err(function(){
- 'asd'.should.not.have.property('length', 3, 'blah');
- }, "blah: expected 'asd' to not have a property 'length' of 3");
-
- err(function(){
- 'asd'.should.not.have.property('foo', 3, 'blah');
- }, "blah: 'asd' has no property 'foo'");
-
- err(function(){
- 'asd'.should.have.property('constructor', Number, 'blah');
- }, "blah: expected 'asd' to have a property 'constructor' of [Function: Number], but got [Function: String]");
- });
-
- it('ownProperty(name)', function(){
- 'test'.should.have.ownProperty('length');
- 'test'.should.haveOwnProperty('length');
- ({ length: 12 }).should.have.ownProperty('length');
-
- err(function(){
- ({ length: 12 }).should.not.have.ownProperty('length', 'blah');
- }, "blah: expected { length: 12 } to not have own property 'length'");
- });
-
- it('string()', function(){
- 'foobar'.should.contain.string('bar');
- 'foobar'.should.contain.string('foo');
- 'foobar'.should.not.contain.string('baz');
-
- err(function(){
- (3).should.contain.string('baz', 'blah');
- }, "blah: expected 3 to be a string");
-
- err(function(){
- 'foobar'.should.contain.string('baz', 'blah');
- }, "blah: expected 'foobar' to contain 'baz'");
-
- err(function(){
- 'foobar'.should.not.contain.string('bar', 'blah');
- }, "blah: expected 'foobar' to not contain 'bar'");
- });
-
- it('include()', function(){
- ['foo', 'bar'].should.include('foo');
- ['foo', 'bar'].should.contain('foo');
- ['foo', 'bar'].should.include('bar');
- [1,2].should.include(1);
- ['foo', 'bar'].should.not.include('baz');
- ['foo', 'bar'].should.not.include(1);
- ({a:1,b:2}).should.include({b:2});
- ({a:1,b:2}).should.not.include({b:3});
-
- err(function(){
- ['foo'].should.include('bar', 'blah');
- }, "blah: expected [ 'foo' ] to include 'bar'");
-
- err(function(){
- ['bar', 'foo'].should.not.include('foo', 'blah');
- }, "blah: expected [ 'bar', 'foo' ] to not include 'foo'");
-
- err(function(){
- ({a:1}).should.include({b:2});
- }, "expected { a: 1 } to have a property 'b'")
- });
-
- it('keys(array)', function(){
- ({ foo: 1 }).should.have.keys(['foo']);
- ({ foo: 1, bar: 2 }).should.have.keys(['foo', 'bar']);
- ({ foo: 1, bar: 2 }).should.have.keys('foo', 'bar');
- ({ foo: 1, bar: 2, baz: 3 }).should.include.keys('foo', 'bar');
- ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('bar', 'foo');
- ({ foo: 1, bar: 2, baz: 3 }).should.contain.keys('baz');
-
- ({ foo: 1, bar: 2 }).should.contain.keys('foo');
- ({ foo: 1, bar: 2 }).should.contain.keys('bar', 'foo');
- ({ foo: 1, bar: 2 }).should.contain.keys(['foo']);
- ({ foo: 1, bar: 2 }).should.contain.keys(['bar']);
- ({ foo: 1, bar: 2 }).should.contain.keys(['bar', 'foo']);
-
- ({ foo: 1, bar: 2 }).should.not.have.keys('baz');
- ({ foo: 1, bar: 2 }).should.not.have.keys('foo', 'baz');
- ({ foo: 1, bar: 2 }).should.not.contain.keys('baz');
- ({ foo: 1, bar: 2 }).should.not.contain.keys('foo', 'baz');
- ({ foo: 1, bar: 2 }).should.not.contain.keys('baz', 'foo');
-
- err(function(){
- ({ foo: 1 }).should.have.keys();
- }, "keys required");
-
- err(function(){
- ({ foo: 1 }).should.have.keys([]);
- }, "keys required");
-
- err(function(){
- ({ foo: 1 }).should.not.have.keys([]);
- }, "keys required");
-
- err(function(){
- ({ foo: 1 }).should.contain.keys([]);
- }, "keys required");
-
- err(function(){
- ({ foo: 1 }).should.have.keys(['bar']);
- }, "expected { foo: 1 } to have key 'bar'");
-
- err(function(){
- ({ foo: 1 }).should.have.keys(['bar', 'baz']);
- }, "expected { foo: 1 } to have keys 'bar', and 'baz'");
-
- err(function(){
- ({ foo: 1 }).should.have.keys(['foo', 'bar', 'baz']);
- }, "expected { foo: 1 } to have keys 'foo', 'bar', and 'baz'");
-
- err(function(){
- ({ foo: 1 }).should.not.have.keys(['foo']);
- }, "expected { foo: 1 } to not have key 'foo'");
-
- err(function(){
- ({ foo: 1 }).should.not.have.keys(['foo']);
- }, "expected { foo: 1 } to not have key 'foo'");
-
- err(function(){
- ({ foo: 1, bar: 2 }).should.not.have.keys(['foo', 'bar']);
- }, "expected { foo: 1, bar: 2 } to not have keys 'foo', and 'bar'");
-
- err(function(){
- ({ foo: 1 }).should.not.contain.keys(['foo']);
- }, "expected { foo: 1 } to not contain key 'foo'");
-
- err(function(){
- ({ foo: 1 }).should.contain.keys('foo', 'bar');
- }, "expected { foo: 1 } to contain keys 'foo', and 'bar'");
- });
-
- it('throw', function () {
- // See GH-45: some poorly-constructed custom errors don't have useful names
- // on either their constructor or their constructor prototype, but instead
- // only set the name inside the constructor itself.
- var PoorlyConstructedError = function () {
- this.name = 'PoorlyConstructedError';
- };
- PoorlyConstructedError.prototype = Object.create(Error.prototype);
-
- function CustomError(message) {
- this.name = 'CustomError';
- this.message = message;
- }
- CustomError.prototype = Error.prototype;
-
- var specificError = new RangeError('boo');
-
- var goodFn = function () { 1==1; }
- , badFn = function () { throw new Error('testing'); }
- , stringErrFn = function () { throw 'testing'; }
- , refErrFn = function () { throw new ReferenceError('hello'); }
- , ickyErrFn = function () { throw new PoorlyConstructedError(); }
- , specificErrFn = function () { throw specificError; }
- , customErrFn = function() { throw new CustomError('foo'); };
-
- (goodFn).should.not.throw();
- (goodFn).should.not.throw(Error);
- (goodFn).should.not.throw(specificError);
- (badFn).should.throw();
- (badFn).should.throw(Error);
- (badFn).should.not.throw(ReferenceError);
- (badFn).should.not.throw(specificError);
- (stringErrFn).should.throw();
- (stringErrFn).should.not.throw(ReferenceError);
- (stringErrFn).should.not.throw(specificError);
- (refErrFn).should.throw();
- (refErrFn).should.throw(ReferenceError);
- (refErrFn).should.throw(Error);
- (refErrFn).should.not.throw(TypeError);
- (refErrFn).should.not.throw(specificError);
- (ickyErrFn).should.throw();
- (ickyErrFn).should.throw(PoorlyConstructedError);
- (ickyErrFn).should.throw(Error);
- (ickyErrFn).should.not.throw(specificError);
- (specificErrFn).should.throw(specificError);
-
- (badFn).should.throw(/testing/);
- (badFn).should.throw('testing');
- (badFn).should.not.throw(/hello/);
- (badFn).should.not.throw('hello');
- (badFn).should.throw(Error, /testing/);
- (badFn).should.throw(Error, 'testing');
-
- (stringErrFn).should.throw(/testing/);
- (stringErrFn).should.throw('testing');
- (stringErrFn).should.not.throw(/hello/);
- (stringErrFn).should.not.throw('hello');
-
- should.throw(badFn);
- should.throw(refErrFn, ReferenceError);
- should.throw(refErrFn, Error);
- should.throw(ickyErrFn, PoorlyConstructedError);
- should.throw(specificErrFn, specificError);
- should.not.throw(goodFn);
- should.not.throw(badFn, ReferenceError);
- should.not.throw(badFn, specificError);
-
- should.throw(badFn, Error, /testing/);
- should.throw(badFn, Error, 'testing');
-
- err(function(){
- (goodFn).should.throw();
- }, "expected [Function] to throw an error");
-
- err(function(){
- (goodFn).should.throw(ReferenceError);
- }, "expected [Function] to throw ReferenceError");
-
- err(function(){
- (goodFn).should.throw(specificError);
- }, "expected [Function] to throw 'RangeError: boo'");
-
- err(function(){
- (badFn).should.not.throw();
- }, "expected [Function] to not throw an error but 'Error: testing' was thrown");
-
- err(function(){
- (badFn).should.throw(ReferenceError);
- }, "expected [Function] to throw 'ReferenceError' but 'Error: testing' was thrown");
-
- err(function(){
- (badFn).should.throw(specificError);
- }, "expected [Function] to throw 'RangeError: boo' but 'Error: testing' was thrown");
-
- err(function(){
- (badFn).should.not.throw(Error);
- }, "expected [Function] to not throw 'Error' but 'Error: testing' was thrown");
-
- err(function(){
- (stringErrFn).should.not.throw();
- }, "expected [Function] to not throw an error but 'testing' was thrown");
-
- err(function(){
- (stringErrFn).should.throw(ReferenceError);
- }, "expected [Function] to throw 'ReferenceError' but 'testing' was thrown");
-
- err(function(){
- (stringErrFn).should.throw(specificError);
- }, "expected [Function] to throw 'RangeError: boo' but 'testing' was thrown");
-
- err(function(){
- (stringErrFn).should.not.throw('testing');
- }, "expected [Function] to throw error not including 'testing'");
-
- err(function(){
- (refErrFn).should.not.throw(ReferenceError);
- }, "expected [Function] to not throw 'ReferenceError' but 'ReferenceError: hello' was thrown");
-
- err(function(){
- (badFn).should.throw(PoorlyConstructedError);
- }, "expected [Function] to throw 'PoorlyConstructedError' but 'Error: testing' was thrown")
-
- err(function(){
- (ickyErrFn).should.not.throw(PoorlyConstructedError);
- }, /^(expected \[Function\] to not throw 'PoorlyConstructedError' but)(.*)(PoorlyConstructedError|\{ Object \()(.*)(was thrown)$/);
-
- err(function(){
- (ickyErrFn).should.throw(ReferenceError);
- }, /^(expected \[Function\] to throw 'ReferenceError' but)(.*)(PoorlyConstructedError|\{ Object \()(.*)(was thrown)$/);
-
- err(function(){
- (specificErrFn).should.throw(new ReferenceError('eek'));
- }, "expected [Function] to throw 'ReferenceError: eek' but 'RangeError: boo' was thrown");
-
- err(function(){
- (specificErrFn).should.not.throw(specificError);
- }, "expected [Function] to not throw 'RangeError: boo'");
-
- err(function (){
- (badFn).should.not.throw(/testing/);
- }, "expected [Function] to throw error not matching /testing/");
-
- err(function () {
- (badFn).should.throw(/hello/);
- }, "expected [Function] to throw error matching /hello/ but got \'testing\'");
-
- err(function () {
- (badFn).should.throw(Error, /hello/, 'blah');
- }, "blah: expected [Function] to throw error matching /hello/ but got 'testing'");
-
- err(function () {
- (badFn).should.throw(Error, 'hello', 'blah');
- }, "blah: expected [Function] to throw error including 'hello' but got 'testing'");
-
- err(function () {
- (customErrFn).should.not.throw();
- }, "expected [Function] to not throw an error but 'CustomError: foo' was thrown");
- });
-
- it('respondTo', function(){
- function Foo(){};
- Foo.prototype.bar = function(){};
- Foo.func = function(){};
-
- var bar = {};
- bar.foo = function(){};
-
- Foo.should.respondTo('bar');
- Foo.should.not.respondTo('foo');
- Foo.should.itself.respondTo('func');
- Foo.should.itself.not.respondTo('bar');
-
- bar.should.respondTo('foo');
-
- err(function(){
- Foo.should.respondTo('baz', 'constructor');
- }, /^(constructor: expected)(.*)(\[Function: Foo\])(.*)(to respond to \'baz\')$/);
-
- err(function(){
- bar.should.respondTo('baz', 'object');
- }, /^(object: expected)(.*)(\{ foo: \[Function\] \}|\{ Object \()(.*)(to respond to \'baz\')$/);
- });
-
- it('satisfy', function(){
- var matcher = function (num){
- return num === 1;
- };
-
- (1).should.satisfy(matcher);
-
- err(function(){
- (2).should.satisfy(matcher, 'blah');
- }, "blah: expected 2 to satisfy [Function]");
- });
-
- it('closeTo', function(){
- (1.5).should.be.closeTo(1.0, 0.5);
-
- err(function(){
- (2).should.be.closeTo(1.0, 0.5, 'blah');
- }, "blah: expected 2 to be close to 1 +/- 0.5");
- });
-
- it('include.members', function() {
- [1, 2, 3].should.include.members([3]);
- [1, 2, 3].should.include.members([]);
- [1, 2, 3].should.include.members([2, 1]);
-
- [1, 2, 3].should.not.include.members([999]);
- [].should.not.include.members([23]);
-
- err(function() {
- [].should.include.members([43]);
- }, 'expected [] to be a superset of [ 43 ]');
-
- err(function() {
- [5, 2, 1].should.not.include.members([2]);
- }, 'expected [ 5, 2, 1 ] to not be a superset of [ 2 ]');
-
- err(function() {
- 'foo'.should.include.members([12]);
- }, "expected 'foo' to be an array");
-
- err(function() {
- [1, 2, 3].should.include.members('o');
- }, "expected 'o' to be an array");
- });
-
- it('memberEquals', function() {
- [1, 2, 3].should.have.same.members([3, 2, 1]);
- [5, 4].should.have.same.members([5, 4]);
- [].should.have.same.members([]);
-
- err(function() {
- [1, 2, 3].should.have.same.members([]);
- }, 'expected [ 1, 2, 3 ] to have the same members as []');
-
- err(function() {
- [1, 2, 3].should.have.same.members(4);
- }, 'expected 4 to be an array');
- });
-});
diff --git a/tests/lib/chai-1.9.0/test/utilities.js b/tests/lib/chai-1.9.0/test/utilities.js
deleted file mode 100644
index 4ccc17c431..0000000000
--- a/tests/lib/chai-1.9.0/test/utilities.js
+++ /dev/null
@@ -1,308 +0,0 @@
-describe('utilities', function () {
- var expect = chai.expect;
-
- after(function() {
- // Some clean-up so we can run tests in a --watch
- delete chai.Assertion.prototype.eqqqual;
- delete chai.Assertion.prototype.result;
- delete chai.Assertion.prototype.doesnotexist;
- });
-
- it('_obj', function () {
- var foo = 'bar'
- , test = expect(foo);
-
- expect(test).to.have.property('_obj', foo);
-
- var bar = 'baz';
- test._obj = bar;
-
- expect(test).to.have.property('_obj', bar);
- test.equal(bar);
- });
-
- it('transferFlags', function () {
- var foo = 'bar'
- , test = expect(foo).not;
-
- chai.use(function (_chai, utils) {
- var obj = {};
- utils.transferFlags(test, obj);
- expect(utils.flag(obj, 'object')).to.equal(foo);
- expect(utils.flag(obj, 'negate')).to.equal(true);
- });
- });
-
- it('transferFlags, includeAll = false', function () {
- var foo = 'bar';
-
- chai.use(function (_chai, utils) {
- var obj = {};
- var test = function() {};
-
- var assertion = new chai.Assertion({}, "message", test);
- var flag = {};
- utils.flag(obj, 'flagMe', flag);
- utils.flag(obj, 'negate', true);
- utils.transferFlags(test, obj, false);
-
- expect(utils.flag(obj, 'object')).to.equal(undefined);
- expect(utils.flag(obj, 'message')).to.equal(undefined);
- expect(utils.flag(obj, 'ssfi')).to.equal(undefined);
- expect(utils.flag(obj, 'negate')).to.equal(true);
- expect(utils.flag(obj, 'flagMe')).to.equal(flag);
- });
- });
-
- it('getPathValue', function () {
- var object = {
- hello: 'universe'
- , universe: {
- hello: 'world'
- }
- , world: [ 'hello', 'universe' ]
- , complex: [
- { hello: 'universe' }
- , { universe: 'world' }
- , [ { hello: 'world' } ]
- ]
- }
-
- var arr = [ [ true ] ];
-
- chai.use(function (_chai, utils) {
- var gpv = utils.getPathValue;
- expect(gpv('hello', object)).to.equal('universe');
- expect(gpv('universe.hello', object)).to.equal('world');
- expect(gpv('world[1]', object)).to.equal('universe');
- expect(gpv('complex[1].universe', object)).to.equal('world');
- expect(gpv('complex[2][0].hello', object)).to.equal('world');
- expect(gpv('[0][0]', arr)).to.be.true;
- });
- });
-
- it('addMethod', function () {
- chai.use(function(_chai, utils) {
- expect(_chai.Assertion).to.not.respondTo('eqqqual');
- _chai.Assertion.addMethod('eqqqual', function (str) {
- var object = utils.flag(this, 'object');
- new _chai.Assertion(object).to.be.eql(str);
- });
- expect(_chai.Assertion).to.respondTo('eqqqual');
- });
-
- expect('spec').to.eqqqual('spec');
- });
-
- it('addMethod returning result', function () {
- chai.use(function(_chai, utils) {
- _chai.Assertion.addMethod('result', function () {
- return 'result';
- })
- });
-
- expect(expect('foo').result()).to.equal('result');
- });
-
- it('overwriteMethod', function () {
- chai.use(function (_chai, _) {
- expect(_chai.Assertion).to.respondTo('eqqqual');
- _chai.Assertion.overwriteMethod('eqqqual', function (_super) {
- return function (str) {
- var object = _.flag(this, 'object');
- if (object == 'cucumber' && str == 'cuke') {
- _.flag(this, 'cucumber', true);
- } else {
- _super.apply(this, arguments);
- }
- };
- });
-
- });
-
- var vege = expect('cucumber').to.eqqqual('cucumber');
- expect(vege.__flags).to.not.have.property('cucumber');
- var cuke = expect('cucumber').to.eqqqual('cuke');
- expect(cuke.__flags).to.have.property('cucumber');
-
- chai.use(function (_chai, _) {
- expect(_chai.Assertion).to.not.respondTo('doesnotexist');
- _chai.Assertion.overwriteMethod('doesnotexist', function (_super) {
- expect(_super).to.be.a('function');
- return function () {
- _.flag(this, 'doesnt', true);
- _super.apply(this, arguments);
- }
- });
- });
-
- var dne = expect('something').to.doesnotexist();
- expect(dne.__flags).to.have.property('doesnt');
- });
-
- it('overwriteMethod returning result', function () {
- chai.use(function (_chai, _) {
- _chai.Assertion.overwriteMethod('result', function (_super) {
- return function () {
- return 'result';
- }
- });
- });
-
- expect(expect('foo').result()).to.equal('result');
- });
-
- it('addProperty', function () {
- chai.use(function (_chai, _) {
- _chai.Assertion.addProperty('tea', function () {
- _.flag(this, 'tea', 'chai');
- });
- });
-
- var assert = expect('chai').to.be.tea;
- expect(assert.__flags.tea).to.equal('chai');
- });
-
- it('addProperty returning result', function () {
- chai.use(function(_chai, _) {
- _chai.Assertion.addProperty('result', function () {
- return 'result';
- })
- });
-
- expect(expect('foo').result).to.equal('result');
- });
-
- it('overwriteProperty', function () {
- chai.use(function (_chai, _) {
- expect(new chai.Assertion()).to.have.property('tea');
- _chai.Assertion.overwriteProperty('tea', function (_super) {
- return function () {
- var act = _.flag(this, 'object');
- if (act === 'matcha') {
- _.flag(this, 'tea', 'matcha');
- } else {
- _super.call(this);
- }
- }
- });
- });
-
- var matcha = expect('matcha').to.be.tea;
- expect(matcha.__flags.tea).to.equal('matcha');
- var assert = expect('something').to.be.tea;
- expect(assert.__flags.tea).to.equal('chai');
- });
-
- it('overwriteProperty returning result', function () {
- chai.use(function(_chai, _) {
- _chai.Assertion.overwriteProperty('result', function (_super) {
- return function () {
- return 'result';
- }
- });
- });
-
- expect(expect('foo').result).to.equal('result');
- });
-
- it('getMessage', function () {
- chai.use(function (_chai, _) {
- expect(_.getMessage({}, [])).to.equal('');
- expect(_.getMessage({}, [null, null, null])).to.equal('');
-
- var obj = {};
- _.flag(obj, 'message', 'foo');
- expect(_.getMessage(obj, [])).to.contain('foo');
- });
- });
-
- it('inspect with custom object-returning inspect()s', function () {
- chai.use(function (_chai, _) {
- var obj = {
- outer: {
- inspect: function () {
- return { foo: 'bar' };
- }
- }
- };
-
- expect(_.inspect(obj)).to.equal('{ outer: { foo: \'bar\' } }');
- });
- });
-
- it('addChainableMethod', function () {
- chai.use(function (_chai, _) {
- _chai.Assertion.addChainableMethod('x',
- function () {
- new chai.Assertion(this._obj).to.be.equal('x');
- }
- , function () {
- this._obj = this._obj || {};
- this._obj.__x = 'X!'
- }
- );
-
- expect("foo").x.to.equal("foo");
- expect("x").x();
-
- expect(function () {
- expect("foo").x();
- }).to.throw(_chai.AssertionError);
-
- // Verify whether the original Function properties are present.
- // see https://github.com/chaijs/chai/commit/514dd6ce4#commitcomment-2593383
- var propertyDescriptor = Object.getOwnPropertyDescriptor(chai.Assertion.prototype, "x");
- expect(propertyDescriptor.get).to.have.property("call", Function.prototype.call);
- expect(propertyDescriptor.get).to.have.property("apply", Function.prototype.apply);
- expect(propertyDescriptor.get()).to.have.property("call", Function.prototype.call);
- expect(propertyDescriptor.get()).to.have.property("apply", Function.prototype.apply);
-
- var obj = {};
- expect(obj).x.to.be.ok;
- expect(obj).to.have.property('__x', 'X!');
- })
- });
-
- it('overwriteChainableMethod', function () {
- chai.use(function (_chai, _) {
- _chai.Assertion.overwriteChainableMethod('x',
- function(_super) {
- return function() {
- if (_.flag(this, 'marked')) {
- new chai.Assertion(this._obj).to.be.equal('spot');
- } else {
- _super.apply(this, arguments);
- }
- };
- }
- , function(_super) {
- return function() {
- _.flag(this, 'message', 'x marks the spot');
- _super.apply(this, arguments);
- };
- }
- );
-
- // Make sure the original behavior of 'x' remains the same
- expect('foo').x.to.equal("foo");
- expect("x").x();
- expect(function () {
- expect("foo").x();
- }).to.throw(_chai.AssertionError);
- var obj = {};
- expect(obj).x.to.be.ok;
- expect(obj).to.have.property('__x', 'X!');
-
- // Test the new behavior of 'x'
- var assertion = expect('foo').x.to.be.ok;
- expect(_.flag(assertion, 'message')).to.equal('x marks the spot');
- expect(function () {
- var assertion = expect('x');
- _.flag(assertion, 'marked', true);
- assertion.x()
- }).to.throw(_chai.AssertionError);
- });
- });
-
-});
diff --git a/tests/lib/jsdoc-toolkit/README.txt b/tests/lib/jsdoc-toolkit/README.txt
deleted file mode 100644
index 763e803925..0000000000
--- a/tests/lib/jsdoc-toolkit/README.txt
+++ /dev/null
@@ -1,183 +0,0 @@
-======================================================================
-
-DESCRIPTION:
-
-This is the source code for JsDoc Toolkit, an automatic documentation
-generation tool for JavaScript. It is written in JavaScript and is run
-from a command line (or terminal) using Java and Mozilla's Rhino
-JavaScript runtime engine.
-
-Using this tool you can automatically turn JavaDoc-like comments in
-your JavaScript source code into published output files, such as HTML
-or XML.
-
-For more information, to report a bug, or to browse the technical
-documentation for this tool please visit the official JsDoc Toolkit
-project homepage at http://code.google.com/p/jsdoc-toolkit/
-
-For the most up-to-date documentation on JsDoc Toolkit see the
-official wiki at http://code.google.com/p/jsdoc-toolkit/w/list
-
-======================================================================
-
-REQUIREMENTS:
-
-JsDoc Toolkit is known to work with:
-java version "1.6.0_03"
-Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
-on Windows XP,
-and java version "1.5.0_19"
-Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-304)
-on Mac OS X 10.5.
-
-Other versions of java may or may not work with JsDoc Toolkit.
-
-======================================================================
-
-USAGE:
-
-Running JsDoc Toolkit requires you to have Java installed on your
-computer. For more information see http://www.java.com/getjava/
-
-Before running the JsDoc Toolkit app you should change your current
-working directory to the jsdoc-toolkit folder. Then follow the
-examples below, or as shown on the project wiki.
-
-On a computer running Windows a valid command line to run JsDoc
-Toolkit might look like this:
-
-> java -jar jsrun.jar app\run.js -a -t=templates\jsdoc mycode.js
-
-On Mac OS X or Linux the same command would look like this:
-
-$ java -jar jsrun.jar app/run.js -a -t=templates/jsdoc mycode.js
-
-The above assumes your current working directory contains jsrun.jar,
-the "app" and "templates" subdirectories from the standard JsDoc
-Toolkit distribution and that the relative path to the code you wish
-to document is "mycode.js".
-
-The output documentation files will be saved to a new directory named
-"out" (by default) in the current directory, or if you specify a
--d=somewhere_else option, to the somewhere_else directory.
-
-For help (usage notes) enter this on the command line:
-
-$ java -jar jsrun.jar app/run.js --help
-
-More information about the various command line options used by JsDoc
-Toolkit are available on the project wiki.
-
-======================================================================
-
-RUNNING VIA SHELL SCRIPT
-
-Avi Deitcher has contributed the file jsrun.sh with the following usage notes:
-
-A script to simplify running jsdoc from the command-line, especially when
-running from within a development or build environment such as ant.
-
-Normally, to run jsdoc, you need a command-line as the following:
-java -Djsdoc.dir=/some/long/dir/path/to/jsdoc -jar
-/some/long/dir/path/to/jsdoc/jsrun.jar /some/long/dir/path/to/jsdoc/app/run.js
--t=template -r=4 /some/long/dir/path/to/my/src/code
-
-This can get tedious to redo time and again, and difficult to use from within a build environment.
-
-To simplify the process, jsrun.sh will automatically run this path, as well as passing through any arguments.
-
-Usage: jsrun.sh <run.js arguments>
-
-All <run.js arguments> will be passed through.
-Additionally, jsrun.sh will take the following actions:
-1) If the environment variable JSDOCDIR is set, it will add
-"-Djsdoc.dir=$JSDOCDIR" to the command-line
-2) If the environment variable JSDOCTEMPLATEDIR is set, it will add
-"-Djsdoc.template.dir=$JSDOCTEMPLATEDIR" to the command-line
-3) java with the appropriate path to jsrun.jar and run.js will be instantiated
-
-If not variables are set, it is assumed that the path to jsrun.jar and app/ is in the current working directory.
-
-Example:
-# jsrun.sh ./src/
-Assuming JSDOCDIR=/some/path/to/my/jsdoc will cause the following command to
-execute:
-java -Djsdoc.dir=/some/path/to/my/jsdoc -jar /some/path/to/my/jsdoc/jsrun.jar
-/some/path/to/my/jsdoc/app/run.js ./src/
-
-======================================================================
-
-TESTING:
-
-To run the suite of unit tests included with JsDoc Toolkit enter this
-on the command line:
-
-$ java -jar jsrun.jar app/run.js -T
-
-To see a dump of the internal data structure that JsDoc Toolkit has
-built from your source files use this command:
-
-$ java -jar jsrun.jar app/run.js mycode.js -Z
-
-======================================================================
-
-LICENSE:
-
-JSDoc.pm
-
-This project is based on the JSDoc.pm tool, created by Michael
-Mathews and Gabriel Reid. More information on JsDoc.pm can
-be found on the JSDoc.pm homepage: http://jsdoc.sourceforge.net/
-
-Complete documentation on JsDoc Toolkit can be found on the project
-wiki at http://code.google.com/p/jsdoc-toolkit/w/list
-
-Rhino
-
-Rhino (JavaScript in Java) is open source and licensed by Mozilla
-under the MPL 1.1 or later/GPL 2.0 or later licenses, the text of
-which is available at http://www.mozilla.org/MPL/
-
-You can obtain the source code for Rhino from the Mozilla web site at
-http://www.mozilla.org/rhino/download.html
-
-JsDoc Toolkit is a larger work that uses the Rhino JavaScript engine
-but is not derived from it in any way. The Rhino library is used
-without modification and without any claims whatsoever.
-
-The Rhino Debugger
-
-You can obtain more information about the Rhino Debugger from the
-Mozilla web site at http://www.mozilla.org/rhino/debugger.html
-
-JsDoc Toolkit is a larger work that uses the Rhino Debugger but
-is not derived from it in any way. The Rhino Debugger is used
-without modification and without any claims whatsoever.
-
-JsDoc Toolkit
-
-All code specific to JsDoc Toolkit are free, open source and licensed
-for use under the X11/MIT License.
-
-JsDoc Toolkit is Copyright (c)2009 Michael Mathews <micmath@gmail.com>
-
-This program is free software; you can redistribute it and/or
-modify it under the terms below.
-
-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 must 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.
diff --git a/tests/lib/jsdoc-toolkit/app/frame.js b/tests/lib/jsdoc-toolkit/app/frame.js
deleted file mode 100644
index 1beb405597..0000000000
--- a/tests/lib/jsdoc-toolkit/app/frame.js
+++ /dev/null
@@ -1,33 +0,0 @@
-IO.include("frame/Opt.js");
-IO.include("frame/Chain.js");
-IO.include("frame/Link.js");
-IO.include("frame/String.js");
-IO.include("frame/Hash.js");
-IO.include("frame/Namespace.js");
-//IO.include("frame/Reflection.js");
-
-/** A few helper functions to make life a little easier. */
-
-function defined(o) {
- return (o !== undefined);
-}
-
-function copy(o) { // todo check for circular refs
- if (o == null || typeof(o) != 'object') return o;
- var c = new o.constructor();
- for(var p in o) c[p] = copy(o[p]);
- return c;
-}
-
-function isUnique(arr) {
- var l = arr.length;
- for(var i = 0; i < l; i++ ) {
- if (arr.lastIndexOf(arr[i]) > i) return false;
- }
- return true;
-}
-
-/** Returns the given string with all regex meta characters backslashed. */
-RegExp.escapeMeta = function(str) {
- return str.replace(/([$^\\\/()|?+*\[\]{}.-])/g, "\\$1");
-}
diff --git a/tests/lib/jsdoc-toolkit/app/frame/Chain.js b/tests/lib/jsdoc-toolkit/app/frame/Chain.js
deleted file mode 100644
index a028b5b0c6..0000000000
--- a/tests/lib/jsdoc-toolkit/app/frame/Chain.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/**@constructor*/
-function ChainNode(object, link) {
- this.value = object;
- this.link = link; // describes this node's relationship to the previous node
-}
-
-/**@constructor*/
-function Chain(valueLinks) {
- this.nodes = [];
- this.cursor = -1;
-
- if (valueLinks && valueLinks.length > 0) {
- this.push(valueLinks[0], "//");
- for (var i = 1, l = valueLinks.length; i < l; i+=2) {
- this.push(valueLinks[i+1], valueLinks[i]);
- }
- }
-}
-
-Chain.prototype.push = function(o, link) {
- if (this.nodes.length > 0 && link) this.nodes.push(new ChainNode(o, link));
- else this.nodes.push(new ChainNode(o));
-}
-
-Chain.prototype.unshift = function(o, link) {
- if (this.nodes.length > 0 && link) this.nodes[0].link = link;
- this.nodes.unshift(new ChainNode(o));
- this.cursor++;
-}
-
-Chain.prototype.get = function() {
- if (this.cursor < 0 || this.cursor > this.nodes.length-1) return null;
- return this.nodes[this.cursor];
-}
-
-Chain.prototype.first = function() {
- this.cursor = 0;
- return this.get();
-}
-
-Chain.prototype.last = function() {
- this.cursor = this.nodes.length-1;
- return this.get();
-}
-
-Chain.prototype.next = function() {
- this.cursor++;
- return this.get();
-}
-
-Chain.prototype.prev = function() {
- this.cursor--;
- return this.get();
-}
-
-Chain.prototype.toString = function() {
- var string = "";
- for (var i = 0, l = this.nodes.length; i < l; i++) {
- if (this.nodes[i].link) string += " -("+this.nodes[i].link+")-> ";
- string += this.nodes[i].value.toString();
- }
- return string;
-}
-
-Chain.prototype.joinLeft = function() {
- var result = "";
- for (var i = 0, l = this.cursor; i < l; i++) {
- if (result && this.nodes[i].link) result += this.nodes[i].link;
- result += this.nodes[i].value.toString();
- }
- return result;
-}
-
-/* USAGE:
-
-var path = "one/two/three.four/five-six";
-var pathChain = new Chain(path.split(/([\/.-])/));
-print(pathChain);
-
-var lineage = new Chain();
-lineage.push("Port");
-lineage.push("Les", "son");
-lineage.push("Dawn", "daughter");
-lineage.unshift("Purdie", "son");
-
-print(lineage);
-
-// walk left
-for (var node = lineage.last(); node !== null; node = lineage.prev()) {
- print("< "+node.value);
-}
-
-// walk right
-var node = lineage.first()
-while (node !== null) {
- print(node.value);
- node = lineage.next();
- if (node && node.link) print("had a "+node.link+" named");
-}
-
-*/ \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/frame/Dumper.js b/tests/lib/jsdoc-toolkit/app/frame/Dumper.js
deleted file mode 100644
index 731cd33453..0000000000
--- a/tests/lib/jsdoc-toolkit/app/frame/Dumper.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- * @class
-<pre>
-This is a lightly modified version of Kevin Jones' JavaScript
-library Data.Dump. To download the original visit:
- <a href="http://openjsan.org/doc/k/ke/kevinj/Data/Dump/">http://openjsan.org/doc/k/ke/kevinj/Data/Dump/</a>
-
-AUTHORS
-
-The Data.Dump JavaScript module is written by Kevin Jones
-(kevinj@cpan.org), based on Data::Dump by Gisle Aas (gisle@aas.no),
-based on Data::Dumper by Gurusamy Sarathy (gsar@umich.edu).
-
-COPYRIGHT
-
-Copyright 2007 Kevin Jones. Copyright 1998-2000,2003-2004 Gisle Aas.
-Copyright 1996-1998 Gurusamy Sarathy.
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the Perl Artistic License
-
-See http://www.perl.com/perl/misc/Artistic.html
-</pre>
- * @static
- */
-Dumper = {
- /** @param [...] The objects to dump. */
- dump: function () {
- if (arguments.length > 1)
- return this._dump(arguments);
- else if (arguments.length == 1)
- return this._dump(arguments[0]);
- else
- return "()";
- },
-
- _dump: function (obj) {
- if (typeof obj == 'undefined') return 'undefined';
- var out;
- if (obj.serialize) { return obj.serialize(); }
- var type = this._typeof(obj);
- if (obj.circularReference) obj.circularReference++;
- switch (type) {
- case 'circular':
- out = "{ //circularReference\n}";
- break;
- case 'object':
- var pairs = new Array;
-
- for (var prop in obj) {
- if (prop != "circularReference" && obj.hasOwnProperty(prop)) { //hide inherited properties
- pairs.push(prop + ': ' + this._dump(obj[prop]));
- }
- }
-
- out = '{' + this._format_list(pairs) + '}';
- break;
-
- case 'string':
- for (var prop in Dumper.ESC) {
- if (Dumper.ESC.hasOwnProperty(prop)) {
- obj = obj.replace(prop, Dumper.ESC[prop]);
- }
- }
-
- // Escape UTF-8 Strings
- if (obj.match(/^[\x00-\x7f]*$/)) {
- out = '"' + obj.replace(/\"/g, "\\\"").replace(/([\n\r]+)/g, "\\$1") + '"';
- }
- else {
- out = "unescape('"+escape(obj)+"')";
- }
- break;
-
- case 'array':
- var elems = new Array;
-
- for (var i=0; i<obj.length; i++) {
- elems.push( this._dump(obj[i]) );
- }
-
- out = '[' + this._format_list(elems) + ']';
- break;
-
- case 'date':
- // firefox returns GMT strings from toUTCString()...
- var utc_string = obj.toUTCString().replace(/GMT/,'UTC');
- out = 'new Date("' + utc_string + '")';
- break;
-
- case 'element':
- // DOM element
- out = this._dump_dom(obj);
- break;
-
- default:
- out = obj;
- }
-
- out = String(out).replace(/\n/g, '\n ');
- out = out.replace(/\n (.*)$/,"\n$1");
-
- return out;
- },
-
- _format_list: function (list) {
- if (!list.length) return '';
- var nl = list.toString().length > 60 ? '\n' : ' ';
- return nl + list.join(',' + nl) + nl;
- },
-
- _typeof: function (obj) {
- if (obj && obj.circularReference && obj.circularReference > 1) return 'circular';
- if (Array.prototype.isPrototypeOf(obj)) return 'array';
- if (Date.prototype.isPrototypeOf(obj)) return 'date';
- if (typeof obj.nodeType != 'undefined') return 'element';
- return typeof(obj);
- },
-
- _dump_dom: function (obj) {
- return '"' + Dumper.nodeTypes[obj.nodeType] + '"';
- }
-};
-
-Dumper.ESC = {
- "\t": "\\t",
- "\n": "\\n",
- "\f": "\\f"
-};
-
-Dumper.nodeTypes = {
- 1: "ELEMENT_NODE",
- 2: "ATTRIBUTE_NODE",
- 3: "TEXT_NODE",
- 4: "CDATA_SECTION_NODE",
- 5: "ENTITY_REFERENCE_NODE",
- 6: "ENTITY_NODE",
- 7: "PROCESSING_INSTRUCTION_NODE",
- 8: "COMMENT_NODE",
- 9: "DOCUMENT_NODE",
- 10: "DOCUMENT_TYPE_NODE",
- 11: "DOCUMENT_FRAGMENT_NODE",
- 12: "NOTATION_NODE"
-}; \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/frame/Hash.js b/tests/lib/jsdoc-toolkit/app/frame/Hash.js
deleted file mode 100644
index fa60d87476..0000000000
--- a/tests/lib/jsdoc-toolkit/app/frame/Hash.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- @constructor
- @example
- var _index = new Hash();
- _index.set("a", "apple");
- _index.set("b", "blue");
- _index.set("c", "coffee");
-
- for (var p = _index.first(); p; p = _index.next()) {
- print(p.key+" is for "+p.value);
- }
-
- */
-var Hash = function() {
- this._map = {};
- this._keys = [];
- this._vals = [];
- this.reset();
-}
-
-Hash.prototype.set = function(k, v) {
- if (k != "") {
- this._keys.push(k);
- this._map["="+k] = this._vals.length;
- this._vals.push(v);
- }
-}
-
-Hash.prototype.replace = function(k, k2, v) {
- if (k == k2) return;
-
- var offset = this._map["="+k];
- this._keys[offset] = k2;
- if (typeof v != "undefined") this._vals[offset] = v;
- this._map["="+k2] = offset;
- delete(this._map["="+k]);
-}
-
-Hash.prototype.drop = function(k) {
- if (k != "") {
- var offset = this._map["="+k];
- this._keys.splice(offset, 1);
- this._vals.splice(offset, 1);
- delete(this._map["="+k]);
- for (var p in this._map) {
- if (this._map[p] >= offset) this._map[p]--;
- }
- if (this._cursor >= offset && this._cursor > 0) this._cursor--;
- }
-}
-
-Hash.prototype.get = function(k) {
- if (k != "") {
- return this._vals[this._map["="+k]];
- }
-}
-
-Hash.prototype.keys = function() {
- return this._keys;
-}
-
-Hash.prototype.hasKey = function(k) {
- if (k != "") {
- return (typeof this._map["="+k] != "undefined");
- }
-}
-
-Hash.prototype.values = function() {
- return this._vals;
-}
-
-Hash.prototype.reset = function() {
- this._cursor = 0;
-}
-
-Hash.prototype.first = function() {
- this.reset();
- return this.next();
-}
-
-Hash.prototype.next = function() {
- if (this._cursor++ < this._keys.length)
- return {key: this._keys[this._cursor-1], value: this._vals[this._cursor-1]};
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/frame/Link.js b/tests/lib/jsdoc-toolkit/app/frame/Link.js
deleted file mode 100644
index f0020a13ea..0000000000
--- a/tests/lib/jsdoc-toolkit/app/frame/Link.js
+++ /dev/null
@@ -1,173 +0,0 @@
-/** Handle the creation of HTML links to documented symbols.
- @constructor
-*/
-function Link() {
- this.alias = "";
- this.src = "";
- this.file = "";
- this.text = "";
- this.innerName = "";
- this.classLink = false;
- this.targetName = "";
-
- this.target = function(targetName) {
- if (defined(targetName)) this.targetName = targetName;
- return this;
- }
- this.inner = function(inner) {
- if (defined(inner)) this.innerName = inner;
- return this;
- }
- this.withText = function(text) {
- if (defined(text)) this.text = text;
- return this;
- }
- this.toSrc = function(filename) {
- if (defined(filename)) this.src = filename;
- return this;
- }
- this.toSymbol = function(alias) {
- if (defined(alias)) this.alias = new String(alias);
- return this;
- }
- this.toClass = function(alias) {
- this.classLink = true;
- return this.toSymbol(alias);
- }
- this.toFile = function(file) {
- if (defined(file)) this.file = file;
- return this;
- }
-
- this.toString = function() {
- var linkString;
- var thisLink = this;
-
- if (this.alias) {
- linkString = this.alias.replace(/(^|[^a-z$0-9_#.:^-])([|a-z$0-9_#.:^-]+)($|[^a-z$0-9_#.:^-])/i,
- function(match, prematch, symbolName, postmatch) {
- var symbolNames = symbolName.split("|");
- var links = [];
- for (var i = 0, l = symbolNames.length; i < l; i++) {
- thisLink.alias = symbolNames[i];
- links.push(thisLink._makeSymbolLink(symbolNames[i]));
- }
- return prematch+links.join("|")+postmatch;
- }
- );
- }
- else if (this.src) {
- linkString = thisLink._makeSrcLink(this.src);
- }
- else if (this.file) {
- linkString = thisLink._makeFileLink(this.file);
- }
-
- return linkString;
- }
-}
-
-/** prefixed for hashes */
-Link.hashPrefix = "";
-
-/** Appended to the front of relative link paths. */
-Link.base = "";
-
-Link.symbolNameToLinkName = function(symbol) {
- var linker = "",
- ns = "";
-
- if (symbol.isStatic) linker = ".";
- else if (symbol.isInner) linker = "-";
-
- if (symbol.isEvent && !/^event:/.test(symbol.name)) {
- ns = "event:";
- }
- return Link.hashPrefix+linker+ns+symbol.name;
-}
-
-Link.getSymbol= function(alias) {
- var symbol= Link.symbolSet.getSymbol(alias);
-
- if (symbol)
- return symbol;
-
- if ('#'!==alias.charAt(0) || !Link.currentSymbol)
- return null;
-
- // resolve relative name
- var container= Link.currentSymbol;
-
- while (container)
- {
- symbol= Link.symbolSet.getSymbol(container.alias + alias);
- if (symbol)
- return symbol;
-
- // No superclass
- if (!container.augments.length)
- return null;
-
- container= Link.symbolSet.getSymbol(container.augments[0].desc);
- }
-
- return null;
-}
-
-/** Create a link to another symbol. */
-Link.prototype._makeSymbolLink = function(alias) {
- var linkBase = Link.base+publish.conf.symbolsDir;
- var linkTo = Link.getSymbol(alias);
- var linkPath;
- var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
-
- // if there is no symbol by that name just return the name unaltered
- if (!linkTo)
- return this.text || alias;
-
- // it's a symbol in another file
- else {
- if (!linkTo.is("CONSTRUCTOR") && !linkTo.isNamespace) { // it's a method or property
- linkPath= (Link.filemap) ? Link.filemap[linkTo.memberOf] :
- escape(linkTo.memberOf) || "_global_";
- linkPath += publish.conf.ext + "#" + Link.symbolNameToLinkName(linkTo);
- }
- else {
- linkPath = (Link.filemap)? Link.filemap[linkTo.alias] : escape(linkTo.alias);
- linkPath += publish.conf.ext;// + (this.classLink? "":"#" + Link.hashPrefix + "constructor");
- }
- linkPath = linkBase + linkPath
- }
-
- var linkText= this.text || alias;
-
- var link = {linkPath: linkPath, linkText: linkText, linkInner: (this.innerName? "#"+this.innerName : "")};
-
- if (typeof JSDOC.PluginManager != "undefined") {
- JSDOC.PluginManager.run("onSymbolLink", link);
- }
-
- return "<a href=\""+link.linkPath+link.linkInner+"\""+target+">"+link.linkText+"</a>";
-}
-
-/** Create a link to a source file. */
-Link.prototype._makeSrcLink = function(srcFilePath) {
- var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
-
- // transform filepath into a filename
- var srcFile = srcFilePath.replace(/\.\.?[\\\/]/g, "").replace(/[:\\\/]/g, "_");
- var outFilePath = Link.base + publish.conf.srcDir + srcFile + publish.conf.ext;
-
- if (!this.text) this.text = FilePath.fileName(srcFilePath);
- return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
-}
-
-/** Create a link to a source file. */
-Link.prototype._makeFileLink = function(filePath) {
- var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
-
- var outFilePath = Link.base + filePath;
-
- if (!this.text) this.text = filePath;
- return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/frame/Namespace.js b/tests/lib/jsdoc-toolkit/app/frame/Namespace.js
deleted file mode 100644
index 9ea2adb197..0000000000
--- a/tests/lib/jsdoc-toolkit/app/frame/Namespace.js
+++ /dev/null
@@ -1,10 +0,0 @@
-_global_ = this;
-
-function Namespace(name, f) {
- var n = name.split(".");
- for (var o = _global_, i = 0, l = n.length; i < l; i++) {
- o = o[n[i]] = o[n[i]] || {};
- }
-
- if (f) f();
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/frame/Opt.js b/tests/lib/jsdoc-toolkit/app/frame/Opt.js
deleted file mode 100644
index bca4ee7ab3..0000000000
--- a/tests/lib/jsdoc-toolkit/app/frame/Opt.js
+++ /dev/null
@@ -1,134 +0,0 @@
-/** @namespace */
-Opt = {
- /**
- * Get commandline option values.
- * @param {Array} args Commandline arguments. Like ["-a=xml", "-b", "--class=new", "--debug"]
- * @param {object} optNames Map short names to long names. Like {a:"accept", b:"backtrace", c:"class", d:"debug"}.
- * @return {object} Short names and values. Like {a:"xml", b:true, c:"new", d:true}
- */
- get: function(args, optNames) {
- var opt = {"_": []}; // the unnamed option allows multiple values
- for (var i = 0; i < args.length; i++) {
- var arg = new String(args[i]);
- var name;
- var value;
- if (arg.charAt(0) == "-") {
- if (arg.charAt(1) == "-") { // it's a longname like --foo
- arg = arg.substring(2);
- var m = arg.split("=");
- name = m.shift();
- value = m.shift();
- if (typeof value == "undefined") value = true;
-
- for (var n in optNames) { // convert it to a shortname
- if (name == optNames[n]) {
- name = n;
- }
- }
- }
- else { // it's a shortname like -f
- arg = arg.substring(1);
- var m = arg.split("=");
- name = m.shift();
- value = m.shift();
- if (typeof value == "undefined") value = true;
-
- for (var n in optNames) { // find the matching key
- if (name == n || name+'[]' == n) {
- name = n;
- break;
- }
- }
- }
- if (name.match(/(.+)\[\]$/)) { // it's an array type like n[]
- name = RegExp.$1;
- if (!opt[name]) opt[name] = [];
- }
-
- if (opt[name] && opt[name].push) {
- opt[name].push(value);
- }
- else {
- opt[name] = value;
- }
- }
- else { // not associated with any optname
- opt._.push(args[i]);
- }
- }
- return opt;
- }
-}
-
-/*t:
- plan(11, "Testing Opt.");
-
- is(
- typeof Opt,
- "object",
- "Opt is an object."
- );
-
- is(
- typeof Opt.get,
- "function",
- "Opt.get is a function."
- );
-
- var optNames = {a:"accept", b:"backtrace", c:"class", d:"debug", "e[]":"exceptions"};
- var t_options = Opt.get(["-a=xml", "-b", "--class=new", "--debug", "-e=one", "-e=two", "foo", "bar"], optNames);
-
- is(
- t_options.a,
- "xml",
- "an option defined with a short name can be accessed by its short name."
- );
-
- is(
- t_options.b,
- true,
- "an option defined with a short name and no value are true."
- );
-
- is(
- t_options.c,
- "new",
- "an option defined with a long name can be accessed by its short name."
- );
-
- is(
- t_options.d,
- true,
- "an option defined with a long name and no value are true."
- );
-
- is(
- typeof t_options.e,
- "object",
- "an option that can accept multiple values is defined."
- );
-
- is(
- t_options.e.length,
- 2,
- "an option that can accept multiple values can have more than one value."
- );
-
- is(
- t_options.e[1],
- "two",
- "an option that can accept multiple values can be accessed as an array."
- );
-
- is(
- typeof t_options._,
- "object",
- "the property '_' is defined for unnamed options."
- );
-
- is(
- t_options._[0],
- "foo",
- "the property '_' can be accessed as an array."
- );
- */ \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/frame/Reflection.js b/tests/lib/jsdoc-toolkit/app/frame/Reflection.js
deleted file mode 100644
index 0968f1c640..0000000000
--- a/tests/lib/jsdoc-toolkit/app/frame/Reflection.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/**@constructor*/
-function Reflection(obj) {
- this.obj = obj;
-}
-
-Reflection.prototype.getConstructorName = function() {
- if (this.obj.constructor.name) return this.obj.constructor.name;
- var src = this.obj.constructor.toSource();
- var name = src.substring(name.indexOf("function")+8, src.indexOf('(')).replace(/ /g,'');
- return name;
-}
-
-Reflection.prototype.getMethod = function(name) {
- for (var p in this.obj) {
- if (p == name && typeof(this.obj[p]) == "function") return this.obj[p];
- }
- return null;
-}
-
-Reflection.prototype.getParameterNames = function() {
- var src = this.obj.toSource();
- src = src.substring(
- src.indexOf("(", 8)+1, src.indexOf(")")
- );
- return src.split(/, ?/);
-}
diff --git a/tests/lib/jsdoc-toolkit/app/frame/String.js b/tests/lib/jsdoc-toolkit/app/frame/String.js
deleted file mode 100644
index 837a36623e..0000000000
--- a/tests/lib/jsdoc-toolkit/app/frame/String.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- @name String
- @class Additions to the core string object.
-*/
-
-/** @author Steven Levithan, released as public domain. */
-String.prototype.trim = function() {
- var str = this.replace(/^\s+/, '');
- for (var i = str.length - 1; i >= 0; i--) {
- if (/\S/.test(str.charAt(i))) {
- str = str.substring(0, i + 1);
- break;
- }
- }
- return str;
-}
-/*t:
- plan(6, "Testing String.prototype.trim.");
-
- var s = " a bc ".trim();
- is(s, "a bc", "multiple spaces front and back are trimmed.");
-
- s = "a bc\n\n".trim();
- is(s, "a bc", "newlines only in back are trimmed.");
-
- s = "\ta bc".trim();
- is(s, "a bc", "tabs only in front are trimmed.");
-
- s = "\n \t".trim();
- is(s, "", "an all-space string is trimmed to empty.");
-
- s = "a b\nc".trim();
- is(s, "a b\nc", "a string with no spaces in front or back is trimmed to itself.");
-
- s = "".trim();
- is(s, "", "an empty string is trimmed to empty.");
-
-*/
-
-String.prototype.balance = function(open, close) {
- var i = 0;
- while (this.charAt(i) != open) {
- if (i == this.length) return [-1, -1];
- i++;
- }
-
- var j = i+1;
- var balance = 1;
- while (j < this.length) {
- if (this.charAt(j) == open) balance++;
- if (this.charAt(j) == close) balance--;
- if (balance == 0) break;
- j++;
- if (j == this.length) return [-1, -1];
- }
-
- return [i, j];
-}
-/*t:
- plan(16, "Testing String.prototype.balance.");
-
- var s = "{abc}".balance("{","}");
- is(s[0], 0, "opener in first is found.");
- is(s[1], 4, "closer in last is found.");
-
- s = "ab{c}de".balance("{","}");
- is(s[0], 2, "opener in middle is found.");
- is(s[1], 4, "closer in middle is found.");
-
- s = "a{b{c}de}f".balance("{","}");
- is(s[0], 1, "nested opener is found.");
- is(s[1], 8, "nested closer is found.");
-
- s = "{}".balance("{","}");
- is(s[0], 0, "opener with no content is found.");
- is(s[1], 1, "closer with no content is found.");
-
- s = "".balance("{","}");
- is(s[0], -1, "empty string opener is -1.");
- is(s[1], -1, "empty string closer is -1.");
-
- s = "{abc".balance("{","}");
- is(s[0], -1, "opener with no closer returns -1.");
- is(s[1], -1, "no closer returns -1.");
-
- s = "abc".balance("{","}");
- is(s[0], -1, "no opener or closer returns -1 for opener.");
- is(s[1], -1, "no opener or closer returns -1 for closer.");
-
- s = "a<bc}de".balance("<","}");
- is(s[0], 1, "unmatching opener is found.");
- is(s[1], 4, "unmatching closer is found.");
-*/ \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/frame/Testrun.js b/tests/lib/jsdoc-toolkit/app/frame/Testrun.js
deleted file mode 100644
index acd5ca6845..0000000000
--- a/tests/lib/jsdoc-toolkit/app/frame/Testrun.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * @fileOverview
- * @name JsTestrun
- * @author Michael Mathews micmath@gmail.com
- * @url $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-2.4.0/jsdoc-toolkit/app/frame/Testrun.js $
- * @revision $Id: Testrun.js 418 2008-01-15 21:40:33Z micmath $
- * @license <a href="http://en.wikipedia.org/wiki/MIT_License">X11/MIT License</a>
- * (See the accompanying README file for full details.)
- */
-
-/**
- Yet another unit testing tool for JavaScript.
- @author Michael Mathews <a href="mailto:micmath@gmail.com">micmath@gmail.com</a>
- @param {object} testCases Properties are testcase names, values are functions to execute as tests.
-*/
-function testrun(testCases) {
- var ran = 0;
- for (t in testCases) {
- var result = testCases[t]();
- ran++;
- }
-
- return testrun.reportOut+"-------------------------------\n"+((testrun.fails>0)? ":( Failed "+testrun.fails+"/" : ":) Passed all ")+testrun.count+" test"+((testrun.count == 1)? "":"s")+".\n";
-}
-
-testrun.count = 0;
-testrun.current = null;
-testrun.passes = 0;
-testrun.fails = 0;
-testrun.reportOut = "";
-
-/** @private */
-testrun.report = function(text) {
- testrun.reportOut += text+"\n";
-}
-
-/**
- Check if test evaluates to true.
- @param {string} test To be evaluated.
- @param {string} message Optional. To be displayed in the report.
- @return {boolean} True if the string test evaluates to true.
-*/
-ok = function(test, message) {
- testrun.count++;
-
- var result;
- try {
- result = eval(test);
-
- if (result) {
- testrun.passes++;
- testrun.report(" OK "+testrun.count+" - "+((message != null)? message : ""));
- }
- else {
- testrun.fails++;
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
- }
- }
- catch(e) {
- testrun.fails++
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
-
- }
-}
-
-/**
- Check if test is same as expected.
- @param {string} test To be evaluated.
- @param {string} expected
- @param {string} message Optional. To be displayed in the report.
- @return {boolean} True if (test == expected). Note that the comparison is not a strict equality check.
-*/
-is = function(test, expected, message) {
- testrun.count++;
-
- var result;
- try {
- result = eval(test);
-
- if (result == expected) {
- testrun.passes++
- testrun.report(" OK "+testrun.count+" - "+((message != null)? message : ""));
- }
- else {
- testrun.fails++
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
- testrun.report("expected: "+expected);
- testrun.report(" got: "+result);
- }
- }
- catch(e) {
- testrun.fails++
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
- testrun.report("expected: "+expected);
- testrun.report(" got: "+result);}
-}
-
-/**
- Check if test matches pattern.
- @param {string} test To be evaluated.
- @param {string} pattern Used to create a RegExp.
- @param {string} message Optional. To be displayed in the report.
- @return {boolean} True if test matches pattern.
-*/
-like = function(test, pattern, message) {
- testrun.count++;
-
- var result;
- try {
- result = eval(test);
- var rgx = new RegExp(pattern);
-
- if (rgx.test(result)) {
- testrun.passes++
- testrun.report(" OK "+testrun.count+" - "+((message != null)? message : ""));
- }
- else {
- testrun.fails++
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
- testrun.report(" this: "+result);
- testrun.report("is not like: "+pattern);
- }
- }
- catch(e) {
- testrun.fails++
- testrun.report("NOT OK "+testrun.count+" - "+((message != null)? message : ""));
- }
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/handlers/FOODOC.js b/tests/lib/jsdoc-toolkit/app/handlers/FOODOC.js
deleted file mode 100644
index c845b1859f..0000000000
--- a/tests/lib/jsdoc-toolkit/app/handlers/FOODOC.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- This is the main container for the FOODOC handler.
- @namespace
-*/
-FOODOC = {
-};
-
-/** The current version string of this application. */
-FOODOC.VERSION = "1.0";
-
-FOODOC.handle = function(srcFile, src) {
- LOG.inform("Handling file '" + srcFile + "'");
-
- return [
- new JSDOC.Symbol(
- "foo",
- [],
- "VIRTUAL",
- new JSDOC.DocComment("/** This is a foo. */")
- )
- ];
-};
-
-FOODOC.publish = function(symbolgroup) {
- LOG.inform("Publishing symbolgroup.");
-};
diff --git a/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC.js b/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC.js
deleted file mode 100644
index e777d03e7f..0000000000
--- a/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * This is the main container for the XMLDOC handler.
- * @namespace
- * @author Brett Fattori (bfattori@fry.com)
- * @version $Revision: 498 $
- */
-XMLDOC = {
-
-};
-
-/** The current version string of this application. */
-XMLDOC.VERSION = "1.0";
-
-/** Include the library necessary to handle XML files */
-IO.includeDir("handlers/XMLDOC/");
-
-/**
- * @type Symbol[]
- */
-XMLDOC.handle = function(srcFile, src) {
-
-};
-
-XMLDOC.publish = function(symbolgroup) {
-
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js b/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js
deleted file mode 100644
index 240563dafd..0000000000
--- a/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js
+++ /dev/null
@@ -1,159 +0,0 @@
-LOG.inform("XMLDOC.DomReader loaded");
-
-XMLDOC.DomReader = function(root) {
-
- this.dom = root;
-
- /**
- * The current node the reader is on
- */
- this.node = root;
-
- /**
- * Get the current node the reader is on
- * @type XMLDOC.Parser.node
- */
- XMLDOC.DomReader.prototype.getNode = function() {
- return this.node;
- };
-
- /**
- * Set the node the reader should be positioned on.
- * @param node {XMLDOC.Parser.node}
- */
- XMLDOC.DomReader.prototype.setNode = function(node) {
- this.node = node;
- };
-
- /**
- * A helper method to make sure the current node will
- * never return null, unless null is passed as the root.
- * @param step {String} An expression to evaluate - should return a node or null
- */
- XMLDOC.DomReader.prototype.navigate = function(step) {
- var n;
- if ((n = step) != null)
- {
- this.node = n;
- return this.node;
- }
- return null;
- };
-
- /**
- * Get the root node of the current node's document.
- */
- XMLDOC.DomReader.prototype.root = function() {
- this.navigate(this.dom);
- };
-
- /**
- * Get the parent of the current node.
- */
- XMLDOC.DomReader.prototype.parent = function() {
- return this.navigate(this.node.parentNode());
- };
-
- /**
- * Get the first child of the current node.
- */
- XMLDOC.DomReader.prototype.firstChild = function() {
- return this.navigate(this.node.firstChild());
- };
-
- /**
- * Get the last child of the current node.
- */
- XMLDOC.DomReader.prototype.lastChild = function() {
- return this.navigate(this.node.lastChild());
- };
-
- /**
- * Get the next sibling of the current node.
- */
- XMLDOC.DomReader.prototype.nextSibling = function() {
- return this.navigate(this.node.nextSibling());
- };
-
- /**
- * Get the previous sibling of the current node.
- */
- XMLDOC.DomReader.prototype.prevSibling = function() {
- return this.navigate(this.node.prevSibling());
- };
-
- //===============================================================================================
- // Support methods
-
- /**
- * Walk the tree starting with the current node, calling the plug-in for
- * each node visited. Each time the plug-in is called, the DomReader
- * is passed as the only parameter. Use the {@link XMLDOC.DomReader#getNode} method
- * to access the current node. <i>This method uses a depth first traversal pattern.</i>
- *
- * @param srcFile {String} The source file being evaluated
- */
- XMLDOC.DomReader.prototype.getSymbols = function(srcFile)
- {
- XMLDOC.DomReader.symbols = [];
- XMLDOC.DomReader.currentFile = srcFile;
- JSDOC.Symbol.srcFile = (srcFile || "");
-
- if (defined(JSDOC.PluginManager)) {
- JSDOC.PluginManager.run("onDomGetSymbols", this);
- }
-
- return XMLDOC.DomReader.symbols;
- };
-
- /**
- * Find the node with the given name using a depth first traversal.
- * Does not modify the DomReader's current node.
- *
- * @param name {String} The name of the node to find
- * @return the node that was found, or null if not found
- */
- XMLDOC.DomReader.prototype.findNode = function(name)
- {
- var findNode = null;
-
- // Start at the current node and move into the subtree,
- // looking for the node with the given name
- function deeper(node, find)
- {
- var look = null;
-
- if (node) {
- if (node.name == find)
- {
- return node;
- }
-
- if (node.firstChild())
- {
- look = deeper(node.firstChild(), find);
- }
-
- if (!look && node.nextSibling())
- {
- look = deeper(node.nextSibling(), find);
- }
- }
-
- return look;
- }
-
- return deeper(this.getNode().firstChild(), name);
- };
-
- /**
- * Find the next node with the given name using a depth first traversal.
- *
- * @param name {String} The name of the node to find
- */
- XMLDOC.DomReader.prototype.findPreviousNode = function(name)
- {
- };
-
-};
-
diff --git a/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js b/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js
deleted file mode 100644
index e9b3e3ce89..0000000000
--- a/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js
+++ /dev/null
@@ -1,16 +0,0 @@
-LOG.inform("XMLDOC.symbolize loaded");
-
-/**
- * Convert the source file to a set of symbols
- */
-XMLDOC.symbolize = function(srcFile, src) {
-
- LOG.inform("Symbolizing file '" + srcFile + "'");
-
- // XML files already have a defined structure, so we don't need to
- // do anything but parse them. The DOM reader can create a symbol
- // table from the parsed XML.
- var dr = new XMLDOC.DomReader(XMLDOC.Parser.parse(src));
- return dr.getSymbols(srcFile);
-
-};
diff --git a/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js b/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js
deleted file mode 100644
index 78e8f45564..0000000000
--- a/tests/lib/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js
+++ /dev/null
@@ -1,292 +0,0 @@
-LOG.inform("XMLDOC.Parser loaded");
-
-/**
- * XML Parser object. Returns an {@link #XMLDOC.Parser.node} which is
- * the root element of the parsed document.
- * <p/>
- * By default, this parser will only handle well formed XML. To
- * allow the parser to handle HTML, set the <tt>XMLDOC.Parser.strictMode</tt>
- * variable to <tt>false</tt> before calling <tt>XMLDOC.Parser.parse()</tt>.
- * <p/>
- * <i>Note: If you pass poorly formed XML, it will cause the parser to throw
- * an exception.</i>
- *
- * @author Brett Fattori (bfattori@fry.com)
- * @author $Author: micmath $
- * @version $Revision: 497 $
- */
-XMLDOC.Parser = {};
-
-/**
- * Strict mode setting. Setting this to false allows HTML-style source to
- * be parsed. Normally, well formed XML has defined end tags, or empty tags
- * are properly formed. Default: <tt>true</tt>
- * @type Boolean
- */
-XMLDOC.Parser.strictMode = true;
-
-/**
- * A node in an XML Document. Node types are ROOT, ELEMENT, COMMENT, PI, and TEXT.
- * @param parent {XMLDOC.Parser.node} The parent node
- * @param name {String} The node name
- * @param type {String} One of the types
- */
-XMLDOC.Parser.node = function(parent, name, type)
-{
- this.name = name;
- this.type = type || "ELEMENT";
- this.parent = parent;
- this.charData = "";
- this.attrs = {};
- this.nodes = [];
- this.cPtr = 0;
-
- XMLDOC.Parser.node.prototype.getAttributeNames = function() {
- var a = [];
- for (var o in this.attrs)
- {
- a.push(o);
- }
-
- return a;
- };
-
- XMLDOC.Parser.node.prototype.getAttribute = function(attr) {
- return this.attrs[attr];
- };
-
- XMLDOC.Parser.node.prototype.setAttribute = function(attr, val) {
- this.attrs[attr] = val;
- };
-
- XMLDOC.Parser.node.prototype.getChild = function(idx) {
- return this.nodes[idx];
- };
-
- XMLDOC.Parser.node.prototype.parentNode = function() {
- return this.parent;
- };
-
- XMLDOC.Parser.node.prototype.firstChild = function() {
- return this.nodes[0];
- };
-
- XMLDOC.Parser.node.prototype.lastChild = function() {
- return this.nodes[this.nodes.length - 1];
- };
-
- XMLDOC.Parser.node.prototype.nextSibling = function() {
- var p = this.parent;
- if (p && (p.nodes.indexOf(this) + 1 != p.nodes.length))
- {
- return p.getChild(p.nodes.indexOf(this) + 1);
- }
- return null;
- };
-
- XMLDOC.Parser.node.prototype.prevSibling = function() {
- var p = this.parent;
- if (p && (p.nodes.indexOf(this) - 1 >= 0))
- {
- return p.getChild(p.nodes.indexOf(this) - 1);
- }
- return null;
- };
-};
-
-/**
- * Parse an XML Document from the specified source. The XML should be
- * well formed, unless strict mode is disabled, then the parser will
- * handle HTML-style XML documents.
- * @param src {String} The source to parse
- */
-XMLDOC.Parser.parse = function(src)
-{
- var A = [];
-
- // Normailize whitespace
- A = src.split("\r\n");
- src = A.join("\n");
- A = src.split("\r");
- src = A.join("\n");
-
- // Remove XML and DOCTYPE specifier
- src.replace(/<\?XML .*\?>/i, "");
- src.replace(/<!DOCTYPE .*\>/i, "");
-
- // The document is the root node and cannot be modified or removed
- var doc = new XMLDOC.Parser.node(null, "ROOT", "DOCUMENT");
-
- // Let's break it down
- XMLDOC.Parser.eat(doc, src);
-
- return doc;
-};
-
-/**
- * The XML fragment processing routine. This method is private and should not be called
- * directly.
- * @param parentNode {XMLDOC.Parser.node} The node which is the parent of this fragment
- * @param src {String} The source within the fragment to process
- * @private
- */
-XMLDOC.Parser.eat = function(parentNode, src)
-{
- // A simple tag def
- var reTag = new RegExp("<(!|)(\\?|--|)((.|\\s)*?)\\2>","g");
-
- // Special tag types
- var reCommentTag = /<!--((.|\s)*?)-->/;
- var rePITag = /<\?((.|\s)*?)\?>/;
-
- // A start tag (with potential empty marker)
- var reStartTag = /<(.*?)( +([\w_\-]*)=(\"|')(.*)\4)*(\/)?>/;
-
- // An empty HTML style tag (not proper XML, but we'll accept it so we can process HTML)
- var reHTMLEmptyTag = /<(.*?)( +([\w_\-]*)=(\"|')(.*)\4)*>/;
-
- // Fully enclosing tag with nested tags
- var reEnclosingTag = /<(.*?)( +([\w_\-]*)=(\"|')(.*?)\4)*>((.|\s)*?)<\/\1>/;
-
- // Breaks down attributes
- var reAttributes = new RegExp(" +([\\w_\\-]*)=(\"|')(.*?)\\2","g");
-
- // Find us a tag
- var tag;
- while ((tag = reTag.exec(src)) != null)
- {
- if (tag.index > 0)
- {
- // The next tag has some text before it
- var text = src.substring(0, tag.index).replace(/^[ \t\n]+((.|\n)*?)[ \t\n]+$/, "$1");
-
- if (text.length > 0 && (text != "\n"))
- {
- var txtnode = new XMLDOC.Parser.node(parentNode, "", "TEXT");
- txtnode.charData = text;
-
- // Append the new text node
- parentNode.nodes.push(txtnode);
- }
-
- // Reset the lastIndex of reTag
- reTag.lastIndex -= src.substring(0, tag.index).length;
-
- // Eat the text
- src = src.substring(tag.index);
- }
-
- if (reCommentTag.test(tag[0]))
- {
- // Is this a comment?
- var comment = new XMLDOC.Parser.node(parentNode, "", "COMMENT");
- comment.charData = reCommentTag.exec(tag[0])[1];
-
- // Append the comment
- parentNode.nodes.push(comment);
-
- // Move the lastIndex of reTag
- reTag.lastIndex -= tag[0].length;
-
- // Eat the tag
- src = src.replace(reCommentTag, "");
- }
- else if (rePITag.test(tag[0]))
- {
- // Is this a processing instruction?
- var pi = new XMLDOC.Parser.node(parentNode, "", "PI");
- pi.charData = rePITag.exec(tag[0])[1];
-
- // Append the processing instruction
- parentNode.nodes.push(pi);
-
- // Move the lastIndex of reTag
- reTag.lastIndex -= tag[0].length;
-
- // Eat the tag
- src = src.replace(rePITag, "");
- }
- else if (reStartTag.test(tag[0]))
- {
- // Break it down
- var e = reStartTag.exec(tag[0]);
- var elem = new XMLDOC.Parser.node(parentNode, e[1], "ELEMENT");
-
- // Get attributes from the tag
- var a;
- while ((a = reAttributes.exec(e[2])) != null )
- {
- elem.attrs[a[1]] = a[3];
- }
-
- // Is this an empty XML-style tag?
- if (e[6] == "/")
- {
- // Append the empty element
- parentNode.nodes.push(elem);
-
- // Move the lastIndex of reTag (include the start tag length)
- reTag.lastIndex -= e[0].length;
-
- // Eat the tag
- src = src.replace(reStartTag, "");
- }
- else
- {
- // Check for malformed XML tags
- var htmlParsed = false;
- var htmlStartTag = reHTMLEmptyTag.exec(src);
-
- // See if there isn't an end tag within this block
- var reHTMLEndTag = new RegExp("</" + htmlStartTag[1] + ">");
- var htmlEndTag = reHTMLEndTag.exec(src);
-
- if (XMLDOC.Parser.strictMode && htmlEndTag == null)
- {
- // Poorly formed XML fails in strict mode
- var err = new Error("Malformed XML passed to XMLDOC.Parser... Error contains malformed 'src'");
- err.src = src;
- throw err;
- }
- else if (htmlEndTag == null)
- {
- // This is an HTML-style empty tag, store the element for it in non-strict mode
- parentNode.nodes.push(elem);
-
- // Eat the tag
- src = src.replace(reHTMLEmptyTag, "");
- htmlParsed = true;
- }
-
- // If we didn't parse HTML-style, it must be an enclosing tag
- if (!htmlParsed)
- {
- var enc = reEnclosingTag.exec(src);
-
- // Go deeper into the document
- XMLDOC.Parser.eat(elem, enc[6]);
-
- // Append the new element node
- parentNode.nodes.push(elem);
-
- // Eat the tag
- src = src.replace(reEnclosingTag, "");
- }
- }
-
- // Reset the lastIndex of reTag
- reTag.lastIndex = 0;
- }
- }
-
- // No tag was found... append the text if there is any
- src = src.replace(/^[ \t\n]+((.|\n)*?)[ \t\n]+$/, "$1");
- if (src.length > 0 && (src != "\n"))
- {
- var txtNode = new XMLDOC.Parser.node(parentNode, "", "TEXT");
- txtNode.charData = src;
-
- // Append the new text node
- parentNode.nodes.push(txtNode);
- }
-};
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC.js
deleted file mode 100644
index 9f14c5c166..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/**
- @overview
- @date $Date: 2010-06-13 22:02:44 +0100 (Sun, 13 Jun 2010) $
- @version $Revision: 837 $
- @location $HeadURL: https://jsdoc-toolkit.googlecode.com/svn/tags/jsdoc_toolkit-2.4.0/jsdoc-toolkit/app/lib/JSDOC.js $
- @name JSDOC.js
- */
-
-/**
- This is the main container for the JSDOC application.
- @namespace
-*/
-JSDOC = {
-};
-
-/**
- @requires Opt
- */
-if (typeof arguments == "undefined") arguments = [];
-JSDOC.opt = Opt.get(
- arguments,
- {
- a: "allfunctions",
- c: "conf",
- d: "directory",
- "D[]": "define",
- e: "encoding",
- "E[]": "exclude",
- h: "help",
- m: "multiple",
- n: "nocode",
- o: "out",
- p: "private",
- q: "quiet",
- r: "recurse",
- S: "securemodules",
- s: "suppress",
- t: "template",
- T: "testmode",
- u: "unique",
- v: "verbose",
- x: "ext"
- }
-);
-
-/** The current version string of this application. */
-JSDOC.VERSION = "2.4.0";
-
-/** Print out usage information and quit. */
-JSDOC.usage = function() {
- print("USAGE: java -jar jsrun.jar app/run.js [OPTIONS] <SRC_DIR> <SRC_FILE> ...");
- print("");
- print("OPTIONS:");
- print(" -a or --allfunctions\n Include all functions, even undocumented ones.\n");
- print(" -c or --conf\n Load a configuration file.\n");
- print(" -d=<PATH> or --directory=<PATH>\n Output to this directory (defaults to \"out\").\n");
- print(" -D=\"myVar:My value\" or --define=\"myVar:My value\"\n Multiple. Define a variable, available in JsDoc as JSDOC.opt.D.myVar.\n");
- print(" -e=<ENCODING> or --encoding=<ENCODING>\n Use this encoding to read and write files.\n");
- print(" -E=\"REGEX\" or --exclude=\"REGEX\"\n Multiple. Exclude files based on the supplied regex.\n");
- print(" -h or --help\n Show this message and exit.\n");
- print(" -m or --multiples\n Don't warn about symbols being documented more than once.\n");
- print(" -n or --nocode\n Ignore all code, only document comments with @name tags.\n");
- print(" -o=<PATH> or --out=<PATH>\n Print log messages to a file (defaults to stdout).\n");
- print(" -p or --private\n Include symbols tagged as private, underscored and inner symbols.\n");
- print(" -q or --quiet\n Do not output any messages, not even warnings.\n");
- print(" -r=<DEPTH> or --recurse=<DEPTH>\n Descend into src directories.\n");
- print(" -s or --suppress\n Suppress source code output.\n");
- print(" -S or --securemodules\n Use Secure Modules mode to parse source code.\n");
- print(" -t=<PATH> or --template=<PATH>\n Required. Use this template to format the output.\n");
- print(" -T or --test\n Run all unit tests and exit.\n");
- print(" -u or --unique\n Force file names to be unique, but not based on symbol names.\n");
- print(" -v or --verbose\n Provide verbose feedback about what is happening.\n");
- print(" -x=<EXT>[,EXT]... or --ext=<EXT>[,EXT]...\n Scan source files with the given extension/s (defaults to js).\n");
-
- quit();
-}
-
-/*t:
- plan(4, "Testing JSDOC namespace.");
-
- is(
- typeof JSDOC,
- "object",
- "JSDOC.usage is a function."
- );
-
- is(
- typeof JSDOC.VERSION,
- "string",
- "JSDOC.VERSION is a string."
- );
-
- is(
- typeof JSDOC.usage,
- "function",
- "JSDOC.usage is a function."
- );
-
- is(
- typeof JSDOC.opt,
- "object",
- "JSDOC.opt is a object."
- );
- */
-
-if (this.IO) IO.includeDir("lib/JSDOC/");
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/DocComment.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/DocComment.js
deleted file mode 100644
index b99a08317e..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/DocComment.js
+++ /dev/null
@@ -1,204 +0,0 @@
-if (typeof JSDOC == "undefined") JSDOC = {};
-
-/**
- Create a new DocComment. This takes a raw documentation comment,
- and wraps it in useful accessors.
- @class Represents a documentation comment object.
- */
-JSDOC.DocComment = function(/**String*/comment) {
- this.init();
- if (typeof comment != "undefined") {
- this.parse(comment);
- }
-}
-
-JSDOC.DocComment.prototype.init = function() {
- this.isUserComment = true;
- this.src = "";
- this.meta = "";
- this.tagTexts = [];
- this.tags = [];
-}
-
-/**
- @requires JSDOC.DocTag
- */
-JSDOC.DocComment.prototype.parse = function(/**String*/comment) {
- if (comment == "") {
- comment = "/** @desc */";
- this.isUserComment = false;
- }
-
- this.src = JSDOC.DocComment.unwrapComment(comment);
-
- this.meta = "";
- if (this.src.indexOf("#") == 0) {
- this.src.match(/#(.+[+-])([\s\S]*)$/);
- if (RegExp.$1) this.meta = RegExp.$1;
- if (RegExp.$2) this.src = RegExp.$2;
- }
-
- if (typeof JSDOC.PluginManager != "undefined") {
- JSDOC.PluginManager.run("onDocCommentSrc", this);
- }
-
- this.fixDesc();
-
- this.src = JSDOC.DocComment.shared+"\n"+this.src;
-
- this.tagTexts =
- this.src
- .split(/(^|[\r\n])\s*@/)
- .filter(function($){return $.match(/\S/)});
-
- /**
- The tags found in the comment.
- @type JSDOC.DocTag[]
- */
- this.tags = this.tagTexts.map(function($){return new JSDOC.DocTag($)});
-
- if (typeof JSDOC.PluginManager != "undefined") {
- JSDOC.PluginManager.run("onDocCommentTags", this);
- }
-}
-
-/*t:
- plan(5, "testing JSDOC.DocComment");
- requires("../frame/String.js");
- requires("../lib/JSDOC/DocTag.js");
-
- var com = new JSDOC.DocComment("/**@foo some\n* comment here*"+"/");
- is(com.tagTexts[0], "foo some\ncomment here", "first tag text is found.");
- is(com.tags[0].title, "foo", "the title is found in a comment with one tag.");
-
- var com = new JSDOC.DocComment("/** @foo first\n* @bar second*"+"/");
- is(com.getTag("bar").length, 1, "getTag() returns one tag by that title.");
-
- JSDOC.DocComment.shared = "@author John Smith";
- var com = new JSDOC.DocComment("/**@foo some\n* comment here*"+"/");
- is(com.tags[0].title, "author", "shared comment is added.");
- is(com.tags[1].title, "foo", "shared comment is added to existing tag.");
-*/
-
-/**
- If no @desc tag is provided, this function will add it.
- */
-JSDOC.DocComment.prototype.fixDesc = function() {
- if (this.meta && this.meta != "@+") return;
- if (/^\s*[^@\s]/.test(this.src)) {
- this.src = "@desc "+this.src;
- }
-}
-
-/*t:
- plan(5, "testing JSDOC.DocComment#fixDesc");
-
- var com = new JSDOC.DocComment();
-
- com.src = "this is a desc\n@author foo";
- com.fixDesc();
- is(com.src, "@desc this is a desc\n@author foo", "if no @desc tag is provided one is added.");
-
- com.src = "x";
- com.fixDesc();
- is(com.src, "@desc x", "if no @desc tag is provided one is added to a single character.");
-
- com.src = "\nx";
- com.fixDesc();
- is(com.src, "@desc \nx", "if no @desc tag is provided one is added to return and character.");
-
- com.src = " ";
- com.fixDesc();
- is(com.src, " ", "if no @desc tag is provided one is not added to just whitespace.");
-
- com.src = "";
- com.fixDesc();
- is(com.src, "", "if no @desc tag is provided one is not added to empty.");
-*/
-
-/**
- Remove slash-star comment wrapper from a raw comment string.
- @type String
- */
-JSDOC.DocComment.unwrapComment = function(/**String*/comment) {
- if (!comment) return "";
- var unwrapped = comment.replace(/(^\/\*\*|\*\/$)/g, "").replace(/^\s*\* ?/gm, "");
- return unwrapped;
-}
-
-/*t:
- plan(5, "testing JSDOC.DocComment.unwrapComment");
-
- var com = "/**x*"+"/";
- var unwrapped = JSDOC.DocComment.unwrapComment(com);
- is(unwrapped, "x", "a single character jsdoc is found.");
-
- com = "/***x*"+"/";
- unwrapped = JSDOC.DocComment.unwrapComment(com);
- is(unwrapped, "x", "three stars are allowed in the opener.");
-
- com = "/****x*"+"/";
- unwrapped = JSDOC.DocComment.unwrapComment(com);
- is(unwrapped, "*x", "fourth star in the opener is kept.");
-
- com = "/**x\n * y\n*"+"/";
- unwrapped = JSDOC.DocComment.unwrapComment(com);
- is(unwrapped, "x\ny\n", "leading stars and spaces are trimmed.");
-
- com = "/**x\n * y\n*"+"/";
- unwrapped = JSDOC.DocComment.unwrapComment(com);
- is(unwrapped, "x\n y\n", "only first space after leading stars are trimmed.");
-*/
-
-/**
- Provides a printable version of the comment.
- @type String
- */
-JSDOC.DocComment.prototype.toString = function() {
- return this.src;
-}
-
-/*t:
- plan(1, "testing JSDOC.DocComment#fixDesc");
- var com = new JSDOC.DocComment();
- com.src = "foo";
- is(""+com, "foo", "stringifying a comment returns the unwrapped src.");
-*/
-
-/**
- Given the title of a tag, returns all tags that have that title.
- @type JSDOC.DocTag[]
- */
-JSDOC.DocComment.prototype.getTag = function(/**String*/tagTitle) {
- return this.tags.filter(function($){return $.title == tagTitle});
-}
-
-JSDOC.DocComment.prototype.deleteTag = function(/**String*/tagTitle) {
- this.tags = this.tags.filter(function($){return $.title != tagTitle})
-}
-
-/*t:
- plan(1, "testing JSDOC.DocComment#getTag");
- requires("../frame/String.js");
- requires("../lib/JSDOC/DocTag.js");
-
- var com = new JSDOC.DocComment("/**@foo some\n* @bar\n* @bar*"+"/");
- is(com.getTag("bar").length, 2, "getTag returns expected number of tags.");
-*/
-
-/**
- Used to store the currently shared tag text.
-*/
-JSDOC.DocComment.shared = "";
-
-/*t:
- plan(2, "testing JSDOC.DocComment.shared");
- requires("../frame/String.js");
- requires("../lib/JSDOC/DocTag.js");
-
- JSDOC.DocComment.shared = "@author Michael";
-
- var com = new JSDOC.DocComment("/**@foo\n* @foo*"+"/");
- is(com.getTag("author").length, 1, "getTag returns shared tag.");
- is(com.getTag("foo").length, 2, "getTag returns unshared tags too.");
-*/ \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/DocTag.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/DocTag.js
deleted file mode 100644
index 42605fc297..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/DocTag.js
+++ /dev/null
@@ -1,294 +0,0 @@
-if (typeof JSDOC == "undefined") JSDOC = {};
-
-/**
- @constructor
- */
-JSDOC.DocTag = function(src) {
- this.init();
- if (typeof src != "undefined") {
- this.parse(src);
- }
-}
-
-/**
- Create and initialize the properties of this.
- */
-JSDOC.DocTag.prototype.init = function() {
- this.title = "";
- this.type = "";
- this.name = "";
- this.isOptional = false;
- this.defaultValue = "";
- this.desc = "";
-
- return this;
-}
-
-/**
- Populate the properties of this from the given tag src.
- @param {string} src
- */
-JSDOC.DocTag.prototype.parse = function(src) {
- if (typeof src != "string") throw "src must be a string not "+(typeof src);
-
- try {
- src = this.nibbleTitle(src);
- if (JSDOC.PluginManager) {
- JSDOC.PluginManager.run("onDocTagSynonym", this);
- }
-
- src = this.nibbleType(src);
-
- // only some tags are allowed to have names.
- if (this.title == "param" || this.title == "property" || this.title == "config") { // @config is deprecated
- src = this.nibbleName(src);
- }
- }
- catch(e) {
- if (LOG) LOG.warn(e);
- else throw e;
- }
- this.desc = src; // whatever is left
-
- // example tags need to have whitespace preserved
- if (this.title != "example") this.desc = this.desc.trim();
-
- if (JSDOC.PluginManager) {
- JSDOC.PluginManager.run("onDocTag", this);
- }
-}
-
-/**
- Automatically called when this is stringified.
- */
-JSDOC.DocTag.prototype.toString = function() {
- return this.desc;
-}
-
-/*t:
- plan(1, "testing JSDOC.DocTag#toString");
-
- var tag = new JSDOC.DocTag("param {object} date A valid date.");
- is(""+tag, "A valid date.", "stringifying a tag returns the desc.");
- */
-
-/**
- Find and shift off the title of a tag.
- @param {string} src
- @return src
- */
-JSDOC.DocTag.prototype.nibbleTitle = function(src) {
- if (typeof src != "string") throw "src must be a string not "+(typeof src);
-
- var parts = src.match(/^\s*(\S+)(?:\s([\s\S]*))?$/);
-
- if (parts && parts[1]) this.title = parts[1];
- if (parts && parts[2]) src = parts[2];
- else src = "";
-
- return src;
-}
-
-/*t:
- plan(8, "testing JSDOC.DocTag#nibbleTitle");
-
- var tag = new JSDOC.DocTag();
-
- tag.init().nibbleTitle("aTitleGoesHere");
- is(tag.title, "aTitleGoesHere", "a title can be found in a single-word string.");
-
- var src = tag.init().nibbleTitle("aTitleGoesHere and the rest");
- is(tag.title, "aTitleGoesHere", "a title can be found in a multi-word string.");
- is(src, "and the rest", "the rest is returned when the title is nibbled off.");
-
- src = tag.init().nibbleTitle("");
- is(tag.title, "", "given an empty string the title is empty.");
- is(src, "", "the rest is empty when the tag is empty.");
-
- var src = tag.init().nibbleTitle(" aTitleGoesHere\n a description");
- is(tag.title, "aTitleGoesHere", "leading and trailing spaces are not part of the title.");
- is(src, " a description", "leading spaces (less one) are part of the description.");
-
- tag.init().nibbleTitle("a.Title::Goes_Here foo");
- is(tag.title, "a.Title::Goes_Here", "titles with punctuation are allowed.");
- */
-
-/**
- Find and shift off the type of a tag.
- @requires frame/String.js
- @param {string} src
- @return src
- */
-JSDOC.DocTag.prototype.nibbleType = function(src) {
- if (typeof src != "string") throw "src must be a string not "+(typeof src);
-
- if (src.match(/^\s*\{/)) {
- var typeRange = src.balance("{", "}");
- if (typeRange[1] == -1) {
- throw "Malformed comment tag ignored. Tag type requires an opening { and a closing }: "+src;
- }
- this.type = src.substring(typeRange[0]+1, typeRange[1]).trim();
- this.type = this.type.replace(/\s*,\s*/g, "|"); // multiples can be separated by , or |
- src = src.substring(typeRange[1]+1);
- }
-
- return src;
-}
-
-/*t:
- plan(5, "testing JSDOC.DocTag.parser.nibbleType");
- requires("../frame/String.js");
-
- var tag = new JSDOC.DocTag();
-
- tag.init().nibbleType("{String[]} aliases");
- is(tag.type, "String[]", "type can have non-alpha characters.");
-
- tag.init().nibbleType("{ aTypeGoesHere } etc etc");
- is(tag.type, "aTypeGoesHere", "type is trimmed.");
-
- tag.init().nibbleType("{ oneType, twoType ,\n threeType } etc etc");
- is(tag.type, "oneType|twoType|threeType", "multiple types can be separated by commas.");
-
- var error;
- try { tag.init().nibbleType("{widget foo"); }
- catch(e) { error = e; }
- is(typeof error, "string", "malformed tag type throws error.");
- isnt(error.indexOf("Malformed"), -1, "error message tells tag is malformed.");
- */
-
-/**
- Find and shift off the name of a tag.
- @requires frame/String.js
- @param {string} src
- @return src
- */
-JSDOC.DocTag.prototype.nibbleName = function(src) {
- if (typeof src != "string") throw "src must be a string not "+(typeof src);
-
- src = src.trim();
-
- // is optional?
- if (src.charAt(0) == "[") {
- var nameRange = src.balance("[", "]");
- if (nameRange[1] == -1) {
- throw "Malformed comment tag ignored. Tag optional name requires an opening [ and a closing ]: "+src;
- }
- this.name = src.substring(nameRange[0]+1, nameRange[1]).trim();
- this.isOptional = true;
-
- src = src.substring(nameRange[1]+1);
-
- // has default value?
- var nameAndValue = this.name.split("=");
- if (nameAndValue.length) {
- this.name = nameAndValue.shift().trim();
- this.defaultValue = nameAndValue.join("=");
- }
- }
- else {
- var parts = src.match(/^(\S+)(?:\s([\s\S]*))?$/);
- if (parts) {
- if (parts[1]) this.name = parts[1];
- if (parts[2]) src = parts[2].trim();
- else src = "";
- }
- }
-
- return src;
-}
-
-/*t:
- requires("../frame/String.js");
- plan(9, "testing JSDOC.DocTag.parser.nibbleName");
-
- var tag = new JSDOC.DocTag();
-
- tag.init().nibbleName("[foo] This is a description.");
- is(tag.isOptional, true, "isOptional syntax is detected.");
- is(tag.name, "foo", "optional param name is found.");
-
- tag.init().nibbleName("[foo] This is a description.");
- is(tag.isOptional, true, "isOptional syntax is detected when no type.");
- is(tag.name, "foo", "optional param name is found when no type.");
-
- tag.init().nibbleName("[foo=7] This is a description.");
- is(tag.name, "foo", "optional param name is found when default value.");
- is(tag.defaultValue, 7, "optional param default value is found when default value.");
-
- //tag.init().nibbleName("[foo= a value] This is a description.");
- //is(tag.defaultValue, " a value", "optional param default value is found when default value has spaces (issue #112).");
-
- tag.init().nibbleName("[foo=[]] This is a description.");
- is(tag.defaultValue, "[]", "optional param default value is found when default value is [] (issue #95).");
-
- tag.init().nibbleName("[foo=a=b] This is a description.");
- is(tag.name, "foo", "optional param name is found when default value is a=b.");
- is(tag.defaultValue, "a=b", "optional param default value is found when default value is a=b.")
- */
-
-/*t:
- plan(32, "Testing JSDOC.DocTag.parser.");
- requires("../frame/String.js");
-
- var tag = new JSDOC.DocTag();
-
- is(typeof tag, "object", "JSDOC.DocTag.parser with an empty string returns an object.");
- is(typeof tag.title, "string", "returned object has a string property 'title'.");
- is(typeof tag.type, "string", "returned object has a string property 'type'.");
- is(typeof tag.name, "string", "returned object has a string property 'name'.");
- is(typeof tag.defaultValue, "string", "returned object has a string property 'defaultValue'.");
- is(typeof tag.isOptional, "boolean", "returned object has a boolean property 'isOptional'.");
- is(typeof tag.desc, "string", "returned object has a string property 'desc'.");
-
- tag = new JSDOC.DocTag("param {widget} foo");
- is(tag.title, "param", "param title is found.");
- is(tag.name, "foo", "param name is found when desc is missing.");
- is(tag.desc, "", "param desc is empty when missing.");
-
- tag = new JSDOC.DocTag("param {object} date A valid date.");
- is(tag.name, "date", "param name is found with a type.");
- is(tag.type, "object", "param type is found.");
- is(tag.desc, "A valid date.", "param desc is found with a type.");
-
- tag = new JSDOC.DocTag("param aName a description goes\n here.");
- is(tag.name, "aName", "param name is found without a type.");
- is(tag.desc, "a description goes\n here.", "param desc is found without a type.");
-
- tag = new JSDOC.DocTag("param {widget}");
- is(tag.name, "", "param name is empty when it is not given.");
-
- tag = new JSDOC.DocTag("param {widget} [foo] This is a description.");
- is(tag.name, "foo", "optional param name is found.");
-
- tag = new JSDOC.DocTag("return {aType} This is a description.");
- is(tag.type, "aType", "when return tag has no name, type is found.");
- is(tag.desc, "This is a description.", "when return tag has no name, desc is found.");
-
- tag = new JSDOC.DocTag("author Joe Coder <jcoder@example.com>");
- is(tag.title, "author", "author tag has a title.");
- is(tag.type, "", "the author tag has no type.");
- is(tag.name, "", "the author tag has no name.");
- is(tag.desc, "Joe Coder <jcoder@example.com>", "author tag has desc.");
-
- tag = new JSDOC.DocTag("private \t\n ");
- is(tag.title, "private", "private tag has a title.");
- is(tag.type, "", "the private tag has no type.");
- is(tag.name, "", "the private tag has no name.");
- is(tag.desc, "", "private tag has no desc.");
-
- tag = new JSDOC.DocTag("example\n example(code);\n more();");
- is(tag.desc, " example(code);\n more();", "leading whitespace (less one) in examples code is preserved.");
-
- tag = new JSDOC.DocTag("param theName \n");
- is(tag.name, "theName", "name only is found.");
-
- tag = new JSDOC.DocTag("type theDesc \n");
- is(tag.desc, "theDesc", "desc only is found.");
-
- tag = new JSDOC.DocTag("type {theType} \n");
- is(tag.type, "theType", "type only is found.");
-
- tag = new JSDOC.DocTag("");
- is(tag.title, "", "title is empty when tag is empty.");
- */ \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js
deleted file mode 100644
index c199a40d52..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- @constructor
- @param [opt] Used to override the commandline options. Useful for testing.
- @version $Id: JsDoc.js 831 2010-03-09 14:24:56Z micmath $
-*/
-JSDOC.JsDoc = function(/**object*/ opt) {
- if (opt) {
- JSDOC.opt = opt;
- }
-
- if (JSDOC.opt.h) {
- JSDOC.usage();
- quit();
- }
-
- // defend against options that are not sane
- if (JSDOC.opt._.length == 0) {
- LOG.warn("No source files to work on. Nothing to do.");
- quit();
- }
- if (JSDOC.opt.t === true || JSDOC.opt.d === true) {
- JSDOC.usage();
- }
-
- if (typeof JSDOC.opt.d == "string") {
- if (!JSDOC.opt.d.charAt(JSDOC.opt.d.length-1).match(/[\\\/]/)) {
- JSDOC.opt.d = JSDOC.opt.d+"/";
- }
- LOG.inform("Output directory set to '"+JSDOC.opt.d+"'.");
- IO.mkPath(JSDOC.opt.d);
- }
- if (JSDOC.opt.e) IO.setEncoding(JSDOC.opt.e);
-
- // the -r option: scan source directories recursively
- if (typeof JSDOC.opt.r == "boolean") JSDOC.opt.r = 10;
- else if (!isNaN(parseInt(JSDOC.opt.r))) JSDOC.opt.r = parseInt(JSDOC.opt.r);
- else JSDOC.opt.r = 1;
-
- // the -D option: define user variables
- var D = {};
- if (JSDOC.opt.D) {
- for (var i = 0; i < JSDOC.opt.D.length; i++) {
- var param = JSDOC.opt.D[i];
- // remove first and last character if both == "
- if (
- param.length > 1
- && param.charAt(0) == '"'
- && param.charAt(param.length-1) == '"'
- ) {
- param = param.substr(1, param.length-2);
- }
- var defineParts = param.split(":");
- if (defineParts && defineParts.length > 1) {
- for ( var dpIdx = 2; dpIdx < defineParts.length; dpIdx++ ) {
- defineParts[1] += ':' + defineParts[dpIdx];
- }
- D[defineParts[0]] = defineParts[1];
- }
- }
- }
- JSDOC.opt.D = D;
- // combine any conf file D options with the commandline D options
- if (defined(JSDOC.conf)) for (var c in JSDOC.conf.D) {
- if (!defined(JSDOC.opt.D[c])) {
- JSDOC.opt.D[c] = JSDOC.conf.D[c];
- }
- }
-
- // Give plugins a chance to initialize
- if (defined(JSDOC.PluginManager)) {
- JSDOC.PluginManager.run("onInit", JSDOC.opt);
- }
-
- JSDOC.opt.srcFiles = JSDOC.JsDoc._getSrcFiles();
- JSDOC.JsDoc._parseSrcFiles();
- JSDOC.JsDoc.symbolSet = JSDOC.Parser.symbols;
-}
-
-/**
- Retrieve source file list.
- @returns {String[]} The pathnames of the files to be parsed.
- */
-JSDOC.JsDoc._getSrcFiles = function() {
- JSDOC.JsDoc.srcFiles = [];
-
- var ext = ["js"];
- if (JSDOC.opt.x) {
- ext = JSDOC.opt.x.split(",").map(function($) {return $.toLowerCase()});
- }
-
- for (var i = 0; i < JSDOC.opt._.length; i++) {
- JSDOC.JsDoc.srcFiles = JSDOC.JsDoc.srcFiles.concat(
- IO.ls(JSDOC.opt._[i], JSDOC.opt.r).filter(
- function($) {
- var thisExt = $.split(".").pop().toLowerCase();
-
- if (JSDOC.opt.E) {
- for(var n = 0; n < JSDOC.opt.E.length; n++) {
- if ($.match(new RegExp(JSDOC.opt.E[n]))) {
- LOG.inform("Excluding " + $);
- return false; // if the file matches the regex then it's excluded.
- }
- }
- }
-
- return (ext.indexOf(thisExt) > -1); // we're only interested in files with certain extensions
- }
- )
- );
- }
-
- return JSDOC.JsDoc.srcFiles;
-}
-
-JSDOC.JsDoc._parseSrcFiles = function() {
- JSDOC.Parser.init();
- for (var i = 0, l = JSDOC.JsDoc.srcFiles.length; i < l; i++) {
- var srcFile = JSDOC.JsDoc.srcFiles[i];
-
- if (JSDOC.opt.v) LOG.inform("Parsing file: " + srcFile);
-
- try {
- var src = IO.readFile(srcFile);
- }
- catch(e) {
- LOG.warn("Can't read source file '"+srcFile+"': "+e.message);
- }
-
- var tr = new JSDOC.TokenReader();
- var ts = new JSDOC.TokenStream(tr.tokenize(new JSDOC.TextStream(src)));
-
- JSDOC.Parser.parse(ts, srcFile);
-
- }
- JSDOC.Parser.finish();
-
- if (JSDOC.PluginManager) {
- JSDOC.PluginManager.run("onFinishedParsing", JSDOC.Parser.symbols);
- }
-}
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js
deleted file mode 100644
index ba59e413e6..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/**
- @constructor
-*/
-JSDOC.JsPlate = function(templateFile) {
- if (templateFile) this.template = IO.readFile(templateFile);
-
- this.templateFile = templateFile;
- this.code = "";
- this.parse();
-}
-
-JSDOC.JsPlate.prototype.parse = function() {
- this.template = this.template.replace(/\{#[\s\S]+?#\}/gi, "");
- this.code = "var output=\u001e"+this.template;
-
- this.code = this.code.replace(
- /<for +each="(.+?)" +in="(.+?)" *>/gi,
- function (match, eachName, inName) {
- return "\u001e;\rvar $"+eachName+"_keys = keys("+inName+");\rfor(var $"+eachName+"_i = 0; $"+eachName+"_i < $"+eachName+"_keys.length; $"+eachName+"_i++) {\rvar $"+eachName+"_last = ($"+eachName+"_i == $"+eachName+"_keys.length-1);\rvar $"+eachName+"_key = $"+eachName+"_keys[$"+eachName+"_i];\rvar "+eachName+" = "+inName+"[$"+eachName+"_key];\routput+=\u001e";
- }
- );
- this.code = this.code.replace(/<if test="(.+?)">/g, "\u001e;\rif ($1) { output+=\u001e");
- this.code = this.code.replace(/<elseif test="(.+?)"\s*\/>/g, "\u001e;}\relse if ($1) { output+=\u001e");
- this.code = this.code.replace(/<else\s*\/>/g, "\u001e;}\relse { output+=\u001e");
- this.code = this.code.replace(/<\/(if|for)>/g, "\u001e;\r};\routput+=\u001e");
- this.code = this.code.replace(
- /\{\+\s*([\s\S]+?)\s*\+\}/gi,
- function (match, code) {
- code = code.replace(/"/g, "\u001e"); // prevent qoute-escaping of inline code
- code = code.replace(/(\r?\n)/g, " ");
- return "\u001e+ ("+code+") +\u001e";
- }
- );
- this.code = this.code.replace(
- /\{!\s*([\s\S]+?)\s*!\}/gi,
- function (match, code) {
- code = code.replace(/"/g, "\u001e"); // prevent qoute-escaping of inline code
- code = code.replace(/(\n)/g, " ");
- return "\u001e; "+code+";\routput+=\u001e";
- }
- );
- this.code = this.code+"\u001e;";
-
- this.code = this.code.replace(/(\r?\n)/g, "\\n");
- this.code = this.code.replace(/"/g, "\\\"");
- this.code = this.code.replace(/\u001e/g, "\"");
-}
-
-JSDOC.JsPlate.prototype.toCode = function() {
- return this.code;
-}
-
-JSDOC.JsPlate.keys = function(obj) {
- var keys = [];
- if (obj.constructor.toString().indexOf("Array") > -1) {
- for (var i = 0; i < obj.length; i++) {
- keys.push(i);
- }
- }
- else {
- for (var i in obj) {
- keys.push(i);
- }
- }
- return keys;
-};
-
-JSDOC.JsPlate.values = function(obj) {
- var values = [];
- if (obj.constructor.toString().indexOf("Array") > -1) {
- for (var i = 0; i < obj.length; i++) {
- values.push(obj[i]);
- }
- }
- else {
- for (var i in obj) {
- values.push(obj[i]);
- }
- }
- return values;
-};
-
-JSDOC.JsPlate.prototype.process = function(data, compact) {
- var keys = JSDOC.JsPlate.keys;
- var values = JSDOC.JsPlate.values;
-
- try {
- eval(this.code);
- }
- catch (e) {
- print(">> There was an error evaluating the compiled code from template: "+this.templateFile);
- print(" The error was on line "+e.lineNumber+" "+e.name+": "+e.message);
- var lines = this.code.split("\r");
- if (e.lineNumber-2 >= 0) print("line "+(e.lineNumber-1)+": "+lines[e.lineNumber-2]);
- print("line "+e.lineNumber+": "+lines[e.lineNumber-1]);
- print("");
- }
-
- if (compact) { // patch by mcbain.asm
- // Remove lines that contain only space-characters, usually left by lines in the template
- // which originally only contained JSPlate tags or code. This makes it easier to write
- // non-tricky templates which still put out nice code (not bloated with extra lines).
- // Lines purposely left blank (just a line ending) are left alone.
- output = output.replace(/\s+?(\r?)\n/g, "$1\n");
- }
-
- /*debug*///print(this.code);
- return output;
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Lang.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Lang.js
deleted file mode 100644
index 4091c75b89..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Lang.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/**
- @namespace
-*/
-JSDOC.Lang = {
-}
-
-JSDOC.Lang.isBuiltin = function(name) {
- return (JSDOC.Lang.isBuiltin.coreObjects.indexOf(name) > -1);
-}
-JSDOC.Lang.isBuiltin.coreObjects = ['_global_', 'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object', 'RegExp', 'String'];
-
-JSDOC.Lang.whitespace = function(ch) {
- return JSDOC.Lang.whitespace.names[ch];
-}
-JSDOC.Lang.whitespace.names = {
- " ": "SPACE",
- "\f": "FORMFEED",
- "\t": "TAB",
- "\u0009": "UNICODE_TAB",
- "\u000A": "UNICODE_NBR",
- "\u0008": "VERTICAL_TAB"
-};
-
-JSDOC.Lang.newline = function(ch) {
- return JSDOC.Lang.newline.names[ch];
-}
-JSDOC.Lang.newline.names = {
- "\n": "NEWLINE",
- "\r": "RETURN",
- "\u000A": "UNICODE_LF",
- "\u000D": "UNICODE_CR",
- "\u2029": "UNICODE_PS",
- "\u2028": "UNICODE_LS"
-};
-
-JSDOC.Lang.keyword = function(word) {
- return JSDOC.Lang.keyword.names["="+word];
-}
-JSDOC.Lang.keyword.names = {
- "=break": "BREAK",
- "=case": "CASE",
- "=catch": "CATCH",
- "=const": "VAR",
- "=continue": "CONTINUE",
- "=default": "DEFAULT",
- "=delete": "DELETE",
- "=do": "DO",
- "=else": "ELSE",
- "=false": "FALSE",
- "=finally": "FINALLY",
- "=for": "FOR",
- "=function": "FUNCTION",
- "=if": "IF",
- "=in": "IN",
- "=instanceof": "INSTANCEOF",
- "=new": "NEW",
- "=null": "NULL",
- "=return": "RETURN",
- "=switch": "SWITCH",
- "=this": "THIS",
- "=throw": "THROW",
- "=true": "TRUE",
- "=try": "TRY",
- "=typeof": "TYPEOF",
- "=void": "VOID",
- "=while": "WHILE",
- "=with": "WITH",
- "=var": "VAR"
-};
-
-JSDOC.Lang.punc = function(ch) {
- return JSDOC.Lang.punc.names[ch];
-}
-JSDOC.Lang.punc.names = {
- ";": "SEMICOLON",
- ",": "COMMA",
- "?": "HOOK",
- ":": "COLON",
- "||": "OR",
- "&&": "AND",
- "|": "BITWISE_OR",
- "^": "BITWISE_XOR",
- "&": "BITWISE_AND",
- "===": "STRICT_EQ",
- "==": "EQ",
- "=": "ASSIGN",
- "!==": "STRICT_NE",
- "!=": "NE",
- "<<": "LSH",
- "<=": "LE",
- "<": "LT",
- ">>>": "URSH",
- ">>": "RSH",
- ">=": "GE",
- ">": "GT",
- "++": "INCREMENT",
- "--": "DECREMENT",
- "+": "PLUS",
- "-": "MINUS",
- "*": "MUL",
- "/": "DIV",
- "%": "MOD",
- "!": "NOT",
- "~": "BITWISE_NOT",
- ".": "DOT",
- "[": "LEFT_BRACKET",
- "]": "RIGHT_BRACKET",
- "{": "LEFT_CURLY",
- "}": "RIGHT_CURLY",
- "(": "LEFT_PAREN",
- ")": "RIGHT_PAREN"
-};
-
-JSDOC.Lang.matching = function(name) {
- return JSDOC.Lang.matching.names[name];
-}
-JSDOC.Lang.matching.names = {
- "LEFT_PAREN": "RIGHT_PAREN",
- "RIGHT_PAREN": "LEFT_PAREN",
- "LEFT_CURLY": "RIGHT_CURLY",
- "RIGHT_CURLY": "LEFT_CURLY",
- "LEFT_BRACE": "RIGHT_BRACE",
- "RIGHT_BRACE": "LEFT_BRACE"
-}
-
-JSDOC.Lang.isNumber = function(str) {
- return /^(\.[0-9]|[0-9]+\.|[0-9])[0-9]*([eE][+-][0-9]+)?$/i.test(str);
-}
-
-JSDOC.Lang.isHexDec = function(str) {
- return /^0x[0-9A-F]+$/i.test(str);
-}
-
-JSDOC.Lang.isWordChar = function(str) {
- return /^[a-zA-Z0-9$_.]+$/.test(str);
-}
-
-JSDOC.Lang.isSpace = function(str) {
- return (typeof JSDOC.Lang.whitespace(str) != "undefined");
-}
-
-JSDOC.Lang.isNewline = function(str) {
- return (typeof JSDOC.Lang.newline(str) != "undefined");
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Parser.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Parser.js
deleted file mode 100644
index 90889b0dee..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Parser.js
+++ /dev/null
@@ -1,146 +0,0 @@
-if (typeof JSDOC == "undefined") JSDOC = {};
-
-/**
- @namespace
- @requires JSDOC.Walker
- @requires JSDOC.Symbol
- @requires JSDOC.DocComment
-*/
-JSDOC.Parser = {
- conf: {
- ignoreCode: JSDOC.opt.n,
- ignoreAnonymous: true, // factory: true
- treatUnderscoredAsPrivate: true, // factory: true
- explain: false // factory: false
- },
-
- addSymbol: function(symbol) {
-
- if (JSDOC.Parser.rename) {
- for (var n in JSDOC.Parser.rename) {
- if (symbol.alias.indexOf(n) == 0) {
- if (symbol.name == symbol.alias) {
- symbol.name = symbol.name.replace(n, JSDOC.Parser.rename[n]);
- }
- symbol.alias = symbol.alias.replace(n, JSDOC.Parser.rename[n]);
- }
- }
- }
-
- if (JSDOC.opt.S) {
- if (typeof JSDOC.Parser.secureModules == "undefined") JSDOC.Parser.secureModules = {};
- if (/^exports\./.test(symbol.alias)) {
- symbol.srcFile.match(/(^|[\\\/])([^\\\/]+)\.js/i);
- var fileNS = RegExp.$2;
-
- // need to create the namespace associated with this file first
- if (!JSDOC.Parser.secureModules[fileNS]) {
- JSDOC.Parser.secureModules[fileNS] = 1;
- var nsSymbol = new JSDOC.Symbol(fileNS, [], "GLOBAL", new JSDOC.DocComment(""));
- nsSymbol.isNamespace = true;
- nsSymbol.srcFile = "";
- nsSymbol.isPrivate = false;
- nsSymbol.srcFile = symbol.srcFile;
- nsSymbol.desc = (JSDOC.Parser.symbols.getSymbol(symbol.srcFile) || {desc: ""}).desc;
- JSDOC.Parser.addSymbol(nsSymbol);
- }
-
- symbol.alias = symbol.alias.replace(/^exports\./, fileNS + '.');
- symbol.name = symbol.name.replace(/^exports\./, '');
- symbol.memberOf = fileNS;
- symbol.isStatic = true;
- }
- }
-
- // if a symbol alias is documented more than once the first one with the user docs wins
- if (JSDOC.Parser.symbols.hasSymbol(symbol.alias)) {
- var oldSymbol = JSDOC.Parser.symbols.getSymbol(symbol.alias);
- if (oldSymbol.comment.isUserComment) {
- if (JSDOC.opt.m) return;
- if (symbol.comment.isUserComment) { // old and new are both documented
- LOG.warn("The symbol '"+symbol.alias+"' is documented more than once.");
- return;
- }
- else { // old is documented but new isn't
- return;
- }
- }
- }
-
- // we don't document anonymous things
- if (JSDOC.Parser.conf.ignoreAnonymous && symbol.name.match(/\$anonymous\b/)) return;
-
- // uderscored things may be treated as if they were marked private, this cascades
- if (JSDOC.Parser.conf.treatUnderscoredAsPrivate && symbol.name.match(/[.#-]_[^.#-]+$/)) {
- if (!symbol.comment.getTag("public").length > 0) symbol.isPrivate = true;
- }
-
- // -p flag is required to document private things
- if (!JSDOC.opt.p && symbol.isPrivate) return; // issue #161 fixed by mcbain.asm
-
- // ignored things are not documented, this doesn't cascade
- if (symbol.isIgnored) return;
- JSDOC.Parser.symbols.addSymbol(symbol);
- },
-
- addBuiltin: function(name) {
- var builtin = new JSDOC.Symbol(name, [], "CONSTRUCTOR", new JSDOC.DocComment(""));
- builtin.isNamespace = true;
- builtin.srcFile = "";
- builtin.isPrivate = false;
- JSDOC.Parser.addSymbol(builtin);
- return builtin;
- },
-
- init: function() {
- JSDOC.Parser.symbols = new JSDOC.SymbolSet();
- JSDOC.Parser.walker = new JSDOC.Walker();
- },
-
- finish: function() {
- JSDOC.Parser.symbols.relate();
-
- // make a litle report about what was found
- if (JSDOC.Parser.conf.explain) {
- var symbols = JSDOC.Parser.symbols.toArray();
- var srcFile = "";
- for (var i = 0, l = symbols.length; i < l; i++) {
- var symbol = symbols[i];
- if (srcFile != symbol.srcFile) {
- srcFile = symbol.srcFile;
- print("\n"+srcFile+"\n-------------------");
- }
- print(i+":\n alias => "+symbol.alias + "\n name => "+symbol.name+ "\n isa => "+symbol.isa + "\n memberOf => " + symbol.memberOf + "\n isStatic => " + symbol.isStatic + ", isInner => " + symbol.isInner+ ", isPrivate => " + symbol.isPrivate);
- }
- print("-------------------\n");
- }
- }
-}
-
-JSDOC.Parser.parse = function(/**JSDOC.TokenStream*/ts, /**String*/srcFile) {
- JSDOC.Symbol.srcFile = (srcFile || "");
- JSDOC.DocComment.shared = ""; // shared comments don't cross file boundaries
-
- if (!JSDOC.Parser.walker) JSDOC.Parser.init();
- JSDOC.Parser.walker.walk(ts); // adds to our symbols
-
- // filter symbols by option
- for (var p = JSDOC.Parser.symbols._index.first(); p; p = JSDOC.Parser.symbols._index.next()) {
- var symbol = p.value;
-
- if (!symbol) continue;
-
- if (symbol.is("FILE") || symbol.is("GLOBAL")) {
- continue;
- }
- else if (!JSDOC.opt.a && !symbol.comment.isUserComment) {
- JSDOC.Parser.symbols.deleteSymbol(symbol.alias);
- }
-
- if (/#$/.test(symbol.alias)) { // we don't document prototypes
- JSDOC.Parser.symbols.deleteSymbol(symbol.alias);
- }
- }
-
- return JSDOC.Parser.symbols.toArray();
-}
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js
deleted file mode 100644
index 5f318ff6f9..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- @namespace Holds functionality related to running plugins.
-*/
-JSDOC.PluginManager = {
-}
-
-/**
- @param name A unique name that identifies that plugin.
- @param handlers A collection of named functions. The names correspond to hooks in the core code.
-*/
-JSDOC.PluginManager.registerPlugin = function(/**String*/name, /**Object*/handlers) {
- if (!defined(JSDOC.PluginManager.plugins))
- /** The collection of all plugins. Requires a unique name for each.
- */
- JSDOC.PluginManager.plugins = {};
-
- JSDOC.PluginManager.plugins[name] = handlers;
-}
-
-/**
- @param hook The name of the hook that is being caught.
- @param target Any object. This will be passed as the only argument to the handler whose
- name matches the hook name. Handlers cannot return a value, so must modify the target
- object to have an effect.
-*/
-JSDOC.PluginManager.run = function(/**String*/hook, /**Mixed*/target) {
- for (var name in JSDOC.PluginManager.plugins) {
- if (defined(JSDOC.PluginManager.plugins[name][hook])) {
- JSDOC.PluginManager.plugins[name][hook](target);
- }
- }
-}
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Symbol.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Symbol.js
deleted file mode 100644
index 807f1406fe..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Symbol.js
+++ /dev/null
@@ -1,643 +0,0 @@
-if (typeof JSDOC == "undefined") JSDOC = {};
-
-/**
- Create a new Symbol.
- @class Represents a symbol in the source code.
- */
-JSDOC.Symbol = function() {
- this.init();
- if (arguments.length) this.populate.apply(this, arguments);
-}
-
-JSDOC.Symbol.count = 0;
-
-JSDOC.Symbol.prototype.init = function() {
- this._name = "";
- this._params = [];
- this.$args = [];
- this.addOn = "";
- this.alias = "";
- this.augments = [];
- this.author = "";
- this.classDesc = "";
- this.comment = {};
- this.defaultValue = undefined;
- this.deprecated = "";
- this.desc = "";
- this.example = [];
- this.exceptions = [];
- this.fires = [];
- this.id = JSDOC.Symbol.count++;
- this.inherits = [];
- this.inheritsFrom = [];
- this.isa = "OBJECT";
- this.isConstant = false;
- this.isEvent = false;
- this.isIgnored = false;
- this.isInner = false;
- this.isNamespace = false;
- this.isPrivate = false;
- this.isStatic = false;
- this.memberOf = "";
- this.methods = [];
- this.properties = [];
- this.requires = [];
- this.returns = [];
- this.see = [];
- this.since = "";
- this.srcFile = {};
- this.type = "";
- this.version = "";
-}
-
-JSDOC.Symbol.prototype.serialize = function() {
- var keys = [];
- for (var p in this) {
- keys.push (p);
- }
- keys = keys.sort();
-
- var out = "";
- for (var i in keys) {
- if (typeof this[keys[i]] == "function") continue;
- out += keys[i]+" => "+Dumper.dump(this[keys[i]])+",\n";
- }
- return "\n{\n" + out + "}\n";
-}
-
-JSDOC.Symbol.prototype.clone = function() {
- var clone = new JSDOC.Symbol();
- clone.populate.apply(clone, this.$args); // repopulate using the original arguments
- clone.srcFile = this.srcFile; // not the current srcFile, the one when the original was made
- return clone;
-}
-
-JSDOC.Symbol.prototype.__defineSetter__("name",
- function(n) { n = n.replace(/^_global_[.#-]/, ""); n = n.replace(/\.prototype\.?/g, '#'); this._name = n; }
-);
-JSDOC.Symbol.prototype.__defineGetter__("name",
- function() { return this._name; }
-);
-JSDOC.Symbol.prototype.__defineSetter__("params",
- function(v) {
- for (var i = 0, l = v.length; i < l; i++) {
- if (v[i].constructor != JSDOC.DocTag) { // may be a generic object parsed from signature, like {type:..., name:...}
- this._params[i] = new JSDOC.DocTag("param"+((v[i].type)?" {"+v[i].type+"}":"")+" "+v[i].name);
- }
- else {
- this._params[i] = v[i];
- }
- }
- }
-);
-JSDOC.Symbol.prototype.__defineGetter__("params",
- function() { return this._params; }
-);
-
-JSDOC.Symbol.prototype.getEvents = function() {
- var events = [];
- for (var i = 0, l = this.methods.length; i < l; i++) {
- if (this.methods[i].isEvent) {
- this.methods[i].name = this.methods[i].name.replace("event:", "");
- events.push(this.methods[i]);
- }
- }
- return events;
-}
-
-JSDOC.Symbol.prototype.getMethods = function() {
- var nonEvents = [];
- for (var i = 0, l = this.methods.length; i < l; i++) {
- if (!this.methods[i].isEvent) {
- nonEvents.push(this.methods[i]);
- }
- }
- return nonEvents;
-}
-
-JSDOC.Symbol.prototype.populate = function(
- /** String */ name,
- /** Object[] */ params,
- /** String */ isa,
- /** JSDOC.DocComment */ comment
-) {
- this.$args = arguments;
-
- this.name = name;
- this.alias = this.name;
-
- this.params = params;
- this.isa = (isa == "VIRTUAL")? "OBJECT":isa;
- this.comment = comment || new JSDOC.DocComment("");
- this.srcFile = JSDOC.Symbol.srcFile;
-
- if (this.is("FILE") && !this.alias) this.alias = this.srcFile;
-
- this.setTags();
-
- if (typeof JSDOC.PluginManager != "undefined") {
- JSDOC.PluginManager.run("onSymbol", this);
- }
-}
-
-JSDOC.Symbol.prototype.setTags = function() {
- // @author
- var authors = this.comment.getTag("author");
- if (authors.length) {
- this.author = authors.map(function($){return $.desc;}).join(", ");
- }
-
- /*t:
- plan(34, "testing JSDOC.Symbol");
-
- requires("../lib/JSDOC/DocComment.js");
- requires("../frame/String.js");
- requires("../lib/JSDOC/DocTag.js");
-
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@author Joe Smith*"+"/"));
- is(sym.author, "Joe Smith", "@author tag, author is found.");
- */
-
- // @desc
- var descs = this.comment.getTag("desc");
- if (descs.length) {
- this.desc = descs.map(function($){return $.desc;}).join("\n"); // multiple descriptions are concatenated into one
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@desc This is a description.*"+"/"));
- is(sym.desc, "This is a description.", "@desc tag, description is found.");
- */
-
- // @overview
- if (this.is("FILE")) {
- if (!this.alias) this.alias = this.srcFile;
-
- var overviews = this.comment.getTag("overview");
- if (overviews.length) {
- this.desc = [this.desc].concat(overviews.map(function($){return $.desc;})).join("\n");
- }
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@overview This is an overview.*"+"/"));
- is(sym.desc, "\nThis is an overview.", "@overview tag, description is found.");
- */
-
- // @since
- var sinces = this.comment.getTag("since");
- if (sinces.length) {
- this.since = sinces.map(function($){return $.desc;}).join(", ");
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@since 1.01*"+"/"));
- is(sym.since, "1.01", "@since tag, description is found.");
- */
-
- // @constant
- if (this.comment.getTag("constant").length) {
- this.isConstant = true;
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@constant*"+"/"));
- is(sym.isConstant, true, "@constant tag, isConstant set.");
- */
-
- // @version
- var versions = this.comment.getTag("version");
- if (versions.length) {
- this.version = versions.map(function($){return $.desc;}).join(", ");
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@version 2.0x*"+"/"));
- is(sym.version, "2.0x", "@version tag, version is found.");
- */
-
- // @deprecated
- var deprecateds = this.comment.getTag("deprecated");
- if (deprecateds.length) {
- this.deprecated = deprecateds.map(function($){return $.desc;}).join("\n");
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@deprecated Use other method.*"+"/"));
- is(sym.deprecated, "Use other method.", "@deprecated tag, desc is found.");
- */
-
- // @example
- var examples = this.comment.getTag("example");
- if (examples.length) {
- this.example = examples.map(
- // trim trailing whitespace
- function($) {
- $.desc = $.desc.replace(/\s+$/, "");
- return $;
- }
- );
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@example This\n is an example. \n*"+"/"));
- isnt(typeof sym.example[0], "undefined", "@example tag, creates sym.example array.");
- is(sym.example[0], "This\n is an example.", "@example tag, desc is found.");
- */
-
- // @see
- var sees = this.comment.getTag("see");
- if (sees.length) {
- var thisSee = this.see;
- sees.map(function($){thisSee.push($.desc);});
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "FILE", new JSDOC.DocComment("/**@see The other thing.*"+"/"));
- is(sym.see, "The other thing.", "@see tag, desc is found.");
- */
-
- // @class
- var classes = this.comment.getTag("class");
- if (classes.length) {
- this.isa = "CONSTRUCTOR";
- this.classDesc = classes[0].desc; // desc can't apply to the constructor as there is none.
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@class This describes the class.*"+"/"));
- is(sym.isa, "CONSTRUCTOR", "@class tag, makes symbol a constructor.");
- is(sym.classDesc, "This describes the class.", "@class tag, class description is found.");
- */
-
- // @namespace
- var namespaces = this.comment.getTag("namespace");
- if (namespaces.length) {
- this.classDesc = namespaces[0].desc;
- this.isNamespace = true;
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@namespace This describes the namespace.*"+"/"));
- is(sym.classDesc, "This describes the namespace.", "@namespace tag, class description is found.");
- */
-
- // @param
- var params = this.comment.getTag("param");
- if (params.length) {
- // user-defined params overwrite those with same name defined by the parser
- var thisParams = this.params;
-
- if (thisParams.length == 0) { // none exist yet, so just bung all these user-defined params straight in
- this.params = params;
- }
- else { // need to overlay these user-defined params on to existing parser-defined params
- for (var i = 0, l = params.length; i < l; i++) {
- if (thisParams[i]) {
- if (params[i].type) thisParams[i].type = params[i].type;
- thisParams[i].name = params[i].name;
- thisParams[i].desc = params[i].desc;
- thisParams[i].isOptional = params[i].isOptional;
- thisParams[i].defaultValue = params[i].defaultValue;
- }
- else thisParams[i] = params[i];
- }
- }
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [{type: "array", name: "pages"}], "FUNCTION", new JSDOC.DocComment("/**Description.*"+"/"));
- is(sym.params.length, 1, "parser defined param is found.");
-
- sym = new JSDOC.Symbol("foo", [], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {array} pages*"+"/"));
- is(sym.params.length, 1, "user defined param is found.");
- is(sym.params[0].type, "array", "user defined param type is found.");
- is(sym.params[0].name, "pages", "user defined param name is found.");
-
- sym = new JSDOC.Symbol("foo", [{type: "array", name: "pages"}], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {string} uid*"+"/"));
- is(sym.params.length, 1, "user defined param overwrites parser defined param.");
- is(sym.params[0].type, "string", "user defined param type overwrites parser defined param type.");
- is(sym.params[0].name, "uid", "user defined param name overwrites parser defined param name.");
-
- sym = new JSDOC.Symbol("foo", [{type: "array", name: "pages"}, {type: "number", name: "count"}], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {string} uid*"+"/"));
- is(sym.params.length, 2, "user defined params overlay parser defined params.");
- is(sym.params[1].type, "number", "user defined param type overlays parser defined param type.");
- is(sym.params[1].name, "count", "user defined param name overlays parser defined param name.");
-
- sym = new JSDOC.Symbol("foo", [], "FUNCTION", new JSDOC.DocComment("/**Description.\n@param {array} pages The pages description.*"+"/"));
- is(sym.params.length, 1, "user defined param with description is found.");
- is(sym.params[0].desc, "The pages description.", "user defined param description is found.");
- */
-
- // @constructor
- if (this.comment.getTag("constructor").length) {
- this.isa = "CONSTRUCTOR";
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@constructor*"+"/"));
- is(sym.isa, "CONSTRUCTOR", "@constructor tag, makes symbol a constructor.");
- */
-
- // @static
- if (this.comment.getTag("static").length) {
- this.isStatic = true;
- if (this.isa == "CONSTRUCTOR") {
- this.isNamespace = true;
- }
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@static\n@constructor*"+"/"));
- is(sym.isStatic, true, "@static tag, makes isStatic true.");
- is(sym.isNamespace, true, "@static and @constructor tag, makes isNamespace true.");
- */
-
- // @inner
- if (this.comment.getTag("inner").length) {
- this.isInner = true;
- this.isStatic = false;
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@inner*"+"/"));
- is(sym.isStatic, false, "@inner tag, makes isStatic false.");
- is(sym.isInner, true, "@inner makes isInner true.");
- */
-
- // @name
- var names = this.comment.getTag("name");
- if (names.length) {
- this.name = names[0].desc;
- }
-
- /*t:
- // todo
- */
-
- // @field
- if (this.comment.getTag("field").length) {
- this.isa = "OBJECT";
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "FUNCTION", new JSDOC.DocComment("/**@field*"+"/"));
- is(sym.isa, "OBJECT", "@field tag, makes symbol an object.");
- */
-
- // @function
- if (this.comment.getTag("function").length) {
- this.isa = "FUNCTION";
- if (/event:/.test(this.alias)) this.isEvent = true;
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@function*"+"/"));
- is(sym.isa, "FUNCTION", "@function tag, makes symbol a function.");
- */
-
- // @event
- var events = this.comment.getTag("event");
- if (events.length) {
- this.isa = "FUNCTION";
- this.isEvent = true;
- if (!/event:/.test(this.alias))
- this.alias = this.alias.replace(/^(.*[.#-])([^.#-]+)$/, "$1event:$2");
- }
-
- /*t:
- var sym = new JSDOC.Symbol("foo", [], "OBJECT", new JSDOC.DocComment("/**@event*"+"/"));
- is(sym.isa, "FUNCTION", "@event tag, makes symbol a function.");
- is(sym.isEvent, true, "@event makes isEvent true.");
- */
-
- // @fires
- var fires = this.comment.getTag("fires");
- if (fires.length) {
- for (var i = 0; i < fires.length; i++) {
- this.fires.push(fires[i].desc);
- }
- }
-
- /*t:
- // todo
- */
-
- // @property
- var properties = this.comment.getTag("property");
- if (properties.length) {
- thisProperties = this.properties;
- for (var i = 0; i < properties.length; i++) {
- var property = new JSDOC.Symbol(this.alias+"#"+properties[i].name, [], "OBJECT", new JSDOC.DocComment("/**"+properties[i].desc+"*/"));
- // TODO: shouldn't the following happen in the addProperty method of Symbol?
- if (properties[i].type) property.type = properties[i].type;
- if (properties[i].defaultValue) property.defaultValue = properties[i].defaultValue;
- this.addProperty(property);
- if (!JSDOC.Parser.symbols.getSymbolByName(property.name))
- JSDOC.Parser.addSymbol(property);
- }
- }
-
- /*t:
- // todo
- */
-
- // @return
- var returns = this.comment.getTag("return");
- if (returns.length) { // there can be many return tags in a single doclet
- this.returns = returns;
- this.type = returns.map(function($){return $.type}).join(", ");
- }
-
- /*t:
- // todo
- */
-
- // @exception
- this.exceptions = this.comment.getTag("throws");
-
- /*t:
- // todo
- */
-
- // @requires
- var requires = this.comment.getTag("requires");
- if (requires.length) {
- this.requires = requires.map(function($){return $.desc});
- }
-
- /*t:
- // todo
- */
-
- // @type
- var types = this.comment.getTag("type");
- if (types.length) {
- this.type = types[0].desc; //multiple type tags are ignored
- }
-
- /*t:
- // todo
- */
-
- // @private
- if (this.comment.getTag("private").length || this.isInner) {
- this.isPrivate = true;
- }
-
- // @ignore
- if (this.comment.getTag("ignore").length) {
- this.isIgnored = true;
- }
-
- /*t:
- // todo
- */
-
- // @inherits ... as ...
- var inherits = this.comment.getTag("inherits");
- if (inherits.length) {
- for (var i = 0; i < inherits.length; i++) {
- if (/^\s*([a-z$0-9_.#:-]+)(?:\s+as\s+([a-z$0-9_.#:-]+))?/i.test(inherits[i].desc)) {
- var inAlias = RegExp.$1;
- var inAs = RegExp.$2 || inAlias;
-
- if (inAlias) inAlias = inAlias.replace(/\.prototype\.?/g, "#");
-
- if (inAs) {
- inAs = inAs.replace(/\.prototype\.?/g, "#");
- inAs = inAs.replace(/^this\.?/, "#");
- }
-
- if (inAs.indexOf(inAlias) != 0) { //not a full namepath
- var joiner = ".";
- if (this.alias.charAt(this.alias.length-1) == "#" || inAs.charAt(0) == "#") {
- joiner = "";
- }
- inAs = this.alias + joiner + inAs;
- }
- }
- this.inherits.push({alias: inAlias, as: inAs});
- }
- }
-
- /*t:
- // todo
- */
-
- // @augments
- this.augments = this.comment.getTag("augments");
-
- // @default
- var defaults = this.comment.getTag("default");
- if (defaults.length) {
- if (this.is("OBJECT")) {
- this.defaultValue = defaults[0].desc;
- }
- }
-
- /*t:
- // todo
- */
-
- // @memberOf
- var memberOfs = this.comment.getTag("memberOf");
- if (memberOfs.length) {
- this.memberOf = memberOfs[0].desc;
- this.memberOf = this.memberOf.replace(/\.prototype\.?/g, "#");
- }
-
- /*t:
- // todo
- */
-
- // @public
- if (this.comment.getTag("public").length) {
- this.isPrivate = false;
- }
-
- /*t:
- // todo
- */
-
- if (JSDOC.PluginManager) {
- JSDOC.PluginManager.run("onSetTags", this);
- }
-}
-
-JSDOC.Symbol.prototype.is = function(what) {
- return this.isa === what;
-}
-
-JSDOC.Symbol.prototype.isBuiltin = function() {
- return JSDOC.Lang.isBuiltin(this.alias);
-}
-
-JSDOC.Symbol.prototype.setType = function(/**String*/comment, /**Boolean*/overwrite) {
- if (!overwrite && this.type) return;
- var typeComment = JSDOC.DocComment.unwrapComment(comment);
- this.type = typeComment;
-}
-
-JSDOC.Symbol.prototype.inherit = function(symbol) {
- if (!this.hasMember(symbol.name) && !symbol.isInner) {
- if (symbol.is("FUNCTION"))
- this.methods.push(symbol);
- else if (symbol.is("OBJECT"))
- this.properties.push(symbol);
- }
-}
-
-JSDOC.Symbol.prototype.hasMember = function(name) {
- return (this.hasMethod(name) || this.hasProperty(name));
-}
-
-JSDOC.Symbol.prototype.addMember = function(symbol) {
- if (symbol.is("FUNCTION")) { this.addMethod(symbol); }
- else if (symbol.is("OBJECT")) { this.addProperty(symbol); }
-}
-
-JSDOC.Symbol.prototype.hasMethod = function(name) {
- var thisMethods = this.methods;
- for (var i = 0, l = thisMethods.length; i < l; i++) {
- if (thisMethods[i].name == name) return true;
- if (thisMethods[i].alias == name) return true;
- }
- return false;
-}
-
-JSDOC.Symbol.prototype.addMethod = function(symbol) {
- var methodAlias = symbol.alias;
- var thisMethods = this.methods;
- for (var i = 0, l = thisMethods.length; i < l; i++) {
- if (thisMethods[i].alias == methodAlias) {
- thisMethods[i] = symbol; // overwriting previous method
- return;
- }
- }
- thisMethods.push(symbol); // new method with this alias
-}
-
-JSDOC.Symbol.prototype.hasProperty = function(name) {
- var thisProperties = this.properties;
- for (var i = 0, l = thisProperties.length; i < l; i++) {
- if (thisProperties[i].name == name) return true;
- if (thisProperties[i].alias == name) return true;
- }
- return false;
-}
-
-JSDOC.Symbol.prototype.addProperty = function(symbol) {
- var propertyAlias = symbol.alias;
- var thisProperties = this.properties;
- for (var i = 0, l = thisProperties.length; i < l; i++) {
- if (thisProperties[i].alias == propertyAlias) {
- thisProperties[i] = symbol; // overwriting previous property
- return;
- }
- }
-
- thisProperties.push(symbol); // new property with this alias
-}
-
-JSDOC.Symbol.srcFile = ""; //running reference to the current file being parsed
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js
deleted file mode 100644
index 8afd4066cf..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js
+++ /dev/null
@@ -1,243 +0,0 @@
-/** @constructor */
-JSDOC.SymbolSet = function() {
- this.init();
-}
-
-JSDOC.SymbolSet.prototype.init = function() {
- this._index = new Hash();
-}
-
-JSDOC.SymbolSet.prototype.keys = function() {
- return this._index.keys();
-}
-
-JSDOC.SymbolSet.prototype.hasSymbol = function(alias) {
- return this._index.hasKey(alias);
-}
-
-JSDOC.SymbolSet.prototype.addSymbol = function(symbol) {
- if (JSDOC.opt.a && this.hasSymbol(symbol.alias)) {
- LOG.warn("Overwriting symbol documentation for: " + symbol.alias + ".");
- this.deleteSymbol(symbol.alias);
- }
- this._index.set(symbol.alias, symbol);
-}
-
-JSDOC.SymbolSet.prototype.getSymbol = function(alias) {
- if (this.hasSymbol(alias)) return this._index.get(alias);
-}
-
-JSDOC.SymbolSet.prototype.getSymbolByName = function(name) {
- for (var p = this._index.first(); p; p = this._index.next()) {
- var symbol = p.value;
- if (symbol.name == name) return symbol;
- }
-}
-
-JSDOC.SymbolSet.prototype.toArray = function() {
- return this._index.values();
-}
-
-JSDOC.SymbolSet.prototype.deleteSymbol = function(alias) {
- if (!this.hasSymbol(alias)) return;
- this._index.drop(alias);
-}
-
-JSDOC.SymbolSet.prototype.renameSymbol = function(oldName, newName) {
- // todo: should check if oldname or newname already exist
- this._index.replace(oldName, newName);
- this._index.get(newName).alias = newName;
- return newName;
-}
-
-JSDOC.SymbolSet.prototype.relate = function() {
- this.resolveBorrows();
- this.resolveMemberOf();
- this.resolveAugments();
-}
-
-JSDOC.SymbolSet.prototype.resolveBorrows = function() {
- for (var p = this._index.first(); p; p = this._index.next()) {
- var symbol = p.value;
- if (symbol.is("FILE") || symbol.is("GLOBAL")) continue;
-
- var borrows = symbol.inherits;
- for (var i = 0; i < borrows.length; i++) {
-
-if (/#$/.test(borrows[i].alias)) {
- LOG.warn("Attempted to borrow entire instance of "+borrows[i].alias+" but that feature is not yet implemented.");
- return;
-}
- var borrowed = this.getSymbol(borrows[i].alias);
-
- if (!borrowed) {
- LOG.warn("Can't borrow undocumented "+borrows[i].alias+".");
- continue;
- }
-
- if (borrows[i].as == borrowed.alias) {
- var assumedName = borrowed.name.split(/([#.-])/).pop();
- borrows[i].as = symbol.name+RegExp.$1+assumedName;
- LOG.inform("Assuming borrowed as name is "+borrows[i].as+" but that feature is experimental.");
- }
-
- var borrowAsName = borrows[i].as;
- var borrowAsAlias = borrowAsName;
- if (!borrowAsName) {
- LOG.warn("Malformed @borrow, 'as' is required.");
- continue;
- }
-
- if (borrowAsName.length > symbol.alias.length && borrowAsName.indexOf(symbol.alias) == 0) {
- borrowAsName = borrowAsName.replace(borrowed.alias, "")
- }
- else {
- var joiner = "";
- if (borrowAsName.charAt(0) != "#") joiner = ".";
- borrowAsAlias = borrowed.alias + joiner + borrowAsName;
- }
-
- borrowAsName = borrowAsName.replace(/^[#.]/, "");
-
- if (this.hasSymbol(borrowAsAlias)) continue;
-
- var clone = borrowed.clone();
- clone.name = borrowAsName;
- clone.alias = borrowAsAlias;
- this.addSymbol(clone);
- }
- }
-}
-
-JSDOC.SymbolSet.prototype.resolveMemberOf = function() {
- for (var p = this._index.first(); p; p = this._index.next()) {
- var symbol = p.value;
-
- if (symbol.is("FILE") || symbol.is("GLOBAL")) continue;
-
- // the memberOf value was provided in the @memberOf tag
- else if (symbol.memberOf) {
- // like foo.bar is a memberOf foo
- if (symbol.alias.indexOf(symbol.memberOf) == 0) {
- var memberMatch = new RegExp("^("+symbol.memberOf+")[.#-]?(.+)$");
- var aliasParts = symbol.alias.match(memberMatch);
-
- if (aliasParts) {
- symbol.memberOf = aliasParts[1];
- symbol.name = aliasParts[2];
- }
-
- var nameParts = symbol.name.match(memberMatch);
-
- if (nameParts) {
- symbol.name = nameParts[2];
- }
- }
- // like bar is a memberOf foo
- else {
- var joiner = symbol.memberOf.charAt(symbol.memberOf.length-1);
- if (!/[.#-]/.test(joiner)) symbol.memberOf += ".";
- this.renameSymbol(symbol.alias, symbol.memberOf + symbol.name);
- }
- }
- // the memberOf must be calculated
- else {
- var parts = symbol.alias.match(/^(.*[.#-])([^.#-]+)$/);
-
- if (parts) {
- symbol.memberOf = parts[1];
- symbol.name = parts[2];
- }
- }
-
- // set isStatic, isInner
- if (symbol.memberOf) {
- switch (symbol.memberOf.charAt(symbol.memberOf.length-1)) {
- case '#' :
- symbol.isStatic = false;
- symbol.isInner = false;
- break;
- case '.' :
- symbol.isStatic = true;
- symbol.isInner = false;
- break;
- case '-' :
- symbol.isStatic = false;
- symbol.isInner = true;
- break;
- default: // memberOf ends in none of the above
- symbol.isStatic = true;
- break;
- }
- }
-
- // unowned methods and fields belong to the global object
- if (!symbol.is("CONSTRUCTOR") && !symbol.isNamespace && symbol.memberOf == "") {
- symbol.memberOf = "_global_";
- }
-
- // clean up
- if (symbol.memberOf.match(/[.#-]$/)) {
- symbol.memberOf = symbol.memberOf.substr(0, symbol.memberOf.length-1);
- }
- // add to parent's methods or properties list
- if (symbol.memberOf) {
-
- var container = this.getSymbol(symbol.memberOf);
- if (!container) {
- if (JSDOC.Lang.isBuiltin(symbol.memberOf)) container = JSDOC.Parser.addBuiltin(symbol.memberOf);
- else {
- LOG.warn("Trying to document "+symbol.name +" as a member of undocumented symbol "+symbol.memberOf+".");
- }
- }
-
- if (container) container.addMember(symbol);
- }
- }
-}
-
-JSDOC.SymbolSet.prototype.resolveAugments = function() {
- for (var p = this._index.first(); p; p = this._index.next()) {
- var symbol = p.value;
-
- if (symbol.alias == "_global_" || symbol.is("FILE")) continue;
- JSDOC.SymbolSet.prototype.walk.apply(this, [symbol]);
- }
-}
-
-JSDOC.SymbolSet.prototype.walk = function(symbol) {
- var augments = symbol.augments;
- for(var i = 0; i < augments.length; i++) {
- var contributer = this.getSymbol(augments[i]);
- if (!contributer && JSDOC.Lang.isBuiltin(''+augments[i])) {
- contributer = new JSDOC.Symbol("_global_."+augments[i], [], augments[i], new JSDOC.DocComment("Built in."));
- contributer.isNamespace = true;
- contributer.srcFile = "";
- contributer.isPrivate = false;
- JSDOC.Parser.addSymbol(contributer);
- }
-
- if (contributer) {
- if (contributer.augments.length) {
- JSDOC.SymbolSet.prototype.walk.apply(this, [contributer]);
- }
-
- symbol.inheritsFrom.push(contributer.alias);
- //if (!isUnique(symbol.inheritsFrom)) {
- // LOG.warn("Can't resolve augments: Circular reference: "+symbol.alias+" inherits from "+contributer.alias+" more than once.");
- //}
- //else {
- var cmethods = contributer.methods;
- var cproperties = contributer.properties;
-
- for (var ci = 0, cl = cmethods.length; ci < cl; ci++) {
- if (!cmethods[ci].isStatic) symbol.inherit(cmethods[ci]);
- }
- for (var ci = 0, cl = cproperties.length; ci < cl; ci++) {
- if (!cproperties[ci].isStatic) symbol.inherit(cproperties[ci]);
- }
- //}
- }
- else LOG.warn("Can't augment contributer: "+augments[i]+", not found.");
- }
-}
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/TextStream.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/TextStream.js
deleted file mode 100644
index b4bd1496a8..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/TextStream.js
+++ /dev/null
@@ -1,41 +0,0 @@
-
-/**
- @constructor
-*/
-JSDOC.TextStream = function(text) {
- if (typeof(text) == "undefined") text = "";
- text = ""+text;
- this.text = text;
- this.cursor = 0;
-}
-
-JSDOC.TextStream.prototype.look = function(n) {
- if (typeof n == "undefined") n = 0;
-
- if (this.cursor+n < 0 || this.cursor+n >= this.text.length) {
- var result = new String("");
- result.eof = true;
- return result;
- }
- return this.text.charAt(this.cursor+n);
-}
-
-JSDOC.TextStream.prototype.next = function(n) {
- if (typeof n == "undefined") n = 1;
- if (n < 1) return null;
-
- var pulled = "";
- for (var i = 0; i < n; i++) {
- if (this.cursor+i < this.text.length) {
- pulled += this.text.charAt(this.cursor+i);
- }
- else {
- var result = new String("");
- result.eof = true;
- return result;
- }
- }
-
- this.cursor += n;
- return pulled;
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Token.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Token.js
deleted file mode 100644
index c862d4fbed..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Token.js
+++ /dev/null
@@ -1,18 +0,0 @@
-if (typeof JSDOC == "undefined") JSDOC = {};
-
-/**
- @constructor
-*/
-JSDOC.Token = function(data, type, name) {
- this.data = data;
- this.type = type;
- this.name = name;
-}
-
-JSDOC.Token.prototype.toString = function() {
- return "<"+this.type+" name=\""+this.name+"\">"+this.data+"</"+this.type+">";
-}
-
-JSDOC.Token.prototype.is = function(what) {
- return this.name === what || this.type === what;
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js
deleted file mode 100644
index cf30da3842..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js
+++ /dev/null
@@ -1,332 +0,0 @@
-if (typeof JSDOC == "undefined") JSDOC = {};
-
-/**
- @class Search a {@link JSDOC.TextStream} for language tokens.
-*/
-JSDOC.TokenReader = function() {
- this.keepDocs = true;
- this.keepWhite = false;
- this.keepComments = false;
-}
-
-/**
- @type {JSDOC.Token[]}
- */
-JSDOC.TokenReader.prototype.tokenize = function(/**JSDOC.TextStream*/stream) {
- var tokens = [];
- /**@ignore*/ tokens.last = function() { return tokens[tokens.length-1]; }
- /**@ignore*/ tokens.lastSym = function() {
- for (var i = tokens.length-1; i >= 0; i--) {
- if (!(tokens[i].is("WHIT") || tokens[i].is("COMM"))) return tokens[i];
- }
- }
-
- while (!stream.look().eof) {
- if (this.read_mlcomment(stream, tokens)) continue;
- if (this.read_slcomment(stream, tokens)) continue;
- if (this.read_dbquote(stream, tokens)) continue;
- if (this.read_snquote(stream, tokens)) continue;
- if (this.read_regx(stream, tokens)) continue;
- if (this.read_numb(stream, tokens)) continue;
- if (this.read_punc(stream, tokens)) continue;
- if (this.read_newline(stream, tokens)) continue;
- if (this.read_space(stream, tokens)) continue;
- if (this.read_word(stream, tokens)) continue;
-
- // if execution reaches here then an error has happened
- tokens.push(new JSDOC.Token(stream.next(), "TOKN", "UNKNOWN_TOKEN"));
- }
- return tokens;
-}
-
-/**
- @returns {Boolean} Was the token found?
- */
-JSDOC.TokenReader.prototype.read_word = function(/**JSDOC.TokenStream*/stream, tokens) {
- var found = "";
- while (!stream.look().eof && JSDOC.Lang.isWordChar(stream.look())) {
- found += stream.next();
- }
-
- if (found === "") {
- return false;
- }
- else {
- var name;
- if ((name = JSDOC.Lang.keyword(found))) tokens.push(new JSDOC.Token(found, "KEYW", name));
- else tokens.push(new JSDOC.Token(found, "NAME", "NAME"));
- return true;
- }
-}
-
-/**
- @returns {Boolean} Was the token found?
- */
-JSDOC.TokenReader.prototype.read_punc = function(/**JSDOC.TokenStream*/stream, tokens) {
- var found = "";
- var name;
- while (!stream.look().eof && JSDOC.Lang.punc(found+stream.look())) {
- found += stream.next();
- }
-
- if (found === "") {
- return false;
- }
- else {
- tokens.push(new JSDOC.Token(found, "PUNC", JSDOC.Lang.punc(found)));
- return true;
- }
-}
-
-/**
- @returns {Boolean} Was the token found?
- */
-JSDOC.TokenReader.prototype.read_space = function(/**JSDOC.TokenStream*/stream, tokens) {
- var found = "";
-
- while (!stream.look().eof && JSDOC.Lang.isSpace(stream.look())) {
- found += stream.next();
- }
-
- if (found === "") {
- return false;
- }
- else {
- if (this.collapseWhite) found = " ";
- if (this.keepWhite) tokens.push(new JSDOC.Token(found, "WHIT", "SPACE"));
- return true;
- }
-}
-
-/**
- @returns {Boolean} Was the token found?
- */
-JSDOC.TokenReader.prototype.read_newline = function(/**JSDOC.TokenStream*/stream, tokens) {
- var found = "";
-
- while (!stream.look().eof && JSDOC.Lang.isNewline(stream.look())) {
- found += stream.next();
- }
-
- if (found === "") {
- return false;
- }
- else {
- if (this.collapseWhite) found = "\n";
- if (this.keepWhite) tokens.push(new JSDOC.Token(found, "WHIT", "NEWLINE"));
- return true;
- }
-}
-
-/**
- @returns {Boolean} Was the token found?
- */
-JSDOC.TokenReader.prototype.read_mlcomment = function(/**JSDOC.TokenStream*/stream, tokens) {
- if (stream.look() == "/" && stream.look(1) == "*") {
- var found = stream.next(2);
-
- while (!stream.look().eof && !(stream.look(-1) == "/" && stream.look(-2) == "*")) {
- found += stream.next();
- }
-
- // to start doclet we allow /** or /*** but not /**/ or /****
- if (/^\/\*\*([^\/]|\*[^*])/.test(found) && this.keepDocs) tokens.push(new JSDOC.Token(found, "COMM", "JSDOC"));
- else if (this.keepComments) tokens.push(new JSDOC.Token(found, "COMM", "MULTI_LINE_COMM"));
- return true;
- }
- return false;
-}
-
-/**
- @returns {Boolean} Was the token found?
- */
-JSDOC.TokenReader.prototype.read_slcomment = function(/**JSDOC.TokenStream*/stream, tokens) {
- var found;
- if (
- (stream.look() == "/" && stream.look(1) == "/" && (found=stream.next(2)))
- ||
- (stream.look() == "<" && stream.look(1) == "!" && stream.look(2) == "-" && stream.look(3) == "-" && (found=stream.next(4)))
- ) {
-
- while (!stream.look().eof && !JSDOC.Lang.isNewline(stream.look())) {
- found += stream.next();
- }
-
- if (this.keepComments) {
- tokens.push(new JSDOC.Token(found, "COMM", "SINGLE_LINE_COMM"));
- }
- return true;
- }
- return false;
-}
-
-/**
- @returns {Boolean} Was the token found?
- */
-JSDOC.TokenReader.prototype.read_dbquote = function(/**JSDOC.TokenStream*/stream, tokens) {
- if (stream.look() == "\"") {
- // find terminator
- var string = stream.next();
-
- while (!stream.look().eof) {
- if (stream.look() == "\\") {
- if (JSDOC.Lang.isNewline(stream.look(1))) {
- do {
- stream.next();
- } while (!stream.look().eof && JSDOC.Lang.isNewline(stream.look()));
- string += "\\\n";
- }
- else {
- string += stream.next(2);
- }
- }
- else if (stream.look() == "\"") {
- string += stream.next();
- tokens.push(new JSDOC.Token(string, "STRN", "DOUBLE_QUOTE"));
- return true;
- }
- else {
- string += stream.next();
- }
- }
- }
- return false; // error! unterminated string
-}
-
-/**
- @returns {Boolean} Was the token found?
- */
-JSDOC.TokenReader.prototype.read_snquote = function(/**JSDOC.TokenStream*/stream, tokens) {
- if (stream.look() == "'") {
- // find terminator
- var string = stream.next();
-
- while (!stream.look().eof) {
- if (stream.look() == "\\") { // escape sequence
- string += stream.next(2);
- }
- else if (stream.look() == "'") {
- string += stream.next();
- tokens.push(new JSDOC.Token(string, "STRN", "SINGLE_QUOTE"));
- return true;
- }
- else {
- string += stream.next();
- }
- }
- }
- return false; // error! unterminated string
-}
-
-/**
- @returns {Boolean} Was the token found?
- */
-JSDOC.TokenReader.prototype.read_numb = function(/**JSDOC.TokenStream*/stream, tokens) {
- if (stream.look() === "0" && stream.look(1) == "x") {
- return this.read_hex(stream, tokens);
- }
-
- var found = "";
-
- while (!stream.look().eof && JSDOC.Lang.isNumber(found+stream.look())){
- found += stream.next();
- }
-
- if (found === "") {
- return false;
- }
- else {
- if (/^0[0-7]/.test(found)) tokens.push(new JSDOC.Token(found, "NUMB", "OCTAL"));
- else tokens.push(new JSDOC.Token(found, "NUMB", "DECIMAL"));
- return true;
- }
-}
-/*t:
- requires("../lib/JSDOC/TextStream.js");
- requires("../lib/JSDOC/Token.js");
- requires("../lib/JSDOC/Lang.js");
-
- plan(3, "testing JSDOC.TokenReader.prototype.read_numb");
-
- //// setup
- var src = "function foo(num){while (num+8.0 >= 0x20 && num < 0777){}}";
- var tr = new JSDOC.TokenReader();
- var tokens = tr.tokenize(new JSDOC.TextStream(src));
-
- var hexToken, octToken, decToken;
- for (var i = 0; i < tokens.length; i++) {
- if (tokens[i].name == "HEX_DEC") hexToken = tokens[i];
- if (tokens[i].name == "OCTAL") octToken = tokens[i];
- if (tokens[i].name == "DECIMAL") decToken = tokens[i];
- }
- ////
-
- is(decToken.data, "8.0", "decimal number is found in source.");
- is(hexToken.data, "0x20", "hexdec number is found in source (issue #99).");
- is(octToken.data, "0777", "octal number is found in source.");
-*/
-
-/**
- @returns {Boolean} Was the token found?
- */
-JSDOC.TokenReader.prototype.read_hex = function(/**JSDOC.TokenStream*/stream, tokens) {
- var found = stream.next(2);
-
- while (!stream.look().eof) {
- if (JSDOC.Lang.isHexDec(found) && !JSDOC.Lang.isHexDec(found+stream.look())) { // done
- tokens.push(new JSDOC.Token(found, "NUMB", "HEX_DEC"));
- return true;
- }
- else {
- found += stream.next();
- }
- }
- return false;
-}
-
-/**
- @returns {Boolean} Was the token found?
- */
-JSDOC.TokenReader.prototype.read_regx = function(/**JSDOC.TokenStream*/stream, tokens) {
- var last;
- if (
- stream.look() == "/"
- &&
- (
-
- (
- !(last = tokens.lastSym()) // there is no last, the regex is the first symbol
- ||
- (
- !last.is("NUMB")
- && !last.is("NAME")
- && !last.is("RIGHT_PAREN")
- && !last.is("RIGHT_BRACKET")
- )
- )
- )
- ) {
- var regex = stream.next();
-
- while (!stream.look().eof) {
- if (stream.look() == "\\") { // escape sequence
- regex += stream.next(2);
- }
- else if (stream.look() == "/") {
- regex += stream.next();
-
- while (/[gmi]/.test(stream.look())) {
- regex += stream.next();
- }
-
- tokens.push(new JSDOC.Token(regex, "REGX", "REGX"));
- return true;
- }
- else {
- regex += stream.next();
- }
- }
- // error: unterminated regex
- }
- return false;
-}
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js
deleted file mode 100644
index 0d799069fd..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js
+++ /dev/null
@@ -1,133 +0,0 @@
-if (typeof JSDOC == "undefined") JSDOC = {};
-
-/**
- @constructor
-*/
-JSDOC.TokenStream = function(tokens) {
- this.tokens = (tokens || []);
- this.rewind();
-}
-
-/**
- @constructor
- @private
-*/
-function VoidToken(/**String*/type) {
- this.toString = function() {return "<VOID type=\""+type+"\">"};
- this.is = function(){return false;}
-}
-
-JSDOC.TokenStream.prototype.rewind = function() {
- this.cursor = -1;
-}
-
-/**
- @type JSDOC.Token
-*/
-JSDOC.TokenStream.prototype.look = function(/**Number*/n, /**Boolean*/considerWhitespace) {
- if (typeof n == "undefined") n = 0;
-
- if (considerWhitespace == true) {
- if (this.cursor+n < 0 || this.cursor+n > this.tokens.length) return {};
- return this.tokens[this.cursor+n];
- }
- else {
- var count = 0;
- var i = this.cursor;
-
- while (true) {
- if (i < 0) return new JSDOC.Token("", "VOID", "START_OF_STREAM");
- else if (i > this.tokens.length) return new JSDOC.Token("", "VOID", "END_OF_STREAM");
-
- if (i != this.cursor && (this.tokens[i] === undefined || this.tokens[i].is("WHIT"))) {
- if (n < 0) i--; else i++;
- continue;
- }
-
- if (count == Math.abs(n)) {
- return this.tokens[i];
- }
- count++;
- (n < 0)? i-- : i++;
- }
-
- return new JSDOC.Token("", "VOID", "STREAM_ERROR"); // because null isn't an object and caller always expects an object
- }
-}
-
-/**
- @type JSDOC.Token|JSDOC.Token[]
-*/
-JSDOC.TokenStream.prototype.next = function(/**Number*/howMany) {
- if (typeof howMany == "undefined") howMany = 1;
- if (howMany < 1) return null;
- var got = [];
-
- for (var i = 1; i <= howMany; i++) {
- if (this.cursor+i >= this.tokens.length) {
- return null;
- }
- got.push(this.tokens[this.cursor+i]);
- }
- this.cursor += howMany;
-
- if (howMany == 1) {
- return got[0];
- }
- else return got;
-}
-
-/**
- @type JSDOC.Token[]
-*/
-JSDOC.TokenStream.prototype.balance = function(/**String*/start, /**String*/stop) {
- if (!stop) stop = JSDOC.Lang.matching(start);
-
- var depth = 0;
- var got = [];
- var started = false;
-
- while ((token = this.look())) {
- if (token.is(start)) {
- depth++;
- started = true;
- }
-
- if (started) {
- got.push(token);
- }
-
- if (token.is(stop)) {
- depth--;
- if (depth == 0) return got;
- }
- if (!this.next()) break;
- }
-}
-
-JSDOC.TokenStream.prototype.getMatchingToken = function(/**String*/start, /**String*/stop) {
- var depth = 0;
- var cursor = this.cursor;
-
- if (!start) {
- start = JSDOC.Lang.matching(stop);
- depth = 1;
- }
- if (!stop) stop = JSDOC.Lang.matching(start);
-
- while ((token = this.tokens[cursor])) {
- if (token.is(start)) {
- depth++;
- }
-
- if (token.is(stop) && cursor) {
- depth--;
- if (depth == 0) return this.tokens[cursor];
- }
- cursor++;
- }
-}
-
-JSDOC.TokenStream.prototype.insertAhead = function(/**JSDOC.Token*/token) {
- this.tokens.splice(this.cursor+1, 0, token);
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Util.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Util.js
deleted file mode 100644
index 6d7edb3680..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Util.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * @namespace
- * @deprecated Use {@link FilePath} instead.
- */
-JSDOC.Util = {
-}
-
-/**
- * @deprecated Use {@link FilePath.fileName} instead.
- */
-JSDOC.Util.fileName = function(path) {
- LOG.warn("JSDOC.Util.fileName is deprecated. Use FilePath.fileName instead.");
- var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
- return path.substring(nameStart);
-}
-
-/**
- * @deprecated Use {@link FilePath.fileExtension} instead.
- */
-JSDOC.Util.fileExtension = function(filename) {
- LOG.warn("JSDOC.Util.fileExtension is deprecated. Use FilePath.fileExtension instead.");
- return filename.split(".").pop().toLowerCase();
-};
-
-/**
- * @deprecated Use {@link FilePath.dir} instead.
- */
-JSDOC.Util.dir = function(path) {
- LOG.warn("JSDOC.Util.dir is deprecated. Use FilePath.dir instead.");
- var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
- return path.substring(0, nameStart-1);
-}
diff --git a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Walker.js b/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Walker.js
deleted file mode 100644
index 8e46a2564e..0000000000
--- a/tests/lib/jsdoc-toolkit/app/lib/JSDOC/Walker.js
+++ /dev/null
@@ -1,501 +0,0 @@
-if (typeof JSDOC == "undefined") JSDOC = {};
-
-/** @constructor */
-JSDOC.Walker = function(/**JSDOC.TokenStream*/ts) {
- this.init();
- if (typeof ts != "undefined") {
- this.walk(ts);
- }
-}
-
-JSDOC.Walker.prototype.init = function() {
- this.ts = null;
-
- var globalSymbol = new JSDOC.Symbol("_global_", [], "GLOBAL", new JSDOC.DocComment(""));
- globalSymbol.isNamespace = true;
- globalSymbol.srcFile = "";
- globalSymbol.isPrivate = false;
- JSDOC.Parser.addSymbol(globalSymbol);
- this.lastDoc = null;
- this.token = null;
-
- /**
- The chain of symbols under which we are currently nested.
- @type Array
- */
- this.namescope = [globalSymbol];
- this.namescope.last = function(n){ if (!n) n = 0; return this[this.length-(1+n)] || "" };
-}
-
-JSDOC.Walker.prototype.walk = function(/**JSDOC.TokenStream*/ts) {
- this.ts = ts;
- while (this.token = this.ts.look()) {
- if (this.token.popNamescope) {
-
- var symbol = this.namescope.pop();
- if (symbol.is("FUNCTION")) {
- if (this.ts.look(1).is("LEFT_PAREN") && symbol.comment.getTag("function").length == 0) {
- symbol.isa = "OBJECT";
- }
- }
- }
- this.step();
- if (!this.ts.next()) break;
- }
-}
-
-JSDOC.Walker.prototype.step = function() {
- if (this.token.is("JSDOC")) { // it's a doc comment
-
- var doc = new JSDOC.DocComment(this.token.data);
-
- if (doc.getTag("exports").length > 0) {
- var exports = doc.getTag("exports")[0];
-
- exports.desc.match(/(\S+) as (\S+)/i);
- var n1 = RegExp.$1;
- var n2 = RegExp.$2;
-
- if (!n1 && n2) throw "@exports tag requires a value like: 'name as ns.name'";
-
- JSDOC.Parser.rename = (JSDOC.Parser.rename || {});
- JSDOC.Parser.rename[n1] = n2
- }
-
- if (doc.getTag("lends").length > 0) {
- var lends = doc.getTag("lends")[0];
-
- var name = lends.desc
- if (!name) throw "@lends tag requires a value.";
-
- var symbol = new JSDOC.Symbol(name, [], "OBJECT", doc);
-
- this.namescope.push(symbol);
-
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
- if (matching) matching.popNamescope = name;
- else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
-
- this.lastDoc = null;
- return true;
- }
- else if (doc.getTag("name").length > 0 && doc.getTag("overview").length == 0) { // it's a virtual symbol
- var virtualName = doc.getTag("name")[0].desc;
- if (!virtualName) throw "@name tag requires a value.";
-
- if (doc.getTag("memberOf").length > 0) {
- virtualName = (doc.getTag("memberOf")[0] + "." + virtualName)
- .replace(/([#.])\./, "$1");
- doc.deleteTag("memberOf");
- }
-
- var symbol = new JSDOC.Symbol(virtualName, [], "VIRTUAL", doc);
-
- JSDOC.Parser.addSymbol(symbol);
-
- this.lastDoc = null;
- return true;
- }
- else if (doc.meta) { // it's a meta doclet
- if (doc.meta == "@+") JSDOC.DocComment.shared = doc.src;
- else if (doc.meta == "@-") JSDOC.DocComment.shared = "";
- else if (doc.meta == "nocode+") JSDOC.Parser.conf.ignoreCode = true;
- else if (doc.meta == "nocode-") JSDOC.Parser.conf.ignoreCode = JSDOC.opt.n;
- else throw "Unrecognized meta comment: "+doc.meta;
-
- this.lastDoc = null;
- return true;
- }
- else if (doc.getTag("overview").length > 0) { // it's a file overview
- symbol = new JSDOC.Symbol("", [], "FILE", doc);
-
- JSDOC.Parser.addSymbol(symbol);
-
- this.lastDoc = null;
- return true;
- }
- else {
- this.lastDoc = doc;
- return false;
- }
- }
- else if (!JSDOC.Parser.conf.ignoreCode) { // it's code
- if (this.token.is("NAME")) { // it's the name of something
- var symbol;
- var name = this.token.data;
- var doc = null; if (this.lastDoc) doc = this.lastDoc;
- var params = [];
-
- // it's inside an anonymous object
- if (this.ts.look(1).is("COLON") && this.ts.look(-1).is("LEFT_CURLY") && !(this.ts.look(-2).is("JSDOC") || this.namescope.last().comment.getTag("lends").length || this.ts.look(-2).is("ASSIGN") || this.ts.look(-2).is("COLON"))) {
- name = "$anonymous";
- name = this.namescope.last().alias+"-"+name
-
- params = [];
-
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
-
- JSDOC.Parser.addSymbol(symbol);
-
- this.namescope.push(symbol);
-
- var matching = this.ts.getMatchingToken(null, "RIGHT_CURLY");
- if (matching) matching.popNamescope = name;
- else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
- }
- // function foo() {}
- else if (this.ts.look(-1).is("FUNCTION") && this.ts.look(1).is("LEFT_PAREN")) {
- var isInner;
-
- if (this.lastDoc) doc = this.lastDoc;
-
- if (doc && doc.getTag("memberOf").length > 0) {
- name = (doc.getTag("memberOf")[0]+"."+name).replace("#.", "#");
- doc.deleteTag("memberOf");
- }
- else {
- name = this.namescope.last().alias+"-"+name;
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
- }
-
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
-
- params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
-
- symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
- if (isInner) symbol.isInner = true;
-
- if (this.ts.look(1).is("JSDOC")) {
- var inlineReturn = ""+this.ts.look(1).data;
- inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
- symbol.type = inlineReturn;
- }
-
- JSDOC.Parser.addSymbol(symbol);
-
- this.namescope.push(symbol);
-
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
- if (matching) matching.popNamescope = name;
- else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
- }
- // foo = function() {}
- else if (this.ts.look(1).is("ASSIGN") && this.ts.look(2).is("FUNCTION")) {
- var constructs;
- var isConstructor = false;
- if (doc && (constructs = doc.getTag("constructs")) && constructs.length) {
- if (constructs[0].desc) {
- name = constructs[0].desc;
- isConstructor = true;
- }
- }
-
- var isInner;
- if (this.ts.look(-1).is("VAR") || this.isInner) {
- if (doc && doc.getTag("memberOf").length > 0) {
- name = (doc.getTag("memberOf")[0]+"."+name).replace("#.", "#");
- doc.deleteTag("memberOf");
- }
- else {
- name = this.namescope.last().alias+"-"+name;
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
- }
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
- }
- else if (name.indexOf("this.") == 0) {
- name = this.resolveThis(name);
- }
-
- if (this.lastDoc) doc = this.lastDoc;
- params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
-
- symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
-
- if (isInner) symbol.isInner = true;
- if (isConstructor) symbol.isa = "CONSTRUCTOR";
-
- if (this.ts.look(1).is("JSDOC")) {
- var inlineReturn = ""+this.ts.look(1).data;
- inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
- symbol.type = inlineReturn;
- }
-
- JSDOC.Parser.addSymbol(symbol);
-
- this.namescope.push(symbol);
-
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
- if (matching) matching.popNamescope = name;
- else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
- }
- // foo = new function() {} or foo = (function() {}
- else if (this.ts.look(1).is("ASSIGN") && (this.ts.look(2).is("NEW") || this.ts.look(2).is("LEFT_PAREN")) && this.ts.look(3).is("FUNCTION")) {
- var isInner;
- if (this.ts.look(-1).is("VAR") || this.isInner) {
- name = this.namescope.last().alias+"-"+name
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
- }
- else if (name.indexOf("this.") == 0) {
- name = this.resolveThis(name);
- }
-
- this.ts.next(3); // advance past the "new" or "("
-
- if (this.lastDoc) doc = this.lastDoc;
- params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
-
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
- if (isInner) symbol.isInner = true;
-
- if (this.ts.look(1).is("JSDOC")) {
- var inlineReturn = ""+this.ts.look(1).data;
- inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
- symbol.type = inlineReturn;
- }
-
- JSDOC.Parser.addSymbol(symbol);
-
- symbol.scopeType = "INSTANCE";
- this.namescope.push(symbol);
-
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
- if (matching) matching.popNamescope = name;
- else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
- }
- // foo: function() {}
- else if (this.ts.look(1).is("COLON") && this.ts.look(2).is("FUNCTION")) {
- name = (this.namescope.last().alias+"."+name).replace("#.", "#");
-
- if (this.lastDoc) doc = this.lastDoc;
- params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
-
- if (doc && doc.getTag("constructs").length) {
- name = name.replace(/\.prototype(\.|$)/, "#");
-
- if (name.indexOf("#") > -1) name = name.match(/(^[^#]+)/)[0];
- else name = this.namescope.last().alias;
-
- symbol = new JSDOC.Symbol(name, params, "CONSTRUCTOR", doc);
- }
- else {
- symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
- }
-
- if (this.ts.look(1).is("JSDOC")) {
- var inlineReturn = ""+this.ts.look(1).data;
- inlineReturn = inlineReturn.replace(/(^\/\*\* *| *\*\/$)/g, "");
- symbol.type = inlineReturn;
- }
-
- JSDOC.Parser.addSymbol(symbol);
-
- this.namescope.push(symbol);
-
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
- if (matching) matching.popNamescope = name;
- else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
- }
- // foo = {}
- else if (this.ts.look(1).is("ASSIGN") && this.ts.look(2).is("LEFT_CURLY")) {
- var isInner;
- if (this.ts.look(-1).is("VAR") || this.isInner) {
- name = this.namescope.last().alias+"-"+name
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
- }
- else if (name.indexOf("this.") == 0) {
- name = this.resolveThis(name);
- }
-
- if (this.lastDoc) doc = this.lastDoc;
-
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
- if (isInner) symbol.isInner = true;
-
- if (doc) JSDOC.Parser.addSymbol(symbol);
-
- this.namescope.push(symbol);
-
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
- if (matching) matching.popNamescope = name;
- else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
- }
- // var foo;
- else if (this.ts.look(1).is("SEMICOLON")) {
- var isInner;
-
- if (this.ts.look(-1).is("VAR") || this.isInner) {
- name = this.namescope.last().alias+"-"+name
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
-
- if (this.lastDoc) doc = this.lastDoc;
-
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
- if (isInner) symbol.isInner = true;
-
- if (doc) JSDOC.Parser.addSymbol(symbol);
- }
- }
- // foo = x
- else if (this.ts.look(1).is("ASSIGN")) {
- var isInner;
- if (this.ts.look(-1).is("VAR") || this.isInner) {
- name = this.namescope.last().alias+"-"+name
- if (!this.namescope.last().is("GLOBAL")) isInner = true;
- }
- else if (name.indexOf("this.") == 0) {
- name = this.resolveThis(name);
- }
-
- if (this.lastDoc) doc = this.lastDoc;
-
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
- if (isInner) symbol.isInner = true;
-
- if (doc) JSDOC.Parser.addSymbol(symbol);
- }
- // foo: {}
- else if (this.ts.look(1).is("COLON") && this.ts.look(2).is("LEFT_CURLY")) {
- name = (this.namescope.last().alias+"."+name).replace("#.", "#");
-
- if (this.lastDoc) doc = this.lastDoc;
-
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
-
- if (doc) JSDOC.Parser.addSymbol(symbol);
-
- this.namescope.push(symbol);
-
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
- if (matching) matching.popNamescope = name;
- else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
- }
- // foo: x
- else if (this.ts.look(1).is("COLON")) {
- name = (this.namescope.last().alias+"."+name).replace("#.", "#");;
-
- if (this.lastDoc) doc = this.lastDoc;
-
- symbol = new JSDOC.Symbol(name, params, "OBJECT", doc);
-
- if (doc) JSDOC.Parser.addSymbol(symbol);
- }
- // foo(...)
- else if (this.ts.look(1).is("LEFT_PAREN")) {
- if (typeof JSDOC.PluginManager != "undefined") {
- var functionCall = {name: name};
-
- var cursor = this.ts.cursor;
- params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
- this.ts.cursor = cursor;
-
- for (var i = 0; i < params.length; i++)
- functionCall["arg" + (i + 1)] = params[i].name;
-
- JSDOC.PluginManager.run("onFunctionCall", functionCall);
- if (functionCall.doc) {
- this.ts.insertAhead(new JSDOC.Token(functionCall.doc, "COMM", "JSDOC"));
- }
- }
- }
- this.lastDoc = null;
- }
- else if (this.token.is("FUNCTION")) { // it's an anonymous function
- if (
- (!this.ts.look(-1).is("COLON") || !this.ts.look(-1).is("ASSIGN"))
- && !this.ts.look(1).is("NAME")
- ) {
- if (this.lastDoc) doc = this.lastDoc;
-
- name = "$anonymous";
- name = this.namescope.last().alias+"-"+name
-
- params = JSDOC.Walker.onParamList(this.ts.balance("LEFT_PAREN"));
-
- symbol = new JSDOC.Symbol(name, params, "FUNCTION", doc);
-
- JSDOC.Parser.addSymbol(symbol);
-
- this.namescope.push(symbol);
-
- var matching = this.ts.getMatchingToken("LEFT_CURLY");
- if (matching) matching.popNamescope = name;
- else LOG.warn("Mismatched } character. Can't parse code in file " + symbol.srcFile + ".");
- }
- }
- }
- return true;
-}
-
-/**
- Resolves what "this." means when it appears in a name.
- @param name The name that starts with "this.".
- @returns The name with "this." resolved.
- */
-JSDOC.Walker.prototype.resolveThis = function(name) {
- name.match(/^this\.(.+)$/)
- var nameFragment = RegExp.$1;
- if (!nameFragment) return name;
-
- var symbol = this.namescope.last();
- var scopeType = symbol.scopeType || symbol.isa;
-
- // if we are in a constructor function, `this` means the instance
- if (scopeType == "CONSTRUCTOR") {
- name = symbol.alias+"#"+nameFragment;
- }
-
- // if we are in an anonymous constructor function, `this` means the instance
- else if (scopeType == "INSTANCE") {
- name = symbol.alias+"."+nameFragment;
- }
-
- // if we are in a function, `this` means the container (possibly the global)
- else if (scopeType == "FUNCTION") {
- // in a method of a prototype, so `this` means the constructor
- if (symbol.alias.match(/(^.*)[#.-][^#.-]+/)) {
- var parentName = RegExp.$1;
- var parent = JSDOC.Parser.symbols.getSymbol(parentName);
-
- if (!parent) {
- if (JSDOC.Lang.isBuiltin(parentName)) parent = JSDOC.Parser.addBuiltin(parentName);
- else {
- if (symbol.alias.indexOf("$anonymous") < 0) // these will be ignored eventually
- LOG.warn("Trying to document "+symbol.alias+" without first documenting "+parentName+".");
- }
- }
- if (parent) name = parentName+(parent.is("CONSTRUCTOR")?"#":".")+nameFragment;
- }
- else {
- parent = this.namescope.last(1);
- name = parent.alias+(parent.is("CONSTRUCTOR")?"#":".")+nameFragment;
- }
- }
- // otherwise it means the global
- else {
- name = nameFragment;
- }
-
- return name;
-}
-
-JSDOC.Walker.onParamList = function(/**Array*/paramTokens) {
- if (!paramTokens) {
- LOG.warn("Malformed parameter list. Can't parse code.");
- return [];
- }
- var params = [];
- for (var i = 0, l = paramTokens.length; i < l; i++) {
- if (paramTokens[i].is("JSDOC")) {
- var paramType = paramTokens[i].data.replace(/(^\/\*\* *| *\*\/$)/g, "");
-
- if (paramTokens[i+1] && paramTokens[i+1].is("NAME")) {
- i++;
- params.push({type: paramType, name: paramTokens[i].data});
- }
- }
- else if (paramTokens[i].is("NAME")) {
- params.push({name: paramTokens[i].data});
- }
- }
- return params;
-}
diff --git a/tests/lib/jsdoc-toolkit/app/main.js b/tests/lib/jsdoc-toolkit/app/main.js
deleted file mode 100644
index 654528f292..0000000000
--- a/tests/lib/jsdoc-toolkit/app/main.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * @version $Id: main.js 818 2009-11-08 14:51:41Z micmath $
- */
-
-function main() {
- IO.include("lib/JSDOC.js");
- IO.includeDir("plugins/");
-
- // process the options
-
- // the -c option: options are defined in a configuration file
- if (JSDOC.opt.c) {
- eval("JSDOC.conf = " + IO.readFile(JSDOC.opt.c));
-
- LOG.inform("Using configuration file at '"+JSDOC.opt.c+"'.");
-
- for (var c in JSDOC.conf) {
- if (c !== "D" && !defined(JSDOC.opt[c])) { // commandline overrules config file
- JSDOC.opt[c] = JSDOC.conf[c];
- }
- }
-
- if (typeof JSDOC.conf["_"] != "undefined") {
- JSDOC.opt["_"] = JSDOC.opt["_"].concat(JSDOC.conf["_"]);
- }
-
- LOG.inform("With configuration: ");
- for (var o in JSDOC.opt) {
- LOG.inform(" "+o+": "+JSDOC.opt[o]);
- }
- }
-
- // be verbose
- if (JSDOC.opt.v) LOG.verbose = true;
-
- // send log messages to a file
- if (JSDOC.opt.o) LOG.out = IO.open(JSDOC.opt.o);
-
- // run the unit tests
- if (JSDOC.opt.T) {
- LOG.inform("JsDoc Toolkit running in test mode at "+new Date()+".");
- IO.include("frame/Testrun.js");
- IO.include("test.js");
- }
- else {
- // a template must be defined and must be a directory path
- if (!JSDOC.opt.t && System.getProperty("jsdoc.template.dir")) {
- JSDOC.opt.t = System.getProperty("jsdoc.template.dir");
- }
- if (JSDOC.opt.t && SYS.slash != JSDOC.opt.t.slice(-1)) {
- JSDOC.opt.t += SYS.slash;
- }
-
- // verbose messages about the options we were given
- LOG.inform("JsDoc Toolkit main() running at "+new Date()+".");
- LOG.inform("With options: ");
- for (var o in JSDOC.opt) {
- LOG.inform(" "+o+": "+JSDOC.opt[o]);
- }
-
- // initialize and build a symbolSet from your code
- JSDOC.JsDoc();
-
- // debugger's option: dump the entire symbolSet produced from your code
- if (JSDOC.opt.Z) {
- LOG.warn("So you want to see the data structure, eh? This might hang if you have circular refs...");
- IO.include("frame/Dumper.js");
- var symbols = JSDOC.JsDoc.symbolSet.toArray();
- for (var i = 0, l = symbols.length; i < l; i++) {
- var symbol = symbols[i];
- print("// symbol: " + symbol.alias);
- print(symbol.serialize());
- }
- }
- else {
- if (typeof JSDOC.opt.t != "undefined") {
- try {
- // a file named "publish.js" must exist in the template directory
- load(JSDOC.opt.t+"publish.js");
-
- // and must define a function named "publish"
- if (!publish) {
- LOG.warn("No publish() function is defined in that template so nothing to do.");
- }
- else {
- // which will be called with the symbolSet produced from your code
- publish(JSDOC.JsDoc.symbolSet);
- }
- }
- catch(e) {
- LOG.warn("Sorry, that doesn't seem to be a valid template: "+JSDOC.opt.t+"publish.js : "+e);
- }
- }
- else {
- LOG.warn("No template given. Might as well read the usage notes.");
- JSDOC.usage();
- }
- }
- }
-
- // notify of any warnings
- if (!JSDOC.opt.q && LOG.warnings.length) {
- print(LOG.warnings.length+" warning"+(LOG.warnings.length != 1? "s":"")+".");
- }
-
- // stop sending log messages to a file
- if (LOG.out) {
- LOG.out.flush();
- LOG.out.close();
- }
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/plugins/commentSrcJson.js b/tests/lib/jsdoc-toolkit/app/plugins/commentSrcJson.js
deleted file mode 100644
index e826b57224..0000000000
--- a/tests/lib/jsdoc-toolkit/app/plugins/commentSrcJson.js
+++ /dev/null
@@ -1,20 +0,0 @@
-JSDOC.PluginManager.registerPlugin(
- "JSDOC.commentSrcJson",
- {
- onDocCommentSrc: function(comment) {
- var json;
- if (/^\s*@json\b/.test(comment)) {
- comment.src = new String(comment.src).replace("@json", "");
-
- eval("json = "+comment.src);
- var tagged = "";
- for (var i in json) {
- var tag = json[i];
- // todo handle cases where tag is an object
- tagged += "@"+i+" "+tag+"\n";
- }
- comment.src = tagged;
- }
- }
- }
-); \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/plugins/frameworkPrototype.js b/tests/lib/jsdoc-toolkit/app/plugins/frameworkPrototype.js
deleted file mode 100644
index e2a0576f2d..0000000000
--- a/tests/lib/jsdoc-toolkit/app/plugins/frameworkPrototype.js
+++ /dev/null
@@ -1,16 +0,0 @@
-JSDOC.PluginManager.registerPlugin(
- "JSDOC.frameworkPrototype",
- {
- onPrototypeClassCreate: function(classCreator) {
- var desc = "";
- if (classCreator.comment) {
- desc = classCreator.comment;
- }
- var insert = desc+"/** @name "+classCreator.name+"\n@constructor\n@scope "+classCreator.name+".prototype */"
-
- insert = insert.replace(/\*\/\/\*\*/g, "\n");
- /*DEBUG*///print("insert is "+insert);
- classCreator.addComment.data = insert;
- }
- }
-);
diff --git a/tests/lib/jsdoc-toolkit/app/plugins/functionCall.js b/tests/lib/jsdoc-toolkit/app/plugins/functionCall.js
deleted file mode 100644
index 6f87705eee..0000000000
--- a/tests/lib/jsdoc-toolkit/app/plugins/functionCall.js
+++ /dev/null
@@ -1,10 +0,0 @@
-JSDOC.PluginManager.registerPlugin(
- "JSDOC.functionCall",
- {
- onFunctionCall: function(functionCall) {
- if (functionCall.name == "dojo.define" && functionCall.arg1) {
- functionCall.doc = "/** @lends "+eval(functionCall.arg1)+".prototype */";
- }
- }
- }
-); \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/plugins/publishSrcHilite.js b/tests/lib/jsdoc-toolkit/app/plugins/publishSrcHilite.js
deleted file mode 100644
index a3fc97ec25..0000000000
--- a/tests/lib/jsdoc-toolkit/app/plugins/publishSrcHilite.js
+++ /dev/null
@@ -1,62 +0,0 @@
-JSDOC.PluginManager.registerPlugin(
- "JSDOC.publishSrcHilite",
- {
- onPublishSrc: function(src) {
- if (src.path in JsHilite.cache) {
- return; // already generated src code
- }
- else JsHilite.cache[src.path] = true;
-
- try {
- var sourceCode = IO.readFile(src.path);
- }
- catch(e) {
- print(e.message);
- quit();
- }
-
- var hiliter = new JsHilite(sourceCode, src.charset);
- src.hilited = hiliter.hilite();
- }
- }
-);
-
-function JsHilite(src, charset) {
-
- var tr = new JSDOC.TokenReader();
-
- tr.keepComments = true;
- tr.keepDocs = true;
- tr.keepWhite = true;
-
- this.tokens = tr.tokenize(new JSDOC.TextStream(src));
-
- // TODO is redefining toString() the best way?
- JSDOC.Token.prototype.toString = function() {
- return "<span class=\""+this.type+"\">"+this.data.replace(/</g, "&lt;")+"</span>";
- }
-
- if (!charset) charset = "utf-8";
-
- this.header = '<html><head><meta http-equiv="content-type" content="text/html; charset='+charset+'"> '+
- "<style>\n\
- .KEYW {color: #933;}\n\
- .COMM {color: #bbb; font-style: italic;}\n\
- .NUMB {color: #393;}\n\
- .STRN {color: #393;}\n\
- .REGX {color: #339;}\n\
- .line {border-right: 1px dotted #666; color: #666; font-style: normal;}\n\
- </style></head><body><pre>";
- this.footer = "</pre></body></html>";
- this.showLinenumbers = true;
-}
-
-JsHilite.cache = {};
-
-JsHilite.prototype.hilite = function() {
- var hilited = this.tokens.join("");
- var line = 1;
- if (this.showLinenumbers) hilited = hilited.replace(/(^|\n)/g, function(m){return m+"<span class='line'>"+((line<10)? " ":"")+((line<100)? " ":"")+(line++)+"</span> "});
-
- return this.header+hilited+this.footer;
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/plugins/symbolLink.js b/tests/lib/jsdoc-toolkit/app/plugins/symbolLink.js
deleted file mode 100644
index c87f1ca7b6..0000000000
--- a/tests/lib/jsdoc-toolkit/app/plugins/symbolLink.js
+++ /dev/null
@@ -1,10 +0,0 @@
-JSDOC.PluginManager.registerPlugin(
- "JSDOC.symbolLink",
- {
- onSymbolLink: function(link) {
- // modify link.linkPath (the href part of the link)
- // or link.linkText (the text displayed)
- // or link.linkInner (the #name part of the link)
- }
- }
-); \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/plugins/tagParamConfig.js b/tests/lib/jsdoc-toolkit/app/plugins/tagParamConfig.js
deleted file mode 100644
index efd461a27a..0000000000
--- a/tests/lib/jsdoc-toolkit/app/plugins/tagParamConfig.js
+++ /dev/null
@@ -1,31 +0,0 @@
-JSDOC.PluginManager.registerPlugin(
- "JSDOC.tagParamConfig",
- {
- onDocCommentTags: function(comment) {
- var currentParam = null;
- var tags = comment.tags;
- for (var i = 0, l = tags.length; i < l; i++) {
-
- if (tags[i].title == "param") {
- if (tags[i].name.indexOf(".") == -1) {
- currentParam = i;
- }
- }
- else if (tags[i].title == "config") {
- tags[i].title = "param";
- if (currentParam == null) {
- tags[i].name = "arguments"+"."+tags[i].name;
- }
- else if (tags[i].name.indexOf(tags[currentParam].name+".") != 0) {
- tags[i].name = tags[currentParam].name+"."+tags[i].name;
- }
- currentParam != null
- //tags[currentParam].properties.push(tags[i]);
- }
- else {
- currentParam = null;
- }
- }
- }
- }
-);
diff --git a/tests/lib/jsdoc-toolkit/app/plugins/tagSynonyms.js b/tests/lib/jsdoc-toolkit/app/plugins/tagSynonyms.js
deleted file mode 100644
index 05fde166de..0000000000
--- a/tests/lib/jsdoc-toolkit/app/plugins/tagSynonyms.js
+++ /dev/null
@@ -1,43 +0,0 @@
-JSDOC.PluginManager.registerPlugin(
- "JSDOC.tagSynonyms",
- {
- onDocCommentSrc: function(comment) {
- comment.src = comment.src.replace(/@methodOf\b/i, "@function\n@memberOf");
- comment.src = comment.src.replace(/@fieldOf\b/i, "@field\n@memberOf");
- },
-
- onDocCommentTags: function(comment) {
- for (var i = 0, l = comment.tags.length; i < l; i++) {
- var title = comment.tags[i].title.toLowerCase();
- var syn;
- if ((syn = JSDOC.tagSynonyms.synonyms["="+title])) {
- comment.tags[i].title = syn;
- }
- }
- }
- }
-);
-
-new Namespace(
- "JSDOC.tagSynonyms",
- function() {
- JSDOC.tagSynonyms.synonyms = {
- "=member": "memberOf",
- "=memberof": "memberOf",
- "=description": "desc",
- "=exception": "throws",
- "=argument": "param",
- "=returns": "return",
- "=classdescription": "class",
- "=fileoverview": "overview",
- "=extends": "augments",
- "=base": "augments",
- "=projectdescription": "overview",
- "=classdescription": "class",
- "=link": "see",
- "=borrows": "inherits",
- "=scope": "lends",
- "=construct": "constructor"
- }
- }
-); \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/run.js b/tests/lib/jsdoc-toolkit/app/run.js
deleted file mode 100644
index e44893e5b9..0000000000
--- a/tests/lib/jsdoc-toolkit/app/run.js
+++ /dev/null
@@ -1,347 +0,0 @@
-/**
- * @fileOverview
- * A bootstrap script that creates some basic required objects
- * for loading other scripts.
- * @author Michael Mathews, micmath@gmail.com
- * @version $Id: run.js 756 2009-01-07 21:32:58Z micmath $
- */
-
-/**
- * @namespace Keep track of any messages from the running script.
- */
-LOG = {
- warn: function(msg, e) {
- if (JSDOC.opt.q) return;
- if (e) msg = e.fileName+", line "+e.lineNumber+": "+msg;
-
- msg = ">> WARNING: "+msg;
- LOG.warnings.push(msg);
- if (LOG.out) LOG.out.write(msg+"\n");
- else print(msg);
- },
-
- inform: function(msg) {
- if (JSDOC.opt.q) return;
- msg = " > "+msg;
- if (LOG.out) LOG.out.write(msg+"\n");
- else if (typeof LOG.verbose != "undefined" && LOG.verbose) print(msg);
- }
-};
-LOG.warnings = [];
-LOG.verbose = false
-LOG.out = undefined;
-
-/**
- * @class Manipulate a filepath.
- */
-function FilePath(absPath, separator) {
- this.slash = separator || "/";
- this.root = this.slash;
- this.path = [];
- this.file = "";
-
- var parts = absPath.split(/[\\\/]/);
- if (parts) {
- if (parts.length) this.root = parts.shift() + this.slash;
- if (parts.length) this.file = parts.pop()
- if (parts.length) this.path = parts;
- }
-
- this.path = this.resolvePath();
-}
-
-/** Collapse any dot-dot or dot items in a filepath. */
-FilePath.prototype.resolvePath = function() {
- var resolvedPath = [];
- for (var i = 0; i < this.path.length; i++) {
- if (this.path[i] == "..") resolvedPath.pop();
- else if (this.path[i] != ".") resolvedPath.push(this.path[i]);
- }
- return resolvedPath;
-}
-
-/** Trim off the filename. */
-FilePath.prototype.toDir = function() {
- if (this.file) this.file = "";
- return this;
-}
-
-/** Go up a directory. */
-FilePath.prototype.upDir = function() {
- this.toDir();
- if (this.path.length) this.path.pop();
- return this;
-}
-
-FilePath.prototype.toString = function() {
- return this.root
- + this.path.join(this.slash)
- + ((this.path.length > 0)? this.slash : "")
- + this.file;
-}
-
-/**
- * Turn a path into just the name of the file.
- */
-FilePath.fileName = function(path) {
- var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
- return path.substring(nameStart);
-}
-
-/**
- * Get the extension of a filename
- */
-FilePath.fileExtension = function(filename) {
- return filename.split(".").pop().toLowerCase();
-};
-
-/**
- * Turn a path into just the directory part.
- */
-FilePath.dir = function(path) {
- var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
- return path.substring(0, nameStart-1);
-}
-
-importClass(java.lang.System);
-
-/**
- * @namespace A collection of information about your system.
- */
-SYS = {
- /**
- * Information about your operating system: arch, name, version.
- * @type string
- */
- os: [
- new String(System.getProperty("os.arch")),
- new String(System.getProperty("os.name")),
- new String(System.getProperty("os.version"))
- ].join(", "),
-
- /**
- * Which way does your slash lean.
- * @type string
- */
- slash: System.getProperty("file.separator")||"/",
-
- /**
- * The path to the working directory where you ran java.
- * @type string
- */
- userDir: new String(System.getProperty("user.dir")),
-
- /**
- * Where is Java's home folder.
- * @type string
- */
- javaHome: new String(System.getProperty("java.home")),
-
- /**
- * The absolute path to the directory containing this script.
- * @type string
- */
- pwd: undefined
-};
-
-// jsrun appends an argument, with the path to here.
-if (arguments[arguments.length-1].match(/^-j=(.+)/)) {
- if (RegExp.$1.charAt(0) == SYS.slash || RegExp.$1.charAt(1) == ":") { // absolute path to here
- SYS.pwd = new FilePath(RegExp.$1).toDir().toString();
- }
- else { // relative path to here
- SYS.pwd = new FilePath(SYS.userDir + SYS.slash + RegExp.$1).toDir().toString();
- }
- arguments.pop();
-}
-else {
- print("The run.js script requires you use jsrun.jar.");
- quit();
-}
-
-// shortcut
-var File = Packages.java.io.File;
-
-/**
- * @namespace A collection of functions that deal with reading a writing to disk.
- */
-IO = {
-
- /**
- * Create a new file in the given directory, with the given name and contents.
- */
- saveFile: function(/**string*/ outDir, /**string*/ fileName, /**string*/ content) {
- var out = new Packages.java.io.PrintWriter(
- new Packages.java.io.OutputStreamWriter(
- new Packages.java.io.FileOutputStream(outDir+SYS.slash+fileName),
- IO.encoding
- )
- );
- out.write(content);
- out.flush();
- out.close();
- },
-
- /**
- * @type string
- */
- readFile: function(/**string*/ path) {
- if (!IO.exists(path)) {
- throw "File doesn't exist there: "+path;
- }
- return readFile(path, IO.encoding);
- },
-
- /**
- * @param inFile
- * @param outDir
- * @param [fileName=The original filename]
- */
- copyFile: function(/**string*/ inFile, /**string*/ outDir, /**string*/ fileName) {
- if (fileName == null) fileName = FilePath.fileName(inFile);
-
- var inFile = new File(inFile);
- var outFile = new File(outDir+SYS.slash+fileName);
-
- var bis = new Packages.java.io.BufferedInputStream(new Packages.java.io.FileInputStream(inFile), 4096);
- var bos = new Packages.java.io.BufferedOutputStream(new Packages.java.io.FileOutputStream(outFile), 4096);
- var theChar;
- while ((theChar = bis.read()) != -1) {
- bos.write(theChar);
- }
- bos.close();
- bis.close();
- },
-
- /**
- * Creates a series of nested directories.
- */
- mkPath: function(/**Array*/ path) {
- if (path.constructor != Array) path = path.split(/[\\\/]/);
- var make = "";
- for (var i = 0, l = path.length; i < l; i++) {
- make += path[i] + SYS.slash;
- if (! IO.exists(make)) {
- IO.makeDir(make);
- }
- }
- },
-
- /**
- * Creates a directory at the given path.
- */
- makeDir: function(/**string*/ path) {
- (new File(path)).mkdir();
- },
-
- /**
- * @type string[]
- * @param dir The starting directory to look in.
- * @param [recurse=1] How many levels deep to scan.
- * @returns An array of all the paths to files in the given dir.
- */
- ls: function(/**string*/ dir, /**number*/ recurse, _allFiles, _path) {
- if (_path === undefined) { // initially
- var _allFiles = [];
- var _path = [dir];
- }
- if (_path.length == 0) return _allFiles;
- if (recurse === undefined) recurse = 1;
-
- dir = new File(dir);
- if (!dir.directory) return [String(dir)];
- var files = dir.list();
-
- for (var f = 0; f < files.length; f++) {
- var file = String(files[f]);
- if (file.match(/^\.[^\.\/\\]/)) continue; // skip dot files
-
- if ((new File(_path.join(SYS.slash)+SYS.slash+file)).list()) { // it's a directory
- _path.push(file);
- if (_path.length-1 < recurse) IO.ls(_path.join(SYS.slash), recurse, _allFiles, _path);
- _path.pop();
- }
- else {
- _allFiles.push((_path.join(SYS.slash)+SYS.slash+file).replace(SYS.slash+SYS.slash, SYS.slash));
- }
- }
-
- return _allFiles;
- },
-
- /**
- * @type boolean
- */
- exists: function(/**string*/ path) {
- file = new File(path);
-
- if (file.isDirectory()){
- return true;
- }
- if (!file.exists()){
- return false;
- }
- if (!file.canRead()){
- return false;
- }
- return true;
- },
-
- /**
- *
- */
- open: function(/**string*/ path, /**string*/ append) {
- var append = true;
- var outFile = new File(path);
- var out = new Packages.java.io.PrintWriter(
- new Packages.java.io.OutputStreamWriter(
- new Packages.java.io.FileOutputStream(outFile, append),
- IO.encoding
- )
- );
- return out;
- },
-
- /**
- * Sets {@link IO.encoding}.
- * Encoding is used when reading and writing text to files,
- * and in the meta tags of HTML output.
- */
- setEncoding: function(/**string*/ encoding) {
- if (/ISO-8859-([0-9]+)/i.test(encoding)) {
- IO.encoding = "ISO8859_"+RegExp.$1;
- }
- else {
- IO.encoding = encoding;
- }
- },
-
- /**
- * @default "utf-8"
- * @private
- */
- encoding: "utf-8",
-
- /**
- * Load the given script.
- */
- include: function(relativePath) {
- load(SYS.pwd+relativePath);
- },
-
- /**
- * Loads all scripts from the given directory path.
- */
- includeDir: function(path) {
- if (!path) return;
-
- for (var lib = IO.ls(SYS.pwd+path), i = 0; i < lib.length; i++)
- if (/\.js$/i.test(lib[i])) load(lib[i]);
- }
-}
-
-// now run the application
-IO.include("frame.js");
-IO.include("main.js");
-
-main();
diff --git a/tests/lib/jsdoc-toolkit/app/t/TestDoc.js b/tests/lib/jsdoc-toolkit/app/t/TestDoc.js
deleted file mode 100644
index 1f4977ad94..0000000000
--- a/tests/lib/jsdoc-toolkit/app/t/TestDoc.js
+++ /dev/null
@@ -1,144 +0,0 @@
-var TestDoc = {
- fails: 0,
- plans: 0,
- passes: 0,
- results: []
-};
-
-TestDoc.record = function(result) {
- TestDoc.results.push(result);
- if (typeof result.verdict == "boolean") {
- if (result.verdict === false) TestDoc.fails++;
- if (result.verdict === true) TestDoc.passes++;
- }
-}
-
-TestDoc.prove = function(filePath) {
- if (typeof document != "undefined" && typeof document.write != "undefined") {
- if (TestDoc.console) print = function(s) { TestDoc.console.appendChild(document.createTextNode(s+"\n")); }
- else print = function(s) { document.write(s+"<br />"); }
- }
- TestDoc.run(TestDoc.readFile(filePath));
-}
-
-TestDoc.run = function(src) {
- try { eval(src); } catch(e) { print("# ERROR! "+e); }
-
- var chunks = src.split(/\/\*t:/);
-
- var run = function(chunk) {
- // local shortcuts
- var is = TestDoc.assertEquals;
- var isnt = TestDoc.assertNotEquals;
- var plan = TestDoc.plan;
- var requires = TestDoc.requires;
-
- try { eval(chunk); } catch(e) { print("# ERROR! "+e); }
- }
- for (var start = -1, end = 0; (start = src.indexOf("/*t:", end)) > end; start = end) {
- run(
- src.substring(
- start+4,
- (end = src.indexOf("*/", start))
- )
- );
- }
-}
-
-TestDoc.Result = function(verdict, message) {
- this.verdict = verdict;
- this.message = message;
-}
-
-TestDoc.Result.prototype.toString = function() {
- if (typeof this.verdict == "boolean") {
- return (this.verdict? "ok" : "not ok") + " " + (++TestDoc.report.counter) + " - " + this.message;
- }
-
- return "# " + this.message;
-}
-
-TestDoc.requires = function(file) {
- if (!TestDoc.requires.loaded[file]) {
- load(file);
- TestDoc.requires.loaded[file] = true;
- }
-}
-TestDoc.requires.loaded = {};
-
-TestDoc.report = function() {
- TestDoc.report.counter = 0;
- print("1.."+TestDoc.plans);
- for (var i = 0; i < TestDoc.results.length; i++) {
- print(TestDoc.results[i]);
- }
- print("----------------------------------------");
- if (TestDoc.fails == 0 && TestDoc.passes == TestDoc.plans) {
- print("All tests successful.");
- }
- else {
- print("Failed " + TestDoc.fails + "/" + TestDoc.plans + " tests, "+((TestDoc.plans == 0)? 0 : Math.round(TestDoc.passes/(TestDoc.passes+TestDoc.fails)*10000)/100)+"% okay. Planned to run "+TestDoc.plans+", did run "+(TestDoc.passes+TestDoc.fails)+".")
- }
-}
-
-TestDoc.plan = function(n, message) {
- TestDoc.plans += n;
- TestDoc.record(new TestDoc.Result(null, message+" ("+n+" tests)"));
-}
-
-TestDoc.assertEquals = function(a, b, message) {
- var result = (a == b);
- if (!result) message += "\n#\n# " + a + " does not equal " + b + "\n#";
- TestDoc.record(new TestDoc.Result(result, message));
-}
-
-TestDoc.assertNotEquals = function(a, b, message) {
- var result = (a != b);
- if (!result) message += "\n#\n# " + a + " equals " + b + "\n#";
- TestDoc.record(new TestDoc.Result(result, message));
-}
-
-TestDoc.readFile = (function(){
- // rhino
- if (typeof readFile == "function") {
- return function(url) {
- var text = readFile(url);
- return text || "";
- }
- }
-
- // a web browser
- else {
- return function(url) {
- var httpRequest;
-
- if (window.XMLHttpRequest) { // Mozilla, Safari, etc
- httpRequest = new XMLHttpRequest();
- }
- else if (window.ActiveXObject) { // IE
- try {
- httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
- }
- catch (e) {
- try {
- httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
- }
- catch (e) {
- }
- }
- }
-
- if (!httpRequest) { throw "Cannot create HTTP Request."; }
-
- httpRequest.open('GET', url, false);
- httpRequest.send('');
- if (httpRequest.readyState == 4) {
- if (httpRequest.status >= 400) {
- throw "The HTTP Request returned an error code: "+httpRequest.status;
- }
- }
-
- return httpRequest.responseText || "";
- }
- }
-})();
diff --git a/tests/lib/jsdoc-toolkit/app/t/runner.js b/tests/lib/jsdoc-toolkit/app/t/runner.js
deleted file mode 100644
index 3f9fb4c963..0000000000
--- a/tests/lib/jsdoc-toolkit/app/t/runner.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// try: java -jar ../../jsrun.jar runner.js
-
-load("TestDoc.js");
-
-TestDoc.prove("../frame/Opt.js");
-TestDoc.prove("../lib/JSDOC.js");
-TestDoc.prove("../frame/String.js");
-TestDoc.prove("../lib/JSDOC/DocTag.js");
-TestDoc.prove("../lib/JSDOC/DocComment.js");
-TestDoc.prove("../lib/JSDOC/TokenReader.js");
-TestDoc.prove("../lib/JSDOC/Symbol.js");
-
-TestDoc.report();
diff --git a/tests/lib/jsdoc-toolkit/app/test.js b/tests/lib/jsdoc-toolkit/app/test.js
deleted file mode 100644
index 8fbf87c61a..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test.js
+++ /dev/null
@@ -1,342 +0,0 @@
-load("app/frame/Dumper.js");
-function symbolize(opt) {
- symbols = null;
- JSDOC.JsDoc(opt);
- symbols = JSDOC.JsDoc.symbolSet;
-}
-
-var testCases = [
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/overview.js"]});
- //print(Dumper.dump(symbols));
- is('symbols.getSymbolByName("My Cool Library").name', 'My Cool Library', 'File overview can be found by alias.');
- }
- ,
- function() {
- symbolize({_: [SYS.pwd+"test/name.js"]});
-
- is('symbols.getSymbol("Response").name', "Response", 'Virtual class name is found.');
- is('symbols.getSymbol("Response#text").alias', "Response#text", 'Virtual method name is found.');
- is('symbols.getSymbol("Response#text").memberOf', "Response", 'Virtual method parent name is found.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/prototype.js"]});
-
- is('symbols.getSymbol("Article").name', "Article", 'Function set to constructor prototype with inner constructor name is found.');
- is('symbols.getSymbol("Article").hasMethod("init")', true, 'The initializer method name of prototype function is correct.');
- is('symbols.getSymbol("Article").hasMember("counter")', true, 'A static property set in the prototype definition is found.');
- is('symbols.getSymbol("Article").hasMember("title")', true, 'An instance property set in the prototype is found.');
- is('symbols.getSymbol("Article#title").isStatic', false, 'An instance property has isStatic set to false.');
- is('symbols.getSymbol("Article.counter").name', "counter", 'A static property set in the initializer has the name set correctly.');
- is('symbols.getSymbol("Article.counter").memberOf', "Article", 'A static property set in the initializer has the memberOf set correctly.');
- is('symbols.getSymbol("Article.counter").isStatic', true, 'A static property set in the initializer has isStatic set to true.');
- }
- ,
- function() {
- symbolize({a:true, _: [SYS.pwd+"test/prototype_oblit.js"]});
-
- is('symbols.getSymbol("Article").name', "Article", 'Oblit set to constructor prototype name is found.');
- is('typeof symbols.getSymbol("Article.prototype")', "undefined", 'The prototype oblit is not a symbol.');
- is('symbols.getSymbol("Article#getTitle").name', "getTitle", 'The nonstatic method name of prototype oblit is correct.');
- is('symbols.getSymbol("Article#getTitle").alias', "Article#getTitle", 'The alias of non-static method of prototype oblit is correct.');
- is('symbols.getSymbol("Article#getTitle").isStatic', false, 'The isStatic of a nonstatic method of prototype oblit is correct.');
- is('symbols.getSymbol("Article.getTitle").name', "getTitle", 'The static method name of prototype oblit is correct.');
- is('symbols.getSymbol("Article.getTitle").isStatic', true, 'The isStatic of a static method of prototype oblit is correct.');
- is('symbols.getSymbol("Article#getTitle").isa', "FUNCTION", 'The isa of non-static method of prototype oblit is correct.');
- is('symbols.getSymbol("Article.getTitle").alias', "Article.getTitle", 'The alias of a static method of prototype oblit is correct.');
- is('symbols.getSymbol("Article.getTitle").isa', "FUNCTION", 'The isa of static method of prototype oblit is correct.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/prototype_oblit_constructor.js"]});
-
- is('symbols.getSymbol("Article").name', "Article", 'Oblit set to constructor prototype with inner constructor name is found.');
- is('symbols.getSymbol("Article#init").name', "init", 'The initializer method name of prototype oblit is correct.');
- is('symbols.getSymbol("Article").hasMember("pages")', true, 'Property set by initializer method "this" is on the outer constructor.');
- is('symbols.getSymbol("Article#Title").name', "Title", 'Name of the inner constructor name is found.');
- is('symbols.getSymbol("Article#Title").memberOf', "Article", 'The memberOf of the inner constructor name is found.');
- is('symbols.getSymbol("Article#Title").isa', "CONSTRUCTOR", 'The isa of the inner constructor name is constructor.');
- is('symbols.getSymbol("Article#Title").hasMember("title")', true, 'A property set on the inner constructor "this" is on the inner constructor.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/inner.js"]});
-
- is('symbols.getSymbol("Outer").name', "Outer", 'Outer constructor prototype name is found.');
- is('symbols.getSymbol("Outer").methods.length', 1, 'Inner function doesnt appear as a method of the outer.');
- is('symbols.getSymbol("Outer").hasMethod("open")', true, 'Outer constructors methods arent affected by inner function.');
- is('symbols.getSymbol("Outer-Inner").alias', "Outer-Inner", 'Alias of inner function is found.');
- is('symbols.getSymbol("Outer-Inner").isa', "CONSTRUCTOR", 'isa of inner function constructor is found.');
- is('symbols.getSymbol("Outer-Inner").memberOf', "Outer", 'The memberOf of inner function is found.');
- is('symbols.getSymbol("Outer-Inner").name', "Inner", 'The name of inner function is found.');
- is('symbols.getSymbol("Outer-Inner#name").name', "name", 'A member of the inner function constructor, attached to "this" is found on inner.');
- is('symbols.getSymbol("Outer-Inner#name").memberOf', "Outer-Inner", 'The memberOf of an inner function member is found.');
- }
- ,
- function() {
- symbolize({a:true, _: [SYS.pwd+"test/prototype_nested.js"]});
-
- is('symbols.getSymbol("Word").name', "Word", 'Base constructor name is found.');
- is('symbols.getSymbol("Word").hasMethod("reverse")', true, 'Base constructor method is found.');
- is('symbols.getSymbol("Word").methods.length', 1, 'Base constructor has only one method.');
- is('symbols.getSymbol("Word").memberOf', "", 'Base constructor memberOf is empty.');
- is('symbols.getSymbol("Word#reverse").name', "reverse", 'Member of constructor prototype name is found.');
- is('symbols.getSymbol("Word#reverse").memberOf', "Word", 'Member of constructor prototype memberOf is found.');
- is('symbols.getSymbol("Word#reverse.utf8").name', "utf8", 'Member of constructor prototype method name is found.');
- is('symbols.getSymbol("Word#reverse.utf8").memberOf', "Word#reverse", 'Static nested member memberOf is found.');
- }
- ,
- function() {
- symbolize({a:true, _: [SYS.pwd+"test/namespace_nested.js"]});
-
- is('symbols.getSymbol("ns1").name', "ns1", 'Base namespace name is found.');
- is('symbols.getSymbol("ns1").memberOf', "", 'Base namespace memberOf is empty (its a constructor).');
- is('symbols.getSymbol("ns1.ns2").name', "ns2", 'Nested namespace name is found.');
- is('symbols.getSymbol("ns1.ns2").alias', "ns1.ns2", 'Nested namespace alias is found.');
- is('symbols.getSymbol("ns1.ns2").memberOf', "ns1", 'Nested namespace memberOf is found.');
- is('symbols.getSymbol("ns1.ns2.Function1").name', "Function1", 'Method of nested namespace name is found.');
- is('symbols.getSymbol("ns1.ns2.Function1").memberOf', "ns1.ns2", 'Constructor of nested namespace memberOf is found.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/functions_nested.js"]});
-
- is('symbols.getSymbol("Zop").name', "Zop", 'Any constructor name is found.');
- is('symbols.getSymbol("Zop").isa', "CONSTRUCTOR", 'It isa constructor.');
- is('symbols.getSymbol("Zop").hasMethod("zap")', true, 'Its method name, set later, is in methods array.');
- is('symbols.getSymbol("Foo").name', "Foo", 'The containing constructor name is found.');
- is('symbols.getSymbol("Foo").hasMethod("methodOne")', true, 'Its method name is found.');
- is('symbols.getSymbol("Foo").hasMethod("methodTwo")', true, 'Its second method name is found.');
- is('symbols.getSymbol("Foo#methodOne").alias', "Foo#methodOne", 'A methods alias is found.');
- is('symbols.getSymbol("Foo#methodOne").isStatic', false, 'A methods is not static.');
- is('symbols.getSymbol("Bar").name', "Bar", 'A global function declared inside another function is found.');
- is('symbols.getSymbol("Bar").isa', "FUNCTION", 'It isa function.');
- is('symbols.getSymbol("Bar").memberOf', "_global_", 'It is global.');
- is('symbols.getSymbol("Foo-inner").name', "inner", 'An inner functions name is found.');
- is('symbols.getSymbol("Foo-inner").memberOf', "Foo", 'It is member of the outer function.');
- is('symbols.getSymbol("Foo-inner").isInner', true, 'It is an inner function.');
- }
- ,
- function() {
- symbolize({a:true, _: [SYS.pwd+"test/memberof_constructor.js"]});
-
- is('symbols.getSymbol("Circle#Tangent").name', "Tangent", 'Constructor set on prototype using @member has correct name.');
- is('symbols.getSymbol("Circle#Tangent").memberOf', "Circle", 'Constructor set on prototype using @member has correct memberOf.');
- is('symbols.getSymbol("Circle#Tangent").alias', "Circle#Tangent", 'Constructor set on prototype using @member has correct alias.');
- is('symbols.getSymbol("Circle#Tangent").isa', "CONSTRUCTOR", 'Constructor set on prototype using @member has correct isa.');
- is('symbols.getSymbol("Circle#Tangent").isStatic', false, 'Constructor set on prototype using @member is not static.');
- is('symbols.getSymbol("Circle#Tangent#getDiameter").name', "getDiameter", 'Method set on prototype using @member has correct name.');
- is('symbols.getSymbol("Circle#Tangent#getDiameter").memberOf', "Circle#Tangent", 'Method set on prototype using @member has correct memberOf.');
- is('symbols.getSymbol("Circle#Tangent#getDiameter").alias', "Circle#Tangent#getDiameter", 'Method set on prototype using @member has correct alias.');
- is('symbols.getSymbol("Circle#Tangent#getDiameter").isa', "FUNCTION", 'Method set on prototype using @member has correct isa.');
- is('symbols.getSymbol("Circle#Tangent#getDiameter").isStatic', false, 'Method set on prototype using @member is not static.');
- }
- ,
- function() {
- symbolize({a:true, p: true, _: [SYS.pwd+"test/memberof.js"]});
-
- is('symbols.getSymbol("pack.install").alias', "pack.install", 'Using @memberOf sets alias, when parent name is in memberOf tag.');
- is('symbols.getSymbol("pack.install.overwrite").name', "install.overwrite", 'Using @memberOf sets name, even if the name is dotted.');
- is('symbols.getSymbol("pack.install.overwrite").memberOf', "pack", 'Using @memberOf sets memberOf.');
- is('symbols.getSymbol("pack.install.overwrite").isStatic', true, 'Using @memberOf with value not ending in octothorp sets isStatic to true.');
- }
- ,
- function() {
- symbolize({a:true, p: true, _: [SYS.pwd+"test/memberof2.js"]});
-
- is('symbols.getSymbol("Foo#bar").alias', "Foo#bar", 'An inner function can be documented as an instance method.');
- is('symbols.getSymbol("Foo.zip").alias', "Foo.zip", 'An inner function can be documented as a static method.');
- is('symbols.getSymbol("Foo.Fiz").alias', "Foo.Fiz", 'An inner function can be documented as a static constructor.');
- is('symbols.getSymbol("Foo.Fiz#fipple").alias', "Foo.Fiz#fipple", 'An inner function can be documented as a static constructor with a method.');
- is('symbols.getSymbol("Foo#blat").alias', "Foo#blat", 'An global function can be documented as an instance method.');
- }
- ,
- function() {
- symbolize({a:true, p: true, _: [SYS.pwd+"test/memberof3.js"]});
-
- is('symbols.getSymbol("Foo#bar").alias', "Foo#bar", 'A virtual field can be documented as an instance method.');
- is('symbols.getSymbol("Foo2#bar").alias', "Foo2#bar", 'A virtual field with the same name can be documented as an instance method.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/borrows.js"]});
-
- is('symbols.getSymbol("Layout").name', "Layout", 'Constructor can be found.');
- is('symbols.getSymbol("Layout").hasMethod("init")', true, 'Constructor method name can be found.');
- is('symbols.getSymbol("Layout").hasMember("orientation")', true, 'Constructor property name can be found.');
-
- is('symbols.getSymbol("Page").hasMethod("reset")', true, 'Second constructor method name can be found.');
- is('symbols.getSymbol("Page").hasMember("orientation")', true, 'Second constructor borrowed property name can be found in properties.');
- is('symbols.getSymbol("Page#orientation").memberOf', "Page", 'Second constructor borrowed property memberOf can be found.');
- is('symbols.getSymbol("Page-getInnerElements").alias', "Page-getInnerElements", 'Can borrow an inner function and it is still inner.');
- is('symbols.getSymbol("Page.units").alias', "Page.units", 'Can borrow a static function and it is still static.');
-
- is('symbols.getSymbol("ThreeColumnPage#init").alias', "ThreeColumnPage#init", 'Third constructor method can be found even though method with same name is borrowed.');
- is('symbols.getSymbol("ThreeColumnPage#reset").alias', "ThreeColumnPage#reset", 'Borrowed method can be found.');
- is('symbols.getSymbol("ThreeColumnPage#orientation").alias', "ThreeColumnPage#orientation", 'Twice borrowed method can be found.');
-
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/borrows2.js"]});
-
- is('symbols.getSymbol("Foo").hasMethod("my_zop")', true, 'Borrowed method can be found.');
- is('symbols.getSymbol("Bar").hasMethod("my_zip")', true, 'Second borrowed method can be found.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/constructs.js"]});
-
- is('symbols.getSymbol("Person").hasMethod("say")', true, 'The constructs tag creates a class that lends can add a method to.');
- }
- ,
- function() {
- symbolize({a: true, _: [SYS.pwd+"test/augments.js", SYS.pwd+"test/augments2.js"]});
-
- is('symbols.getSymbol("Page").augments[0]', "Layout", 'An augmented class can be found.');
- is('symbols.getSymbol("Page#reset").alias', "Page#reset", 'Method of augmenter can be found.');
- is('symbols.getSymbol("Page").hasMethod("Layout#init")', true, 'Method from augmented can be found.');
- is('symbols.getSymbol("Page").hasMember("Layout#orientation")', true, 'Property from augmented can be found.');
- is('symbols.getSymbol("Page").methods.length', 3, 'Methods of augmented class are included in methods array.');
-
- is('symbols.getSymbol("ThreeColumnPage").augments[0]', "Page", 'The extends tag is a synonym for augments.');
- is('symbols.getSymbol("ThreeColumnPage").hasMethod("ThreeColumnPage#init")', true, 'Local method overrides augmented method of same name.');
- is('symbols.getSymbol("ThreeColumnPage").methods.length', 3, 'Local method count is right.');
-
- is('symbols.getSymbol("NewsletterPage").augments[0]', "ThreeColumnPage", 'Can augment across file boundaries.');
- is('symbols.getSymbol("NewsletterPage").augments.length', 2, 'Multiple augments are supported.');
- is('symbols.getSymbol("NewsletterPage").inherits[0].alias', "Junkmail#annoy", 'Inherited method with augments.');
- is('symbols.getSymbol("NewsletterPage").methods.length', 6, 'Methods of augmented class are included in methods array across files.');
- is('symbols.getSymbol("NewsletterPage").properties.length', 1, 'Properties of augmented class are included in properties array across files.');
- }
- ,
- function() {
- symbolize({a:true, _: [SYS.pwd+"test/static_this.js"]});
-
- is('symbols.getSymbol("box.holder").name', "holder", 'Static namespace name can be found.');
- is('symbols.getSymbol("box.holder.foo").name', "foo", 'Static namespace method name can be found.');
- is('symbols.getSymbol("box.holder").isStatic', true, 'Static namespace method is static.');
-
- is('symbols.getSymbol("box.holder.counter").name', "counter", 'Instance namespace property name set on "this" can be found.');
- is('symbols.getSymbol("box.holder.counter").alias', "box.holder.counter", 'Instance namespace property alias set on "this" can be found.');
- is('symbols.getSymbol("box.holder.counter").memberOf', "box.holder", 'Static namespace property memberOf set on "this" can be found.');
- }
- ,
- function() {
- symbolize({a:true, p: true, _: [SYS.pwd+"test/lend.js"]});
-
- is('symbols.getSymbol("Person").name', "Person", 'Class defined in lend comment is found.');
- is('symbols.getSymbol("Person").hasMethod("initialize")', true, 'Lent instance method name can be found.');
- is('symbols.getSymbol("Person").hasMethod("say")', true, 'Second instance method can be found.');
- is('symbols.getSymbol("Person#sing").isStatic', false, 'Instance method is known to be not static.');
-
- is('symbols.getSymbol("Person.getCount").name', "getCount", 'Static method name from second lend comment can be found.');
- is('symbols.getSymbol("Person.getCount").isStatic', true, 'Static method from second lend comment is known to be static.');
-
- is('LOG.warnings.filter(function($){if($.indexOf("notok") > -1) return $}).length', 1, 'A warning is emitted when lending to an undocumented parent.');
- }
- ,
- function() {
- symbolize({a:true, _: [SYS.pwd+"test/param_inline.js"]});
-
- is('symbols.getSymbol("Layout").params[0].type', "int", 'Inline param name is set.');
- is('symbols.getSymbol("Layout").params[0].desc', "The number of columns.", 'Inline param desc is set from comment.');
- is('symbols.getSymbol("Layout#getElement").params[0].name', "id", 'User defined param documentation takes precedence over parser defined.');
- is('symbols.getSymbol("Layout#getElement").params[0].isOptional', true, 'Default for param is to not be optional.');
- is('symbols.getSymbol("Layout#getElement").params[1].isOptional', false, 'Can mark a param as being optional.');
- is('symbols.getSymbol("Layout#getElement").params[1].type', "number|string", 'Type of inline param doc can have multiple values.');
- is('symbols.getSymbol("Layout#Canvas").params[0].type', "", 'Type can be not defined for some params.');
- is('symbols.getSymbol("Layout#Canvas").params[2].type', "int", 'Type can be defined inline for only some params.');
- is('symbols.getSymbol("Layout#rotate").params.length', 0, 'Docomments inside function sig is ignored without a param.');
- is('symbols.getSymbol("Layout#init").params[2].type', "zoppler", 'Doc comment type overrides inline type for param with same name.');
- }
- ,
- function() {
- symbolize({a: true, _: [SYS.pwd+"test/shared.js", SYS.pwd+"test/shared2.js"]});
-
- is('symbols.getSymbol("Array#some").name', 'some', 'The name of a symbol in a shared section is found.');
- is('symbols.getSymbol("Array#some").alias', 'Array#some', 'The alias of a symbol in a shared section is found.');
- is('symbols.getSymbol("Array#some").desc', "Extension to builtin array.", 'A description can be shared.');
- is('symbols.getSymbol("Array#filter").desc', "Extension to builtin array.\nChange every element of an array.", 'A shared description is appended.');
- is('symbols.getSymbol("Queue").desc', "A first in, first out data structure.", 'A description is not shared when outside a shared section.');
- is('symbols.getSymbol("Queue.rewind").alias', "Queue.rewind", 'Second shared tag can be started.');
- is('symbols.getSymbol("startOver").alias', "startOver", 'Shared tag doesnt cross over files.');
- }
- ,
- function() {
- symbolize({a: true, _: [SYS.pwd+"test/config.js"]});
- is('symbols.getSymbol("Contact").params[0].name', 'person', 'The name of a param is found.');
- is('symbols.getSymbol("Contact").params[1].name', 'person.name', 'The name of a param set with a dot name is found.');
- is('symbols.getSymbol("Contact").params[2].name', 'person.age', 'The name of a second param set with a dot name is found.');
- is('symbols.getSymbol("Contact").params[4].name', 'connection', 'The name of a param after config is found.');
-
- is('symbols.getSymbol("Family").params[0].name', 'persons', 'Another name of a param is found.');
- is('symbols.getSymbol("Family").params[1].name', 'persons.Father', 'The name of a param+config is found.');
- is('symbols.getSymbol("Family").params[2].name', 'persons.Mother', 'The name of a second param+config is found.');
- is('symbols.getSymbol("Family").params[3].name', 'persons.Children', 'The name of a third param+config is found.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/ignore.js"]});
- is('LOG.warnings.filter(function($){if($.indexOf("undocumented symbol Ignored") > -1) return $}).length', 1, 'A warning is emitted when documenting members of an ignored parent.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/functions_anon.js"]});
- is('symbols.getSymbol("a.b").alias', 'a.b', 'In anonymous constructor this is found to be the container object.');
- is('symbols.getSymbol("a.f").alias', 'a.f', 'In anonymous constructor this can have a method.');
- is('symbols.getSymbol("a.c").alias', 'a.c', 'In anonymous constructor method this is found to be the container object.');
- is('symbols.getSymbol("g").alias', 'g', 'In anonymous function executed inline this is the global.');
- is('symbols.getSymbol("bar2.p").alias', 'bar2.p', 'In named constructor executed inline this is the container object.');
- is('symbols.getSymbol("module.pub").alias', 'module.pub', 'In parenthesized anonymous function executed inline function scoped variables arent documented.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/oblit_anon.js"]});
- is('symbols.getSymbol("opt").name', 'opt', 'Anonymous object properties are created.');
- is('symbols.getSymbol("opt.conf.keep").alias', 'opt.conf.keep', 'Anonymous object first property is assigned to $anonymous.');
- is('symbols.getSymbol("opt.conf.base").alias', 'opt.conf.base', 'Anonymous object second property is assigned to $anonymous.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/params_optional.js"]});
- is('symbols.getSymbol("Document").params.length', 3, 'Correct number of params are found when optional param syntax is used.');
- is('symbols.getSymbol("Document").params[1].name', "id", 'Name of optional param is found.');
- is('symbols.getSymbol("Document").params[1].isOptional', true, 'Optional param is marked isOptional.');
- is('symbols.getSymbol("Document").params[2].name', "title", 'Name of optional param with default value is found.');
- is('symbols.getSymbol("Document").params[2].isOptional', true, 'Optional param with default value is marked isOptional.');
- is('symbols.getSymbol("Document").params[2].defaultValue', " This is untitled.", 'Optional param default value is found.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/synonyms.js"]});
- is('symbols.getSymbol("myObject.myFunc").type', 'function', 'Type can be set to function.');
- }
- ,
- function() {
- symbolize({a:true, p:true, _: [SYS.pwd+"test/event.js"]});
- is('symbols.getSymbol("Kitchen#event:cakeEaten").isEvent', true, 'Function with event prefix is an event.');
- is('symbols.getSymbol("Kitchen#cakeEaten").isa', "FUNCTION", 'Function with same name as event isa function.');
- }
- ,
- function() {
- symbolize({x:"js", a:true, _: [SYS.pwd+"test/scripts/"]});
- is('JSDOC.JsDoc.srcFiles.length', 1, 'Only js files are scanned when -x=js.');
- }
- ,
- function() {
- symbolize({x:"js", a:true, _: [SYS.pwd+"test/exports.js"]});
- is('symbols.getSymbol("mxn.Map#doThings").name', 'doThings', 'Exports creates a documentation alias that can have methods.');
- }
- ,
- function() {
- symbolize({p:true, a:true, _: [SYS.pwd+"test/module.js"]});
- is('symbols.getSymbol("myProject.myModule.myPublicMethod").name', 'myPublicMethod', 'A function wrapped in parens can be recognized.');
- is('symbols.getSymbol("myProject.myModule-myPrivateMethod").name', 'myPrivateMethod', 'A private method in the scope of a function wrapped in parens can be recognized.');
- is('symbols.getSymbol("myProject.myModule-myPrivateVar").name', 'myPrivateVar', 'A private member in the scope of a function wrapped in parens can be recognized.');
- }
-];
-
-//// run and print results
-print(testrun(testCases));
diff --git a/tests/lib/jsdoc-toolkit/app/test/addon.js b/tests/lib/jsdoc-toolkit/app/test/addon.js
deleted file mode 100644
index 8886205330..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/addon.js
+++ /dev/null
@@ -1,24 +0,0 @@
-String.prototype.reverse = function() {
-}
-
-String.prototype.reverse.utf8 = function() {
-}
-
-Function.count = function() {
-}
-
-/** @memberOf Function */
-Function.count.reset = function() {
-}
-
-/** @memberOf Function */
-count.getValue = function() {
-}
-
-/** @memberOf Function.prototype */
-getSig = function() {
-}
-
-/** @memberOf Function.prototype */
-Function.prototype.getProps = function() {
-}
diff --git a/tests/lib/jsdoc-toolkit/app/test/anon_inner.js b/tests/lib/jsdoc-toolkit/app/test/anon_inner.js
deleted file mode 100644
index e1b4bfa9d4..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/anon_inner.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * @name bar
- * @namespace
- */
-
-new function() {
- /**
- * @name bar-foo
- * @function
- * @param {number} x
- */
- function foo(x) {
- }
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/augments.js b/tests/lib/jsdoc-toolkit/app/test/augments.js
deleted file mode 100644
index d5e10d5517..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/augments.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
-@constructor
-*/
-function Layout(p) {
- this.init = function(p) {
- }
-
- this.getId = function() {
- }
-
- /** @type Page */
- this.orientation = "landscape";
-}
-
-/**
-@constructor
-@augments Layout
-*/
-function Page() {
- this.reset = function(b) {
- }
-}
-
-/**
-@extends Page
-@constructor
-*/
-function ThreeColumnPage() {
- this.init = function(resetCode) {
- }
-}
diff --git a/tests/lib/jsdoc-toolkit/app/test/augments2.js b/tests/lib/jsdoc-toolkit/app/test/augments2.js
deleted file mode 100644
index e8388f0f88..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/augments2.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
-@constructor
-*/
-function LibraryItem() {
- this.reserve = function() {
- }
-}
-
-/**
-@constructor
-*/
-function Junkmail() {
- this.annoy = function() {
- }
-}
-
-/**
-@inherits Junkmail.prototype.annoy as pester
-@augments ThreeColumnPage
-@augments LibraryItem
-@constructor
-*/
-function NewsletterPage() {
- this.getHeadline = function() {
- }
-}
diff --git a/tests/lib/jsdoc-toolkit/app/test/borrows.js b/tests/lib/jsdoc-toolkit/app/test/borrows.js
deleted file mode 100644
index 23996fcb91..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/borrows.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
-@constructor
-*/
-function Layout(p) {
- /** initilize 1 */
- this.init = function(p) {
- }
-
- /** get the id */
- this.getId = function() {
- }
-
- /** @type string */
- this.orientation = "landscape";
-
- function getInnerElements(elementSecretId){
- }
-}
-
-/** A static method. */
-Layout.units = function() {
-}
-
-/**
-@constructor
-@borrows Layout#orientation
-@borrows Layout-getInnerElements
-@borrows Layout.units
-*/
-function Page() {
- /** reset the page */
- this.reset = function(b) {
- }
-}
-
-/**
-@constructor
-@borrows Layout.prototype.orientation as this.orientation
-@borrows Layout.prototype.init as #init
-@inherits Page.prototype.reset as #reset
-*/
-function ThreeColumnPage() {
- /** initilize 2 */
- this.init = function(p) {
- }
-}
diff --git a/tests/lib/jsdoc-toolkit/app/test/borrows2.js b/tests/lib/jsdoc-toolkit/app/test/borrows2.js
deleted file mode 100644
index cb76c226fa..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/borrows2.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// testing circular borrows
-
-/**
- @class
- @borrows Bar#zop as this.my_zop
-*/
-function Foo() {
- /** this is a zip. */
- this.zip = function() {}
-
- this.my_zop = new Bar().zop;
-}
-
-/**
- @class
- @borrows Foo#zip as this.my_zip
-*/
-function Bar() {
- /** this is a zop. */
- this.zop = function() {}
-
- this.my_zip = new Foo().zip;
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/config.js b/tests/lib/jsdoc-toolkit/app/test/config.js
deleted file mode 100644
index 0748a210a2..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/config.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * @constructor
- * @param person The person.
- * @param {string} person.name The person's name.
- * @config {integer} age The person's age.
- * @config [id=1] Optional id number to use.
- * @param connection
- */
-function Contact(person, connection) {
-
-}
-
-/**
- * @constructor
- * @param persons
- * @config {string} Father The paternal person.
- * @config {string} Mother The maternal person.
- * @config {string[]} Children And the rest.
- */
-function Family(/**Object*/persons) {
-
-}
diff --git a/tests/lib/jsdoc-toolkit/app/test/constructs.js b/tests/lib/jsdoc-toolkit/app/test/constructs.js
deleted file mode 100644
index cca5dbd38e..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/constructs.js
+++ /dev/null
@@ -1,18 +0,0 @@
-var Person = makeClass(
- /**
- @scope Person
- */
- {
- /**
- This is just another way to define a constructor.
- @constructs
- @param {string} name The name of the person.
- */
- initialize: function(name) {
- this.name = name;
- },
- say: function(message) {
- return this.name + " says: " + message;
- }
- }
-); \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/encoding.js b/tests/lib/jsdoc-toolkit/app/test/encoding.js
deleted file mode 100644
index ba64219319..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/encoding.js
+++ /dev/null
@@ -1,10 +0,0 @@
-
-/**
- * @Constructor
- * @desc é…置文件
- * @class 什么也ä¸è¿”回
- */
-function Test(conf) {
- // do something;
-}
-
diff --git a/tests/lib/jsdoc-toolkit/app/test/encoding_other.js b/tests/lib/jsdoc-toolkit/app/test/encoding_other.js
deleted file mode 100644
index b144da4cf0..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/encoding_other.js
+++ /dev/null
@@ -1,12 +0,0 @@
-
-/**
- * @Constructor
- * @desc ðïîÛ
- * @class ßàáâãäåæçèçìëêíîï °±²³´µ¡¶·¸¹
- */
-function Test(conf) {
- // do something;
-}
-
-// run with commanline option -e=iso-8859-5
-
diff --git a/tests/lib/jsdoc-toolkit/app/test/event.js b/tests/lib/jsdoc-toolkit/app/test/event.js
deleted file mode 100644
index 4c7098b78d..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/event.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * @name Kitchen
- * @constructor
- * @fires Bakery#event:donutOrdered
- */
-
-/**
- * Fired when some cake is eaten.
- * @name Kitchen#event:cakeEaten
- * @function
- * @param {Number} pieces The number of pieces eaten.
- */
-
-/**
- * Find out if cake was eaten.
- * @name Kitchen#cakeEaten
- * @function
- * @param {Boolean} wasEaten
- */
-
-/**
- * @name getDesert
- * @function
- * @fires Kitchen#event:cakeEaten
- */
-
-/**
- * @name Bakery
- * @constructor
- * @extends Kitchen
- */
-
-/**
- * Fired when a donut order is made.
- * @name Bakery#event:donutOrdered
- * @event
- * @param {Event} e The event object.
- * @param {String} [e.topping] Optional sprinkles.
- */
-
-/**
- * @constructor
- * @borrows Bakery#event:donutOrdered as this.event:cakeOrdered
- */
-function CakeShop() {
-}
-
-/** @event */
-CakeShop.prototype.icingReady = function(isPink) {
-}
-
-/** @event */
-function amHungry(/**Boolean*/enoughToEatAHorse) {
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/exports.js b/tests/lib/jsdoc-toolkit/app/test/exports.js
deleted file mode 100644
index 566e5c8ba1..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/exports.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/** @namespace */
-var mxn = {};
-
-(function(){
- /** @exports Map as mxn.Map */
- var Map =
- /** @constructor */
- mxn.Map = function() {
- };
-
- /** A method. */
- Map.prototype.doThings = function() {
- };
-})(); \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/functions_anon.js b/tests/lib/jsdoc-toolkit/app/test/functions_anon.js
deleted file mode 100644
index 07a2d4a27f..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/functions_anon.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/** an anonymous constructor executed inline */
-a = new function() {
- /** a.b*/
- this.b = 1;
- /** a.f */
- this.f = function() {
- /** a.c */
- this.c = 2;
- }
-}
-
-/**
- named function executed inline
-*/
-bar1 = function Zoola1() {
- /** property of global */
- this.g = 1;
-}();
-
-/**
- named constructor executed inline
-*/
-bar2 = new function Zoola2() {
- /** property of bar */
- this.p = 1;
-};
-
-/** module pattern */
-module = (function () {
- /** won't appear in documentation */
- var priv = 1;
-
- /** @scope module */
- return {
- /** will appear as a property of module */
- pub: 1
- }
-})();
diff --git a/tests/lib/jsdoc-toolkit/app/test/functions_nested.js b/tests/lib/jsdoc-toolkit/app/test/functions_nested.js
deleted file mode 100644
index abff69990a..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/functions_nested.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/** @constructor */
-function Zop() {
-}
-
-/**
- @class
-*/
-Foo = function(id) {
- // this is a bit twisted, but if you call Foo() you will then
- // modify Foo(). This is kinda, sorta non-insane, because you
- // would have to call Foo() 100% of the time to use Foo's methods
- Foo.prototype.methodOne = function(bar) {
- alert(bar);
- };
-
- // same again
- Foo.prototype.methodTwo = function(bar2) {
- alert(bar2);
- };
-
- // and these are only executed if the enclosing function is actually called
- // and who knows if that will ever happen?
- Bar = function(pez) {
- alert(pez);
- };
- Zop.prototype.zap = function(p){
- alert(p);
- };
-
- // but this is only visible inside Foo
- function inner() {
- }
-};
diff --git a/tests/lib/jsdoc-toolkit/app/test/global.js b/tests/lib/jsdoc-toolkit/app/test/global.js
deleted file mode 100644
index 5ea489496b..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/global.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/** ecks */
-var x = [1, 2, 4];
-
-var y = {
- foo: function(){
- }
-}
-
-bar = function() {
-}
-
-function zop() {
-}
diff --git a/tests/lib/jsdoc-toolkit/app/test/globals.js b/tests/lib/jsdoc-toolkit/app/test/globals.js
deleted file mode 100644
index a61824879d..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/globals.js
+++ /dev/null
@@ -1,25 +0,0 @@
-function example(/**Circle*/a, b) {
- /** a global defined in function */
- var number = a;
-
- var hideNumber = function(){
- }
-
- setNumber = function(){
- }
- alert('You have chosen: ' + b);
-}
-
-function initPage() {
- var supported = document.createElement && document.getElementsByTagName;
- if (!supported) return;
- // start of DOM script
- var x = document.getElementById('writeroot');
- // etc.
-}
-
-/** an example var */
-var document = new Document(x, y);
-
-var getNumber = function(){
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/ignore.js b/tests/lib/jsdoc-toolkit/app/test/ignore.js
deleted file mode 100644
index d3fac9ed5a..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/ignore.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/**
- * A test constructor.
- * @constructor
- * @ignore
- */
-function Ignored() {
- /** a method */
- this.bar = function() {
- }
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/inner.js b/tests/lib/jsdoc-toolkit/app/test/inner.js
deleted file mode 100644
index 37cfa9dc26..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/inner.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/**
- * @constructor
- */
-function Outer() {
- /**
- * @constructor
- */
- function Inner(name) {
- /** The name of this. */
- this.name = name;
- }
-
- this.open = function(name) {
- return (new Inner(name));
- }
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/jsdoc_test.js b/tests/lib/jsdoc-toolkit/app/test/jsdoc_test.js
deleted file mode 100644
index 3318ea03ca..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/jsdoc_test.js
+++ /dev/null
@@ -1,469 +0,0 @@
-/**
- * @fileoverview This file is to be used for testing the JSDoc parser
- * It is not intended to be an example of good JavaScript OO-programming,
- * nor is it intended to fulfill any specific purpose apart from
- * demonstrating the functionality of the
- * <a href='http://sourceforge.net/projects/jsdoc'>JSDoc</a> parser
- *
- * @author Gabriel Reid gab_reid@users.sourceforge.net
- * @version 0.1
- */
-
-/**
- * Construct a new Shape object.
- * @class This is the basic Shape class.
- * It can be considered an abstract class, even though no such thing
- * really existing in JavaScript
- * @constructor
- * @throws MemoryException if there is no more memory
- * @throws GeneralShapeException rarely (if ever)
- * @return {Shape|Coordinate} A new shape.
- */
-function Shape(){
-
- /**
- * This is an example of a function that is not given as a property
- * of a prototype, but instead it is assigned within a constructor.
- * For inner functions like this to be picked up by the parser, the
- * function that acts as a constructor <b>must</b> be denoted with
- * the <b>&#64;constructor</b> tag in its comment.
- * @type String
- */
- this.getClassName = function(){
- return "Shape";
- }
-
- /**
- * This is an inner method, just used here as an example
- * @since version 0.5
- * @author Sue Smart
- */
- function addReference(){
- // Do nothing...
- }
-
-}
-
-/**
- * Create a new Hexagon instance.
- * @extends Shape
- * @class Hexagon is a class that is a <i>logical</i> sublcass of
- * {@link Shape} (thanks to the <code>&#64;extends</code> tag), but in
- * reality it is completely unrelated to Shape.
- * @param {int} sideLength The length of one side for the new Hexagon
- * @example
- * var h = new Hexagon(2);
- * @example
- * if (hasHex) {
- * hex = new Hexagon(5);
- * color = hex.getColor();
- * }
- */
-function Hexagon(sideLength) {
-}
-
-/**
- * This is an unattached (static) function that adds two integers together.
- * @param {int} One The first number to add
- * @param {int} Two The second number to add
- * @author Gabriel Reid
- * @deprecated So you shouldn't use it anymore! Use {@link Shape#getClassName} instead.
- */
-function Add(One, Two){
- return One + Two;
-}
-
-/**
- * The color of this shape
- * @type Color
- */
-Shape.prototype.color = null;
-
-/**
- * The border of this shape.
- * @field
- * @type int
- */
-Shape.prototype.border = function(){return border;};
-
-/*
- * These are all the instance method implementations for Shape
- */
-
-/**
- * Get the coordinates of this shape. It is assumed that we're always talking
- * about shapes in a 2D location here.
- * @requires The {@link Shape} class
- * @returns A Coordinate object representing the location of this Shape
- * @type Coordinate[]
- */
-Shape.prototype.getCoords = function(){
- return this.coords;
-}
-
-/**
- * Get the color of this shape.
- * @see #setColor
- * @see The <a href="http://example.com">Color</a> library.
- * @link Shape
- * @type Color
- */
-Shape.prototype.getColor = function(){
- return this.color;
-}
-
-/**
- * Set the coordinates for this Shape
- * @param {Coordinate} coordinates The coordinates to set for this Shape
- */
-Shape.prototype.setCoords = function(coordinates){
- this.coords = coordinates;
-}
-
-/**
- * Set the color for this Shape
- * @param {Color} color The color to set for this Shape
- * @param other There is no other param, but it can still be documented if
- * optional parameters are used
- * @throws NonExistantColorException (no, not really!)
- * @see #getColor
- */
-Shape.prototype.setColor = function(color){
- this.color = color;
-}
-
-/**
- * Clone this shape
- * @returns A copy of this shape
- * @type Shape
- * @author Gabriel Reid
- */
-Shape.prototype.clone = function(){
- return new Shape();
-}
-
-/**
- * Create a new Rectangle instance.
- * @class A basic rectangle class, inherits from Shape.
- * This class could be considered a concrete implementation class
- * @constructor
- * @param {int} width The optional width for this Rectangle
- * @param {int} height Thie optional height for this Rectangle
- * @author Gabriel Reid
- * @see Shape is the base class for this
- * @augments Shape
- * @hilited
- */
-function Rectangle(width, // This is the width
- height // This is the height
- ){
- if (width){
- this.width = width;
- if (height){
- this.height = height;
- }
- }
-}
-
-/* Inherit from Shape */
-Rectangle.prototype = new Shape();
-
-/**
- * Value to represent the width of the Rectangle.
- * <br>Text in <b>bold</b> and <i>italic</i> and a
- * link to <a href="http://sf.net">SourceForge</a>
- * @private
- * @type int
- */
-Rectangle.prototype.width = 0;
-
-/**
- * Value to represent the height of the Rectangle
- * @private
- * @type int
- */
-Rectangle.prototype.height = 0;
-
-/**
- * Get the type of this object.
- * @type String
- */
-Rectangle.prototype.getClassName= function(){
- return "Rectangle";
-}
-
-/**
- * Get the value of the width for the Rectangle
- * @type int
- * @see Rectangle#setWidth
- */
-Rectangle.prototype.getWidth = function(){
- return this.width;
-}
-
-/**
- * Get the value of the height for the Rectangle.
- * Another getter is the {@link Shape#getColor} method in the
- * {@link Shape} base class.
- * @return The height of this Rectangle
- * @type int
- * @see Rectangle#setHeight
- */
-Rectangle.prototype.getHeight = function(){
- return this.height;
-}
-
-/**
- * Set the width value for this Rectangle.
- * @param {int} width The width value to be set
- * @see #setWidth
- */
-Rectangle.prototype.setWidth = function(width){
- this.width = width;
-}
-
-/**
- * Set the height value for this Rectangle.
- * @param {int} height The height value to be set
- * @see #getHeight
- */
-Rectangle.prototype.setHeight = function(height){
- this.height = height;
-}
-
-/**
- * Get the value for the total area of this Rectangle
- * @return total area of this Rectangle
- * @type int
- */
-Rectangle.prototype.getArea = function(){
- return width * height;
-}
-
-/**
- * Create a new Square instance.
- * @class A Square is a subclass of {@link Rectangle}
- * @param {int} width The optional width for this Rectangle
- * @param {int} height The optional height for this Rectangle
- * @augments Rectangle
- */
-function Square(width, height){
- if (width){
- this.width = width;
- if (height){
- this.height = height;
- }
- }
-
-}
-
-/* Square is a subclass of Rectangle */
-Square.prototype = new Rectangle();
-
-/**
- * Set the width value for this Shape.
- * @param {int} width The width value to be set
- * @see #getWidth
- */
-Square.prototype.setWidth = function(width){
- this.width = this.height = width;
-}
-
-/**
- * Set the height value for this Shape
- * Sets the {@link Rectangle#height} attribute in the Rectangle.
- * @param {int} height The height value to be set
- */
-Square.prototype.setHeight = function(height){
- this.height = this.width = height;
-}
-
-/**
- * Create a new Circle instance based on a radius.
- * @class Circle class is another subclass of Shape
- * @extends Shape
- * @param {int} radius The optional radius of this {@link Circle }
- * @mixin Square.prototype.setWidth as this.setDiameter
- */
-function Circle(radius){
- if (radius) {
- /** The radius of the this Circle. */
- this.radius = radius;
- }
-}
-
-/* Circle inherits from {@link Shape} */
-Circle.prototype = new Shape();
-
-/**
- * The radius value for this Circle
- * @private
- * @type int
- */
-Circle.prototype.radius = 0;
-
-/**
- * A very simple class (static) field that is also a constant
- * @final
- * @type float
- */
-Circle.PI = 3.14;
-
-/**
- * Get the radius value for this Circle
- * @type int
- * @see #setRadius
- */
-Circle.prototype.getRadius = function(){
- return this.radius;
-}
-
-/**
- * Set the radius value for this Circle
- * @param {int} radius The {@link Circle#radius} value to set
- * @see #getRadius
- */
-Circle.prototype.setRadius = function(radius){
- this.radius = radius;
-}
-
-/**
- * An example of a class (static) method that acts as a factory for Circle
- * objects. Given a radius value, this method creates a new Circle.
- * @param {int} radius The radius value to use for the new Circle.
- * @type Circle
- */
-Circle.createCircle = function(radius){
- return new Circle(radius);
-}
-
-/**
- * Create a new Coordinate instance based on x and y grid data.
- * @class Coordinate is a class that can encapsulate location information.
- * @param {int} [x=0] The optional x portion of the Coordinate
- * @param {int} [y=0] The optinal y portion of the Coordinate
- */
-function Coordinate(x, y){
- if (x){
- this.x = x;
- if (y){
- this.y = y;
- }
- }
-}
-
-/**
- * The x portion of the Coordinate
- * @type int
- * @see #getX
- * @see #setX
- */
-Coordinate.prototype.x = 0;
-
-/**
- * The y portion of the Coordinate
- * @type int
- * @see #getY
- * @see #setY
- */
-Coordinate.prototype.y = 0;
-
-/**
- * Gets the x portion of the Coordinate.
- * @type int
- * @see #setX
- */
-Coordinate.prototype.getX = function(){
- return this.x;
-}
-
-/**
- * Get the y portion of the Coordinate.
- * @type int
- * @see #setY
- */
-Coordinate.prototype.getY = function(){
- return this.y;
-}
-
-/**
- * Sets the x portion of the Coordinate.
- * @param {int} x The x value to set
- * @see #getX
- */
-Coordinate.prototype.setX = function(x){
- this.x = x;
-}
-
-/**
- * Sets the y portion of the Coordinate.
- * @param {int} y The y value to set
- * @see #getY
- */
-Coordinate.prototype.setY = function(y){
- this.y = y;
-}
-
-/**
- * @class This class exists to demonstrate the assignment of a class prototype
- * as an anonymous block.
- */
-function ShapeFactory(){
-}
-
-ShapeFactory.prototype = {
- /**
- * Creates a new {@link Shape} instance.
- * @return A new {@link Shape}
- * @type Shape
- */
- createShape: function(){
- return new Shape();
- }
-}
-
-/**
- * An example of a singleton class
- * @param ... Arguments represent {@link coordinate}s in the shape.
- * @constructor
- */
-MySingletonShapeFactory = function(){
-
- /**
- * Get the next {@link Shape}
- * @type Shape
- * @return A new {@link Shape}
- */
- this.getShape = function(){
- return null;
- }
-
-}
-
-/**
- * Create a new Foo instance.
- * @class This is the Foo class. It exists to demonstrate 'nested' classes.
- * @constructor
- * @see Foo.Bar
- */
-function Foo(){}
-
-/**
- * Creates a new instance of Bar.
- * @class This class exists to demonstrate 'nested' classes.
- * @constructor
- * @see Foo.Bar
- */
-function Bar(){}
-
-/**
- * Nested class
- * @constructor
- */
-Foo.Bar = function(){
- /** The x. */ this.x = 2;
-}
-
-Foo.Bar.prototype = new Bar();
-/** The y. */
-Foo.Bar.prototype.y = '3';
diff --git a/tests/lib/jsdoc-toolkit/app/test/lend.js b/tests/lib/jsdoc-toolkit/app/test/lend.js
deleted file mode 100644
index 92b15d5adf..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/lend.js
+++ /dev/null
@@ -1,33 +0,0 @@
- /** @class */
-var Person = Class.create(
- /**
- @lends Person.prototype
- */
- {
- initialize: function(name) {
- this.name = name;
- },
- say: function(message) {
- return this.name + ': ' + message;
- }
- }
- );
-
-/** @lends Person.prototype */
-{
- /** like say but more musical */
- sing: function(song) {
- }
-}
-
-/** @lends Person */
-{
- getCount: function() {
- }
-}
-
-/** @lends Unknown.prototype */
-{
- notok: function() {
- }
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/memberof.js b/tests/lib/jsdoc-toolkit/app/test/memberof.js
deleted file mode 100644
index cf1404ecaf..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/memberof.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/** @constructor */
-pack = function() {
- this.init = function(){}
- function config(){}
-}
-
- pack.build = function(task) {};
-
-/** @memberOf pack */
-pack.install = function() {}
-
-/** @memberOf pack */
-pack.install.overwrite = function() {}
-
-/** @memberOf pack */
-clean = function() {}
-
-/** @memberOf pack-config */
-install = function() {};
diff --git a/tests/lib/jsdoc-toolkit/app/test/memberof2.js b/tests/lib/jsdoc-toolkit/app/test/memberof2.js
deleted file mode 100644
index 77942ae899..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/memberof2.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * @constructor
- */
-function Foo() {
- /**
- @memberOf Foo.prototype
- */
- function bar(a, b) {
- }
-
- /**
- @memberOf Foo
- */
- var zip = function(p, q) {
- }
-
- /**
- @memberOf Foo
- */
- function zop( x,y ) {
- }
-
- /**
- @memberOf Foo
- @constructor
- */
- function Fiz() {
- /** A method of Foo#Fiz. */
- this.fipple = function(fop){}
- }
-}
-
-/**
- @memberOf Foo#
- */
-var blat = function() {
-
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/memberof3.js b/tests/lib/jsdoc-toolkit/app/test/memberof3.js
deleted file mode 100644
index 8c259425df..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/memberof3.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
-* @name Foo
-* @class
-*/
-
-/**#@+
-* @memberOf Foo#
-* @field
-*/
-
-/**
-* @name bar
-* @type Object[]
-*/
-
-/**#@-*/
-
-/**
-* @name Foo2
-* @class
-*/
-
-/**#@+
-* @memberOf Foo2#
-* @field
-*/
-
-/**
-* @name bar
-* @type Object[]
-*/
-
-/**#@-*/ \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/memberof_constructor.js b/tests/lib/jsdoc-toolkit/app/test/memberof_constructor.js
deleted file mode 100644
index 7cefd72d1b..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/memberof_constructor.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/** @constructor */
-function Circle(){}
-
-/**
- @constructor
- @memberOf Circle#
- */
-Circle.prototype.Tangent = function(){};
-
-// renaming Circle#Tangent to Circle#Circle#Tangent
-
-/**
- @memberOf Circle#Tangent#
- */
-Circle.prototype.Tangent.prototype.getDiameter = function(){};
-
diff --git a/tests/lib/jsdoc-toolkit/app/test/module.js b/tests/lib/jsdoc-toolkit/app/test/module.js
deleted file mode 100644
index 5b3fe42c56..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/module.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/** @namespace */
-myProject = myProject || {};
-
-/** @namespace */
-myProject.myModule = (function () {
- /** describe myPrivateVar here */
- var myPrivateVar = "";
-
- var myPrivateMethod = function () {
- }
-
- /** @scope myProject.myModule */
- return {
- myPublicMethod: function () {
- }
- };
-})(); \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/multi_methods.js b/tests/lib/jsdoc-toolkit/app/test/multi_methods.js
deleted file mode 100644
index bab35c768d..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/multi_methods.js
+++ /dev/null
@@ -1,25 +0,0 @@
-
-/**
- Get the entire flavor.
- @name flavor^3
- @function
- @returns {Object} The entire flavor hash.
-*/
-/**
- Get a named flavor.
- @name flavor^2
- @function
- @param {String} name The name of the flavor to get.
- @returns {String} The value of that flavor.
-*/
-/**
- Set the flavor.
- @param {String} name The name of the flavor to set.
- @param {String} value The value of the flavor.
- @returns {String} The value of that flavor.
-*/
-function flavor(name, value) {
- if (arguments.length > 1) flavor[name] = value;
- else if (arguments.length == 1) return flavor[name];
- else return flavor;
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/name.js b/tests/lib/jsdoc-toolkit/app/test/name.js
deleted file mode 100644
index e88a51a710..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/name.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- @name Response
- @class
-*/
-
-Response.prototype = {
- /**
- @name Response#text
- @function
- @description
- Gets the body of the response as plain text
- @returns {String}
- Response as text
- */
-
- text: function() {
- return this.nativeResponse.responseText;
- }
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/namespace_nested.js b/tests/lib/jsdoc-toolkit/app/test/namespace_nested.js
deleted file mode 100644
index 394447c029..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/namespace_nested.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- @namespace This is the first namespace.
-*/
-ns1 = {};
-
-/**
- This is the second namespace.
- @namespace
-*/
-ns1.ns2 = {};
-
-/**
- This part of ns1.ns2
- @constructor
-*/
-ns1.ns2.Function1 = function() {
-};
-
-ns1.staticFunction = function() {
-};
-
-/** A static field in a namespace. */
-ns1.ns2.staticField = 1;
diff --git a/tests/lib/jsdoc-toolkit/app/test/nocode.js b/tests/lib/jsdoc-toolkit/app/test/nocode.js
deleted file mode 100644
index 22b02ccc48..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/nocode.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/**#nocode+*/
- /**
- @name star
- @function
- */
- function blahblah() {
-
- }
-/**#nocode-*/
-
-function yaddayadda() {
-
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/oblit_anon.js b/tests/lib/jsdoc-toolkit/app/test/oblit_anon.js
deleted file mode 100644
index e7693ddd40..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/oblit_anon.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/** the options */
-opt = Opt.get(
- arguments,
- {
- d: "directory",
- c: "conf",
- "D[]": "define"
- }
-);
-
-/** configuration */
-opt.conf = {
- /** keep */
- keep: true,
- /** base */
- base: getBase(this, {p: properties})
-}
-
diff --git a/tests/lib/jsdoc-toolkit/app/test/overview.js b/tests/lib/jsdoc-toolkit/app/test/overview.js
deleted file mode 100644
index 8e3eda7492..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/overview.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/**
- * @overview This "library" contains a
- * lot of classes and functions.
- * @example
- <pre>
- var x (x < 1);
- alert("This 'is' \"code\"");
- </pre>
- * @name My Cool Library
- * @author Joe Smith jsmith@company.com
- * @version 0.1
- */
-
-/**
- * Gets the current foo
- * @param {String} fooId The unique identifier for the foo.
- * @return {Object} Returns the current foo.
- */
-function getFoo(fooID){
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/param_inline.js b/tests/lib/jsdoc-toolkit/app/test/param_inline.js
deleted file mode 100644
index d457238270..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/param_inline.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- @constructor
- @param columns The number of columns.
-*/
-function Layout(/**int*/columns){
- /**
- @param [id] The id of the element.
- @param elName The name of the element.
- */
- this.getElement = function(
- /** string */ elName,
- /** number|string */ id
- ) {
- };
-
- /**
- @constructor
- */
- this.Canvas = function(top, left, /**int*/width, height) {
- /** Is it initiated yet? */
- this.initiated = true;
- }
-
- this.rotate = function(/**nothing*/) {
- }
-
- /**
- @param x
- @param y
- @param {zoppler} z*/
- this.init = function(x, y, /**abbler*/z) {
- /** The xyz. */
- this.xyz = x+y+z;
- this.getXyz = function() {
- }
- }
-}
diff --git a/tests/lib/jsdoc-toolkit/app/test/params_optional.js b/tests/lib/jsdoc-toolkit/app/test/params_optional.js
deleted file mode 100644
index 18bf59829c..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/params_optional.js
+++ /dev/null
@@ -1,8 +0,0 @@
-
-/**
- * @param {Page[]} pages
- * @param {number} [id] Specifies the id, if applicable.
- * @param {String} [title = This is untitled.] Specifies the title.
- */
-function Document(pages, id, title){
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/prototype.js b/tests/lib/jsdoc-toolkit/app/test/prototype.js
deleted file mode 100644
index a161ed7ec3..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/prototype.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/** @constructor */
-function Article() {
-}
-
-Article.prototype.init = function(title) {
- /** the instance title */
- this.title = title;
-
- /** the static counter */
- Article.counter = 1;
-}
-
-a = new Article();
-a.Init("my title");
-
-print(a.title);
-print(Article.counter); \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/prototype_nested.js b/tests/lib/jsdoc-toolkit/app/test/prototype_nested.js
deleted file mode 100644
index e8ca1ced2c..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/prototype_nested.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/** @constructor */
-function Word() {
-}
-
-Word.prototype.reverse = function() {
-}
-
-Word.prototype.reverse.utf8 = function() {
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/prototype_oblit.js b/tests/lib/jsdoc-toolkit/app/test/prototype_oblit.js
deleted file mode 100644
index 6cfc39caf7..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/prototype_oblit.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/** @constructor */
-function Article() {
-}
-
-Article.prototype = {
- /** instance get title */
- getTitle: function(){
- }
-}
-
-/** static get title */
-Article.getTitle = function(){
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/prototype_oblit_constructor.js b/tests/lib/jsdoc-toolkit/app/test/prototype_oblit_constructor.js
deleted file mode 100644
index 13ec6ef180..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/prototype_oblit_constructor.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @constructor */
-function Article() {
-}
-
-Article.prototype = {
- /** @constructor */
- Title: function(title) {
- /** the value of the Title instance */
- this.title = title;
- },
-
- init: function(pages) {
- /** the value of the pages of the Article instance */
- this.pages = pages;
- }
-}
-
-f = new Article();
-f.init("one two three");
-
-t = new f.Title("my title");
-
-print(f.pages);
-print(t.title); \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/public.js b/tests/lib/jsdoc-toolkit/app/test/public.js
deleted file mode 100644
index 35d34f6f00..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/public.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/**@constructor*/
-function Foo() {
- /**
- @public
- @static
- @field
- */
- var bar = function(x) {
- }
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/scripts/code.js b/tests/lib/jsdoc-toolkit/app/test/scripts/code.js
deleted file mode 100644
index e9d7ed2ecd..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/scripts/code.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- @class
- */
-function thisiscode() {
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/scripts/notcode.txt b/tests/lib/jsdoc-toolkit/app/test/scripts/notcode.txt
deleted file mode 100644
index fcd737e778..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/scripts/notcode.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-(This is not code)
-function foo(){{{{
-(
-!
-@ \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/shared.js b/tests/lib/jsdoc-toolkit/app/test/shared.js
deleted file mode 100644
index 8f190c4aec..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/shared.js
+++ /dev/null
@@ -1,41 +0,0 @@
-
-/**
- * Builtin object.
- * @class
- * @name Array
- */
-
-/**#@+
- * Extension to builtin array.
- * @memberOf Array
- * @method
- */
-
-/**
- * @returns Boolen if some array members...
- */
-Array.prototype.some = function(){};
-
-/**
- * Change every element of an array.
- * @returns Filtered array copy.
- */
-Array.prototype.filter = function(){};
-
-/**#@-*/
-
-/**
- * A first in, first out data structure.
- * @constructor
- */
-Queue = function(){};
-
-/**#@+
- * Extension to Queue.
- * @memberOf Queue
- */
-
-rewind = function(){
-}
-
-// should close automatically here. \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/shared2.js b/tests/lib/jsdoc-toolkit/app/test/shared2.js
deleted file mode 100644
index 3f7736a777..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/shared2.js
+++ /dev/null
@@ -1,2 +0,0 @@
-startOver = function(){
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/shortcuts.js b/tests/lib/jsdoc-toolkit/app/test/shortcuts.js
deleted file mode 100644
index abbcfdfdb4..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/shortcuts.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// /**#=+
-// * {
-// * 'D': 'Date.prototype',
-// * '$N': 'Number'
-// * }
-// */
-// var D = Date.prototype,
-// $N = Number;
-//
-// D.locale = function(){
-// };
-//
-// /**
-// @return {string} The cardinal number string.
-// */
-// $N.nth = function(n){
-// };
-//
-// LOAD.file = function(){
-// }
-//
-// /**#=-*/ \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/static_this.js b/tests/lib/jsdoc-toolkit/app/test/static_this.js
deleted file mode 100644
index 9407b20f3d..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/static_this.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/** the parent */
-var box = {};
-
-/** @namespace */
-box.holder = {}
-
-box.holder.foo = function() {
- /** the counter */
- this.counter = 1;
-}
-
-box.holder.foo();
-print(box.holder.counter);
diff --git a/tests/lib/jsdoc-toolkit/app/test/synonyms.js b/tests/lib/jsdoc-toolkit/app/test/synonyms.js
deleted file mode 100644
index 8068f7a015..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/synonyms.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- @class
- @inherits Bar#zop as #my_zop
-*/
-function Foo() {
- /** this is a zip. */
- this.zip = function() {}
-
- /** from Bar */
- this.my_zop = new Bar().zop;
-}
-
-/**
- @class
- @borrows Foo#zip as this.my_zip
-*/
-function Bar() {
- /** this is a zop. */
- this.zop = function() {}
-
- /** from Foo */
- this.my_zip = new Foo().zip;
-}
-
-/** @namespace */
-var myObject = {
- /**
- @type function
- */
- myFunc: getFunction()
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/tosource.js b/tests/lib/jsdoc-toolkit/app/test/tosource.js
deleted file mode 100644
index 706d47652b..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/tosource.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * @param {Object} object
- * @return {string}
- */
-function valueOf(object) {}
-
-/**
- * @param {Object} object
- * @return {string}
- */
-function toString(object) {}
-
-/**
- * @param {Object} object
- * @return {string}
- */
-function toSource(object) {}
-
-/**
- * @param {Object} object
- * @return {string}
- */
-function constructor(object) {} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/app/test/variable_redefine.js b/tests/lib/jsdoc-toolkit/app/test/variable_redefine.js
deleted file mode 100644
index e76c421315..0000000000
--- a/tests/lib/jsdoc-toolkit/app/test/variable_redefine.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/** @constructor */
-function Foo() {
- var bar = 1;
- bar = 2; // redefining a private
-
- this.baz = 1;
- baz = 2; // global
-
- /** a private */
- var blap = {
- /** in here */
- tada: 1
- }
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/changes.txt b/tests/lib/jsdoc-toolkit/changes.txt
deleted file mode 100644
index dea28c4922..0000000000
--- a/tests/lib/jsdoc-toolkit/changes.txt
+++ /dev/null
@@ -1,123 +0,0 @@
-== 2.4.0 ==
-
- * Fixed bug that added mutiple symbols with the same name to docs.
- * Added support for the -m option to suppress warnings for multiple docs.
- * Added patch by brownsea42 to support quoted user variables on the command line. ( issue #281 )
- * Fixed bug that sometimes caused links to events to be incorrect. ( issue #292 )
-
-== 2.3.3 ==
-
- * Fixed bug that made all fields declared with the @property tag static. ( issue #262 )
- * Minor fix to better handle trailing slash on path to template (from jwmetrocat). ( issue #237 )
- * Fix for @memberOf when applied to inner members. ( issue #264 )
- * Fix for @memberOf when applied to symbols documented with @name. ( issue #260 )
- * Applied patch from kunhualqk, fix for bug where @link to borrowed member did not resolve to parent class. ( issue #218 )
- * Fix for @requires not linking back to the required class
- * Added experimental support for @constructs to have an argument, the class name, when applied to a function assignment.
-
-== 2.3.2 ==
-
- * Minor update to the usage notes and corrected the version number displayed in the output.
-
-== 2.3.1 ==
-
- * Fixed HTML typo in allfiles template. ( issue #228 )
- * Modified template to display version information for classes.
- * Modified template to better support multiple methods with the same name.
- * Fixed bug that caused template to error when backtick characters appeared around class names.
-
-== 2.3.0 ==
-
- * Added option -u, --unique to avoid bug that causes multiple symbols with names that differ only by case to overwrite each others output on case-insensitive filesystems. ( issue #162 )
- * Fixed bug where {@links} in @deprecated tags did not resolve. ( issue #220 )
- * Fixed bug that caused parens around a function to make it to be unrecognized. ( issue #213 )
- * Fixed bug prevented explicit links to named anchors from working (thanks katgao.pku). ( issue #215 )
- * Fixed bug that prevented full description from appearing in file overview. ( issue #224 )
-
-== 2.2.1 ==
-
- * Fixed bug with class template, where sorting of methods was accidentally removed (thanks dezfowler).
- * Added missing test files for the @exports unit tests.
-
-== 2.2.0 ==
-
- * Fixed bug that caused exception when given a folder containing non-js files, even with the x commandline option set to "js". ( issue #193 )
- * Fixed typo in index template [patch submitted by olle]. ( issue #198 )
- * Modified @borrows tag experimentally to allow for missing "as ..." clause.
- * Added support for the @exports tag, to allow one symbol to be documented as another.
- * Added support for the -S option to document code following the Secure Modules pattern.
-
-== 2.1.0 ==
-
- * Added support for the @event tag.
- * Fixed bug that prevented the : character from appearing in symbol names.
- * Fixed bug that prevented underscored symbols marked with @public being tagged as private. (issue #184 )
- * Fixed bug that randomly affected the @memberOf tag when the name of the symbol did not include the parent name.
- * Fixed bug that prevented templates that were not in the jsdoc-toolkit folder from being found. ( issue #176 )
- * Added ability to check for trailing slash on template path. ( issue #177 )
- * Modified classDesc so that it no longer is appended with the constructor desc.
- * Fixed call to plugin onDocCommentSrc.
- * Added missing support for inline doc comments for function return types. ( issue #189 )
- * Added command line option -q, --quiet.
- * Added command line option -E, --exclude. ( issue #143 )
- * Added 2 more hooks for plugins. ( issue #163 )
- * Added support for extending built-ins. ( issue #160 )
- * Added "compact" option to JSDOC.JsPlate.prototype.process. ( issue #159 )
- * @augments no longer documents static members as inherited. ( issue #138 )
- * @link to a class now goes to the page for that class, not the constructor. ( issue #178 )
- * Warnings of mismatched curly brace now include filename. ( issue #166 )
- * Fixed bug affecting template paths loaded via a configuration file when the trailing slash is missing. ( issue #191 )
- * Minor optimizations.
-
-== 2.0.2 ==
-
- * Fixed bug that sometimes caused an example of division in the source code to be interpretted as a regex by the JsDoc Toolkit analyzer. ( issue #158 )
- * Fixed a bug that prevented private variables marked as @public from appearing in the documentation. ( issue #161 )
- * Fixed bug that prevented variable names with underscored properties from appearing in summaries. ( issue #173 )
-
-== 2.0.1 ==
-
- * Fixed bug that prevented @fileOverview tag from being recognized.
- * Added support for @fieldOf as a synonym for @field plus @memberOf.
- * Added support for @name tag in a @fileOverview comment to control the displayed name of the file.
- * Added support for multiple @example tags. ( issue #152 )
- * Modified style sheet of jsdoc template to make more readable. ( issue #151 )
- * Fixed bug that prevented @since documentation from displaying correctly when it appeared in a class. ( issue #150 )
- * Fixed bug that caused inhertited properties to sometimes not resolve correctly. ( issue #144 )
- * Modified so that trailing whitespace in @example is always trimmed. ( issue #153 )
- * Added support for elseif to JsPlate. (hat tip to fredck)
- * Added support for @location urls in the @overview comment to the jsdoc template.
-
-== Changes From Versions 1.4.0 to 2.0.0 ==
-
- * Upgraded included version of Rhino from 1.6 to 1.7R1.
- * Removed circular references in parsed documentation objects.
- * Improved inheritance handling, now properties and events can be inherited same as methods.
- * Improved handling of cross-file relationships, now having two related objects in separate files is not a problem.
- * Improved ability to recognize membership of previously defined objects.
- * Added ability to redefine parsing behavior with plugins.
- * @methodOf is a synonym for @function and @memberOf.
- * Added @default to document default values of members that are objects.
- * Added ability to parse and refer to inner functions.
- * Fixed bug that appeared when calling a method to set properties of the instance referred to by "this".
- * Added ability to automatically create links to other symbols.
- * New "jsdoc" template now produces fully W3C valid XHTML.
- * Inline parameter type hint comments are now documented.
- * Fixed error: Locally scoped variables (declared with var) no longer appear as global.
- * It is now possible to run JsDoc Toolkit from any directory.
- * Added support for inline {@link ...} tags.
- * Added support for the -H command-line option to allow for custom content handlers.
- * Tag names @inherits and @scope changed to @borrows and @lends.
- ? Combining @constructor in a doclet with @lends now supported.
- * Multiple @lend tags now supported.
- * Added support for the @constructs tag, used inside a @lends block.
- * Added support for the @constant tag.
- * Fixed bug that prevented the use of [] as a default value.
- * Added support for the @field tag.
- * Added support for the @public tag (applied to inner functions).
- * @namespace tag can now be applied to functions, not just object literals.
- * Added support for the -s command line option to suppress source code output.
- * Added new unit test framework.
- * Underscored symbols are now treated as if they have a @private tag by default.
- * Improved support for anonymous constructors.
- * Added support for the nocode meta tag.
diff --git a/tests/lib/jsdoc-toolkit/conf/sample.conf b/tests/lib/jsdoc-toolkit/conf/sample.conf
deleted file mode 100644
index c28347b0eb..0000000000
--- a/tests/lib/jsdoc-toolkit/conf/sample.conf
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- This is an example of one way you could set up a configuration file to more
- conveniently define some commandline options. You might like to do this if
- you frequently reuse the same options. Note that you don't need to define
- every option in this file, you can combine a configuration file with
- additional options on the commandline if your wish.
-
- You would include this configuration file by running JsDoc Toolkit like so:
- java -jar jsrun.jar app/run.js -c=conf/sample.conf
-
-*/
-
-{
- // source files to use
- _: ['app/test/jsdoc_test.js'],
-
- // document all functions, even uncommented ones
- a: true,
-
- // including those marked @private
- p: true,
-
- // some extra variables I want to include
- D: {generatedBy: "Michael Mathews", copyright: "2008"},
-
- // use this directory as the output directory
- d: "docs",
-
- // use this template
- t: "templates/jsdoc"
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/java/build.xml b/tests/lib/jsdoc-toolkit/java/build.xml
deleted file mode 100644
index 078fa8aaf3..0000000000
--- a/tests/lib/jsdoc-toolkit/java/build.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<project>
- <target name="clean">
- <delete dir="build"/>
- </target>
-
- <target name="compile">
- <mkdir dir="build/classes"/>
- <javac
- srcdir="src" destdir="build/classes"
- classpath="./classes/js.jar"
- />
- </target>
-
- <target name="jar">
- <mkdir dir="build/jar"/>
- <jar destfile="build/jar/jsrun.jar" basedir="build/classes">
- <manifest>
- <attribute name="Main-Class" value="JsRun"/>
- <attribute name="Class-Path" value="./java/classes/js.jar"/>
- </manifest>
- </jar>
- </target>
-
- <target name="debugjar">
- <mkdir dir="build/jar"/>
- <jar destfile="build/jar/jsdebug.jar" basedir="build/classes">
- <manifest>
- <attribute name="Main-Class" value="JsDebugRun"/>
- <attribute name="Class-Path" value="./java/classes/js.jar"/>
- </manifest>
- </jar>
- </target>
-
- <target name="clean-build" depends="clean,compile,jar"/>
- <target name="clean-debug" depends="clean,compile,debugjar"/>
-</project> \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/java/build_1.4.xml b/tests/lib/jsdoc-toolkit/java/build_1.4.xml
deleted file mode 100644
index 06201e7888..0000000000
--- a/tests/lib/jsdoc-toolkit/java/build_1.4.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<project default="clean-build"><!-- use this build script if you are stuck with ant version 1.4 -->
- <target name="clean">
- <delete dir="build"/>
- </target>
-
- <target name="compile">
- <mkdir dir="build/classes"/>
- <javac
- srcdir="src" destdir="build/classes"
- classpath="./classes/js.jar"
- />
- </target>
-
- <target name="jar">
- <mkdir dir="build/jar"/>
- <jar jarfile="build/jar/jsrun.jar" basedir="build/classes">
- <manifest>
- <attribute name="Main-Class" value="JsRun"/>
- <attribute name="Class-Path" value="./java/classes/js.jar"/>
- </manifest>
- </jar>
- </target>
-
- <target name="debugjar">
- <mkdir dir="build/jar"/>
- <jar jarfile="build/jar/jsdebug.jar" basedir="build/classes">
- <manifest>
- <attribute name="Main-Class" value="JsDebugRun"/>
- <attribute name="Class-Path" value="./java/classes/js.jar"/>
- </manifest>
- </jar>
- </target>
-
- <target name="clean-build" depends="clean,compile,jar"/>
- <target name="clean-debug" depends="clean,compile,debugjar"/>
-</project>
diff --git a/tests/lib/jsdoc-toolkit/java/classes/js.jar b/tests/lib/jsdoc-toolkit/java/classes/js.jar
deleted file mode 100644
index 0352cb180c..0000000000
--- a/tests/lib/jsdoc-toolkit/java/classes/js.jar
+++ /dev/null
Binary files differ
diff --git a/tests/lib/jsdoc-toolkit/java/src/JsDebugRun.java b/tests/lib/jsdoc-toolkit/java/src/JsDebugRun.java
deleted file mode 100644
index 8959011d91..0000000000
--- a/tests/lib/jsdoc-toolkit/java/src/JsDebugRun.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * A trivial bootstrap class that simply adds the path to the
- * .js file as an argument to the Rhino call. This little hack
- * allows the code in the .js file to have access to it's own
- * path via the Rhino arguments object. This is necessary to
- * allow the .js code to find resource files in a location
- * relative to itself.
- *
- * USAGE: java -jar jsdebug.jar path/to/file.js
- */
-public class JsDebugRun {
- public static void main(String[] args) {
- String[] jsargs = {"-j="+args[0]};
-
- String[] allArgs = new String[jsargs.length + args.length];
- System.arraycopy(args, 0, allArgs, 0, args.length);
- System.arraycopy(jsargs, 0, allArgs, args.length ,jsargs.length);
-
- org.mozilla.javascript.tools.debugger.Main.main(allArgs);
- }
-}
diff --git a/tests/lib/jsdoc-toolkit/java/src/JsRun.java b/tests/lib/jsdoc-toolkit/java/src/JsRun.java
deleted file mode 100644
index 0f82b3b6b1..0000000000
--- a/tests/lib/jsdoc-toolkit/java/src/JsRun.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/**
- * A trivial bootstrap class that simply adds the path to the
- * .js file as an argument to the Rhino call. This little hack
- * allows the code in the .js file to have access to it's own
- * path via the Rhino arguments object. This is necessary to
- * allow the .js code to find resource files in a location
- * relative to itself.
- *
- * USAGE: java -jar jsrun.jar path/to/file.js
- */
-public class JsRun {
- public static void main(String[] args) {
- String[] jsargs = {"-j="+args[0]};
-
- String[] allArgs = new String[jsargs.length + args.length];
- System.arraycopy(args, 0, allArgs, 0, args.length);
- System.arraycopy(jsargs, 0, allArgs, args.length ,jsargs.length);
-
- org.mozilla.javascript.tools.shell.Main.main(allArgs);
- }
-}
diff --git a/tests/lib/jsdoc-toolkit/jsdebug.jar b/tests/lib/jsdoc-toolkit/jsdebug.jar
deleted file mode 100644
index a0ac7daa6b..0000000000
--- a/tests/lib/jsdoc-toolkit/jsdebug.jar
+++ /dev/null
Binary files differ
diff --git a/tests/lib/jsdoc-toolkit/jsrun.jar b/tests/lib/jsdoc-toolkit/jsrun.jar
deleted file mode 100644
index 49c03f4c6f..0000000000
--- a/tests/lib/jsdoc-toolkit/jsrun.jar
+++ /dev/null
Binary files differ
diff --git a/tests/lib/jsdoc-toolkit/jsrun.sh b/tests/lib/jsdoc-toolkit/jsrun.sh
deleted file mode 100644
index 8c05c62759..0000000000
--- a/tests/lib/jsdoc-toolkit/jsrun.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/ksh
-
-# launcher script for jsdoc
-# Author: Avi Deitcher
-#
-# This program is released under the MIT License as follows:
-
-# Copyright (c) 2008-2009 Atomic Inc <avi@jsorm.com>
-#
-#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.
-#
-
-if [[ -n "$JSDOCDIR" ]]; then
- _DOCDIR="-Djsdoc.dir=$JSDOCDIR"
- _APPDIR="$JSDOCDIR/app"
- _BASEDIR="$JSDOCDIR"
-else
- _DOCDIR=""
- _APPDIR="./app"
- _BASEDIR="."
-fi
-
-if [[ -n "$JSDOCTEMPLATEDIR" ]]; then
- _TDIR="-Djsdoc.template.dir=$JSDOCTEMPLATEDIR"
-else
- _TDIR=""
-fi
-
-CMD="java $_DOCDIR $_TDIR -jar $_BASEDIR/jsrun.jar $_APPDIR/run.js $@"
-echo $CMD
-$CMD
-
diff --git a/tests/lib/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl b/tests/lib/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl
deleted file mode 100644
index 32f43582f8..0000000000
--- a/tests/lib/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl
+++ /dev/null
@@ -1,17 +0,0 @@
-<div align="center">{+new Link().toFile("index.html").withText("Class Index")+}
-| {+new Link().toFile("files.html").withText("File Index")+}</div>
-<hr />
-<h2>Classes</h2>
-<ul class="classList">
- <for each="thisClass" in="data">
- <li>{!
- if (thisClass.alias == "_global_") {
- output += "<i>"+new Link().toClass(thisClass.alias)+"</i>";
- }
- else {
- output += new Link().toClass(thisClass.alias);
- }
- !}</li>
- </for>
-</ul>
-<hr /> \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl b/tests/lib/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl
deleted file mode 100644
index 7f31f55cbe..0000000000
--- a/tests/lib/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
- {! Link.base = ""; /* all generated links will be relative to this */ !}
- <title>JsDoc Reference - File Index</title>
- <meta name="generator" content="JsDoc Toolkit" />
-
- <style type="text/css">
- {+include("static/default.css")+}
- </style>
- </head>
-
- <body>
- {+include("static/header.html")+}
-
- <div id="index">
- {+publish.classesIndex+}
- </div>
-
- <div id="content">
- <h1 class="classTitle">File Index</h1>
-
- <for each="item" in="data">
- <div>
- <h2>{+new Link().toSrc(item.alias).withText(item.name)+}</h2>
- <if test="item.desc">{+resolveLinks(item.desc)+}</if>
- <dl>
- <if test="item.author">
- <dt class="heading">Author:</dt>
- <dd>{+item.author+}</dd>
- </if>
- <if test="item.version">
- <dt class="heading">Version:</dt>
- <dd>{+item.version+}</dd>
- </if>
- {! var locations = item.comment.getTag('location').map(function($){return $.toString().replace(/(^\$ ?| ?\$$)/g, '').replace(/^HeadURL: https:/g, 'http:');}) !}
- <if test="locations.length">
- <dt class="heading">Location:</dt>
- <for each="location" in="locations">
- <dd><a href="{+location+}">{+location+}</a></dd>
- </for>
- </if>
- </dl>
- </div>
- <hr />
- </for>
-
- </div>
- <div class="fineprint" style="clear:both">
- <if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
- </div>
- </body>
-</html> \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/templates/jsdoc/class.tmpl b/tests/lib/jsdoc-toolkit/templates/jsdoc/class.tmpl
deleted file mode 100644
index ed5ffa39df..0000000000
--- a/tests/lib/jsdoc-toolkit/templates/jsdoc/class.tmpl
+++ /dev/null
@@ -1,646 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
- <meta name="generator" content="JsDoc Toolkit" />
- {! Link.base = "../"; /* all generated links will be relative to this */ !}
- <title>JsDoc Reference - {+data.alias+}</title>
-
- <style type="text/css">
- {+include("static/default.css")+}
- </style>
- </head>
-
- <body>
-<!-- ============================== header ================================= -->
- <!-- begin static/header.html -->
- {+include("static/header.html")+}
- <!-- end static/header.html -->
-
-<!-- ============================== classes index ============================ -->
- <div id="index">
- <!-- begin publish.classesIndex -->
- {+publish.classesIndex+}
- <!-- end publish.classesIndex -->
- </div>
-
- <div id="content">
-<!-- ============================== class title ============================ -->
- <h1 class="classTitle">
- {!
- var classType = "";
-
- if (data.isBuiltin()) {
- classType += "Built-In ";
- }
-
- if (data.isNamespace) {
- if (data.is('FUNCTION')) {
- classType += "Function ";
- }
- classType += "Namespace ";
- }
- else {
- classType += "Class ";
- }
- !}
- {+classType+}{+data.alias+}
- </h1>
-
-<!-- ============================== class summary ========================== -->
- <p class="description">
- <if test="data.version"><br />Version
- {+ data.version +}.<br />
- </if>
- <if test="data.augments.length"><br />Extends
- {+
- data.augments
- .sort()
- .map(
- function($) { return new Link().toSymbol($); }
- )
- .join(", ")
- +}.<br />
- </if>
-
- {+resolveLinks(data.classDesc)+}
-
- <if test="!data.isBuiltin()">{# isn't defined in any file #}
- <br /><i>Defined in: </i> {+new Link().toSrc(data.srcFile)+}.
- </if>
- </p>
-
-<!-- ============================== constructor summary ==================== -->
- <if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
- <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class {+data.alias+}.">
- <caption>{+classType+}Summary</caption>
- <thead>
- <tr>
- <th scope="col">Constructor Attributes</th>
- <th scope="col">Constructor Name and Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td class="attributes">{!
- if (data.isPrivate) output += "&lt;private&gt; ";
- if (data.isInner) output += "&lt;inner&gt; ";
- !}&nbsp;</td>
- <td class="nameDescription" {!if (data.comment.getTag("hilited").length){output += 'style="color: red"'}!}>
- <div class="fixedFont">
- <b>{+ new Link().toSymbol(data.alias).inner('constructor')+}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
- </div>
- <div class="description">{+resolveLinks(summarize(data.desc))+}</div>
- </td>
- </tr>
- </tbody>
- </table>
- </if>
-
-<!-- ============================== properties summary ===================== -->
- <if test="data.properties.length">
- {! var ownProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !}
- <if test="ownProperties.length">
- <table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class {+data.alias+}.">
- <caption>Field Summary</caption>
- <thead>
- <tr>
- <th scope="col">Field Attributes</th>
- <th scope="col">Field Name and Description</th>
- </tr>
- </thead>
- <tbody>
- <for each="member" in="ownProperties">
- <tr>
- <td class="attributes">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- if (member.isConstant) output += "&lt;constant&gt; ";
- !}&nbsp;</td>
- <td class="nameDescription">
- <div class="fixedFont">
- <if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>
- </div>
- <div class="description">{+resolveLinks(summarize(member.desc))+}</div>
- </td>
- </tr>
- </for>
- </tbody>
- </table>
- </if>
-
- <if test="data.inheritsFrom.length">
- <dl class="inheritsList">
- {!
- var borrowedMembers = data.properties.filter(function($) {return $.memberOf != data.alias});
-
- var contributers = [];
- borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
- for (var i = 0, l = contributers.length; i < l; i++) {
- output +=
- "<dt>Fields borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
- +
- "<dd>" +
- borrowedMembers
- .filter(
- function($) { return $.memberOf == contributers[i] }
- )
- .sort(makeSortby("name"))
- .map(
- function($) { return new Link().toSymbol($.alias).withText($.name) }
- )
- .join(", ")
- +
- "</dd>";
- }
- !}
- </dl>
- </if>
- </if>
-
-<!-- ============================== methods summary ======================== -->
- <if test="data.methods.length">
- {! var ownMethods = data.methods.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !}
- <if test="ownMethods.length">
- <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class {+data.alias+}.">
- <caption>Method Summary</caption>
- <thead>
- <tr>
- <th scope="col">Method Attributes</th>
- <th scope="col">Method Name and Description</th>
- </tr>
- </thead>
- <tbody>
- <for each="member" in="ownMethods">
- <tr>
- <td class="attributes">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- !}&nbsp;</td>
- <td class="nameDescription">
- <div class="fixedFont"><if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name.replace(/\^\d+$/, ''))+}</b>{+makeSignature(member.params)+}
- </div>
- <div class="description">{+resolveLinks(summarize(member.desc))+}</div>
- </td>
- </tr>
- </for>
- </tbody>
- </table>
- </if>
-
- <if test="data.inheritsFrom.length">
- <dl class="inheritsList">
- {!
- var borrowedMembers = data.methods.filter(function($) {return $.memberOf != data.alias});
- var contributers = [];
- borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
- for (var i = 0, l = contributers.length; i < l; i++) {
- output +=
- "<dt>Methods borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
- +
- "<dd>" +
- borrowedMembers
- .filter(
- function($) { return $.memberOf == contributers[i] }
- )
- .sort(makeSortby("name"))
- .map(
- function($) { return new Link().toSymbol($.alias).withText($.name) }
- )
- .join(", ")
- +
- "</dd>";
- }
-
- !}
- </dl>
- </if>
- </if>
-<!-- ============================== events summary ======================== -->
- <if test="data.events.length">
- {! var ownEvents = data.events.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !}
- <if test="ownEvents.length">
- <table class="summaryTable" cellspacing="0" summary="A summary of the events documented in the class {+data.alias+}.">
- <caption>Event Summary</caption>
- <thead>
- <tr>
- <th scope="col">Event Attributes</th>
- <th scope="col">Event Name and Description</th>
- </tr>
- </thead>
- <tbody>
- <for each="member" in="ownEvents">
- <tr>
- <td class="attributes">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- !}&nbsp;</td>
- <td class="nameDescription">
- <div class="fixedFont"><if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>{+makeSignature(member.params)+}
- </div>
- <div class="description">{+resolveLinks(summarize(member.desc))+}</div>
- </td>
- </tr>
- </for>
- </tbody>
- </table>
- </if>
-
- <if test="data.inheritsFrom.length">
- <dl class="inheritsList">
- {!
- var borrowedMembers = data.events.filter(function($) {return $.memberOf != data.alias});
- var contributers = [];
- borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
- for (var i = 0, l = contributers.length; i < l; i++) {
- output +=
- "<dt>Events borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
- +
- "<dd>" +
- borrowedMembers
- .filter(
- function($) { return $.memberOf == contributers[i] }
- )
- .sort(makeSortby("name"))
- .map(
- function($) { return new Link().toSymbol($.alias).withText($.name) }
- )
- .join(", ")
- +
- "</dd>";
- }
-
- !}
- </dl>
- </if>
- </if>
-
-<!-- ============================== constructor details ==================== -->
- <if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
- <div class="details"><a name="constructor"> </a>
- <div class="sectionTitle">
- {+classType+}Detail
- </div>
-
- <div class="fixedFont">{!
- if (data.isPrivate) output += "&lt;private&gt; ";
- if (data.isInner) output += "&lt;inner&gt; ";
- !}
- <b>{+ data.alias +}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
- </div>
-
- <div class="description">
- {+resolveLinks(data.desc)+}
- <if test="data.author"><br /><i>Author: </i>{+data.author+}.</if>
- </div>
-
- <if test="data.example.length">
- <for each="example" in="data.example">
- <pre class="code">{+example+}</pre>
- </for>
- </if>
-
- <if test="data.params.length">
- <dl class="detailList">
- <dt class="heading">Parameters:</dt>
- <for each="item" in="data.params">
- <dt>
- {+((item.type)?""+("<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type)+"}</span> ")) : "")+} <b>{+item.name+}</b>
- <if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
- </dt>
- <dd>{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="data.deprecated">
- <dl class="detailList">
- <dt class="heading">Deprecated:</dt>
- <dt>
- {+resolveLinks(data.deprecated)+}
- </dt>
- </dl>
- </if>
- <if test="data.since">
- <dl class="detailList">
- <dt class="heading">Since:</dt>
- <dd>{+ data.since +}</dd>
- </dl>
- </if>
- <if test="data.exceptions.length">
- <dl class="detailList">
- <dt class="heading">Throws:</dt>
- <for each="item" in="data.exceptions">
- <dt>
- {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
- </dt>
- <dd>{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="data.returns.length">
- <dl class="detailList">
- <dt class="heading">Returns:</dt>
- <for each="item" in="data.returns">
- <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="data.requires.length">
- <dl class="detailList">
- <dt class="heading">Requires:</dt>
- <for each="item" in="data.requires">
- <dd>{+ new Link().toSymbol(item) +}</dd>
- </for>
- </dl>
- </if>
- <if test="data.see.length">
- <dl class="detailList">
- <dt class="heading">See:</dt>
- <for each="item" in="data.see">
- <dd>{+ new Link().toSymbol(item) +}</dd>
- </for>
- </dl>
- </if>
-
- </div>
- </if>
-
-<!-- ============================== field details ========================== -->
- <if test="defined(ownProperties) && ownProperties.length">
- <div class="sectionTitle">
- Field Detail
- </div>
- <for each="member" in="ownProperties">
- <a name="{+Link.symbolNameToLinkName(member)+}"> </a>
- <div class="fixedFont">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- if (member.isConstant) output += "&lt;constant&gt; ";
- !}
-
- <if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
- <if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>
-
- </div>
- <div class="description">
- {+resolveLinks(member.desc)+}
- <if test="member.srcFile != data.srcFile">
- <br />
- <i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
- </if>
- <if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
- </div>
-
- <if test="member.example.length">
- <for each="example" in="member.example">
- <pre class="code">{+example+}</pre>
- </for>
- </if>
-
- <if test="member.deprecated">
- <dl class="detailList">
- <dt class="heading">Deprecated:</dt>
- <dt>
- {+ resolveLinks(member.deprecated) +}
- </dt>
- </dl>
- </if>
- <if test="member.since">
- <dl class="detailList">
- <dt class="heading">Since:</dt>
- <dd>{+ member.since +}</dd>
- </dl>
- </if>
- <if test="member.see.length">
- <dl class="detailList">
- <dt class="heading">See:</dt>
- <for each="item" in="member.see">
- <dd>{+ new Link().toSymbol(item) +}</dd>
- </for>
- </dl>
- </if>
- <if test="member.defaultValue">
- <dl class="detailList">
- <dt class="heading">Default Value:</dt>
- <dd>
- {+resolveLinks(member.defaultValue)+}
- </dd>
- </dl>
- </if>
-
- <if test="!$member_last"><hr /></if>
- </for>
- </if>
-
-<!-- ============================== method details ========================= -->
- <if test="defined(ownMethods) && ownMethods.length">
- <div class="sectionTitle">
- Method Detail
- </div>
- <for each="member" in="ownMethods">
- <a name="{+Link.symbolNameToLinkName(member)+}"> </a>
- <div class="fixedFont">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- !}
-
- <if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
- <if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name.replace(/\^\d+$/, '')+}</b>{+makeSignature(member.params)+}
-
- </div>
- <div class="description">
- {+resolveLinks(member.desc)+}
- <if test="member.srcFile != data.srcFile">
- <br />
- <i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
- </if>
- <if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
- </div>
-
- <if test="member.example.length">
- <for each="example" in="member.example">
- <pre class="code">{+example+}</pre>
- </for>
- </if>
-
- <if test="member.params.length">
- <dl class="detailList">
- <dt class="heading">Parameters:</dt>
- <for each="item" in="member.params">
- <dt>
- {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}<b>{+item.name+}</b>
- <if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
- </dt>
- <dd>{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="member.deprecated">
- <dl class="detailList">
- <dt class="heading">Deprecated:</dt>
- <dt>
- {+ resolveLinks(member.deprecated) +}
- </dt>
- </dl>
- </if>
- <if test="member.since">
- <dl class="detailList">
- <dt class="heading">Since:</dt>
- <dd>{+ member.since +}</dd>
- </dl>
- </dl>
- </if>
- <if test="member.exceptions.length">
- <dl class="detailList">
- <dt class="heading">Throws:</dt>
- <for each="item" in="member.exceptions">
- <dt>
- {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
- </dt>
- <dd>{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="member.returns.length">
- <dl class="detailList">
- <dt class="heading">Returns:</dt>
- <for each="item" in="member.returns">
- <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="member.requires.length">
- <dl class="detailList">
- <dt class="heading">Requires:</dt>
- <for each="item" in="member.requires">
- <dd>{+ resolveLinks(item) +}</dd>
- </for>
- </dl>
- </if>
- <if test="member.see.length">
- <dl class="detailList">
- <dt class="heading">See:</dt>
- <for each="item" in="member.see">
- <dd>{+ new Link().toSymbol(item) +}</dd>
- </for>
- </dl>
- </if>
-
- <if test="!$member_last"><hr /></if>
- </for>
- </if>
-
-<!-- ============================== event details ========================= -->
- <if test="defined(ownEvents) && ownEvents.length">
- <div class="sectionTitle">
- Event Detail
- </div>
- <for each="member" in="ownEvents">
- <a name="{+Link.symbolNameToLinkName(member)+}"> </a>
- <div class="fixedFont">{!
- if (member.isPrivate) output += "&lt;private&gt; ";
- if (member.isInner) output += "&lt;inner&gt; ";
- if (member.isStatic) output += "&lt;static&gt; ";
- !}
-
- <if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
- <if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>{+makeSignature(member.params)+}
-
- </div>
- <div class="description">
- {+resolveLinks(member.desc)+}
- <if test="member.srcFile != data.srcFile">
- <br />
- <i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
- </if>
- <if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
- </div>
-
- <if test="member.example.length">
- <for each="example" in="member.example">
- <pre class="code">{+example+}</pre>
- </for>
- </if>
-
- <if test="member.params.length">
- <dl class="detailList">
- <dt class="heading">Parameters:</dt>
- <for each="item" in="member.params">
- <dt>
- {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}<b>{+item.name+}</b>
- <if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
- </dt>
- <dd>{+ resolveLinks(item.desc) +}</dd>
- </for>
- </dl>
- </if>
- <if test="member.deprecated">
- <dl class="detailList">
- <dt class="heading">Deprecated:</dt>
- <dt>
- {+ resolveLinks(member.deprecated) +}
- </dt>
- </dl>
- </if>
- <if test="member.since">
- <dl class="detailList">
- <dt class="heading">Since:</dt>
- <dd>{+ member.since +}</dd>
- </dl>
- </dl>
- </if>
- <if test="member.exceptions.length">
- <dl class="detailList">
- <dt class="heading">Throws:</dt>
- <for each="item" in="member.exceptions">
- <dt>
- {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
- </dt>
- <dd>{+ resolveLinks(item.desc) +}</dd>
- </for>
- </dl>
- </if>
- <if test="member.returns.length">
- <dl class="detailList">
- <dt class="heading">Returns:</dt>
- <for each="item" in="member.returns">
- <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
- </for>
- </dl>
- </if>
- <if test="member.requires.length">
- <dl class="detailList">
- <dt class="heading">Requires:</dt>
- <for each="item" in="member.requires">
- <dd>{+ resolveLinks(item) +}</dd>
- </for>
- </dl>
- </if>
- <if test="member.see.length">
- <dl class="detailList">
- <dt class="heading">See:</dt>
- <for each="item" in="member.see">
- <dd>{+ new Link().toSymbol(item) +}</dd>
- </for>
- </dl>
- </if>
-
- <if test="!$member_last"><hr /></if>
- </for>
- </if>
-
- <hr />
- </div>
-
-<!-- ============================== footer ================================= -->
- <div class="fineprint" style="clear:both">
- <if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
- </div>
- </body>
-</html>
diff --git a/tests/lib/jsdoc-toolkit/templates/jsdoc/index.tmpl b/tests/lib/jsdoc-toolkit/templates/jsdoc/index.tmpl
deleted file mode 100644
index 3d4f3e43cc..0000000000
--- a/tests/lib/jsdoc-toolkit/templates/jsdoc/index.tmpl
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
-
- <title>JsDoc Reference - Index</title>
- <meta name="generator" content="JsDoc Toolkit" />
-
- <style type="text/css">
- {+include("static/default.css")+}
- </style>
- </head>
-
- <body>
- {+include("static/header.html")+}
-
- <div id="index">
- {+publish.classesIndex+}
- </div>
-
- <div id="content">
- <h1 class="classTitle">Class Index</h1>
-
- <for each="thisClass" in="data">
- <div>
- <h2>{+(new Link().toSymbol(thisClass.alias))+}</h2>
- {+resolveLinks(summarize(thisClass.classDesc))+}
- </div>
- <hr />
- </for>
-
- </div>
- <div class="fineprint" style="clear:both">
- <if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
- Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blankt">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
- </div>
- </body>
-</html> \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/templates/jsdoc/publish.js b/tests/lib/jsdoc-toolkit/templates/jsdoc/publish.js
deleted file mode 100644
index d873073944..0000000000
--- a/tests/lib/jsdoc-toolkit/templates/jsdoc/publish.js
+++ /dev/null
@@ -1,200 +0,0 @@
-/** Called automatically by JsDoc Toolkit. */
-function publish(symbolSet) {
- publish.conf = { // trailing slash expected for dirs
- ext: ".html",
- outDir: JSDOC.opt.d || SYS.pwd+"../out/jsdoc/",
- templatesDir: JSDOC.opt.t || SYS.pwd+"../templates/jsdoc/",
- symbolsDir: "symbols/",
- srcDir: "symbols/src/"
- };
-
- // is source output is suppressed, just display the links to the source file
- if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) {
- Link.prototype._makeSrcLink = function(srcFilePath) {
- return "&lt;"+srcFilePath+"&gt;";
- }
- }
-
- // create the folders and subfolders to hold the output
- IO.mkPath((publish.conf.outDir+"symbols/src").split("/"));
-
- // used to allow Link to check the details of things being linked to
- Link.symbolSet = symbolSet;
-
- // create the required templates
- try {
- var classTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"class.tmpl");
- var classesTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allclasses.tmpl");
- }
- catch(e) {
- print("Couldn't create the required templates: "+e);
- quit();
- }
-
- // some ustility filters
- function hasNoParent($) {return ($.memberOf == "")}
- function isaFile($) {return ($.is("FILE"))}
- function isaClass($) {return ($.is("CONSTRUCTOR") || $.isNamespace)}
-
- // get an array version of the symbolset, useful for filtering
- var symbols = symbolSet.toArray();
-
- // create the hilited source code files
- var files = JSDOC.opt.srcFiles;
- for (var i = 0, l = files.length; i < l; i++) {
- var file = files[i];
- var srcDir = publish.conf.outDir + "symbols/src/";
- makeSrcFile(file, srcDir);
- }
-
- // get a list of all the classes in the symbolset
- var classes = symbols.filter(isaClass).sort(makeSortby("alias"));
-
- // create a filemap in which outfiles must be to be named uniquely, ignoring case
- if (JSDOC.opt.u) {
- var filemapCounts = {};
- Link.filemap = {};
- for (var i = 0, l = classes.length; i < l; i++) {
- var lcAlias = classes[i].alias.toLowerCase();
-
- if (!filemapCounts[lcAlias]) filemapCounts[lcAlias] = 1;
- else filemapCounts[lcAlias]++;
-
- Link.filemap[classes[i].alias] =
- (filemapCounts[lcAlias] > 1)?
- lcAlias+"_"+filemapCounts[lcAlias] : lcAlias;
- }
- }
-
- // create a class index, displayed in the left-hand column of every class page
- Link.base = "../";
- publish.classesIndex = classesTemplate.process(classes); // kept in memory
-
- // create each of the class pages
- for (var i = 0, l = classes.length; i < l; i++) {
- var symbol = classes[i];
-
- symbol.events = symbol.getEvents(); // 1 order matters
- symbol.methods = symbol.getMethods(); // 2
-
- Link.currentSymbol= symbol;
- var output = "";
- output = classTemplate.process(symbol);
-
- IO.saveFile(publish.conf.outDir+"symbols/", ((JSDOC.opt.u)? Link.filemap[symbol.alias] : symbol.alias) + publish.conf.ext, output);
- }
-
- // regenerate the index with different relative links, used in the index pages
- Link.base = "";
- publish.classesIndex = classesTemplate.process(classes);
-
- // create the class index page
- try {
- var classesindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"index.tmpl");
- }
- catch(e) { print(e.message); quit(); }
-
- var classesIndex = classesindexTemplate.process(classes);
- IO.saveFile(publish.conf.outDir, "index"+publish.conf.ext, classesIndex);
- classesindexTemplate = classesIndex = classes = null;
-
- // create the file index page
- try {
- var fileindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allfiles.tmpl");
- }
- catch(e) { print(e.message); quit(); }
-
- var documentedFiles = symbols.filter(isaFile); // files that have file-level docs
- var allFiles = []; // not all files have file-level docs, but we need to list every one
-
- for (var i = 0; i < files.length; i++) {
- allFiles.push(new JSDOC.Symbol(files[i], [], "FILE", new JSDOC.DocComment("/** */")));
- }
-
- for (var i = 0; i < documentedFiles.length; i++) {
- var offset = files.indexOf(documentedFiles[i].alias);
- allFiles[offset] = documentedFiles[i];
- }
-
- allFiles = allFiles.sort(makeSortby("name"));
-
- // output the file index page
- var filesIndex = fileindexTemplate.process(allFiles);
- IO.saveFile(publish.conf.outDir, "files"+publish.conf.ext, filesIndex);
- fileindexTemplate = filesIndex = files = null;
-}
-
-/** Just the first sentence (up to a full stop). Should not break on dotted variable names. */
-function summarize(desc) {
- if (typeof desc != "undefined")
- return desc.match(/([\w\W]+?\.)[^a-z0-9_$]/i)? RegExp.$1 : desc;
-}
-
-/** Make a symbol sorter by some attribute. */
-function makeSortby(attribute) {
- return function(a, b) {
- if (a[attribute] != undefined && b[attribute] != undefined) {
- a = a[attribute].toLowerCase();
- b = b[attribute].toLowerCase();
- if (a < b) return -1;
- if (a > b) return 1;
- return 0;
- }
- }
-}
-
-/** Pull in the contents of an external file at the given path. */
-function include(path) {
- var path = publish.conf.templatesDir+path;
- return IO.readFile(path);
-}
-
-/** Turn a raw source file into a code-hilited page in the docs. */
-function makeSrcFile(path, srcDir, name) {
- if (JSDOC.opt.s) return;
-
- if (!name) {
- name = path.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_");
- name = name.replace(/\:/g, "_");
- }
-
- var src = {path: path, name:name, charset: IO.encoding, hilited: ""};
-
- if (defined(JSDOC.PluginManager)) {
- JSDOC.PluginManager.run("onPublishSrc", src);
- }
-
- if (src.hilited) {
- IO.saveFile(srcDir, name+publish.conf.ext, src.hilited);
- }
-}
-
-/** Build output for displaying function parameters. */
-function makeSignature(params) {
- if (!params) return "()";
- var signature = "("
- +
- params.filter(
- function($) {
- return $.name.indexOf(".") == -1; // don't show config params in signature
- }
- ).map(
- function($) {
- return $.name;
- }
- ).join(", ")
- +
- ")";
- return signature;
-}
-
-/** Find symbol {@link ...} strings in text and turn into html links */
-function resolveLinks(str, from) {
- str = str.replace(/\{@link ([^} ]+) ?\}/gi,
- function(match, symbolName) {
- return new Link().toSymbol(symbolName);
- }
- );
-
- return str;
-}
diff --git a/tests/lib/jsdoc-toolkit/templates/jsdoc/static/default.css b/tests/lib/jsdoc-toolkit/templates/jsdoc/static/default.css
deleted file mode 100644
index 7e4bfd6a05..0000000000
--- a/tests/lib/jsdoc-toolkit/templates/jsdoc/static/default.css
+++ /dev/null
@@ -1,161 +0,0 @@
-/* default.css */
-body
-{
- font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
- width: 800px;
-}
-
-.header
-{
- clear: both;
- background-color: #ccc;
- padding: 8px;
-}
-
-h1
-{
- font-size: 150%;
- font-weight: bold;
- padding: 0;
- margin: 1em 0 0 .3em;
-}
-
-hr
-{
- border: none 0;
- border-top: 1px solid #7F8FB1;
- height: 1px;
-}
-
-pre.code
-{
- display: block;
- padding: 8px;
- border: 1px dashed #ccc;
-}
-
-#index
-{
- margin-top: 24px;
- float: left;
- width: 160px;
- position: absolute;
- left: 8px;
- background-color: #F3F3F3;
- padding: 8px;
-}
-
-#content
-{
- margin-left: 190px;
- width: 600px;
-}
-
-.classList
-{
- list-style-type: none;
- padding: 0;
- margin: 0 0 0 8px;
- font-family: arial, sans-serif;
- font-size: 1em;
- overflow: auto;
-}
-
-.classList li
-{
- padding: 0;
- margin: 0 0 8px 0;
-}
-
-.summaryTable { width: 100%; }
-
-h1.classTitle
-{
- font-size:170%;
- line-height:130%;
-}
-
-h2 { font-size: 110%; }
-caption, div.sectionTitle
-{
- background-color: #7F8FB1;
- color: #fff;
- font-size:130%;
- text-align: left;
- padding: 2px 6px 2px 6px;
- border: 1px #7F8FB1 solid;
-}
-
-div.sectionTitle { margin-bottom: 8px; }
-.summaryTable thead { display: none; }
-
-.summaryTable td
-{
- vertical-align: top;
- padding: 4px;
- border-bottom: 1px #7F8FB1 solid;
- border-right: 1px #7F8FB1 solid;
-}
-
-/*col#summaryAttributes {}*/
-.summaryTable td.attributes
-{
- border-left: 1px #7F8FB1 solid;
- width: 140px;
- text-align: right;
-}
-
-td.attributes, .fixedFont
-{
- line-height: 15px;
- color: #002EBE;
- font-family: "Courier New",Courier,monospace;
- font-size: 13px;
-}
-
-.summaryTable td.nameDescription
-{
- text-align: left;
- font-size: 13px;
- line-height: 15px;
-}
-
-.summaryTable td.nameDescription, .description
-{
- line-height: 15px;
- padding: 4px;
-}
-
-.summaryTable { margin-bottom: 8px; }
-
-ul.inheritsList
-{
- list-style: square;
- margin-left: 20px;
- padding-left: 0;
-}
-
-.detailList {
- margin-left: 20px;
- line-height: 15px;
-}
-.detailList dt { margin-left: 20px; }
-
-.detailList .heading
-{
- font-weight: bold;
- padding-bottom: 6px;
- margin-left: 0;
-}
-
-.light, td.attributes, .light a:link, .light a:visited
-{
- color: #777;
- font-style: italic;
-}
-
-.fineprint
-{
- text-align: right;
- font-size: 10px;
-} \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/templates/jsdoc/static/header.html b/tests/lib/jsdoc-toolkit/templates/jsdoc/static/header.html
deleted file mode 100644
index 353b735a4c..0000000000
--- a/tests/lib/jsdoc-toolkit/templates/jsdoc/static/header.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<div id="header">
-</div> \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/templates/jsdoc/static/index.html b/tests/lib/jsdoc-toolkit/templates/jsdoc/static/index.html
deleted file mode 100644
index 7632b1d4e2..0000000000
--- a/tests/lib/jsdoc-toolkit/templates/jsdoc/static/index.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8">
- <title>Generated Javascript Documentation</title>
-</head>
-<frameset cols="20%,80%">
- <frame src="allclasses-frame.html" name="packageFrame" />
- <frame src="splash.html" name="classFrame" />
- <noframes>
- <body>
- <p>
- This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
- </p>
- </body>
- </noframes>
-</frameset>
-</html> \ No newline at end of file
diff --git a/tests/lib/jsdoc-toolkit/templates/jsdoc/symbol.tmpl b/tests/lib/jsdoc-toolkit/templates/jsdoc/symbol.tmpl
deleted file mode 100644
index 549ab6e3f3..0000000000
--- a/tests/lib/jsdoc-toolkit/templates/jsdoc/symbol.tmpl
+++ /dev/null
@@ -1,35 +0,0 @@
-<symbol alias="{+data.alias+}">
- <name>{+data.name+}</name>
- <memberOf>{+data.memberOf+}</memberOf>
- <isStatic>{+data.isStatic+}</isStatic>
- <isa>{+data.isa+}</isa>
- <desc>{+data.desc+}</desc>
- <classDesc>{+data.classDesc+}</classDesc>
-
- <methods><for each="method" in="data.methods">
- <method>
- <name>{+method.name+}</name>
- <memberOf>{+method.memberOf+}</memberOf>
- <isStatic>{+method.isStatic+}</isStatic>
- <desc>{+method.desc+}</desc>
- <params><for each="param" in="method.params">
- <param>
- <type>{+param.type+}</type>
- <name>{+param.name+}</name>
- <desc>{+param.desc+}</desc>
- <defaultValue>{+param.defaultValue+}</defaultValue>
- </param></for>
- </params>
- </method></for>
- </methods>
-
- <properties><for each="property" in="data.properties">
- <property>
- <name>{+property.name+}</name>
- <memberOf>{+property.memberOf+}</memberOf>
- <isStatic>{+property.isStatic+}</isStatic>
- <desc>{+property.desc+}</desc>
- <type>{+property.type+}</type>
- </property></for>
- </properties>
-</symbol>
diff --git a/tests/lib/mocha-3.1.2/.editorconfig b/tests/lib/mocha-3.1.2/.editorconfig
deleted file mode 100644
index e3a4859eeb..0000000000
--- a/tests/lib/mocha-3.1.2/.editorconfig
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is for unifying the coding style for different editors and IDEs
-# editorconfig.org
-
-root = true
-
-[*]
-end_of_line = lf
-charset = utf-8
-insert_final_newline = true
-trim_trailing_whitespace = true
-indent_style = space
-indent_size = 2
-
-[Makefile]
-indent_style = tab
-
-[*.md]
-trim_trailing_whitespace = false
diff --git a/tests/lib/mocha-3.1.2/.eslintignore b/tests/lib/mocha-3.1.2/.eslintignore
deleted file mode 100644
index 3e4b026a81..0000000000
--- a/tests/lib/mocha-3.1.2/.eslintignore
+++ /dev/null
@@ -1,2 +0,0 @@
-lib/to-iso-string/**/*.js
-mocha.js
diff --git a/tests/lib/mocha-3.1.2/.eslintrc.yaml b/tests/lib/mocha-3.1.2/.eslintrc.yaml
deleted file mode 100644
index 911f22c681..0000000000
--- a/tests/lib/mocha-3.1.2/.eslintrc.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-env:
- node: true
- browser: true
-parserOptions:
- ecmaVersion: 5
- sourceType: script
-extends: semistandard
-rules:
- strict:
- - error
- - safe
diff --git a/tests/lib/mocha-3.1.2/.gitignore b/tests/lib/mocha-3.1.2/.gitignore
deleted file mode 100644
index fa1c0b0ccf..0000000000
--- a/tests/lib/mocha-3.1.2/.gitignore
+++ /dev/null
@@ -1,17 +0,0 @@
-.DS_Store
-node_modules
-*.sock
-testing
-_mocha.js
-my-reporter.js
-*.sw*
-lib/browser/diff.js
-.idea
-*.iml
-*.patch
-*.diff
-npm-debug.log*
-.envrc
-.karma/
-*.orig
-
diff --git a/tests/lib/mocha-3.1.2/.mailmap b/tests/lib/mocha-3.1.2/.mailmap
deleted file mode 100644
index 528a26775e..0000000000
--- a/tests/lib/mocha-3.1.2/.mailmap
+++ /dev/null
@@ -1,12 +0,0 @@
-TJ Holowaychuk <tj@vision-media.ca>
-Travis Jeffery <tj@travisjeffery.com> <travisjeffery@gmail.com>
-Travis Jeffery <tj@travisjeffery.com> Dr. Travis Jeffery <tj@travisjeffery.com>
-Christopher Hiller <boneskull@boneskull.com> Christopher Hiller <chiller@badwing.com>
-David da Silva Contín <dasilvacontin@gmail.com> David da Silva <daviddasilvacontin@me.com>
-David da Silva Contín <dasilvacontin@gmail.com> David da Silva <dasilvacontin@gmail.com>
-David da Silva Contín <dasilvacontin@gmail.com> <daviddasilvacontin@gmail.com>
-Ariel Mashraki <ariel@mashraki.co.il> Ariel Mashraki <ariel@codeoasis.com>
-Ariel Mashraki <ariel@mashraki.co.il> Ariel Mashraki <ariel.mashraki@ironsrc.com>
-Forbes Lindesay <forbes@lindesay.co.uk> Forbes Lindesay <fpfl2@cam.ac.uk>
-Ben Bradley <ben@bradleyit.com> Ben Bradley <[ben.bradley@cigna.com|mailto:ben.bradley@cigna.com]>
-Glen Mailer <glenjamin@gmail.com> Glen Mailer <glen.mailer@bskyb.com>
diff --git a/tests/lib/mocha-3.1.2/.npmignore b/tests/lib/mocha-3.1.2/.npmignore
deleted file mode 100644
index e3216decb2..0000000000
--- a/tests/lib/mocha-3.1.2/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-assets/
-
diff --git a/tests/lib/mocha-3.1.2/.travis.yml b/tests/lib/mocha-3.1.2/.travis.yml
deleted file mode 100644
index 29b4c419e5..0000000000
--- a/tests/lib/mocha-3.1.2/.travis.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-# in order to use 'trusty' dist, need this.
-# see https://docs.travis-ci.com/user/trusty-ci-environment/
-sudo: required
-
-# trust dist provides a modern build chain (as opposed to 'precise' dist)
-# which absolves us from having to install compilers and stuff
-dist: trusty
-
-language: node_js
-
-env:
- global:
- # phantomjs hosts binaries @ bitbucket, which has fairly restrictive
- # rate-limiting. pull it from this sketchy site in China instead.
- - PHANTOMJS_CDNURL='https://cnpmjs.org/downloads'
- # we're going to use s3 to temporarily store Karma test bundles for debugging
- - AWS_ACCESS_KEY_ID=AKIAJ3QQTLQXWXYJ6PTA
- - secure: k4musDC734E1NFOWaY5qb/l0B9K1cfusFTvMZFayTMs5ubKjeNYCgct2sDSvO5tO7Un935I0sYOOSRPvANPhs8dP1a/8/x0PnwIfnpoCFQCCaI0bWnIQj7nOZ2TaEB/fngZCerCFpNDlzqI6BmaR+XoMvA74v2YD/vVXnzvXNQk=
-
-matrix:
- fast_finish: true
- include:
- - node_js: '6'
- env: TARGET=test-node
- - node_js: '5'
- env: TARGET=test-node
- - node_js: '4'
- env: TARGET=test-node
- - node_js: 'iojs'
- env: TARGET=test-node
- - node_js: '0.12'
- env: TARGET=test-node
- - node_js: '0.11'
- env: TARGET=test-node
- - node_js: '0.10'
- env: TARGET=test-node
- - node_js: '6'
- env: TARGET=lint
- - node_js: '6'
- env: TARGET=test-browser S3=1
-
-before_install: scripts/travis-before-install.sh
-
-before_script: scripts/travis-before-script.sh
-
-script: make $TARGET
-
-after_script: scripts/travis-after-script.sh
-
-notifications:
- urls:
- # for gitter
- - secure: fUrHenYJs+pTuLtgBRoYyrlyfVekxaIGmLWq7bhUUqBj/7p5eCkQFn13LlPht0/4WWZOiPBcdTN7tKnz3Ho7ATUJhAchvOWDUgL5gtTvOzeCHbPuCvHz/VLK6hMoPdbLA45M864NDLotfHvyh62WgQaVw9iPc80eb+umaDPrYiU=
- on_success: change
- on_failure: always
diff --git a/tests/lib/mocha-3.1.2/CHANGELOG.md b/tests/lib/mocha-3.1.2/CHANGELOG.md
deleted file mode 100644
index da0fb42933..0000000000
--- a/tests/lib/mocha-3.1.2/CHANGELOG.md
+++ /dev/null
@@ -1,1445 +0,0 @@
-# 3.1.2 / 2016-10-10
-
-## :bug: Bug Fix
-
-- [#2528]: Recovery gracefully if an `Error`'s `stack` property isn't writable ([@boneskull])
-
-[#2528]: https://github.com/mochajs/mocha/issues/2528
-
-# 3.1.1 / 2016-10-09
-
-## :bug: Bug Fix
-
-- [#1417]: Don't report `done()` was called multiple times when it wasn't ([@frankleonrose])
-
-## :nut_and_bolt: Other
-
-- [#2490]: Lint with [semistandard](https://npmjs.com/package/semistandard) config ([@makepanic])
-- [#2525]: Lint all `.js` files ([@boneskull])
-- [#2524]: Provide workaround for developers unable to run browser tests on macOS Sierra ([@boneskull])
-
-[#1417]: https://github.com/mochajs/mocha/issues/1417
-[#2490]: https://github.com/mochajs/mocha/issues/2490
-[#2525]: https://github.com/mochajs/mocha/issues/2525
-[#2524]: https://github.com/mochajs/mocha/issues/2524
-[@makepanic]: https://github.com/makepanic
-[@frankleonrose]: https://github.com/frankleonrose
-
-# 3.1.0 / 2016-09-27
-
-## :tada: Enhancement
-
-- [#2357]: Support `--inspect` on command-line ([@simov])
-- [#2194]: Human-friendly error if no files are matched on command-line ([@Munter])
-- [#1744]: Human-friendly error if a Suite has no callback (BDD/TDD only) ([@anton])
-
-## :bug: Bug Fix
-
-- [#2488]: Fix case in which *variables beginning with lowercase "D"* may not have been reported properly as global leaks ([@JustATrick]) :laughing:
-- [#2465]: Always halt execution in async function when `this.skip()` is called ([@boneskull])
-- [#2445]: Exits with expected code 130 when `SIGINT` encountered; exit code can no longer rollover at 256 ([@Munter])
-- [#2315]: Fix uncaught TypeError thrown from callback stack ([@1999])
-- Fix broken `only()`/`skip()` in IE7/IE8 ([@boneskull])
-- [#2502]: Fix broken stack trace filter on Node.js under Windows ([@boneskull])
-- [#2496]: Fix diff output for objects instantiated with `String` constructor ([more](https://youtrack.jetbrains.com/issue/WEB-23383)) ([@boneskull])
-
-[#2496]: https://github.com/mochajs/mocha/issues/2496
-[#2502]: https://github.com/mochajs/mocha/issues/2502
-[#2315]: https://github.com/mochajs/mocha/issues/2315
-[#2445]: https://github.com/mochajs/mocha/pull/2445
-[#2465]: https://github.com/mochajs/mocha/issues/2465
-[#2488]: https://github.com/mochajs/mocha/issues/2488
-[#1744]: https://github.com/mochajs/mocha/issues/1744
-[#2194]: https://github.com/mochajs/mocha/issues/2194
-[#2357]: https://github.com/mochajs/mocha/issues/2357
-[@1999]: https://github.com/1999
-[@JustATrick]: https://github.com/JustATrick
-[@anton]: https://github.com/anton
-[@simov]: https://github.com/simov
-
-# 3.0.2 / 2016-08-08
-
-## :bug: Bug Fix
-
-- [#2424]: Fix error loading Mocha via Require.js ([@boneskull])
-- [#2417]: Fix execution of *deeply* nested `describe.only()` suites ([@not-an-aardvark])
-- Remove references to `json-cov` and `html-cov` reporters in CLI ([@boneskull])
-
-[#2417]: https://github.com/mochajs/mocha/issues/2417
-[#2424]: https://github.com/mochajs/mocha/issues/2424
-
-# 3.0.1 / 2016-08-03
-
-## :bug: Bug Fix
-
-- [#2406]: Restore execution of nested `describe.only()` suites ([@not-an-aardvark])
-
-[#2406]: https://github.com/mochajs/mocha/issues/2406
-[@not-an-aardvark]: https://github.com/not-an-aardvark
-
-# 3.0.0 / 2016-07-31
-
-## :boom: Breaking Changes
-
-- :warning: Due to the increasing difficulty of applying security patches made within its dependency tree, as well as looming incompatibilities with Node.js v7.0, **Mocha no longer supports Node.js v0.8**.
-- :warning: **Mocha may no longer be installed by versions of `npm` less than `1.4.0`.** Previously, this requirement only affected Mocha's development dependencies. In short, this allows Mocha to depend on packages which have dependencies fixed to major versions (`^`).
-- `.only()` is no longer "fuzzy", can be used multiple times, and generally just works like you think it should. :joy:
-- To avoid common bugs, when a test injects a callback function (suggesting asynchronous execution), calls it, *and* returns a `Promise`, Mocha will now throw an exception:
-
- ```js
- const assert = require('assert');
-
- it('should complete this test', function (done) {
- return new Promise(function (resolve) {
- assert.ok(true);
- resolve();
- })
- .then(done);
- });
- ```
-
- The above test will fail with `Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.`.
-- When a test timeout value *greater than* `2147483648` is specified in any context (`--timeout`, `mocha.setup()`, per-suite, per-test, etc.), the timeout will be *disabled* and the test(s) will be allowed to run indefinitely. This is equivalent to specifying a timeout value of `0`. See [MDN](https://developer.mozilla.org/docs/Web/API/WindowTimers/setTimeout#Maximum_delay_value) for reasoning.
-- The `dot` reporter now uses more visually distinctive characters when indicating "pending" and "failed" tests.
-- Mocha no longer supports [component](https://www.npmjs.com/package/component).
-- The long-forsaken `HTMLCov` and `JSONCov` reporters--and any relationship to the "node-jscoverage" project--have been removed.
-- `spec` reporter now omits leading carriage returns (`\r`) in non-TTY environment.
-
-## :tada: Enhancements
-
-- [#808]: Allow regular-expression-like strings in `--grep` and browser's `grep` querystring; enables flags such as `i` for case-insensitive matches and `u` for unicode. ([@a8m])
-- [#2000]: Use distinctive characters in `dot` reporter; `,` will denote a "pending" test and `!` will denote a "failing" test. ([@elliottcable])
-- [#1632]: Throw a useful exception when a suite or test lacks a title. ([@a8m])
-- [#1481]: Better `.only()` behavior. ([@a8m])
-- [#2334]: Allow `this.skip()` in async tests and hooks. ([@boneskull])
-- [#1320]: Throw a useful exception when test resolution method is overspecified. ([@jugglinmike])
-- [#2364]: Support `--preserve-symlinks`. ([@rosswarren])
-
-## :bug: Bug Fixes
-
-- [#2259]: Restore ES3 compatibility. Specifically, support an environment lacking `Date.prototype.toISOString()`, `JSON`, or has a non-standard implementation of `JSON`. ([@ndhoule], [@boneskull])
-- [#2286]: Fix `after()` failing to execute if test skipped using `this.skip()` in `beforeEach()`; no longer marks the entire suite as "pending". ([@dasilvacontin], [@boneskull])
-- [#2208]: Fix function name display in `markdown` and `html` (browser) reporters. ([@ScottFreeCode])
-- [#2299]: Fix progress bar in `html` (browser) reporter. ([@AviVahl])
-- [#2307]: Fix `doc` reporter crashing when test fails. ([@jleyba])
-- [#2323]: Ensure browser entry point (`browser-entry.js`) is published to npm (for use with bundlers). ([@boneskull])
-- [#2310]: Ensure custom reporter with an absolute path works in Windows. ([@silentcloud])
-- [#2311]: Fix problem wherein calling `this.slow()` without a value would blast any previously set value. ([@boneskull])
-- [#1813]: Ensure Mocha's own test suite will run in Windows. ([@tswaters], [@TimothyGu], [@boneskull])
-- [#2317]: Ensure all interfaces are displayed in `--help` on CLI. ([@ScottFreeCode])
-- [#1644]: Don't exhibit undefined behavior when calling `this.timeout()` with very large values ([@callumacrae], [@boneskull])
-- [#2361]: Don't truncate name of thrown anonymous exception. ([@boneskull])
-- [#2367]: Fix invalid CSS. ([@bensontrent])
-- [#2401]: Remove carriage return before each test line in spec reporter. ([@Munter])
-
-## :nut_and_bolt: Other
-
-- Upgrade production dependencies to address security advisories (and because now we can): `glob`, `commander`, `escape-string-regexp`,
-and `supports-color`. ([@boneskull], [@RobLoach])
-- Add Windows to CI. ([@boneskull], [@TimothyGu])
-- Ensure appropriate `engines` field in `package.json`. ([@shinnn], [@boneskull])
-- [#2348]: Upgrade ESLint to v2 ([@anthony-redfox])
-
-We :heart: our [backers and sponsors](https://opencollective.com/mochajs)!
-
-:shipit:
-
-[#2401]: https://github.com/mochajs/mocha/pull/2401
-[#2348]: https://github.com/mochajs/mocha/issues/2348
-[#808]: https://github.com/mochajs/mocha/issues/808
-[#2361]: https://github.com/mochajs/mocha/pull/2361
-[#2367]: https://github.com/mochajs/mocha/pull/2367
-[#2364]: https://github.com/mochajs/mocha/pull/2364
-[#1320]: https://github.com/mochajs/mocha/pull/1320
-[#2307]: https://github.com/mochajs/mocha/pull/2307
-[#2259]: https://github.com/mochajs/mocha/pull/2259
-[#2208]: https://github.com/mochajs/mocha/pull/2208
-[#2299]: https://github.com/mochajs/mocha/pull/2299
-[#2286]: https://github.com/mochajs/mocha/issues/2286
-[#1644]: https://github.com/mochajs/mocha/issues/1644
-[#2310]: https://github.com/mochajs/mocha/issues/2310
-[#2311]: https://github.com/mochajs/mocha/issues/2311
-[#2323]: https://github.com/mochajs/mocha/issues/2323
-[#2000]: https://github.com/mochajs/mocha/pull/2000
-[#1632]: https://github.com/mochajs/mocha/issues/1632
-[#1813]: https://github.com/mochajs/mocha/issues/1813
-[#2334]: https://github.com/mochajs/mocha/issues/2334
-[#2317]: https://github.com/mochajs/mocha/issues/2317
-[#1481]: https://github.com/mochajs/mocha/issues/1481
-[@elliottcable]: https://github.com/elliottcable
-[@RobLoach]: https://github.com/robloach
-[@AviVahl]: https://github.com/avivahl
-[@silentcloud]: https://github.com/silentcloud
-[@tswaters]: https://github.com/tswaters
-[@jleyba]: https://github.com/jleyba
-[@TimothyGu]: https://github.com/timothygu
-[@callumacrae]: https://github.com/callumacrae
-[@shinnn]: https://github.com/shinnn
-[@bensontrent]: https://github.com/bensontrent
-[@jugglinmike]: https://github.com/jugglinmike
-[@rosswarren]: https://github.com/rosswarren
-[@anthony-redfox]: https://github.com/anthony-redfox
-[@Munter]: https://github.com/munter
-
-# 2.5.3 / 2016-05-25
-
-- [#2112] - Fix HTML reporter regression causing duplicate error output ([@danielstjules] via 6d24063)
-- [#2119] - Make HTML reporter failure/passed links preventDefault to avoid SPA's hash navigation ([@jimenglish81] via 9e93efc)
-
-[@danielstjules]: https://github.com/danielstjules
-[@jimenglish81]: https://github.com/jimenglish81
-[#2112]: https://github.com/mochajs/mocha/pull/2112
-[#2119]: https://github.com/mochajs/mocha/pull/2119
-
-# 2.5.2 / 2016-05-24
-
-- [#2178] - Avoid double and triple xUnit XML escaping ([@graingert] via 49b5ff1)
-
-[@graingert]: https://github.com/graingert
-[#2178]: https://github.com/mochajs/mocha/pull/2178
-
-# 2.5.1 / 2016-05-23
-
-- Fix [to-iso-string](https://npmjs.com/package/to-iso-string) dependency ([@boneskull] via bd9450b)
-
-Thanks @entertainyou, @SimenB, @just-paja for the heads-up.
-
-# 2.5.0 / 2016-05-23
-
-> This has been awhile coming! We needed to feel confident that the next release wouldn't break browser compatibility (e.g. the last few patch releases).
->
-> ### Browser Tests in CI
->
-> We now run unit tests against PhantomJS v1.x and an assortment of browsers on [SauceLabs](https://saucelabs.com), including:
-> - Internet Explorer v8.0
-> - Chrome (latest)
-> - Firefox (latest)
-> - Safari (latest)
-> - Microsoft Edge (latest)
->
-> To accomplish this, we now run Mocha's unit tests (and a handful of integration tests) via [Karma](https://npmjs.com/package/karma) and a modified [karma-mocha](https://npmjs.com/package/karma-mocha). Along the way, we had to solve issue [#880] (apologies to @mderijcke and @sukima who had PRs addressing this), as well as replace most usages of [should](https://npmjs.com/package/should) with [expect.js](https://npmjs.com/package/expect.js) for IE8.
->
-> Going forward, when sending PRs, your code will *only* run against PhantomJS v1.x (and not hit SauceLabs) [because security](https://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests).
->
-> ### Node.js 6.x
-> Node.js 6.x "just worked" before, but now it's in the CI matrix, so it's "officially" supported. Mocha *still retains support* for Node.js 0.8.x.
->
-> ### "Minor" Release
-> You'll see mostly bug fixes below, but also a couple features--as such, it's a "minor" release.
->
-> ### TYVM
->
-> Thanks to everyone who contributed, and our fabulous [sponsors and backers](https://opencollective.com/mochajs)!
-
-- [#2079] - Add browser checks to CI; update [browserify](https://npmjs.com/package/browserify) to v13.0.0 ([@dasilvacontin], [@ScottFreeCode], [@boneskull] via c04c1d7, 0b1e9b3, 0dde0fa, f8a3d86, 9e8cbaa)
-- [#880] - Make Mocha browserifyable ([@boneskull] via 524862b)
-- [#2121] - Update [glob](https://npmjs.com/package/glob) to v3.2.11 ([@astorije] via 7920fc4)
-- [#2126] - Fix dupe error messages in stack trace filter ([@Turbo87] via 4301caa)
-- [#2109] - Fix certain diffs when objects cannot be coerced into primitives ([@joshlory] via 61fbb7f)
-- [#1827] - Fix TWBS/`mocha.css` collisions ([@irnc] via 0543798)
-- [#1760], [#1936] - Fix `this.skip()` in HTML reporter ([@mislav] via cb4248b)
-- [#2115] - Fix exceptions thrown from hooks in HTML reporter ([@danielstjules] via e290bc0)
-- [#2089] - Handle Symbol values in `util.stringify()` ([@ryym] via ea61d05)
-- [#2097] - Fix diff for objects overriding `Object.prototype.hasOwnProperty` ([@mantoni] via b20fdfe)
-- [#2101] - Properly handle non-string "messages" thrown from assertion libraries ([@jkimbo] via 9c41051)
-- [#2124] - Update [growl](https://npmjs.com/package/growl) ([@benjamine] via 9ae6a85)
-- [#2162], [#2205] - JSDoc fixes ([@OlegTsyba] via 8031f20, [@ScottFreeCode] via f83b1d9)
-- [#2132] - Remove Growl-related cruft ([@julienw] via 00d6469)
-- [#2172] - Add [OpenCollective](https://opencollective.com) badge, sponsors & backers ([@xdamman], [@boneskull] via caee94f)
-- [#1841] - Add new logo, banner assets ([@dasilvacontin] via 00fd0e1)
-- [#2214] - Update `README.md` header ([@dasilvacontin] via c0f9be2)
-- [#2236] - Better checks for Node.js v0.8 compatibility in CI ([@dasilvacontin] via ba5637d)
-- [#2239] - Add Node.js v6.x to CI matrix ([@boneskull] via 3904da4)
-
-[#880]: https://github.com/mochajs/mocha/issues/880
-[#1841]: https://github.com/mochajs/mocha/pull/1841
-[#2239]: https://github.com/mochajs/mocha/issues/2239
-[#2153]: https://github.com/mochajs/mocha/pull/2153
-[#2214]: https://github.com/mochajs/mocha/pull/2214
-[#2236]: https://github.com/mochajs/mocha/pull/2236
-[#2079]: https://github.com/mochajs/mocha/issues/2079
-[#2231]: https://github.com/mochajs/mocha/pull/2231
-[#2089]: https://github.com/mochajs/mocha/issues/2089
-[#2097]: https://github.com/mochajs/mocha/pull/2097
-[#1760]: https://github.com/mochajs/mocha/issues/1760
-[#1936]: https://github.com/mochajs/mocha/issues/1936
-[#2115]: https://github.com/mochajs/mocha/pull/2115
-[#1827]: https://github.com/mochajs/mocha/pull/1827
-[#2101]: https://github.com/mochajs/mocha/pull/2101
-[#2124]: https://github.com/mochajs/mocha/pull/2124
-[#2109]: https://github.com/mochajs/mocha/issues/2109
-[#2162]: https://github.com/mochajs/mocha/pull/2162
-[#2132]: https://github.com/mochajs/mocha/issues/2132
-[#2126]: https://github.com/mochajs/mocha/issues/2126
-[#2121]: https://github.com/mochajs/mocha/issues/2121
-[#2205]: https://github.com/mochajs/mocha/pull/2205
-[#2172]: https://github.com/mochajs/mocha/pull/2172
-[@xdamman]: https://github.com/xdamman
-[@Turbo87]: https://github.com/Turbo87
-[@OlegTsyba]: https://github.com/OlegTsyba
-[@ryym]: https://github.com/ryym
-[@mantoni]: https://github.com/mantoni
-[@mislav]: https://github.com/mislav
-[@irnc]: https://github.com/irnc
-[@jkimbo]: https://github.com/jkimbo
-[@benjamine]: https://github.com/benjamine
-[@joshlory]: https://github.com/joshlory
-[@julienw]: https://github.com/julienw
-[@ScottFreeCode]: https://github.com/ScottFreeCode
-[@astorije]: https://github.com/astorije
-[@dasilvacontin]: https://github.com/dasilvacontin
-
-2.4.5 / 2016-01-28
-==================
-
-* [#2080], [#2078], [#2072], [#2073], [#1200] - Revert changes to console colors in changeset [1192914](https://github.com/mochajs/mocha/commit/119291449cd03a11cdeda9e37cf718a69a012896) and subsequent related changes thereafter. Restores compatibility with IE8 & PhantomJS. See also [mantoni/mochify.js#129](https://github.com/mantoni/mochify.js/issues/129) and [openlayers/ol3#4746](https://github.com/openlayers/ol3/pull/4746) ([@boneskull])
-* [#2082] - Fix several test assertions ([@mislav])
-
-[#1200]: https://github.com/mochajs/mocha/issues/1200
-[#2082]: https://github.com/mochajs/mocha/pull/2082
-
-2.4.4 / 2016-01-27
-==================
-
-* [#2080] - Fix broken RequireJS compatibility ([@boneskull])
-
-[#2080]: https://github.com/mochajs/mocha/issues/2080
-
-2.4.3 / 2016-01-27
-==================
-
-* [#2078] - Fix broken IE8 ([@boneskull])
-
-[#2078]: https://github.com/mochajs/mocha/issues/2078
-
-2.4.2 / 2016-01-26
-==================
-
-* [#2053] - Fix web worker compatibility ([@mislav])
-* [#2072] - Fix Windows color output ([@thedark1337])
-* [#2073] - Fix colors in `progress` and `landing` reporters ([@gyandeeps])
-
-[#2053]: https://github.com/mochajs/mocha/pull/2053
-[#2072]: https://github.com/mochajs/mocha/pull/2072
-[#2073]: https://github.com/mochajs/mocha/pull/2073
-[@gyandeeps]: https://github.com/gyandeeps
-[@thedark1337]: https://github.com/thedark1337
-
-2.4.1 / 2016-01-26
-==================
-
-* [#2067] - Fix HTML/doc reporter regressions ([@danielstjules])
-
-[#2067]: https://github.com/mochajs/mocha/pull/2067
-
-2.4.0 / 2016-01-25
-==================
-
-* [#1945] - Correctly skip tests when skipping in suite's before() ([@ryanshawty])
-* [#2056] - chore(license): update license year to 2016 ([@pra85])
-* [#2048] - Fix `this.skip` from spec with HTML reporter ([@mislav])
-* [#2033] - Update tests for newer versions of should.js ([@tomhughes])
-* [#2037] - Fix for memory leak caused by referenced to deferred test ([@bd82])
-* [#2038] - Also run Travis-CI on node.js 4 & 5 ([@bd82])
-* [#2028] - Remove reference to test before afterAll hook runs ([@stonelgh])
-* Bump mkdirp to 0.5.1 to support strict mode ([@danielstjules])
-* [#1977] - safely stringify PhantomJS undefined value ([@ahamid])
-* Add the ability to retry tests ([@@longlho])
-* [#1982] - Enable --log-timer-events option [@Alaneor]
-* Fix #1980: Load mocha.opts from bin/mocha and bin/_mocha ([@danielstjules])
-* [#1976] - Simplify function call ([@iclanzan])
-* [#1963] - Add support --perf-basic-prof ([@robraux])
-* [#1981] - Fix HTML reporter handling of done and exceptions ([@Standard8])
-* [#1993] - propagate "file" property for "exports" interface ([@segrey])
-* [#1999] - Add support for strict mode ([@tmont])
-* [#2005] - XUnit Reporter Writes to stdout, falls back to console.log ([@jonnyreeves])
-* [#2021] - Fix non ES5 compliant regexp ([@zetaben])
-* [#1965] - Don't double install BDD UI ([@cowboyd])
-* [#1995] - Make sure the xunit output dir exists before writing to it ([@ianwremmel])
-* Use chalk for the base reporter colors; closes #1200 ([@boneskull])
-* Fix requiring custom interfaces ([@jgkim])
-* [#1967] Silence Bluebird js warnings ([@krisr])
-
-[#1945]: https://github.com/mochajs/mocha/pull/1945
-[#2056]: https://github.com/mochajs/mocha/pull/2056
-[#2048]: https://github.com/mochajs/mocha/pull/2048
-[#2033]: https://github.com/mochajs/mocha/pull/2033
-[#2037]: https://github.com/mochajs/mocha/pull/2037
-[#2038]: https://github.com/mochajs/mocha/pull/2038
-[#2028]: https://github.com/mochajs/mocha/pull/2028
-[#1977]: https://github.com/mochajs/mocha/pull/1977
-[#1982]: https://github.com/mochajs/mocha/pull/1982
-[#1976]: https://github.com/mochajs/mocha/pull/1976
-[#1963]: https://github.com/mochajs/mocha/pull/1963
-[#1981]: https://github.com/mochajs/mocha/pull/1981
-[#1993]: https://github.com/mochajs/mocha/pull/1993
-[#1999]: https://github.com/mochajs/mocha/pull/1999
-[#2005]: https://github.com/mochajs/mocha/pull/2005
-[#2021]: https://github.com/mochajs/mocha/pull/2021
-[1965#]: https://github.com/mochajs/mocha/pull/1965
-[#1995]: https://github.com/mochajs/mocha/pull/1995
-[#1967]: https://github.com/mochajs/mocha/pull/1967
-[@ryanshawty]: https://github.com/ryanshawty
-[@pra85]: https://github.com/pra85
-[@mislav]: https://github.com/mislav
-[@tomhughes]: https://github.com/tomhughes
-[@bd82]: https://github.com/bd82
-[@stonelgh]: https://github.com/stonelgh
-[@danielstjules]: https://github.com/danielstjules
-[@ahamid]: https://github.com/ahamid
-[@longlho]: https://github.com/longlho
-[@Alaneor]: https://github.com/Alaneor
-[@iclanzan]: https://github.com/iclanzan
-[@robraux]: https://github.com/robraux
-[@Standard8]: https://github.com/Standard8
-[@segrey]: https://github.com/segrey
-[@tmont]: https://github.com/tmont
-[@jonnyreeves]: https://github.com/jonnyreeves
-[@zetaben]: https://github.com/zetaben
-[@cowboyd]: https://github.com/cowboyd
-[@ianwremmel]: https://github.com/ianwremmel
-[@boneskull]: https://github.com/boneskull
-[@jgkim]: https://github.com/jgkim
-[@krisr]: https://github.com/krisr
-
-2.3.4 / 2015-11-15
-==================
-
- * Update debug dependency to 2.2.0
- * remove duplication of mocha.opts on process.argv
- * Fix typo in test/reporters/nyan.js
-
-2.3.3 / 2015-09-19
-==================
-
- * [#1875] - Fix Markdown reporter exceeds maximum call stack size ([@danielstjules])
- * [#1864] - Fix xunit missing output with --reporter-options output ([@danielstjules])
- * [#1846] - Support all harmony flags ([@danielstjules])
- * Fix fragile xunit reporter spec ([@danielstjules])
- * [#1669] - Fix catch uncaught errors outside test suite execution ([@danielstjules])
- * [#1868] - Revert jade to support npm < v1.3.7 ([@danielstjules])
- * [#1766] - Don't remove modules/components from stack trace in the browser ([@danielstjules])
- * [#1798] - Fix correctly attribute mutiple done err with hooks ([@danielstjules])
- * Fix use utils.reduce for IE8 compatibility ([@wsw0108])
- * Some linting errors fixed by [@danielstjules]
- * Call the inspect() function if message is not set ([@kevinburke])
-
-[#1875]: https://github.com/mochajs/mocha/issues/1875
-[#1864]: https://github.com/mochajs/mocha/issues/1864
-[#1846]: https://github.com/mochajs/mocha/issues/1846
-[#1669]: https://github.com/mochajs/mocha/issues/1669
-[#1868]: https://github.com/mochajs/mocha/issues/1868
-[#1766]: https://github.com/mochajs/mocha/issues/1766
-[#1798]: https://github.com/mochajs/mocha/issues/1798
-[@danielstjules]: https://github.com/danielstjules
-[@wsw0108]: https://github.com/wsw0108
-[@kevinburke]: https://github.com/kevinburke
-
-2.3.2 / 2015-09-07
-==================
- * [#1868] - Fix compatibility with older versions of NPM ([@boneskull])
-
- [#1868]: https://github.com/mochajs/mocha/issues/1868
-
-2.3.1 / 2015-09-06
-==================
-
- * [#1812] - Fix: Bail flag causes before() hooks to be run even after a failure ([@aaroncrows])
-
- [#1812]: https://github.com/mochajs/mocha/issues/1812
- [aaroncrows]: https://github.com/aaroncrows
-
-2.3.0 / 2015-08-30
-==================
-
- * [#553] - added --allowUncaught option ([@amsul])
- * [#1490] - Allow --async-only to be satisfied by returning a promise ([@jlai])
- * [#1829] - support --max-old-space-size ([@gigadude])
- * [#1811] - upgrade Jade dependency ([@outsideris])
- * [#1769] - Fix async hook error handling ([@ajaykodali])
- * [#1230] - More descriptive beforeEach/afterEach messages ([@duncanbeevers])
- * [#1787] - Scope loading behaviour instead of using early return ([@aryeguy])
- * [#1789] - Fix: html-runner crashing ([@sunesimonsen])
- * [#1749] - Fix maximum call stack error on large amount of tests ([@tinganho])
- * [#1230] - Decorate failed hook titles with test title ([@duncanbeevers])
- * [#1260] - Build using Browserify ([@ndhoule])
- * [#1728] - Don't use `__proto__` ([@ndhoule])
- * [#1781] - Fix hook error tests ([@glenjamin])
- * [#1754] - Allow boolean --reporter-options ([@papandreou])
- * [#1766] - Fix overly aggressive stack suppression ([@moll])
- * [#1752] - Avoid potential infinite loop ([@gsilk])
- * [#1761] - Fix problems running under PhantomJS ([@chromakode])
- * [#1700] - Fix more problems running under PhantomJS ([@jbnicolai])
- * [#1774] - Support escaped spaces in CLI options ([@adamgruber])
- * [#1687] - Fix HTML reporter links with special chars ([@benvinegar])
- * [#1359] - Adopt code style and enforce it using ESLint ([@ndhoule] w/ assist from [@jbnicolai] & [@boneskull])
- * various refactors ([@jbnicolai])
- * [#1758] - Add cross-frame compatible Error checking ([@outdooricon])
- * [#1741] - Remove moot `version` property from bower.json ([@kkirsche])
- * [#1739] - Improve `HISTORY.md` ([@rstacruz])
- * [#1730] - Support more io.js flags ([@ryedog])
- * [#1349] - Allow HTML in HTML reporter errors ([@papandreou] / [@sunesimonsen])
- * [#1572] - Prevent default browser behavior for failure/pass links ([@jschilli])
- * [#1630] - Support underscored harmony flags ([@dominicbarnes])
- * [#1718] - Support more harmony flags ([@slyg])
- * [#1689] - Add stack to JSON-stream reporter ([@jonathandelgado])
- * [#1654] - Fix `ReferenceError` "location is not defined" ([@jakemmarsh])
-
- [#553]: https://github.com/mochajs/mocha/issues/553
- [#1490]: https://github.com/mochajs/mocha/issues/1490
- [#1829]: https://github.com/mochajs/mocha/issues/1829
- [#1811]: https://github.com/mochajs/mocha/issues/1811
- [#1769]: https://github.com/mochajs/mocha/issues/1769
- [#1230]: https://github.com/mochajs/mocha/issues/1230
- [#1787]: https://github.com/mochajs/mocha/issues/1787
- [#1789]: https://github.com/mochajs/mocha/issues/1789
- [#1749]: https://github.com/mochajs/mocha/issues/1749
- [#1230]: https://github.com/mochajs/mocha/issues/1230
- [#1260]: https://github.com/mochajs/mocha/issues/1260
- [#1728]: https://github.com/mochajs/mocha/issues/1728
- [#1781]: https://github.com/mochajs/mocha/issues/1781
- [#1754]: https://github.com/mochajs/mocha/issues/1754
- [#1766]: https://github.com/mochajs/mocha/issues/1766
- [#1752]: https://github.com/mochajs/mocha/issues/1752
- [#1761]: https://github.com/mochajs/mocha/issues/1761
- [#1700]: https://github.com/mochajs/mocha/issues/1700
- [#1774]: https://github.com/mochajs/mocha/issues/1774
- [#1687]: https://github.com/mochajs/mocha/issues/1687
- [#1359]: https://github.com/mochajs/mocha/issues/1359
- [#1758]: https://github.com/mochajs/mocha/issues/1758
- [#1741]: https://github.com/mochajs/mocha/issues/1741
- [#1739]: https://github.com/mochajs/mocha/issues/1739
- [#1730]: https://github.com/mochajs/mocha/issues/1730
- [#1349]: https://github.com/mochajs/mocha/issues/1349
- [#1572]: https://github.com/mochajs/mocha/issues/1572
- [#1630]: https://github.com/mochajs/mocha/issues/1630
- [#1718]: https://github.com/mochajs/mocha/issues/1718
- [#1689]: https://github.com/mochajs/mocha/issues/1689
- [#1654]: https://github.com/mochajs/mocha/issues/1654
- [@adamgruber]: https://github.com/adamgruber
- [@ajaykodali]: https://github.com/ajaykodali
- [@amsul]: https://github.com/amsul
- [@aryeguy]: https://github.com/aryeguy
- [@benvinegar]: https://github.com/benvinegar
- [@boneskull]: https://github.com/boneskull
- [@chromakode]: https://github.com/chromakode
- [@dominicbarnes]: https://github.com/dominicbarnes
- [@duncanbeevers]: https://github.com/duncanbeevers
- [@gigadude]: https://github.com/gigadude
- [@glenjamin]: https://github.com/glenjamin
- [@gsilk]: https://github.com/gsilk
- [@jakemmarsh]: https://github.com/jakemmarsh
- [@jbnicolai]: https://github.com/jbnicolai
- [@jlai]: https://github.com/jlai
- [@jonathandelgado]: https://github.com/jonathandelgado
- [@jschilli]: https://github.com/jschilli
- [@kkirsche]: https://github.com/kkirsche
- [@moll]: https://github.com/moll
- [@ndhoule]: https://github.com/ndhoule
- [@outdooricon]: https://github.com/outdooricon
- [@outsideris]: https://github.com/outsideris
- [@papandreou]: https://github.com/papandreou
- [@rstacruz]: https://github.com/rstacruz
- [@ryedog]: https://github.com/ryedog
- [@slyg]: https://github.com/slyg
- [@sunesimonsen]: https://github.com/sunesimonsen
- [@tinganho]: https://github.com/tinganho
-
-2.2.5 / 2015-05-14
-==================
-
- * [#1699] - Upgrade jsdiff to v1.4.0 ([@nylen])
- * [#1648] - fix diff background colors in the console ([@nylen])
- * [#1327] - fix tests running twice, a regression issue. ([#1686], [@danielstjules])
- * [#1675] - add integration tests ([@danielstjules])
- * [#1682] - use a valid SPDX license identifier in package.json ([@kemitchell])
- * [#1660] - fix assertion of invalid dates ([#1661], [@a8m])
- * [#1241] - fix issue with multiline diffs appearing as single line ([#1655], [@a8m])
-
-[#1699]: https://github.com/mochajs/mocha/issues/1699
-[#1648]: https://github.com/mochajs/mocha/issues/1648
-[#1327]: https://github.com/mochajs/mocha/issues/1327
-[#1686]: https://github.com/mochajs/mocha/issues/1686
-[#1675]: https://github.com/mochajs/mocha/issues/1675
-[#1682]: https://github.com/mochajs/mocha/issues/1682
-[#1660]: https://github.com/mochajs/mocha/issues/1660
-[#1661]: https://github.com/mochajs/mocha/issues/1661
-[#1241]: https://github.com/mochajs/mocha/issues/1241
-[#1655]: https://github.com/mochajs/mocha/issues/1655
-[@nylen]: https://github.com/nylen
-[@danielstjules]: https://github.com/danielstjules
-[@kemitchell]: https://github.com/kemitchell
-[@a8m]: https://github.com/a8m
-
-2.2.4 / 2015-04-08
-==================
-
- * Load mocha.opts in _mocha for now (close #1645)
-
-2.2.3 / 2015-04-07
-==================
-
- * fix(reporter/base): string diff - issue #1241
- * fix(reporter/base): string diff - issue #1241
- * fix(reporter/base): don't show diffs for errors without expectation
- * fix(reporter/base): don't assume error message is first line of stack
- * improve: dry up reporter/base test
- * fix(reporter/base): explicitly ignore showDiff #1614
- * Add iojs to travis build
- * Pass `--allow-natives-syntax` flag to node.
- * Support --harmony_classes flag for io.js
- * Fix 1556: Update utils.clean to handle newlines in func declarations
- * Fix 1606: fix err handling in IE <= 8 and non-ES5 browsers
- * Fix 1585: make _mocha executable again
- * chore(package.json): add a8m as a contributor
- * Fixed broken link on html-cov reporter
- * support --es_staging flag
- * fix issue where menu overlaps content.
- * update contributors in package.json
- * Remove trailing whitespace from reporter output
- * Remove contributors list from readme
- * log third-party reporter errors
- * [Fix] Exclude not own properties when looping on options
- * fix: support node args in mocha.opts (close #1573)
- * fix(reporter/base): string diff - issue #1241
-
-2.2.1 / 2015-03-09
-==================
-
- * Fix passing of args intended for node/iojs.
-
-2.2.0 / 2015-03-06
-==================
-
- * Update mocha.js
- * Add --fgrep. Use grep for RegExp, fgrep for str
- * Ignore async global errors after spec resolution
- * Fixing errors that prevent mocha.js from loading in the browser - fixes #1558
- * fix(utils): issue #1558 + make
- * add ability to delay root suite; closes #362, closes #1124
- * fix insanity in http tests
- * update travis: add node 0.12, add gitter, remove slack
- * building
- * resolve #1548: ensure the environment's "node" executable is used
- * reporters/base: use supports-color to detect colorable term
- * travis: use docker containers
- * small fix: commander option for --expose-gc
- * Ignore asynchronous errors after global failure
- * Improve error output when a test fails with a non-error
- * updated travis badge, uses svg instead of img
- * Allow skip from test context for #332
- * [JSHINT] Unnecessary semicolon fixed in bin/_mocha
- * Added a reminder about the done() callback to test timeout error messages
- * fixes #1496, in Mocha.run(fn), check if fn exists before executing it, added tests too
- * Add Harmony Proxy flag for iojs
- * test(utils|ms|*): test existing units
- * add support for some iojs flags
- * fix(utils.stringify): issue #1229, diff viewer
- * Remove slack link
- * Prevent multiple 'grep=' querystring params in html reporter
- * Use grep as regexp (close #1381)
- * utils.stringify should handle objects without an Object prototype
- * in runnable test, comparing to undefined error's message rather than a literal
- * Fix test running output truncation on async STDIO
- * ammended for deprecated customFds option in child_process
-
-2.1.0 / 2014-12-23
-==================
-
- * showDiff: don’t stringify strings
- * Clean up unused module dependencies.
- * Filter zero-length strings from mocha.opts
- * only write to stdout in reporters
- * Revert "only write to stdout in reporters"
- * Print colored output only to a tty
- * update summary in README.md
- * rename Readme.md/History.md to README.md/HISTORY.md because neurotic
- * add .mailmap to fix "git shortlog" or "git summary" output
- * fixes #1461: nyan-reporter now respects Base.useColors, fixed bug where Base.color would not return a string when str wasn't a string.
- * Use existing test URL builder in failed replay links
- * modify .travis.yml: use travis_retry; closes #1449
- * fix -t 0 behavior; closes #1446
- * fix tests (whoops)
- * improve diff behavior
- * Preserve pathname when linking to individual tests
- * Fix test
- * Tiny typo in comments fixed
- * after hooks now being called on failed tests when using bail, fixes #1093
- * fix throwing undefined/null now makes tests fail, fixes #1395
- * compiler extensions are added as watched extensions, removed non-standard extensions from watch regex, resolves #1221
- * prefix/namespace for suite titles in markdown reporter, fixes #554
- * fix more bad markdown in CONTRIBUTING.md
- * fix bad markdown in CONTRIBUTING.md
- * add setImmediate/clearImmediate to globals; closes #1435
- * Fix buffer diffs (closes #1132, closes #1433)
- * add a CONTRIBUTING.md. closes #882
- * fix intermittent build failures (maybe). closes #1407
- * add Slack notification to .travis.yml
- * Fix slack link
- * Add slack room to readme
- * Update maintainers
- * update maintainers and contributors
- * resolves #1393: kill children with more effort on SIGINT
- * xunit reporter support for optionally writing to a file
- * if a reporter has a .done method, call it before exiting
- * add support for reporter options
- * only write to stdout in reporters
-
-2.0.0 / 2014-10-21
-==================
-
- * remove: support for node 0.6.x, 0.4.x
- * fix: landing reporter with non ansi characters (#211)
- * fix: html reporter - preserve query params when navigating to suites/tests (#1358)
- * fix: json stream reporter add error message to failed test
- * fix: fixes for visionmedia -> mochajs
- * fix: use stdio, fixes node deprecation warnings (#1391)
-
-1.21.5 / 2014-10-11
-==================
-
- * fix: build for NodeJS v0.6.x
- * fix: do not attempt to highlight syntax when non-HTML reporter is used
- * update: escape-string-regexp to 1.0.2.
- * fix: botched indentation in canonicalize()
- * fix: .gitignore: ignore .patch and .diff files
- * fix: changed 'Catched' to 'Caught' in uncaught exception error handler messages
- * add: `pending` field for json reporter
- * fix: Runner.prototype.uncaught: don't double-end runnables that already have a state.
- * fix: --recursive, broken by f0facd2e
- * update: replaces escapeRegexp with the escape-string-regexp package.
- * update: commander to 2.3.0.
- * update: diff to 1.0.8.
- * fix: ability to disable syntax highlighting (#1329)
- * fix: added empty object to errorJSON() call to catch when no error is present
- * fix: never time out after calling enableTimeouts(false)
- * fix: timeout(0) will work at suite level (#1300)
- * Fix for --watch+only() issue (#888 )
- * fix: respect err.showDiff, add Base reporter test (#810)
-
-1.22.1-3 / 2014-07-27
-==================
-
- * fix: disabling timeouts with this.timeout(0) (#1301)
-
-1.22.1-3 / 2014-07-27
-==================
-
- * fix: local uis and reporters (#1288)
- * fix: building 1.21.0's changes in the browser (#1284)
-
-1.21.0 / 2014-07-23
-==================
-
- * add: --no-timeouts option (#1262, #1268)
- * add: --*- deprecation node flags (#1217)
- * add: --watch-extensions argument (#1247)
- * change: spec reporter is default (#1228)
- * fix: diff output showing incorrect +/- (#1182)
- * fix: diffs of circular structures (#1179)
- * fix: re-render the progress bar when progress has changed only (#1151)
- * fix support for environments with global and window (#1159)
- * fix: reverting to previously defined onerror handler (#1178)
- * fix: stringify non error objects passed to done() (#1270)
- * fix: using local ui, reporters (#1267)
- * fix: cleaning es6 arrows (#1176)
- * fix: don't include attrs in failure tag for xunit (#1244)
- * fix: fail tests that return a promise if promise is rejected w/o a reason (#1224)
- * fix: showing failed tests in doc reporter (#1117)
- * fix: dot reporter dots being off (#1204)
- * fix: catch empty throws (#1219)
- * fix: honoring timeout for sync operations (#1242)
- * update: growl to 1.8.0
-
-1.20.1 / 2014-06-03
-==================
-
- * update: should dev dependency to ~4.0.0 (#1231)
-
-1.20.0 / 2014-05-28
-==================
-
- * add: filenames to suite objects (#1222)
-
-1.19.0 / 2014-05-17
-==================
-
- * add: browser script option to package.json
- * add: export file in Mocha.Test objects (#1174)
- * add: add docs for wrapped node flags
- * fix: mocha.run() to return error status in browser (#1216)
- * fix: clean() to show failure details (#1205)
- * fix: regex that generates html for new keyword (#1201)
- * fix: sibling suites have inherited but separate contexts (#1164)
-
-
-1.18.2 / 2014-03-18
-==================
-
- * fix: html runner was prevented from using #mocha as the default root el (#1162)
-
-1.18.1 / 2014-03-18
-==================
-
- * fix: named before/after hooks in bdd, tdd, qunit interfaces (#1161)
-
-1.18.0 / 2014-03-13
-==================
-
- * add: promise support (#329)
- * add: named before/after hooks (#966)
-
-1.17.1 / 2014-01-22
-==================
-
- * fix: expected messages in should.js (should.js#168)
- * fix: expect errno global in node versions < v0.9.11 (#1111)
- * fix: unreliable checkGlobals optimization (#1110)
-
-1.17.0 / 2014-01-09
-==================
-
- * add: able to require globals (describe, it, etc.) through mocha (#1077)
- * fix: abort previous run on --watch change (#1100)
- * fix: reset context for each --watch triggered run (#1099)
- * fix: error when cli can't resolve path or pattern (#799)
- * fix: canonicalize objects before stringifying and diffing them (#1079)
- * fix: make CR call behave like carriage return for non tty (#1087)
-
-
-1.16.2 / 2013-12-23
-==================
-
- * fix: couple issues with ie 8 (#1082, #1081)
- * fix: issue running the xunit reporter in browsers (#1068)
- * fix: issue with firefox < 3.5 (#725)
-
-
-1.16.1 / 2013-12-19
-==================
-
- * fix: recompiled for missed changes from the last release
-
-
-1.16.0 / 2013-12-19
-==================
-
- * add: Runnable.globals(arr) for per test global whitelist (#1046)
- * add: mocha.throwError(err) for assertion libs to call (#985)
- * remove: --watch's spinner (#806)
- * fix: duplicate test output for multi-line specs in spec reporter (#1006)
- * fix: gracefully exit on SIGINT (#1063)
- * fix expose the specified ui only in the browser (#984)
- * fix: ensure process exit code is preserved when using --no-exit (#1059)
- * fix: return true from window.onerror handler (#868)
- * fix: xunit reporter to use process.stdout.write (#1068)
- * fix: utils.clean(str) indentation (#761)
- * fix: xunit reporter returning test duration a NaN (#1039)
-
-1.15.1 / 2013-12-03
-==================
-
- * fix: recompiled for missed changes from the last release
-
-1.15.0 / 2013-12-02
-==================
-
- * add: `--no-exit` to prevent `process.exit()` (#1018)
- * fix: using inline diffs (#1044)
- * fix: show pending test details in xunit reporter (#1051)
- * fix: faster global leak detection (#1024)
- * fix: yui compression (#1035)
- * fix: wrapping long lines in test results (#1030, #1031)
- * fix: handle errors in hooks (#1043)
-
-1.14.0 / 2013-11-02
-==================
-
- * add: unified diff (#862)
- * add: set MOCHA_COLORS env var to use colors (#965)
- * add: able to override tests links in html reporters (#776)
- * remove: teamcity reporter (#954)
- * update: commander dependency to 2.0.0 (#1010)
- * fix: mocha --ui will try to require the ui if not built in, as --reporter does (#1022)
- * fix: send cursor commands only if isatty (#184, #1003)
- * fix: include assertion message in base reporter (#993, #991)
- * fix: consistent return of it, it.only, and describe, describe.only (#840)
-
-1.13.0 / 2013-09-15
-==================
-
- * add: sort test files with --sort (#813)
- * update: diff depedency to 1.0.7
- * update: glob dependency to 3.2.3 (#927)
- * fix: diffs show whitespace differences (#976)
- * fix: improve global leaks (#783)
- * fix: firefox window.getInterface leak
- * fix: accessing iframe via window[iframeIndex] leak
- * fix: faster global leak checking
- * fix: reporter pending css selector (#970)
-
-1.12.1 / 2013-08-29
-==================
-
- * remove test.js from .gitignore
- * update included version of ms.js
-
-1.12.0 / 2013-07-01
-==================
-
- * add: prevent diffs for differing types. Closes #900
- * add `Mocha.process` hack for phantomjs
- * fix: use compilers with requires
- * fix regexps in diffs. Closes #890
- * fix xunit NaN on failure. Closes #894
- * fix: strip tab indentation in `clean` utility method
- * fix: textmate bundle installation
-
-1.11.0 / 2013-06-12
-==================
-
- * add --prof support
- * add --harmony support
- * add --harmony-generators support
- * add "Uncaught " prefix to uncaught exceptions
- * add web workers support
- * add `suite.skip()`
- * change to output # of pending / passing even on failures. Closes #872
- * fix: prevent hooks from being called if we are bailing
- * fix `this.timeout(0)`
-
-1.10.0 / 2013-05-21
-==================
-
- * add add better globbing support for windows via `glob` module
- * add support to pass through flags such as --debug-brk=1234. Closes #852
- * add test.only, test.skip to qunit interface
- * change to always use word-based diffs for now. Closes #733
- * change `mocha init` tests.html to index.html
- * fix `process` global leak in the browser
- * fix: use resolve() instead of join() for --require
- * fix: filterLeaks() condition to not consider indices in global object as leaks
- * fix: restrict mocha.css styling to #mocha id
- * fix: save timer references to avoid Sinon interfering in the browser build.
-
-1.9.0 / 2013-04-03
-==================
-
- * add improved setImmediate implementation
- * replace --ignore-leaks with --check-leaks
- * change default of ignoreLeaks to true. Closes #791
- * remove scrolling for HTML reporter
- * fix retina support
- * fix tmbundle, restrict to js scope
-
-1.8.2 / 2013-03-11
-==================
-
- * add `setImmediate` support for 0.10.x
- * fix mocha -w spinner on windows
-
-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
diff --git a/tests/lib/mocha-3.1.2/CONTRIBUTING.md b/tests/lib/mocha-3.1.2/CONTRIBUTING.md
deleted file mode 100644
index 6d172f0800..0000000000
--- a/tests/lib/mocha-3.1.2/CONTRIBUTING.md
+++ /dev/null
@@ -1,49 +0,0 @@
-# Contributing to Mocha
-
-Hi! We could use your help. Let us help you help us. Or something.
-
-## General
-
-1. If you are looking for a place to begin, **please send PRs for bugfixes instead of new features**, and/or **look for issues labeled `PR PLEASE`.**
-
-2. **Help with documentation and the wiki is always appreciated**.
-
-3. Please **be courteous and constructive** when commenting on issues, commits, and pull requests.
-
-## Bug Reports & Issues
-
-1. When reporting a bug, please **provide steps to reproduce**. If possible, show code.
-
-2. Please **show all code in JavaScript**. We don't all read `<insert-language-that-compiles-to-JavaScript-here>`. If you do not, you will be asked to.
-
-3. Because Mocha works with many third-party libraries and tools, **ensure the bug you are reporting is actually within Mocha**.
-
-4. If you report a bug, and it is inactive for a significant amount of time, it may be closed. **Please respond promptly to requests for more information**.
-
-## Pull Requests
-
-1. Before sending a large PR, it's recommended to **create an issue to propose the change**. Nobody wants to write a book of code and throw it away.
-
-2. Because Mocha should be kept as maintainable as possible, its codebase must be kept slim. Historically, *most PRs for new features are not merged*. New features inevitably increase the size of the codebase, and thus reduce maintainability. Only features *deemed essential* are likely to be merged--this is at the discretion of the maintainer(s). If your PR for a feature is not merged, this doesn't necessarily mean your PR was a bad idea, wouldn't be used, or otherwise sucks. It just means **only essential PRs for new features are likely to be merged**.
-
-3. Due to the above, before creating a PR for a new feature, **create an issue to propose the feature.**
-
-4. Please **respect existing coding conventions**, whatever those may be.
-
-5. If your PR has been waiting in limbo for some time, it's very helpful to **rebase against master**, which will make it easier to merge.
-
-6. Please **add tests for new code**.
-
-7. **Always run `npm test` before sending a PR.** If you break the tests, your PR will not be accepted until they are fixed.
-
-## Source Control
-
-1. Please **squash your commits** when sending a pull request. If you are unfamiliar with this process, see [this guide](https://help.github.com/articles/about-git-rebase/). If you have already pushed your changesets and are squashing thereafter, this may necessitate the use of a "force push". Please [read the docs](http://git-scm.com/docs/git-push) before you attempt this.
-
-2. Please **follow the commit message conventions [outlined here](https://medium.com/code-adventures/git-conventions-a940ee20862d).**
-
-## TL;DR
-
-**Be kind, be diligent, look before you leap into a PR, and follow common community conventions**.
-
-*- The Mocha Team*
diff --git a/tests/lib/mocha-3.1.2/LICENSE b/tests/lib/mocha-3.1.2/LICENSE
deleted file mode 100644
index 9919641276..0000000000
--- a/tests/lib/mocha-3.1.2/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-(The MIT License)
-
-Copyright (c) 2011-2016 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.
diff --git a/tests/lib/mocha-3.1.2/Makefile b/tests/lib/mocha-3.1.2/Makefile
deleted file mode 100644
index 611211abde..0000000000
--- a/tests/lib/mocha-3.1.2/Makefile
+++ /dev/null
@@ -1,176 +0,0 @@
-BROWSERIFY := "node_modules/.bin/browserify"
-ESLINT := "node_modules/.bin/eslint"
-KARMA := "node_modules/.bin/karma"
-MOCHA := "bin/mocha"
-
-REPORTER ?= spec
-TM_BUNDLE = JavaScript\ mocha.tmbundle
-SRC = $(shell find lib -name "*.js" -type f | sort)
-TESTS = $(shell find test -name "*.js" -type f | sort)
-
-all: mocha.js
-
-mocha.js: $(SRC) browser-entry.js
- @printf "==> [Browser :: build]\n"
- $(BROWSERIFY) ./browser-entry \
- --plugin ./scripts/dedefine \
- --ignore 'fs' \
- --ignore 'glob' \
- --ignore 'path' \
- --ignore 'supports-color' > $@
-
-clean:
- @printf "==> [Clean]\n"
- rm -f mocha.js
-
-lint:
- @printf "==> [Test :: Lint]\n"
- $(ESLINT) .
-
-test-node: test-bdd test-tdd test-qunit test-exports test-unit test-integration test-jsapi test-compilers test-glob test-requires test-reporters test-only test-global-only
-
-test-browser: clean mocha.js test-browser-unit test-browser-bdd test-browser-qunit test-browser-tdd test-browser-exports
-
-test: lint test-node test-browser
-
-test-browser-unit:
- @printf "==> [Test :: Browser]\n"
- NODE_PATH=. $(KARMA) start --single-run
-
-test-browser-bdd:
- @printf "==> [Test :: Browser :: BDD]\n"
- MOCHA_UI=bdd $(MAKE) test-browser-unit
-
-test-browser-qunit:
- @printf "==> [Test :: Browser :: QUnit]\n"
- MOCHA_UI=qunit $(MAKE) test-browser-unit
-
-test-browser-tdd:
- @printf "==> [Test :: Browser :: TDD]\n"
- MOCHA_UI=tdd $(MAKE) test-browser-unit
-
-test-jsapi:
- @printf "==> [Test :: JS API]\n"
- node test/jsapi
-
-test-unit:
- @printf "==> [Test :: Unit]\n"
- $(MOCHA) --reporter $(REPORTER) \
- test/acceptance/*.js \
- --growl \
- test/*.js
-
-test-integration:
- @printf "==> [Test :: Integrations]\n"
- $(MOCHA) --timeout 5000 \
- --reporter $(REPORTER) \
- test/integration/*.js
-
-test-compilers:
- @printf "==> [Test :: Compilers]\n"
- $(MOCHA) --reporter $(REPORTER) \
- --compilers coffee:coffee-script/register,foo:./test/compiler/foo \
- test/acceptance/test.coffee \
- test/acceptance/test.foo
-
-test-requires:
- @printf "==> [Test :: Requires]\n"
- $(MOCHA) --reporter $(REPORTER) \
- --compilers coffee:coffee-script/register \
- --require test/acceptance/require/a.js \
- --require test/acceptance/require/b.coffee \
- --require test/acceptance/require/c.js \
- --require test/acceptance/require/d.coffee \
- test/acceptance/require/require.spec.js
-
-test-bdd:
- @printf "==> [Test :: BDD]\n"
- $(MOCHA) --reporter $(REPORTER) \
- --ui bdd \
- test/acceptance/interfaces/bdd.spec
-
-test-tdd:
- @printf "==> [Test :: TDD]\n"
- $(MOCHA) --reporter $(REPORTER) \
- --ui tdd \
- test/acceptance/interfaces/tdd.spec
-
-test-qunit:
- @printf "==> [Test :: QUnit]\n"
- $(MOCHA) --reporter $(REPORTER) \
- --ui qunit \
- test/acceptance/interfaces/qunit.spec
-
-test-exports:
- @printf "==> [Test :: Exports]\n"
- $(MOCHA) --reporter $(REPORTER) \
- --ui exports \
- test/acceptance/interfaces/exports.spec
-
-test-glob:
- @printf "==> [Test :: Glob]\n"
- bash ./test/acceptance/glob/glob.sh
-
-test-reporters:
- @printf "==> [Test :: Reporters]\n"
- $(MOCHA) --reporter $(REPORTER) \
- test/reporters/*.js
-
-test-only:
- @printf "==> [Test :: Only]\n"
- $(MOCHA) --reporter $(REPORTER) \
- --ui tdd \
- test/acceptance/misc/only/tdd.spec
-
- $(MOCHA) --reporter $(REPORTER) \
- --ui bdd \
- test/acceptance/misc/only/bdd.spec
-
- $(MOCHA) --reporter $(REPORTER) \
- --ui qunit \
- test/acceptance/misc/only/bdd-require.spec
-
-test-global-only:
- @printf "==> [Test :: Global Only]\n"
- $(MOCHA) --reporter $(REPORTER) \
- --ui tdd \
- test/acceptance/misc/only/global/tdd.spec
-
- $(MOCHA) --reporter $(REPORTER) \
- --ui bdd \
- test/acceptance/misc/only/global/bdd.spec
-
- $(MOCHA) --reporter $(REPORTER) \
- --ui qunit \
- test/acceptance/misc/only/global/qunit.spec
-
-test-mocha:
- @printf "==> [Test :: Mocha]\n"
- $(MOCHA) --reporter $(REPORTER) \
- test/mocha
-
-non-tty:
- @printf "==> [Test :: Non-TTY]\n"
- $(MOCHA) --reporter dot \
- test/acceptance/interfaces/bdd.spec 2>&1 > /tmp/dot.out
-
- @echo dot:
- @cat /tmp/dot.out
-
- $(MOCHA) --reporter list \
- test/acceptance/interfaces/bdd.spec 2>&1 > /tmp/list.out
-
- @echo list:
- @cat /tmp/list.out
-
- $(MOCHA) --reporter spec \
- test/acceptance/interfaces/bdd.spec 2>&1 > /tmp/spec.out
-
- @echo spec:
- @cat /tmp/spec.out
-
-tm:
- @printf "==> [TM]\n"
- open editors/$(TM_BUNDLE)
-
-.PHONY: test-jsapi test-compilers watch test test-node test-bdd test-tdd test-qunit test-exports test-unit test-integration non-tty tm clean test-browser test-browser-unit test-browser-bdd test-browser-qunit test-browser-tdd test-browser-exports lint test-only test-global-only
diff --git a/tests/lib/mocha-3.1.2/README.md b/tests/lib/mocha-3.1.2/README.md
deleted file mode 100644
index e2d0bb998a..0000000000
--- a/tests/lib/mocha-3.1.2/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-<br><br>
-<p align="center">
- <img src="https://cldup.com/xFVFxOioAU.svg" alt="Mocha test framework"/>
-</p>
-<br><br>
-
-[![Build Status](https://api.travis-ci.org/mochajs/mocha.svg?branch=master)](http://travis-ci.org/mochajs/mocha) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mochajs/mocha?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
-[![OpenCollective](https://opencollective.com/mochajs/backers/badge.svg)](#backers)
-[![OpenCollective](https://opencollective.com/mochajs/sponsors/badge.svg)](#sponsors)
-
- Mocha is a simple, flexible, fun JavaScript test framework for node.js and the browser. For more information view the [documentation](http://mochajs.org).
-
-## Links
-
- - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- - [Google Group](http://groups.google.com/group/mochajs)
- - [Wiki](https://github.com/mochajs/mocha/wiki)
- - Mocha [Extensions and reporters](https://github.com/mochajs/mocha/wiki)
-
-
-## Backers
-
-[Become a backer]((https://opencollective.com/mochajs#backer)) and show your support to our open source project.
-
-<a href="https://opencollective.com/mochajs/backer/0/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/0/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/1/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/1/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/2/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/2/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/3/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/3/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/4/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/4/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/5/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/5/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/6/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/6/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/7/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/7/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/8/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/8/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/9/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/9/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/10/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/10/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/11/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/11/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/12/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/12/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/13/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/13/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/14/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/14/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/15/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/15/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/16/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/16/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/17/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/17/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/18/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/18/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/19/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/19/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/20/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/20/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/21/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/21/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/22/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/22/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/23/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/23/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/24/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/24/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/25/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/25/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/26/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/26/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/27/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/27/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/28/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/28/avatar"></a>
-<a href="https://opencollective.com/mochajs/backer/29/website" target="_blank"><img src="https://opencollective.com/mochajs/backer/29/avatar"></a>
-
-
-## Sponsors
-
-Does your company use Mocha? Ask your manager or marketing team if your company would be interested in supporting our project. Support will allow the maintainers to dedicate more time for maintenance and new features for everyone. Also, your company's logo will show [on GitHub](https://github.com/mochajs/mocha#readme) and on [our site](https://mochajs.org)--who doesn't want a little extra exposure? [Here's the info](https://opencollective.com/mochajs#sponsor).
-
-<a href="https://opencollective.com/mochajs/sponsor/0/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/0/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/1/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/1/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/2/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/2/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/3/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/3/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/4/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/4/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/5/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/5/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/6/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/6/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/7/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/7/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/8/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/8/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/9/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/9/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/10/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/10/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/11/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/11/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/12/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/12/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/13/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/13/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/14/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/14/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/15/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/15/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/16/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/16/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/17/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/17/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/18/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/18/avatar"></a>
-<a href="https://opencollective.com/mochajs/sponsor/19/website" target="_blank"><img src="https://opencollective.com/mochajs/sponsor/19/avatar"></a>
-
-## License
-
-MIT
diff --git a/tests/lib/mocha-3.1.2/appveyor.yml b/tests/lib/mocha-3.1.2/appveyor.yml
deleted file mode 100644
index 539b8b073d..0000000000
--- a/tests/lib/mocha-3.1.2/appveyor.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-environment:
- matrix:
- - nodejs_version: '6'
- - nodejs_version: '4'
- - nodejs_version: '0.12'
- - nodejs_version: '0.10'
-install:
- - ps: Install-Product node $env:nodejs_version
- - set CI=true
- - set PATH=%APPDATA%\npm;c:\MinGW\bin;%PATH%
- - set PHANTOMJS_CDNURL=https://cnpmjs.org/downloads
- - npm install
- - copy c:\MinGW\bin\mingw32-make.exe c:\MinGW\bin\make.exe
-matrix:
- fast_finish: true
-build: off
-version: '{build}'
-shallow_clone: true
-clone_depth: 1
-test_script:
- - node --version
- - npm --version
- - npm test
-skip_commits:
- message: /\[ci\s+skip\]/
-
diff --git a/tests/lib/mocha-3.1.2/assets/mocha-banner-192.png b/tests/lib/mocha-3.1.2/assets/mocha-banner-192.png
deleted file mode 100644
index 15e076e119..0000000000
--- a/tests/lib/mocha-3.1.2/assets/mocha-banner-192.png
+++ /dev/null
Binary files differ
diff --git a/tests/lib/mocha-3.1.2/assets/mocha-banner.svg b/tests/lib/mocha-3.1.2/assets/mocha-banner.svg
deleted file mode 100644
index 9f54009600..0000000000
--- a/tests/lib/mocha-3.1.2/assets/mocha-banner.svg
+++ /dev/null
@@ -1,160 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- id="Layer_1"
- x="0px"
- y="0px"
- viewBox="0 0 384.90259 191.99999"
- enable-background="new 0 0 193 208"
- xml:space="preserve"
- inkscape:version="0.91 r13725"
- sodipodi:docname="mocha-banner.svg"
- width="384.90259"
- height="192"
- inkscape:export-filename="/Users/boneskull/Downloads/mocha-banner-192.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90"><title
- id="title4160">Mocha Logo</title><metadata
- id="metadata32"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>Mocha Logo</dc:title><dc:date>08-21-2015</dc:date><dc:creator><cc:Agent><dc:title>Dick DeLeon &lt;ddeleon@decipherinc.com&gt;</dc:title></cc:Agent></dc:creator><dc:rights><cc:Agent><dc:title>CC BY-SA 4.0</dc:title></cc:Agent></dc:rights><dc:subject><rdf:Bag><rdf:li>mocha</rdf:li><rdf:li>mochajs</rdf:li></rdf:Bag></dc:subject><dc:contributor><cc:Agent><dc:title>Christopher Hiller &lt;boneskull@boneskull.com&gt;</dc:title></cc:Agent></dc:contributor><cc:license
- rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" /></cc:Work><cc:License
- rdf:about="http://creativecommons.org/licenses/by-sa/3.0/"><cc:permits
- rdf:resource="http://creativecommons.org/ns#Reproduction" /><cc:permits
- rdf:resource="http://creativecommons.org/ns#Distribution" /><cc:requires
- rdf:resource="http://creativecommons.org/ns#Notice" /><cc:requires
- rdf:resource="http://creativecommons.org/ns#Attribution" /><cc:permits
- rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><cc:requires
- rdf:resource="http://creativecommons.org/ns#ShareAlike" /></cc:License></rdf:RDF></metadata><defs
- id="defs30" /><sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10000"
- gridtolerance="10000"
- guidetolerance="10000"
- inkscape:pageopacity="1"
- inkscape:pageshadow="2"
- inkscape:window-width="1920"
- inkscape:window-height="1031"
- id="namedview28"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-right="5"
- fit-margin-bottom="5"
- inkscape:zoom="1"
- inkscape:cx="-211.59419"
- inkscape:cy="96.021558"
- inkscape:window-x="1360"
- inkscape:window-y="23"
- inkscape:window-maximized="0"
- inkscape:current-layer="g13-0"
- showguides="true"
- inkscape:guide-bbox="true"
- inkscape:snap-path-clip="true"
- inkscape:snap-path-mask="true"
- inkscape:snap-text-baseline="false"><sodipodi:guide
- position="178.24489,-94.11572"
- orientation="1,0"
- id="guide4358" /></sodipodi:namedview><path
- id="XMLID_229_"
- d="m 156.71875,146.01685 -68.70282,39.69498 c -2.958045,1.71756 -6.584028,1.71756 -9.542066,0 L 9.77103,146.01685 C 6.812992,144.29928 5,141.1504 5,137.81068 L 5,58.420744 C 5,54.985602 6.812992,51.932143 9.77103,50.214572 L 78.473864,10.5196 c 2.958038,-1.7175702 6.584021,-1.7175702 9.542056,0 l 68.70282,39.694972 c 2.95804,1.717571 4.77104,4.866451 4.77104,8.206172 l 0,79.389936 c -0.0954,3.33972 -1.90842,6.4886 -4.77104,8.20617 z"
- inkscape:connector-curvature="0"
- style="clip-rule:evenodd;fill:#8d6748;fill-rule:evenodd" /><path
- id="XMLID_262_"
- d="m 83.149473,24.164747 0,0 c 0.954207,0 1.812992,0.286262 2.671781,0.763365 l 59.351606,34.255996 c 1.62216,0.954206 2.67177,2.767198 2.67177,4.67561 l 0,68.511982 c 0,1.90842 -1.04962,3.72141 -2.67177,4.67562 l -59.351606,34.25599 c -0.858789,0.47711 -1.717574,0.76336 -2.671781,0.76336 -0.954206,0 -1.908412,-0.28625 -2.671777,-0.76336 L 21.126082,137.04732 c -1.62215,-0.95421 -2.671778,-2.7672 -2.671778,-4.67562 l 0,-68.511982 c 0,-1.908412 1.049628,-3.721404 2.671778,-4.67561 L 80.477696,24.928112 c 0.858785,-0.477103 1.812992,-0.763365 2.671777,-0.763365 m 0,-2.862618 c -1.431309,0 -2.862618,0.381683 -4.103085,1.145048 L 19.694773,56.703173 c -2.576357,1.431309 -4.103086,4.198506 -4.103086,7.061124 l 0,68.511993 c 0,2.95803 1.526729,5.62981 4.103086,7.06112 l 59.351615,34.25599 c 1.240467,0.76337 2.671776,1.14506 4.103085,1.14506 1.431309,0 2.862617,-0.38169 4.103097,-1.14506 l 59.35159,-34.25599 c 2.57636,-1.43131 4.10309,-4.1985 4.10309,-7.06112 l 0,-68.511993 c 0,-2.958038 -1.52673,-5.629815 -4.10309,-7.061124 L 87.25257,22.447177 c -1.24048,-0.763365 -2.671788,-1.145048 -4.103097,-1.145048 l 0,0 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><g
- id="XMLID_228_"
- transform="matrix(0.95420602,0,0,0.95420602,-7.2615534,-2.6484425)"><g
- id="XMLID_223_"><g
- id="XMLID_295_"><path
- d="m 103.6,69.6 c 0,-0.5 -0.4,-1 -1,-1 l -9.4,0 -9.4,0 c -0.5,0 -1,0.4 -1,1 0,3.4 0.5,15.1 5.5,20.8 0.2,0.2 0.4,0.3 0.7,0.3 l 8.4,0 c 0.3,0 0.5,-0.1 0.7,-0.3 5,-5.6 5.5,-17.3 5.5,-20.8 z m -7.4,18.2 -5.9,0 c -0.3,0 -0.5,-0.1 -0.7,-0.3 -3.4,-4 -3.8,-12 -3.9,-14.8 0,-0.5 0.4,-1 1,-1 l 6.6,0 6.6,0 c 0.5,0 1,0.4 1,1 0,2.8 -0.5,10.7 -3.9,14.8 -0.3,0.2 -0.5,0.3 -0.8,0.3 z"
- id="path8"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /></g></g><path
- id="XMLID_225_"
- d="m 95.1,66.6 c 0,0 3.6,-2.1 1.4,-5.9 -1.3,-2 -1.9,-3.7 -1.4,-4.4 -1.3,1.6 -3.5,3.3 -1.1,6.9 0.8,0.9 1.2,2.8 1.1,3.4 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- id="XMLID_224_"
- d="m 91.1,66.9 c 0,0 2.4,-1.4 0.9,-4 -0.9,-1.3 -1.3,-2.5 -0.9,-2.9 -0.9,1.1 -2.3,2.2 -0.7,4.7 0.5,0.5 0.7,1.8 0.7,2.2 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- id="XMLID_227_"
- d="m 99.3,78.5 c -0.4,2.7 -1.2,5.8 -2.9,7.8 -0.2,0.2 -0.4,0.3 -0.6,0.3 l -5,0 c -0.2,0 -0.5,-0.1 -0.6,-0.3 -1.2,-1.5 -2,-3.5 -2.5,-5.6 0,0 5.8,0.8 9.1,-0.4 2.4,-0.9 2.5,-1.8 2.5,-1.8 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /></g><g
- id="g13"
- transform="matrix(0.95420602,0,0,0.95420602,-7.2615534,-2.6484425)"><path
- d="m 33.6,94.7 3.7,0 6.1,9.4 6.1,-9.4 3.7,0 0,20 -3.5,0 0,-14.3 -6.3,9.4 -0.1,0 -6.2,-9.3 0,14.3 -3.5,0 0,-20.1 z"
- id="path15"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- d="m 71.3,115 c -1.5,0 -2.9,-0.3 -4.2,-0.8 -1.3,-0.5 -2.4,-1.3 -3.3,-2.2 -0.9,-0.9 -1.6,-2 -2.1,-3.3 -0.5,-1.2 -0.8,-2.6 -0.8,-4 l 0,-0.1 c 0,-1.4 0.3,-2.7 0.8,-4 0.5,-1.2 1.2,-2.3 2.2,-3.3 0.9,-0.9 2,-1.7 3.3,-2.2 1.3,-0.6 2.7,-0.8 4.2,-0.8 1.5,0 2.9,0.3 4.2,0.8 1.3,0.5 2.4,1.3 3.3,2.2 0.9,0.9 1.6,2 2.1,3.3 0.5,1.2 0.8,2.6 0.8,4 l 0,0.1 c 0,1.4 -0.3,2.7 -0.8,4 -0.5,1.2 -1.2,2.3 -2.2,3.3 -0.9,0.9 -2,1.7 -3.3,2.2 -1.3,0.6 -2.7,0.8 -4.2,0.8 z m 0,-3.2 c 1,0 1.9,-0.2 2.7,-0.6 0.8,-0.4 1.5,-0.9 2.1,-1.5 0.6,-0.6 1,-1.4 1.4,-2.2 0.3,-0.9 0.5,-1.8 0.5,-2.7 l 0,-0.1 c 0,-1 -0.2,-1.9 -0.5,-2.8 -0.3,-0.9 -0.8,-1.6 -1.4,-2.3 -0.6,-0.6 -1.3,-1.1 -2.1,-1.5 -0.8,-0.4 -1.7,-0.6 -2.7,-0.6 -1,0 -1.9,0.2 -2.7,0.6 -0.8,0.4 -1.5,0.9 -2.1,1.5 -0.6,0.6 -1,1.4 -1.4,2.2 -0.3,0.9 -0.5,1.8 -0.5,2.7 l 0,0.1 c 0,1 0.2,1.9 0.5,2.8 0.3,0.9 0.8,1.6 1.4,2.3 0.6,0.6 1.3,1.1 2.1,1.5 0.8,0.4 1.8,0.6 2.7,0.6 z"
- id="path17"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- d="m 98.7,115 c -1.5,0 -2.8,-0.3 -4,-0.8 -1.2,-0.5 -2.3,-1.3 -3.2,-2.2 -0.9,-0.9 -1.6,-2 -2.1,-3.3 -0.5,-1.3 -0.8,-2.6 -0.8,-4 l 0,-0.1 c 0,-1.4 0.3,-2.8 0.8,-4 0.5,-1.2 1.2,-2.3 2.1,-3.3 0.9,-0.9 2,-1.7 3.3,-2.2 1.3,-0.5 2.6,-0.8 4.2,-0.8 0.9,0 1.7,0.1 2.5,0.2 0.8,0.2 1.4,0.4 2.1,0.6 0.6,0.3 1.2,0.6 1.7,1 0.5,0.4 1,0.8 1.5,1.3 l -2.3,2.6 c -0.8,-0.7 -1.6,-1.3 -2.5,-1.8 -0.9,-0.5 -1.9,-0.7 -3.1,-0.7 -1,0 -1.8,0.2 -2.6,0.6 -0.8,0.4 -1.5,0.9 -2.1,1.5 -0.6,0.6 -1,1.4 -1.4,2.2 -0.3,0.9 -0.5,1.8 -0.5,2.7 l 0,0.1 c 0,1 0.2,1.9 0.5,2.8 0.3,0.9 0.8,1.6 1.4,2.3 0.6,0.6 1.3,1.2 2.1,1.5 0.8,0.3 1.7,0.6 2.6,0.6 1.2,0 2.3,-0.2 3.1,-0.7 0.8,-0.5 1.7,-1.1 2.6,-1.9 l 2.3,2.3 c -0.5,0.6 -1,1 -1.6,1.5 -0.6,0.5 -1.2,0.8 -1.8,1.1 -0.6,0.3 -1.4,0.6 -2.1,0.7 -0.9,0.2 -1.8,0.2 -2.7,0.2 z"
- id="path19"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- d="m 113.9,94.7 3.5,0 0,8.3 9.6,0 0,-8.3 3.5,0 0,20 -3.5,0 0,-8.4 -9.6,0 0,8.4 -3.5,0 0,-20 z"
- id="path21"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- d="m 146,94.6 3.2,0 8.8,20.1 -3.7,0 -2,-4.8 -9.4,0 -2.1,4.8 -3.6,0 8.8,-20.1 z m 5,12.2 -3.4,-8 -3.4,8 6.8,0 z"
- id="path23"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /></g><rect
- id="XMLID_444_"
- x="22.414255"
- y="112.81049"
- width="121.66127"
- height="1.0496266"
- style="fill:#ffffff" /><path
- id="XMLID_446_"
- d="m 144.07551,76.932341 -51.71797,0 c 0,0.381682 -0.0954,0.667943 -0.0954,1.049626 l 51.81338,0 0,-1.049626 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- id="XMLID_448_"
- d="m 22.414254,76.932341 0,1.049626 48.759928,0 c 0,-0.381683 -0.09542,-0.667944 -0.09542,-1.049626 l -48.664507,0 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><g
- id="g13-0"
- transform="matrix(0.95420602,0,0,0.95420602,90.83195,-0.74194725)"
- style="fill:#8d6748;fill-opacity:1"><text
- xml:space="preserve"
- style="font-style:normal;font-weight:normal;font-size:41.91966629px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- x="117.80782"
- y="99.410042"
- id="text4344"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan4346"
- x="117.80782"
- y="99.410042" /></text>
-<text
- xml:space="preserve"
- style="font-style:italic;font-variant:normal;font-weight:300;font-stretch:normal;font-size:23.579813px;line-height:125%;font-family:'Helvetica Neue';-inkscape-font-specification:'Helvetica Neue, Light Italic';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#8d6748;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
- x="92.403748"
- y="109.94498"
- id="text4348"
- sodipodi:linespacing="125%"><tspan
- sodipodi:role="line"
- id="tspan4350"
- x="92.403748"
- y="109.94498"
- style="font-style:italic;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:23.579813px;line-height:125%;font-family:'Helvetica Neue';-inkscape-font-specification:'Helvetica Neue, Light Italic';text-align:start;letter-spacing:0.52399588px;writing-mode:lr-tb;text-anchor:start;fill:#8d6748;fill-opacity:1"
- dx="4.114904e-08">simple, flexible, fun</tspan></text>
-</g></svg> \ No newline at end of file
diff --git a/tests/lib/mocha-3.1.2/assets/mocha-logo-128.png b/tests/lib/mocha-3.1.2/assets/mocha-logo-128.png
deleted file mode 100644
index d4dbf34603..0000000000
--- a/tests/lib/mocha-3.1.2/assets/mocha-logo-128.png
+++ /dev/null
Binary files differ
diff --git a/tests/lib/mocha-3.1.2/assets/mocha-logo-192.png b/tests/lib/mocha-3.1.2/assets/mocha-logo-192.png
deleted file mode 100644
index 69fbbff090..0000000000
--- a/tests/lib/mocha-3.1.2/assets/mocha-logo-192.png
+++ /dev/null
Binary files differ
diff --git a/tests/lib/mocha-3.1.2/assets/mocha-logo-64.png b/tests/lib/mocha-3.1.2/assets/mocha-logo-64.png
deleted file mode 100644
index 10403ff294..0000000000
--- a/tests/lib/mocha-3.1.2/assets/mocha-logo-64.png
+++ /dev/null
Binary files differ
diff --git a/tests/lib/mocha-3.1.2/assets/mocha-logo.svg b/tests/lib/mocha-3.1.2/assets/mocha-logo.svg
deleted file mode 100644
index e907e3167e..0000000000
--- a/tests/lib/mocha-3.1.2/assets/mocha-logo.svg
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- version="1.1"
- id="Layer_1"
- x="0px"
- y="0px"
- viewBox="0 0 192 191.99999"
- enable-background="new 0 0 193 208"
- xml:space="preserve"
- inkscape:version="0.91 r13725"
- sodipodi:docname="mocha-logo.svg"
- width="192"
- height="192"
- inkscape:export-filename="/Users/boneskull/Downloads/mocha-logo-192.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90"><title
- id="title4160">Mocha Logo</title><metadata
- id="metadata32"><rdf:RDF><cc:Work
- rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title>Mocha Logo</dc:title><dc:date>08-21-2015</dc:date><dc:creator><cc:Agent><dc:title>Dick DeLeon &lt;ddeleon@decipherinc.com&gt;</dc:title></cc:Agent></dc:creator><dc:rights><cc:Agent><dc:title>CC BY-SA 4.0</dc:title></cc:Agent></dc:rights><dc:subject><rdf:Bag><rdf:li>mocha</rdf:li><rdf:li>mochajs</rdf:li></rdf:Bag></dc:subject><dc:contributor><cc:Agent><dc:title>Christopher Hiller &lt;boneskull@boneskull.com&gt;</dc:title></cc:Agent></dc:contributor><cc:license
- rdf:resource="http://creativecommons.org/licenses/by-sa/3.0/" /></cc:Work><cc:License
- rdf:about="http://creativecommons.org/licenses/by-sa/3.0/"><cc:permits
- rdf:resource="http://creativecommons.org/ns#Reproduction" /><cc:permits
- rdf:resource="http://creativecommons.org/ns#Distribution" /><cc:requires
- rdf:resource="http://creativecommons.org/ns#Notice" /><cc:requires
- rdf:resource="http://creativecommons.org/ns#Attribution" /><cc:permits
- rdf:resource="http://creativecommons.org/ns#DerivativeWorks" /><cc:requires
- rdf:resource="http://creativecommons.org/ns#ShareAlike" /></cc:License></rdf:RDF></metadata><defs
- id="defs30" /><sodipodi:namedview
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
- inkscape:pageshadow="2"
- inkscape:window-width="1920"
- inkscape:window-height="1031"
- id="namedview28"
- showgrid="false"
- fit-margin-top="5"
- fit-margin-left="5"
- fit-margin-right="5"
- fit-margin-bottom="5"
- inkscape:zoom="1"
- inkscape:cx="96"
- inkscape:cy="98.137283"
- inkscape:window-x="1360"
- inkscape:window-y="23"
- inkscape:window-maximized="0"
- inkscape:current-layer="Layer_1" /><path
- id="XMLID_229_"
- d="m 169.47386,143.90113 -68.70282,39.69498 c -2.958045,1.71756 -6.584028,1.71756 -9.542066,0 L 22.52614,143.90113 c -2.958038,-1.71757 -4.77103,-4.86645 -4.77103,-8.20617 l 0,-79.389939 c 0,-3.435142 1.812992,-6.488601 4.77103,-8.206172 L 91.228974,8.403878 c 2.958038,-1.717571 6.584021,-1.717571 9.542056,0 l 68.70282,39.694971 c 2.95804,1.717571 4.77104,4.866451 4.77104,8.206172 l 0,79.389939 c -0.0954,3.33972 -1.90842,6.4886 -4.77104,8.20617 z"
- inkscape:connector-curvature="0"
- style="clip-rule:evenodd;fill:#8d6748;fill-rule:evenodd" /><path
- id="XMLID_262_"
- d="m 95.904583,22.049024 0,0 c 0.954207,0 1.812992,0.286262 2.671781,0.763365 l 59.351606,34.255996 c 1.62216,0.954206 2.67177,2.767198 2.67177,4.67561 l 0,68.511985 c 0,1.90842 -1.04962,3.72141 -2.67177,4.67562 l -59.351606,34.25599 c -0.858789,0.47711 -1.717574,0.76336 -2.671781,0.76336 -0.954206,0 -1.908412,-0.28625 -2.671777,-0.76336 L 33.881192,134.9316 c -1.62215,-0.95421 -2.671778,-2.7672 -2.671778,-4.67562 l 0,-68.511985 c 0,-1.908412 1.049628,-3.721404 2.671778,-4.67561 L 93.232806,22.812389 c 0.858785,-0.477103 1.812992,-0.763365 2.671777,-0.763365 m 0,-2.862618 c -1.431309,0 -2.862618,0.381683 -4.103085,1.145048 L 32.449883,54.58745 c -2.576357,1.431309 -4.103086,4.198506 -4.103086,7.061124 l 0,68.511996 c 0,2.95803 1.526729,5.62981 4.103086,7.06112 l 59.351615,34.25599 c 1.240467,0.76337 2.671776,1.14506 4.103085,1.14506 1.431309,0 2.862617,-0.38169 4.103097,-1.14506 l 59.35159,-34.25599 c 2.57636,-1.43131 4.10309,-4.1985 4.10309,-7.06112 l 0,-68.511996 c 0,-2.958038 -1.52673,-5.629815 -4.10309,-7.061124 L 100.00768,20.331454 C 98.7672,19.568089 97.335892,19.186406 95.904583,19.186406 l 0,0 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><g
- id="XMLID_228_"
- transform="matrix(0.95420602,0,0,0.95420602,5.4935566,-4.7641653)"><g
- id="XMLID_223_"><g
- id="XMLID_295_"><path
- d="m 103.6,69.6 c 0,-0.5 -0.4,-1 -1,-1 l -9.4,0 -9.4,0 c -0.5,0 -1,0.4 -1,1 0,3.4 0.5,15.1 5.5,20.8 0.2,0.2 0.4,0.3 0.7,0.3 l 8.4,0 c 0.3,0 0.5,-0.1 0.7,-0.3 5,-5.6 5.5,-17.3 5.5,-20.8 z m -7.4,18.2 -5.9,0 c -0.3,0 -0.5,-0.1 -0.7,-0.3 -3.4,-4 -3.8,-12 -3.9,-14.8 0,-0.5 0.4,-1 1,-1 l 6.6,0 6.6,0 c 0.5,0 1,0.4 1,1 0,2.8 -0.5,10.7 -3.9,14.8 -0.3,0.2 -0.5,0.3 -0.8,0.3 z"
- id="path8"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /></g></g><path
- id="XMLID_225_"
- d="m 95.1,66.6 c 0,0 3.6,-2.1 1.4,-5.9 -1.3,-2 -1.9,-3.7 -1.4,-4.4 -1.3,1.6 -3.5,3.3 -1.1,6.9 0.8,0.9 1.2,2.8 1.1,3.4 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- id="XMLID_224_"
- d="m 91.1,66.9 c 0,0 2.4,-1.4 0.9,-4 -0.9,-1.3 -1.3,-2.5 -0.9,-2.9 -0.9,1.1 -2.3,2.2 -0.7,4.7 0.5,0.5 0.7,1.8 0.7,2.2 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- id="XMLID_227_"
- d="m 99.3,78.5 c -0.4,2.7 -1.2,5.8 -2.9,7.8 -0.2,0.2 -0.4,0.3 -0.6,0.3 l -5,0 c -0.2,0 -0.5,-0.1 -0.6,-0.3 -1.2,-1.5 -2,-3.5 -2.5,-5.6 0,0 5.8,0.8 9.1,-0.4 2.4,-0.9 2.5,-1.8 2.5,-1.8 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /></g><g
- id="g13"
- transform="matrix(0.95420602,0,0,0.95420602,5.4935566,-4.7641653)"><path
- d="m 33.6,94.7 3.7,0 6.1,9.4 6.1,-9.4 3.7,0 0,20 -3.5,0 0,-14.3 -6.3,9.4 -0.1,0 -6.2,-9.3 0,14.3 -3.5,0 0,-20.1 z"
- id="path15"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- d="m 71.3,115 c -1.5,0 -2.9,-0.3 -4.2,-0.8 -1.3,-0.5 -2.4,-1.3 -3.3,-2.2 -0.9,-0.9 -1.6,-2 -2.1,-3.3 -0.5,-1.2 -0.8,-2.6 -0.8,-4 l 0,-0.1 c 0,-1.4 0.3,-2.7 0.8,-4 0.5,-1.2 1.2,-2.3 2.2,-3.3 0.9,-0.9 2,-1.7 3.3,-2.2 1.3,-0.6 2.7,-0.8 4.2,-0.8 1.5,0 2.9,0.3 4.2,0.8 1.3,0.5 2.4,1.3 3.3,2.2 0.9,0.9 1.6,2 2.1,3.3 0.5,1.2 0.8,2.6 0.8,4 l 0,0.1 c 0,1.4 -0.3,2.7 -0.8,4 -0.5,1.2 -1.2,2.3 -2.2,3.3 -0.9,0.9 -2,1.7 -3.3,2.2 -1.3,0.6 -2.7,0.8 -4.2,0.8 z m 0,-3.2 c 1,0 1.9,-0.2 2.7,-0.6 0.8,-0.4 1.5,-0.9 2.1,-1.5 0.6,-0.6 1,-1.4 1.4,-2.2 0.3,-0.9 0.5,-1.8 0.5,-2.7 l 0,-0.1 c 0,-1 -0.2,-1.9 -0.5,-2.8 -0.3,-0.9 -0.8,-1.6 -1.4,-2.3 -0.6,-0.6 -1.3,-1.1 -2.1,-1.5 -0.8,-0.4 -1.7,-0.6 -2.7,-0.6 -1,0 -1.9,0.2 -2.7,0.6 -0.8,0.4 -1.5,0.9 -2.1,1.5 -0.6,0.6 -1,1.4 -1.4,2.2 -0.3,0.9 -0.5,1.8 -0.5,2.7 l 0,0.1 c 0,1 0.2,1.9 0.5,2.8 0.3,0.9 0.8,1.6 1.4,2.3 0.6,0.6 1.3,1.1 2.1,1.5 0.8,0.4 1.8,0.6 2.7,0.6 z"
- id="path17"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- d="m 98.7,115 c -1.5,0 -2.8,-0.3 -4,-0.8 -1.2,-0.5 -2.3,-1.3 -3.2,-2.2 -0.9,-0.9 -1.6,-2 -2.1,-3.3 -0.5,-1.3 -0.8,-2.6 -0.8,-4 l 0,-0.1 c 0,-1.4 0.3,-2.8 0.8,-4 0.5,-1.2 1.2,-2.3 2.1,-3.3 0.9,-0.9 2,-1.7 3.3,-2.2 1.3,-0.5 2.6,-0.8 4.2,-0.8 0.9,0 1.7,0.1 2.5,0.2 0.8,0.2 1.4,0.4 2.1,0.6 0.6,0.3 1.2,0.6 1.7,1 0.5,0.4 1,0.8 1.5,1.3 l -2.3,2.6 c -0.8,-0.7 -1.6,-1.3 -2.5,-1.8 -0.9,-0.5 -1.9,-0.7 -3.1,-0.7 -1,0 -1.8,0.2 -2.6,0.6 -0.8,0.4 -1.5,0.9 -2.1,1.5 -0.6,0.6 -1,1.4 -1.4,2.2 -0.3,0.9 -0.5,1.8 -0.5,2.7 l 0,0.1 c 0,1 0.2,1.9 0.5,2.8 0.3,0.9 0.8,1.6 1.4,2.3 0.6,0.6 1.3,1.2 2.1,1.5 0.8,0.3 1.7,0.6 2.6,0.6 1.2,0 2.3,-0.2 3.1,-0.7 0.8,-0.5 1.7,-1.1 2.6,-1.9 l 2.3,2.3 c -0.5,0.6 -1,1 -1.6,1.5 -0.6,0.5 -1.2,0.8 -1.8,1.1 -0.6,0.3 -1.4,0.6 -2.1,0.7 -0.9,0.2 -1.8,0.2 -2.7,0.2 z"
- id="path19"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- d="m 113.9,94.7 3.5,0 0,8.3 9.6,0 0,-8.3 3.5,0 0,20 -3.5,0 0,-8.4 -9.6,0 0,8.4 -3.5,0 0,-20 z"
- id="path21"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- d="m 146,94.6 3.2,0 8.8,20.1 -3.7,0 -2,-4.8 -9.4,0 -2.1,4.8 -3.6,0 8.8,-20.1 z m 5,12.2 -3.4,-8 -3.4,8 6.8,0 z"
- id="path23"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /></g><rect
- id="XMLID_444_"
- x="35.169365"
- y="110.69476"
- width="121.66127"
- height="1.0496266"
- style="fill:#ffffff" /><path
- id="XMLID_446_"
- d="m 156.83062,74.816618 -51.71797,0 c 0,0.381682 -0.0954,0.667943 -0.0954,1.049626 l 51.81338,0 0,-1.049626 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /><path
- id="XMLID_448_"
- d="m 35.169364,74.816618 0,1.049626 48.759928,0 c 0,-0.381683 -0.09542,-0.667944 -0.09542,-1.049626 l -48.664507,0 z"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" /></svg> \ No newline at end of file
diff --git a/tests/lib/mocha-3.1.2/bin/.eslintrc b/tests/lib/mocha-3.1.2/bin/.eslintrc
deleted file mode 100644
index db7424631c..0000000000
--- a/tests/lib/mocha-3.1.2/bin/.eslintrc
+++ /dev/null
@@ -1,3 +0,0 @@
----
-rules:
- no-process-exit: 0
diff --git a/tests/lib/mocha-3.1.2/bin/_mocha b/tests/lib/mocha-3.1.2/bin/_mocha
deleted file mode 100644
index 6cfc094ba1..0000000000
--- a/tests/lib/mocha-3.1.2/bin/_mocha
+++ /dev/null
@@ -1,544 +0,0 @@
-#!/usr/bin/env node
-'use strict';
-
-/* eslint no-unused-vars: off */
-
-/**
- * Module dependencies.
- */
-
-var program = require('commander');
-var path = require('path');
-var fs = require('fs');
-var resolve = path.resolve;
-var exists = fs.existsSync || path.existsSync;
-var Mocha = require('../');
-var utils = Mocha.utils;
-var interfaceNames = Object.keys(Mocha.interfaces);
-var join = path.join;
-var cwd = process.cwd();
-var getOptions = require('./options');
-var mocha = new Mocha();
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-
-/**
- * Files.
- */
-
-var files = [];
-
-/**
- * Globals.
- */
-
-var globals = [];
-
-/**
- * Requires.
- */
-
-var requires = [];
-
-/**
- * Images.
- */
-
-var images = {
- fail: path.join(__dirname, '..', 'images', 'error.png'),
- pass: path.join(__dirname, '..', 'images', 'ok.png')
-};
-
-// options
-
-program
- .version(JSON.parse(fs.readFileSync(path.join(__dirname, '..', 'package.json'), 'utf8')).version)
- .usage('[debug] [options] [files]')
- .option('-A, --async-only', 'force all tests to take a callback (async) or return a promise')
- .option('-c, --colors', 'force enabling of colors')
- .option('-C, --no-colors', 'force disabling of colors')
- .option('-G, --growl', 'enable growl notification support')
- .option('-O, --reporter-options <k=v,k2=v2,...>', 'reporter-specific options')
- .option('-R, --reporter <name>', 'specify the reporter to use', 'spec')
- .option('-S, --sort', 'sort test files')
- .option('-b, --bail', 'bail after first test failure')
- .option('-d, --debug', "enable node's debugger, synonym for node --debug")
- .option('-g, --grep <pattern>', 'only run tests matching <pattern>')
- .option('-f, --fgrep <string>', 'only run tests containing <string>')
- .option('-gc, --expose-gc', 'expose gc extension')
- .option('-i, --invert', 'inverts --grep and --fgrep matches')
- .option('-r, --require <name>', 'require the given module')
- .option('-s, --slow <ms>', '"slow" test threshold in milliseconds [75]')
- .option('-t, --timeout <ms>', 'set test-case timeout in milliseconds [2000]')
- .option('-u, --ui <name>', 'specify user-interface (' + interfaceNames.join('|') + ')', 'bdd')
- .option('-w, --watch', 'watch files for changes')
- .option('--check-leaks', 'check for global variable leaks')
- .option('--full-trace', 'display the full stack trace')
- .option('--compilers <ext>:<module>,...', 'use the given module(s) to compile files', list, [])
- .option('--debug-brk', "enable node's debugger breaking on the first line")
- .option('--globals <names>', 'allow the given comma-delimited global [names]', list, [])
- .option('--es_staging', 'enable all staged features')
- .option('--harmony<_classes,_generators,...>', 'all node --harmony* flags are available')
- .option('--preserve-symlinks', 'Instructs the module loader to preserve symbolic links when resolving and caching modules')
- .option('--icu-data-dir', 'include ICU data')
- .option('--inline-diffs', 'display actual/expected differences inline within each string')
- .option('--interfaces', 'display available interfaces')
- .option('--no-deprecation', 'silence deprecation warnings')
- .option('--no-exit', 'require a clean shutdown of the event loop: mocha will not call process.exit')
- .option('--no-timeouts', 'disables timeouts, given implicitly with --debug')
- .option('--opts <path>', 'specify opts path', 'test/mocha.opts')
- .option('--perf-basic-prof', 'enable perf linux profiler (basic support)')
- .option('--prof', 'log statistical profiling information')
- .option('--log-timer-events', 'Time events including external callbacks')
- .option('--recursive', 'include sub directories')
- .option('--reporters', 'display available reporters')
- .option('--retries <times>', 'set numbers of time to retry a failed test case')
- .option('--throw-deprecation', 'throw an exception anytime a deprecated function is used')
- .option('--trace', 'trace function calls')
- .option('--trace-deprecation', 'show stack traces on deprecations')
- .option('--use_strict', 'enforce strict mode')
- .option('--watch-extensions <ext>,...', 'additional extensions to monitor with --watch', list, [])
- .option('--delay', 'wait for async suite definition');
-
-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.js'), '');
- fs.writeFileSync(join(path, 'index.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 reporter');
- 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('');
- interfaceNames.forEach(function (interfaceName) {
- console.log(' ' + interfaceName);
- });
- 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 = resolve(mod);
- }
- requires.push(mod);
-});
-
-// If not already done, load mocha.opts
-if (!process.env.LOADED_MOCHA_OPTS) {
- getOptions();
-}
-
-// parse args
-
-program.parse(process.argv);
-
-// infinite stack traces
-
-Error.stackTraceLimit = Infinity; // TODO: config
-
-// reporter options
-
-var reporterOptions = {};
-if (program.reporterOptions !== undefined) {
- program.reporterOptions.split(',').forEach(function (opt) {
- var L = opt.split('=');
- if (L.length > 2 || L.length === 0) {
- throw new Error("invalid reporter option '" + opt + "'");
- } else if (L.length === 2) {
- reporterOptions[L[0]] = L[1];
- } else {
- reporterOptions[L[0]] = true;
- }
- });
-}
-
-// reporter
-
-mocha.reporter(program.reporter, reporterOptions);
-
-// load reporter
-
-var Reporter = null;
-try {
- Reporter = require('../lib/reporters/' + program.reporter);
-} catch (err) {
- try {
- Reporter = require(program.reporter);
- } catch (err2) {
- throw new Error('reporter "' + program.reporter + '" does not exist');
- }
-}
-
-// --no-colors
-
-if (!program.colors) {
- mocha.useColors(false);
-}
-
-// --colors
-
-if (~process.argv.indexOf('--colors') || ~process.argv.indexOf('-c')) {
- mocha.useColors(true);
-}
-
-// --inline-diffs
-
-if (program.inlineDiffs) {
- mocha.useInlineDiffs(true);
-}
-
-// --slow <ms>
-
-if (program.slow) {
- mocha.suite.slow(program.slow);
-}
-
-// --no-timeouts
-
-if (!program.timeouts) {
- mocha.enableTimeouts(false);
-}
-
-// --timeout
-
-if (program.timeout) {
- mocha.suite.timeout(program.timeout);
-}
-
-// --bail
-
-mocha.suite.bail(program.bail);
-
-// --grep
-
-if (program.grep) {
- mocha.grep(program.grep);
-}
-
-// --fgrep
-
-if (program.fgrep) {
- mocha.fgrep(program.fgrep);
-}
-
-// --invert
-
-if (program.invert) {
- mocha.invert();
-}
-
-// --check-leaks
-
-if (program.checkLeaks) {
- mocha.checkLeaks();
-}
-
-// --stack-trace
-
-if (program.fullTrace) {
- mocha.fullTrace();
-}
-
-// --growl
-
-if (program.growl) {
- mocha.growl();
-}
-
-// --async-only
-
-if (program.asyncOnly) {
- mocha.asyncOnly();
-}
-
-// --delay
-
-if (program.delay) {
- mocha.delay();
-}
-
-// --globals
-
-mocha.globals(globals);
-
-// --retries
-
-if (program.retries) {
- mocha.suite.retries(program.retries);
-}
-
-// custom compiler support
-
-var extensions = ['js'];
-program.compilers.forEach(function (c) {
- var idx = c.indexOf(':');
- var ext = c.slice(0, idx);
- var mod = c.slice(idx + 1);
-
- if (mod[0] === '.') {
- mod = join(process.cwd(), mod);
- }
- require(mod);
- extensions.push(ext);
- program.watchExtensions.push(ext);
-});
-
-// requires
-
-requires.forEach(function (mod) {
- require(mod);
-});
-
-// interface
-
-mocha.ui(program.ui);
-
-// args
-
-var args = program.args;
-
-// default files to test/*.{js,coffee}
-
-if (!args.length) {
- args.push('test');
-}
-
-args.forEach(function (arg) {
- var newFiles;
- try {
- newFiles = utils.lookupFiles(arg, extensions, program.recursive);
- } catch (err) {
- if (err.message.indexOf('cannot resolve path') === 0) {
- console.error('Warning: Could not find any test files matching pattern: ' + arg);
- return;
- }
-
- throw err;
- }
-
- files = files.concat(newFiles);
-});
-
-if (!files.length) {
- console.error('No test files found');
- process.exit(1);
-}
-
-// resolve
-
-files = files.map(function (path) {
- return resolve(path);
-});
-
-if (program.sort) {
- files.sort();
-}
-
-// --watch
-
-var runner;
-var loadAndRun;
-var purge;
-var rerun;
-
-if (program.watch) {
- console.log();
- hideCursor();
- process.on('SIGINT', function () {
- showCursor();
- console.log('\n');
- process.exit(130);
- });
-
- var watchFiles = utils.files(cwd, [ 'js' ].concat(program.watchExtensions));
- var runAgain = false;
-
- loadAndRun = function loadAndRun () {
- try {
- mocha.files = files;
- runAgain = false;
- runner = mocha.run(function () {
- runner = null;
- if (runAgain) {
- rerun();
- }
- });
- } catch (e) {
- console.log(e.stack);
- }
- };
-
- purge = function purge () {
- watchFiles.forEach(function (file) {
- delete require.cache[file];
- });
- };
-
- loadAndRun();
-
- rerun = function rerun () {
- purge();
- stop();
- if (!program.grep) {
- mocha.grep(null);
- }
- mocha.suite = mocha.suite.clone();
- mocha.suite.ctx = new Mocha.Context();
- mocha.ui(program.ui);
- loadAndRun();
- };
-
- utils.watch(watchFiles, function () {
- runAgain = true;
- if (runner) {
- runner.abort();
- } else {
- rerun();
- }
- });
-} else {
-// load
-
- mocha.files = files;
- runner = mocha.run(program.exit ? exit : exitLater);
-}
-
-function exitLater (code) {
- process.on('exit', function () {
- process.exit(Math.min(code, 255));
- });
-}
-
-function exit (code) {
- // flush output for Node.js Windows pipe bug
- // https://github.com/joyent/node/issues/6247 is just one bug example
- // https://github.com/visionmedia/mocha/issues/333 has a good discussion
- function done () {
- if (!(draining--)) {
- process.exit(Math.min(code, 255));
- }
- }
-
- var draining = 0;
- var streams = [process.stdout, process.stderr];
-
- streams.forEach(function (stream) {
- // submit empty write request and wait for completion
- draining += 1;
- stream.write('', done);
- });
-
- done();
-}
-
-process.on('SIGINT', function () {
- runner.abort();
-
- // This is a hack:
- // Instead of `process.exit(130)`, set runner.failures to 130 (exit code for SIGINT)
- // The amount of failures will be emitted as error code later
- runner.failures = 130;
-});
-
-/**
- * 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);
-}
-
-/**
- * Play the given array of strings.
- */
-
-function play (arr, interval) {
- var len = arr.length;
- interval = interval || 100;
- var i = 0;
-
- play.timer = setInterval(function () {
- var str = arr[i++ % len];
- process.stdout.write('\u001b[0G' + str);
- }, interval);
-}
diff --git a/tests/lib/mocha-3.1.2/bin/mocha b/tests/lib/mocha-3.1.2/bin/mocha
deleted file mode 100644
index c6aaa97b00..0000000000
--- a/tests/lib/mocha-3.1.2/bin/mocha
+++ /dev/null
@@ -1,83 +0,0 @@
-#!/usr/bin/env node
-
-'use strict';
-
-/**
- * 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;
-var path = require('path');
-var getOptions = require('./options');
-var args = [path.join(__dirname, '_mocha')];
-
-// Load mocha.opts into process.argv
-// Must be loaded here to handle node-specific options
-getOptions();
-
-process.argv.slice(2).forEach(function (arg) {
- var flag = arg.split('=')[0];
-
- switch (flag) {
- case '-d':
- args.unshift('--debug');
- args.push('--no-timeouts');
- break;
- case 'debug':
- case '--debug':
- case '--debug-brk':
- case '--inspect':
- args.unshift(arg);
- args.push('--no-timeouts');
- break;
- case '-gc':
- case '--expose-gc':
- args.unshift('--expose-gc');
- break;
- case '--gc-global':
- case '--es_staging':
- case '--no-deprecation':
- case '--prof':
- case '--log-timer-events':
- case '--throw-deprecation':
- case '--trace-deprecation':
- case '--use_strict':
- case '--allow-natives-syntax':
- case '--perf-basic-prof':
- args.unshift(arg);
- break;
- default:
- if (arg.indexOf('--harmony') === 0) {
- args.unshift(arg);
- } else if (arg.indexOf('--trace') === 0) {
- args.unshift(arg);
- } else if (arg.indexOf('--icu-data-dir') === 0) {
- args.unshift(arg);
- } else if (arg.indexOf('--max-old-space-size') === 0) {
- args.unshift(arg);
- } else if (arg.indexOf('--preserve-symlinks') === 0) {
- args.unshift(arg);
- } else {
- args.push(arg);
- }
- break;
- }
-});
-
-var proc = spawn(process.execPath, args, { stdio: 'inherit' });
-proc.on('exit', function (code, signal) {
- process.on('exit', function () {
- if (signal) {
- process.kill(process.pid, signal);
- } else {
- process.exit(code);
- }
- });
-});
-
-// terminate children.
-process.on('SIGINT', function () {
- proc.kill('SIGINT'); // calls runner.abort()
- proc.kill('SIGTERM'); // if that didn't work, we're probably in an infinite loop, so make it die.
-});
diff --git a/tests/lib/mocha-3.1.2/bin/options.js b/tests/lib/mocha-3.1.2/bin/options.js
deleted file mode 100644
index be5a60c9c3..0000000000
--- a/tests/lib/mocha-3.1.2/bin/options.js
+++ /dev/null
@@ -1,41 +0,0 @@
-'use strict';
-
-/**
- * Dependencies.
- */
-
-var fs = require('fs');
-
-/**
- * Export `getOptions`.
- */
-
-module.exports = getOptions;
-
-/**
- * Get options.
- */
-
-function getOptions () {
- var optsPath = process.argv.indexOf('--opts') === -1
- ? 'test/mocha.opts'
- : process.argv[process.argv.indexOf('--opts') + 1];
-
- try {
- var opts = fs.readFileSync(optsPath, 'utf8')
- .replace(/\\\s/g, '%20')
- .split(/\s/)
- .filter(Boolean)
- .map(function (value) {
- return value.replace(/%20/g, ' ');
- });
-
- process.argv = process.argv
- .slice(0, 2)
- .concat(opts.concat(process.argv.slice(2)));
- } catch (err) {
- // ignore
- }
-
- process.env.LOADED_MOCHA_OPTS = true;
-}
diff --git a/tests/lib/mocha-3.1.2/bower.json b/tests/lib/mocha-3.1.2/bower.json
deleted file mode 100644
index e96cc9526d..0000000000
--- a/tests/lib/mocha-3.1.2/bower.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "name": "mocha",
- "homepage": "https://mochajs.org",
- "description": "simple, flexible, fun test framework",
- "repository": {
- "type": "git",
- "url": "git://github.com/mochajs/mocha.git"
- },
- "main": [
- "mocha.js",
- "mocha.css"
- ],
- "ignore": [
- "bin",
- "editors",
- "images",
- "lib",
- "scripts",
- "test",
- "assets",
- "media",
- ".*",
- "index.js",
- "karma.conf.js",
- "browser-entry.js",
- "Makefile",
- "package.json",
- "appveyor.yml"
- ],
- "keywords": [
- "mocha",
- "test",
- "bdd",
- "tdd",
- "tap"
- ],
- "license": "MIT"
-}
diff --git a/tests/lib/mocha-3.1.2/browser-entry.js b/tests/lib/mocha-3.1.2/browser-entry.js
deleted file mode 100644
index 1d5ef5a1c4..0000000000
--- a/tests/lib/mocha-3.1.2/browser-entry.js
+++ /dev/null
@@ -1,187 +0,0 @@
-'use strict';
-
-/* eslint no-unused-vars: off */
-/* eslint-env commonjs */
-
-/**
- * Shim process.stdout.
- */
-
-process.stdout = require('browser-stdout')();
-
-var Mocha = require('./lib/mocha');
-
-/**
- * Create a Mocha instance.
- *
- * @return {undefined}
- */
-
-var mocha = new Mocha({ reporter: 'html' });
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-
-var uncaughtExceptionHandlers = [];
-
-var originalOnerrorHandler = global.onerror;
-
-/**
- * Remove uncaughtException listener.
- * Revert to original onerror handler if previously defined.
- */
-
-process.removeListener = function (e, fn) {
- if (e === 'uncaughtException') {
- if (originalOnerrorHandler) {
- global.onerror = originalOnerrorHandler;
- } else {
- global.onerror = function () {};
- }
- var i = Mocha.utils.indexOf(uncaughtExceptionHandlers, fn);
- if (i !== -1) {
- uncaughtExceptionHandlers.splice(i, 1);
- }
- }
-};
-
-/**
- * Implements uncaughtException listener.
- */
-
-process.on = function (e, fn) {
- if (e === 'uncaughtException') {
- global.onerror = function (err, url, line) {
- fn(new Error(err + ' (' + url + ':' + line + ')'));
- return !mocha.allowUncaught;
- };
- uncaughtExceptionHandlers.push(fn);
- }
-};
-
-// The BDD UI is registered by default, but no UI will be functional in the
-// browser without an explicit call to the overridden `mocha.ui` (see below).
-// Ensure that this default UI does not expose its methods to the global scope.
-mocha.suite.removeAllListeners('pre-require');
-
-var immediateQueue = [];
-var immediateTimeout;
-
-function timeslice () {
- var immediateStart = new Date().getTime();
- while (immediateQueue.length && (new Date().getTime() - immediateStart) < 100) {
- immediateQueue.shift()();
- }
- if (immediateQueue.length) {
- immediateTimeout = setTimeout(timeslice, 0);
- } else {
- immediateTimeout = null;
- }
-}
-
-/**
- * High-performance override of Runner.immediately.
- */
-
-Mocha.Runner.immediately = function (callback) {
- immediateQueue.push(callback);
- if (!immediateTimeout) {
- immediateTimeout = setTimeout(timeslice, 0);
- }
-};
-
-/**
- * Function to allow assertion libraries to throw errors directly into mocha.
- * This is useful when running tests in a browser because window.onerror will
- * only receive the 'message' attribute of the Error.
- */
-mocha.throwError = function (err) {
- Mocha.utils.forEach(uncaughtExceptionHandlers, function (fn) {
- fn(err);
- });
- throw err;
-};
-
-/**
- * Override ui to ensure that the ui functions are initialized.
- * Normally this would happen in Mocha.prototype.loadFiles.
- */
-
-mocha.ui = function (ui) {
- Mocha.prototype.ui.call(this, ui);
- this.suite.emit('pre-require', global, null, this);
- return this;
-};
-
-/**
- * Setup mocha with the given setting options.
- */
-
-mocha.setup = function (opts) {
- if (typeof opts === 'string') {
- opts = { ui: opts };
- }
- for (var opt in opts) {
- if (opts.hasOwnProperty(opt)) {
- this[opt](opts[opt]);
- }
- }
- return this;
-};
-
-/**
- * Run mocha, returning the Runner.
- */
-
-mocha.run = function (fn) {
- var options = mocha.options;
- mocha.globals('location');
-
- var query = Mocha.utils.parseQuery(global.location.search || '');
- if (query.grep) {
- mocha.grep(query.grep);
- }
- if (query.fgrep) {
- mocha.fgrep(query.fgrep);
- }
- if (query.invert) {
- mocha.invert();
- }
-
- return Mocha.prototype.run.call(mocha, function (err) {
- // The DOM Document is not available in Web Workers.
- var document = global.document;
- if (document && document.getElementById('mocha') && options.noHighlighting !== true) {
- Mocha.utils.highlightTags('code');
- }
- if (fn) {
- fn(err);
- }
- });
-};
-
-/**
- * Expose the process shim.
- * https://github.com/mochajs/mocha/pull/916
- */
-
-Mocha.process = process;
-
-/**
- * Expose mocha.
- */
-
-global.Mocha = Mocha;
-global.mocha = mocha;
-
-// this allows test/acceptance/required-tokens.js to pass; thus,
-// you can now do `const describe = require('mocha').describe` in a
-// browser context (assuming browserification). should fix #880
-module.exports = global;
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet
deleted file mode 100644
index c722cfe8ae..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - after each.tmSnippet
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>afterEach(function(){
- $0
-})</string>
- <key>name</key>
- <string>bdd - after each</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>ae</string>
- <key>uuid</key>
- <string>7B4DA8F4-2064-468B-B252-054148419B4B</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet
deleted file mode 100644
index c0b1f6bd82..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - after.tmSnippet
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>after(function(){
- $0
-})</string>
- <key>name</key>
- <string>bdd - after</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>a</string>
- <key>uuid</key>
- <string>A49A87F9-399E-4D74-A489-C535BB06D487</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet
deleted file mode 100644
index 14fa93b1b0..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - before each.tmSnippet
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>beforeEach(function(){
- $0
-})</string>
- <key>name</key>
- <string>bdd - before each</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>be</string>
- <key>uuid</key>
- <string>7AB064E3-EFBB-4FA7-98CA-9E87C10CC04E</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet
deleted file mode 100644
index 18b48c0eeb..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - before.tmSnippet
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>before(function(){
- $0
-})</string>
- <key>name</key>
- <string>bdd - before</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>b</string>
- <key>uuid</key>
- <string>DF6F1F42-F80A-4A24-AF78-376F19070C4C</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - describe.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - describe.tmSnippet
deleted file mode 100644
index 041726c067..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - describe.tmSnippet
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>describe('$1', function(){
- $0
-})</string>
- <key>name</key>
- <string>bdd - describe</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>des</string>
- <key>uuid</key>
- <string>4AA1FB50-9BB9-400E-A140-D61C39BDFDF5</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet
deleted file mode 100644
index 72a3b0ee3a..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/bdd - it.tmSnippet
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>it('should $1', function(){
- $0
-})</string>
- <key>name</key>
- <string>bdd - it</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>it</string>
- <key>uuid</key>
- <string>591AE071-95E4-4E1E-B0F3-A7DAF41595EE</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert.tmSnippet
deleted file mode 100644
index 38d78ce2ec..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert.tmSnippet
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>assert($0);</string>
- <key>name</key>
- <string>tdd - assert</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>as</string>
- <key>uuid</key>
- <string>9D920EC2-6A72-4108-B5A0-591AFA61C740</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_deepEqual.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_deepEqual.tmSnippet
deleted file mode 100644
index 4204e4c4f2..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_deepEqual.tmSnippet
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>assert.deepEqual($1, $2);</string>
- <key>name</key>
- <string>tdd - assert.deepEqual</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>deq</string>
- <key>uuid</key>
- <string>7D21FF16-E2E1-46BB-AD6B-82AD767A0822</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_equal.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_equal.tmSnippet
deleted file mode 100644
index 8f09805968..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_equal.tmSnippet
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>assert.equal($1, $2);</string>
- <key>name</key>
- <string>tdd - assert.equal</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>eq</string>
- <key>uuid</key>
- <string>4868D5C0-075D-44A8-B41B-A14E8350C0F8</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_fail.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_fail.tmSnippet
deleted file mode 100644
index 3e8dbe3b9e..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_fail.tmSnippet
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>assert.fail($0);</string>
- <key>name</key>
- <string>tdd - assert.fail</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>fail</string>
- <key>uuid</key>
- <string>11756F3A-5F08-445C-B5B6-30605838BC6F</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_isFunction.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_isFunction.tmSnippet
deleted file mode 100644
index 903d7f6fdf..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - assert_isFunction.tmSnippet
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>assert.isFunction($0);</string>
- <key>name</key>
- <string>tdd - assert.isFunction</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>isf</string>
- <key>uuid</key>
- <string>83DFFD36-2C46-4C92-8950-64665D32DC8E</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - setup.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - setup.tmSnippet
deleted file mode 100644
index a30e650187..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - setup.tmSnippet
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>setup(function() {
- $0
-});</string>
- <key>name</key>
- <string>tdd - setup</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>setup</string>
- <key>uuid</key>
- <string>DCEE796A-900D-4922-BAF0-39C9B91A15E1</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - suite.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - suite.tmSnippet
deleted file mode 100644
index 37cfd8a566..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - suite.tmSnippet
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>suite('$1', function() {
- $0
-});</string>
- <key>name</key>
- <string>tdd - suite</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>suite</string>
- <key>uuid</key>
- <string>2E65C1BE-A568-4868-95BF-E8C958EA5BA5</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - teardown.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - teardown.tmSnippet
deleted file mode 100644
index 68fd441016..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - teardown.tmSnippet
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>teardown(function() {
- $0
-});</string>
- <key>name</key>
- <string>tdd - teardown</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>teardown</string>
- <key>uuid</key>
- <string>9472B167-BEC1-45FD-BA1C-68A99961D8FF</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - test.tmSnippet b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - test.tmSnippet
deleted file mode 100644
index 279da8900d..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/Snippets/tdd - test.tmSnippet
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>content</key>
- <string>test('$1', function() {
- $0
-});</string>
- <key>name</key>
- <string>tdd - test</string>
- <key>scope</key>
- <string>source.js</string>
- <key>tabTrigger</key>
- <string>test</string>
- <key>uuid</key>
- <string>F6E3DF27-3458-4ADD-91A3-B6EF11E1D81E</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/info.plist b/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/info.plist
deleted file mode 100644
index 16f6587a6c..0000000000
--- a/tests/lib/mocha-3.1.2/editors/JavaScript mocha.tmbundle/info.plist
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>name</key>
- <string>JavaScript mocha</string>
- <key>ordering</key>
- <array>
- <string>4AA1FB50-9BB9-400E-A140-D61C39BDFDF5</string>
- <string>591AE071-95E4-4E1E-B0F3-A7DAF41595EE</string>
- <string>DF6F1F42-F80A-4A24-AF78-376F19070C4C</string>
- <string>A49A87F9-399E-4D74-A489-C535BB06D487</string>
- <string>7AB064E3-EFBB-4FA7-98CA-9E87C10CC04E</string>
- <string>7B4DA8F4-2064-468B-B252-054148419B4B</string>
- </array>
- <key>uuid</key>
- <string>094ACE33-0C0E-422A-B3F7-5B919F5B1239</string>
-</dict>
-</plist>
diff --git a/tests/lib/mocha-3.1.2/images/error.png b/tests/lib/mocha-3.1.2/images/error.png
deleted file mode 100644
index a07a1ba5ef..0000000000
--- a/tests/lib/mocha-3.1.2/images/error.png
+++ /dev/null
Binary files differ
diff --git a/tests/lib/mocha-3.1.2/images/ok.png b/tests/lib/mocha-3.1.2/images/ok.png
deleted file mode 100644
index b3623a5994..0000000000
--- a/tests/lib/mocha-3.1.2/images/ok.png
+++ /dev/null
Binary files differ
diff --git a/tests/lib/mocha-3.1.2/index.js b/tests/lib/mocha-3.1.2/index.js
deleted file mode 100644
index d2b7d19609..0000000000
--- a/tests/lib/mocha-3.1.2/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict';
-
-module.exports = require('./lib/mocha');
diff --git a/tests/lib/mocha-3.1.2/karma.conf.js b/tests/lib/mocha-3.1.2/karma.conf.js
deleted file mode 100644
index 8a85bf35cb..0000000000
--- a/tests/lib/mocha-3.1.2/karma.conf.js
+++ /dev/null
@@ -1,180 +0,0 @@
-'use strict';
-
-var fs = require('fs');
-var path = require('path');
-var mkdirp = require('mkdirp');
-var baseBundleDirpath = path.join(__dirname, '.karma');
-var osName = require('os-name');
-
-module.exports = function (config) {
- var bundleDirpath;
- var cfg = {
- frameworks: [
- 'browserify',
- 'expect',
- 'mocha'
- ],
- files: [
- // we use the BDD interface for all of the tests that
- // aren't interface-specific.
- 'test/browser-fixtures/bdd.fixture.js',
- 'test/acceptance/*.spec.js'
- ],
- exclude: [
- 'test/acceptance/http.spec.js',
- 'test/acceptance/fs.spec.js',
- 'test/acceptance/lookup-files.spec.js',
- 'test/acceptance/require/**/*.js',
- 'test/acceptance/misc/**/*.js'
- ],
- preprocessors: {
- 'test/**/*.js': ['browserify']
- },
- browserify: {
- debug: true,
- configure: function configure (b) {
- b.ignore('glob')
- .ignore('fs')
- .ignore('path')
- .ignore('supports-color')
- .on('bundled', function (err, content) {
- if (!err && bundleDirpath) {
- // write bundle to directory for debugging
- fs.writeFileSync(path.join(bundleDirpath,
- 'bundle.' + Date.now() + '.js'), content);
- }
- });
- }
- },
- reporters: ['spec'],
- colors: true,
- browsers: [osName() === 'macOS Sierra' ? 'Chrome' : 'PhantomJS'],
- logLevel: config.LOG_INFO,
- client: {
- mocha: {
- reporter: 'html'
- }
- }
- };
-
- // see https://github.com/saucelabs/karma-sauce-example
- // TO RUN LOCALLY, execute:
- // `CI=1 SAUCE_USERNAME=<user> SAUCE_ACCESS_KEY=<key> make test-browser`
- var env = process.env;
- var sauceConfig;
-
- if (env.CI) {
- console.error('CI mode enabled');
- if (env.TRAVIS) {
- console.error('Travis-CI detected');
- bundleDirpath = path.join(baseBundleDirpath, process.env.TRAVIS_BUILD_ID);
- if (env.SAUCE_USERNAME && env.SAUCE_ACCESS_KEY) {
- // correlate build/tunnel with Travis
- sauceConfig = {
- build: 'TRAVIS #' + env.TRAVIS_BUILD_NUMBER +
- ' (' + env.TRAVIS_BUILD_ID + ')',
- tunnelIdentifier: env.TRAVIS_JOB_NUMBER
- };
- console.error('Configured SauceLabs');
- } else {
- console.error('No SauceLabs credentials present');
- }
- } else if (env.APPVEYOR) {
- console.error('AppVeyor detected');
- bundleDirpath = path.join(baseBundleDirpath, process.env.APPVEYOR_BUILD_ID);
- } else {
- console.error('Local/unknown environment detected');
- bundleDirpath = path.join(baseBundleDirpath, 'local');
- // don't need to run sauce from appveyor b/c travis does it.
- if (!(env.SAUCE_USERNAME || env.SAUCE_ACCESS_KEY)) {
- console.error('No SauceLabs credentials present');
- } else {
- sauceConfig = {
- build: require('os').hostname() + ' (' + Date.now() + ')'
- };
- console.error('Configured SauceLabs');
- }
- }
- mkdirp.sync(bundleDirpath);
- } else {
- console.error('CI mode disabled');
- }
-
- if (sauceConfig) {
- cfg.sauceLabs = sauceConfig;
- addSauceTests(cfg);
- }
-
- // the MOCHA_UI env var will determine if we're running interface-specific
- // tets. since you can only load one at a time, each must be run separately.
- // each has its own set of acceptance tests and a fixture.
- // the "bdd" fixture is used by default.
- var ui = env.MOCHA_UI;
- if (ui) {
- if (cfg.sauceLabs) {
- cfg.sauceLabs.testName = 'Interface "' + ui + '" integration tests';
- }
- cfg.files = [
- 'test/browser-fixtures/' + ui + '.fixture.js',
- 'test/acceptance/interfaces/' + ui + '.spec.js'
- ];
- } else if (cfg.sauceLabs) {
- cfg.sauceLabs.testName = 'Unit Tests';
- }
-
- config.set(cfg);
-};
-
-function addSauceTests (cfg) {
- cfg.reporters.push('saucelabs');
-
- cfg.customLaunchers = {
- ie8: {
- base: 'SauceLabs',
- browserName: 'internet explorer',
- platform: 'Windows 7',
- version: '8.0'
- },
- ie7: {
- base: 'SauceLabs',
- browserName: 'internet explorer',
- platform: 'Windows XP',
- version: '7.0'
- },
- chrome: {
- base: 'SauceLabs',
- browserName: 'chrome',
- platform: 'Windows 8',
- version: 'latest'
- },
- edge: {
- base: 'SauceLabs',
- browserName: 'MicrosoftEdge',
- platform: 'Windows 10',
- version: 'latest'
- },
- firefox: {
- base: 'SauceLabs',
- browserName: 'firefox',
- platform: 'Windows 8.1',
- version: 'latest'
- },
- safari: {
- base: 'SauceLabs',
- browserName: 'safari',
- platform: 'OS X 10.11',
- version: 'latest'
- }
- };
-
- cfg.browsers = cfg.browsers.concat(Object.keys(cfg.customLaunchers));
-
- cfg.sauceLabs = {
- public: 'public',
- startConnect: true
- };
-
- // for slow browser booting, ostensibly
- cfg.captureTimeout = 120000;
- cfg.browserNoActivityTimeout = 20000;
-}
diff --git a/tests/lib/mocha-3.1.2/lib/browser/.eslintrc.yaml b/tests/lib/mocha-3.1.2/lib/browser/.eslintrc.yaml
deleted file mode 100644
index d85f537d3b..0000000000
--- a/tests/lib/mocha-3.1.2/lib/browser/.eslintrc.yaml
+++ /dev/null
@@ -1,4 +0,0 @@
-env:
- node: false
- browser: false
- commonjs: true
diff --git a/tests/lib/mocha-3.1.2/lib/browser/debug.js b/tests/lib/mocha-3.1.2/lib/browser/debug.js
deleted file mode 100644
index 3d12160f1a..0000000000
--- a/tests/lib/mocha-3.1.2/lib/browser/debug.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-function noop () {}
-
-module.exports = function () {
- return noop;
-};
diff --git a/tests/lib/mocha-3.1.2/lib/browser/events.js b/tests/lib/mocha-3.1.2/lib/browser/events.js
deleted file mode 100644
index e46a9f5f05..0000000000
--- a/tests/lib/mocha-3.1.2/lib/browser/events.js
+++ /dev/null
@@ -1,195 +0,0 @@
-'use strict';
-
-/**
- * Module exports.
- */
-
-exports.EventEmitter = EventEmitter;
-
-/**
- * Object#toString reference.
- */
-var objToString = Object.prototype.toString;
-
-/**
- * Check if a value is an array.
- *
- * @api private
- * @param {*} val The value to test.
- * @return {boolean} true if the value is an array, otherwise false.
- */
-function isArray (val) {
- return objToString.call(val) === '[object Array]';
-}
-
-/**
- * Event emitter constructor.
- *
- * @api public
- */
-function EventEmitter () {}
-
-/**
- * Add a listener.
- *
- * @api public
- * @param {string} name Event name.
- * @param {Function} fn Event handler.
- * @return {EventEmitter} Emitter instance.
- */
-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
- * @param {string} name Event name.
- * @param {Function} fn Event handler.
- * @return {EventEmitter} Emitter instance.
- */
-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;
-};
-
-/**
- * Remove a listener.
- *
- * @api public
- * @param {string} name Event name.
- * @param {Function} fn Event handler.
- * @return {EventEmitter} Emitter instance.
- */
-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;
-};
-
-/**
- * Remove all listeners for an event.
- *
- * @api public
- * @param {string} name Event name.
- * @return {EventEmitter} Emitter instance.
- */
-EventEmitter.prototype.removeAllListeners = function (name) {
- if (name === undefined) {
- this.$events = {};
- return this;
- }
-
- if (this.$events && this.$events[name]) {
- this.$events[name] = null;
- }
-
- return this;
-};
-
-/**
- * Get all listeners for a given event.
- *
- * @api public
- * @param {string} name Event name.
- * @return {EventEmitter} Emitter instance.
- */
-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];
-};
-
-/**
- * Emit an event.
- *
- * @api public
- * @param {string} name Event name.
- * @return {boolean} true if at least one handler was invoked, else false.
- */
-EventEmitter.prototype.emit = function (name) {
- if (!this.$events) {
- return false;
- }
-
- var handler = this.$events[name];
-
- if (!handler) {
- return false;
- }
-
- var args = Array.prototype.slice.call(arguments, 1);
-
- if (typeof handler === 'function') {
- 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;
-};
diff --git a/tests/lib/mocha-3.1.2/lib/browser/progress.js b/tests/lib/mocha-3.1.2/lib/browser/progress.js
deleted file mode 100644
index 2b23656b99..0000000000
--- a/tests/lib/mocha-3.1.2/lib/browser/progress.js
+++ /dev/null
@@ -1,119 +0,0 @@
-'use strict';
-
-/**
- * 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 `size`.
- *
- * @api public
- * @param {number} size
- * @return {Progress} Progress instance.
- */
-Progress.prototype.size = function (size) {
- this._size = size;
- return this;
-};
-
-/**
- * Set text to `text`.
- *
- * @api public
- * @param {string} text
- * @return {Progress} Progress instance.
- */
-Progress.prototype.text = function (text) {
- this._text = text;
- return this;
-};
-
-/**
- * Set font size to `size`.
- *
- * @api public
- * @param {number} size
- * @return {Progress} Progress instance.
- */
-Progress.prototype.fontSize = function (size) {
- this._fontSize = size;
- return this;
-};
-
-/**
- * Set font to `family`.
- *
- * @param {string} family
- * @return {Progress} Progress instance.
- */
-Progress.prototype.font = function (family) {
- this._font = family;
- return this;
-};
-
-/**
- * Update percentage to `n`.
- *
- * @param {number} n
- * @return {Progress} Progress instance.
- */
-Progress.prototype.update = function (n) {
- this.percent = n;
- return this;
-};
-
-/**
- * Draw on `ctx`.
- *
- * @param {CanvasRenderingContext2d} ctx
- * @return {Progress} Progress instance.
- */
-Progress.prototype.draw = function (ctx) {
- try {
- var percent = Math.min(this.percent, 100);
- var size = this._size;
- var half = size / 2;
- var x = half;
- var y = half;
- var rad = half - 1;
- var 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) + '%';
- var w = ctx.measureText(text).width;
-
- ctx.fillText(text, x - w / 2 + 1, y + fontSize / 2 - 1);
- } catch (err) {
- // don't fail if we can't render progress
- }
- return this;
-};
diff --git a/tests/lib/mocha-3.1.2/lib/browser/tty.js b/tests/lib/mocha-3.1.2/lib/browser/tty.js
deleted file mode 100644
index c77f7e99a6..0000000000
--- a/tests/lib/mocha-3.1.2/lib/browser/tty.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-
-exports.isatty = function isatty () {
- return true;
-};
-
-exports.getWindowSize = function getWindowSize () {
- if ('innerHeight' in global) {
- return [global.innerHeight, global.innerWidth];
- }
- // In a Web Worker, the DOM Window is not available.
- return [640, 480];
-};
diff --git a/tests/lib/mocha-3.1.2/lib/context.js b/tests/lib/mocha-3.1.2/lib/context.js
deleted file mode 100644
index 019fe8891c..0000000000
--- a/tests/lib/mocha-3.1.2/lib/context.js
+++ /dev/null
@@ -1,112 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var JSON = require('json3');
-
-/**
- * Expose `Context`.
- */
-
-module.exports = Context;
-
-/**
- * Initialize a new `Context`.
- *
- * @api private
- */
-function Context () {}
-
-/**
- * Set or get the context `Runnable` to `runnable`.
- *
- * @api private
- * @param {Runnable} runnable
- * @return {Context}
- */
-Context.prototype.runnable = function (runnable) {
- if (!arguments.length) {
- return this._runnable;
- }
- this.test = this._runnable = runnable;
- return this;
-};
-
-/**
- * Set test timeout `ms`.
- *
- * @api private
- * @param {number} ms
- * @return {Context} self
- */
-Context.prototype.timeout = function (ms) {
- if (!arguments.length) {
- return this.runnable().timeout();
- }
- this.runnable().timeout(ms);
- return this;
-};
-
-/**
- * Set test timeout `enabled`.
- *
- * @api private
- * @param {boolean} enabled
- * @return {Context} self
- */
-Context.prototype.enableTimeouts = function (enabled) {
- this.runnable().enableTimeouts(enabled);
- return this;
-};
-
-/**
- * Set test slowness threshold `ms`.
- *
- * @api private
- * @param {number} ms
- * @return {Context} self
- */
-Context.prototype.slow = function (ms) {
- this.runnable().slow(ms);
- return this;
-};
-
-/**
- * Mark a test as skipped.
- *
- * @api private
- * @return {Context} self
- */
-Context.prototype.skip = function () {
- this.runnable().skip();
- return this;
-};
-
-/**
- * Allow a number of retries on failed tests
- *
- * @api private
- * @param {number} n
- * @return {Context} self
- */
-Context.prototype.retries = function (n) {
- if (!arguments.length) {
- return this.runnable().retries();
- }
- this.runnable().retries(n);
- return this;
-};
-
-/**
- * Inspect the context void of `._runnable`.
- *
- * @api private
- * @return {string}
- */
-Context.prototype.inspect = function () {
- return JSON.stringify(this, function (key, val) {
- return key === 'runnable' || key === 'test' ? undefined : val;
- }, 2);
-};
diff --git a/tests/lib/mocha-3.1.2/lib/hook.js b/tests/lib/mocha-3.1.2/lib/hook.js
deleted file mode 100644
index 392a4cfb4d..0000000000
--- a/tests/lib/mocha-3.1.2/lib/hook.js
+++ /dev/null
@@ -1,48 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Runnable = require('./runnable');
-var inherits = require('./utils').inherits;
-
-/**
- * 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`.
- */
-inherits(Hook, Runnable);
-
-/**
- * Get or set the test `err`.
- *
- * @param {Error} err
- * @return {Error}
- * @api public
- */
-Hook.prototype.error = function (err) {
- if (!arguments.length) {
- err = this._error;
- this._error = null;
- return err;
- }
-
- this._error = err;
-};
diff --git a/tests/lib/mocha-3.1.2/lib/interfaces/bdd.js b/tests/lib/mocha-3.1.2/lib/interfaces/bdd.js
deleted file mode 100644
index 33efc169a2..0000000000
--- a/tests/lib/mocha-3.1.2/lib/interfaces/bdd.js
+++ /dev/null
@@ -1,115 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Test = require('../test');
-
-/**
- * BDD-style interface:
- *
- * describe('Array', function() {
- * describe('#indexOf()', function() {
- * it('should return -1 when not present', function() {
- * // ...
- * });
- *
- * it('should return the index when present', function() {
- * // ...
- * });
- * });
- * });
- *
- * @param {Suite} suite Root suite.
- */
-module.exports = function (suite) {
- var suites = [suite];
-
- suite.on('pre-require', function (context, file, mocha) {
- var common = require('./common')(suites, context, mocha);
-
- context.before = common.before;
- context.after = common.after;
- context.beforeEach = common.beforeEach;
- context.afterEach = common.afterEach;
- context.run = mocha.options.delay && common.runWithSuite(suite);
- /**
- * Describe a "suite" with the given `title`
- * and callback `fn` containing nested suites
- * and/or tests.
- */
-
- context.describe = context.context = function (title, fn) {
- return common.suite.create({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Pending describe.
- */
-
- context.xdescribe = context.xcontext = context.describe.skip = function (title, fn) {
- return common.suite.skip({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Exclusive suite.
- */
-
- context.describe.only = function (title, fn) {
- return common.suite.only({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Describe a specification or test-case
- * with the given `title` and callback `fn`
- * acting as a thunk.
- */
-
- context.it = context.specify = function (title, fn) {
- var suite = suites[0];
- if (suite.isPending()) {
- fn = null;
- }
- var test = new Test(title, fn);
- test.file = file;
- suite.addTest(test);
- return test;
- };
-
- /**
- * Exclusive test-case.
- */
-
- context.it.only = function (title, fn) {
- return common.test.only(mocha, context.it(title, fn));
- };
-
- /**
- * Pending test case.
- */
-
- context.xit = context.xspecify = context.it.skip = function (title) {
- context.it(title);
- };
-
- /**
- * Number of attempts to retry.
- */
- context.it.retries = function (n) {
- context.retries(n);
- };
- });
-};
diff --git a/tests/lib/mocha-3.1.2/lib/interfaces/common.js b/tests/lib/mocha-3.1.2/lib/interfaces/common.js
deleted file mode 100644
index aec6b0d29a..0000000000
--- a/tests/lib/mocha-3.1.2/lib/interfaces/common.js
+++ /dev/null
@@ -1,158 +0,0 @@
-'use strict';
-
-var Suite = require('../suite');
-
-/**
- * Functions common to more than one interface.
- *
- * @param {Suite[]} suites
- * @param {Context} context
- * @param {Mocha} mocha
- * @return {Object} An object containing common functions.
- */
-module.exports = function (suites, context, mocha) {
- return {
- /**
- * This is only present if flag --delay is passed into Mocha. It triggers
- * root suite execution.
- *
- * @param {Suite} suite The root wuite.
- * @return {Function} A function which runs the root suite
- */
- runWithSuite: function runWithSuite (suite) {
- return function run () {
- suite.run();
- };
- },
-
- /**
- * Execute before running tests.
- *
- * @param {string} name
- * @param {Function} fn
- */
- before: function (name, fn) {
- suites[0].beforeAll(name, fn);
- },
-
- /**
- * Execute after running tests.
- *
- * @param {string} name
- * @param {Function} fn
- */
- after: function (name, fn) {
- suites[0].afterAll(name, fn);
- },
-
- /**
- * Execute before each test case.
- *
- * @param {string} name
- * @param {Function} fn
- */
- beforeEach: function (name, fn) {
- suites[0].beforeEach(name, fn);
- },
-
- /**
- * Execute after each test case.
- *
- * @param {string} name
- * @param {Function} fn
- */
- afterEach: function (name, fn) {
- suites[0].afterEach(name, fn);
- },
-
- suite: {
- /**
- * Create an exclusive Suite; convenience function
- * See docstring for create() below.
- *
- * @param {Object} opts
- * @returns {Suite}
- */
- only: function only (opts) {
- mocha.options.hasOnly = true;
- opts.isOnly = true;
- return this.create(opts);
- },
-
- /**
- * Create a Suite, but skip it; convenience function
- * See docstring for create() below.
- *
- * @param {Object} opts
- * @returns {Suite}
- */
- skip: function skip (opts) {
- opts.pending = true;
- return this.create(opts);
- },
-
- /**
- * Creates a suite.
- * @param {Object} opts Options
- * @param {string} opts.title Title of Suite
- * @param {Function} [opts.fn] Suite Function (not always applicable)
- * @param {boolean} [opts.pending] Is Suite pending?
- * @param {string} [opts.file] Filepath where this Suite resides
- * @param {boolean} [opts.isOnly] Is Suite exclusive?
- * @returns {Suite}
- */
- create: function create (opts) {
- var suite = Suite.create(suites[0], opts.title);
- suite.pending = Boolean(opts.pending);
- suite.file = opts.file;
- suites.unshift(suite);
- if (opts.isOnly) {
- suite.parent._onlySuites = suite.parent._onlySuites.concat(suite);
- mocha.options.hasOnly = true;
- }
- if (typeof opts.fn === 'function') {
- opts.fn.call(suite);
- suites.shift();
- } else if (typeof opts.fn === 'undefined' && !suite.pending) {
- throw new Error('Suite "' + suite.fullTitle() + '" was defined but no callback was supplied. Supply a callback or explicitly skip the suite.');
- }
-
- return suite;
- }
- },
-
- test: {
-
- /**
- * Exclusive test-case.
- *
- * @param {Object} mocha
- * @param {Function} test
- * @returns {*}
- */
- only: function (mocha, test) {
- test.parent._onlyTests = test.parent._onlyTests.concat(test);
- mocha.options.hasOnly = true;
- return test;
- },
-
- /**
- * Pending test case.
- *
- * @param {string} title
- */
- skip: function (title) {
- context.test(title);
- },
-
- /**
- * Number of retry attempts
- *
- * @param {number} n
- */
- retries: function (n) {
- context.retries(n);
- }
- }
- };
-};
diff --git a/tests/lib/mocha-3.1.2/lib/interfaces/exports.js b/tests/lib/mocha-3.1.2/lib/interfaces/exports.js
deleted file mode 100644
index debfaee3b8..0000000000
--- a/tests/lib/mocha-3.1.2/lib/interfaces/exports.js
+++ /dev/null
@@ -1,63 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Suite = require('../suite');
-var Test = require('../test');
-
-/**
- * Exports-style (as Node.js module) interface:
- *
- * exports.Array = {
- * '#indexOf()': {
- * 'should return -1 when the value is not present': function() {
- *
- * },
- *
- * 'should return the correct index when the value is present': function() {
- *
- * }
- * }
- * };
- *
- * @param {Suite} suite Root suite.
- */
-module.exports = function (suite) {
- var suites = [suite];
-
- suite.on('require', visit);
-
- function visit (obj, file) {
- var suite;
- for (var key in obj) {
- if (typeof obj[key] === 'function') {
- var fn = obj[key];
- switch (key) {
- case 'before':
- suites[0].beforeAll(fn);
- break;
- case 'after':
- suites[0].afterAll(fn);
- break;
- case 'beforeEach':
- suites[0].beforeEach(fn);
- break;
- case 'afterEach':
- suites[0].afterEach(fn);
- break;
- default:
- var test = new Test(key, fn);
- test.file = file;
- suites[0].addTest(test);
- }
- } else {
- suite = Suite.create(suites[0], key);
- suites.unshift(suite);
- visit(obj[key], file);
- suites.shift();
- }
- }
- }
-};
diff --git a/tests/lib/mocha-3.1.2/lib/interfaces/index.js b/tests/lib/mocha-3.1.2/lib/interfaces/index.js
deleted file mode 100644
index 0bd810abb7..0000000000
--- a/tests/lib/mocha-3.1.2/lib/interfaces/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-
-exports.bdd = require('./bdd');
-exports.tdd = require('./tdd');
-exports.qunit = require('./qunit');
-exports.exports = require('./exports');
diff --git a/tests/lib/mocha-3.1.2/lib/interfaces/qunit.js b/tests/lib/mocha-3.1.2/lib/interfaces/qunit.js
deleted file mode 100644
index 44491db926..0000000000
--- a/tests/lib/mocha-3.1.2/lib/interfaces/qunit.js
+++ /dev/null
@@ -1,99 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Test = require('../test');
-
-/**
- * QUnit-style interface:
- *
- * suite('Array');
- *
- * test('#length', function() {
- * var arr = [1,2,3];
- * ok(arr.length == 3);
- * });
- *
- * test('#indexOf()', function() {
- * var arr = [1,2,3];
- * ok(arr.indexOf(1) == 0);
- * ok(arr.indexOf(2) == 1);
- * ok(arr.indexOf(3) == 2);
- * });
- *
- * suite('String');
- *
- * test('#length', function() {
- * ok('foo'.length == 3);
- * });
- *
- * @param {Suite} suite Root suite.
- */
-module.exports = function (suite) {
- var suites = [suite];
-
- suite.on('pre-require', function (context, file, mocha) {
- var common = require('./common')(suites, context, mocha);
-
- context.before = common.before;
- context.after = common.after;
- context.beforeEach = common.beforeEach;
- context.afterEach = common.afterEach;
- context.run = mocha.options.delay && common.runWithSuite(suite);
- /**
- * Describe a "suite" with the given `title`.
- */
-
- context.suite = function (title) {
- if (suites.length > 1) {
- suites.shift();
- }
- return common.suite.create({
- title: title,
- file: file,
- fn: false
- });
- };
-
- /**
- * Exclusive Suite.
- */
-
- context.suite.only = function (title) {
- if (suites.length > 1) {
- suites.shift();
- }
- return common.suite.only({
- title: title,
- file: file,
- fn: false
- });
- };
-
- /**
- * Describe a specification or test-case
- * with the given `title` and callback `fn`
- * acting as a thunk.
- */
-
- context.test = function (title, fn) {
- var test = new Test(title, fn);
- test.file = file;
- suites[0].addTest(test);
- return test;
- };
-
- /**
- * Exclusive test-case.
- */
-
- context.test.only = function (title, fn) {
- return common.test.only(mocha, context.test(title, fn));
- };
-
- context.test.skip = common.test.skip;
- context.test.retries = common.test.retries;
- });
-};
diff --git a/tests/lib/mocha-3.1.2/lib/interfaces/tdd.js b/tests/lib/mocha-3.1.2/lib/interfaces/tdd.js
deleted file mode 100644
index 253e221575..0000000000
--- a/tests/lib/mocha-3.1.2/lib/interfaces/tdd.js
+++ /dev/null
@@ -1,106 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Test = require('../test');
-
-/**
- * TDD-style interface:
- *
- * suite('Array', function() {
- * suite('#indexOf()', function() {
- * suiteSetup(function() {
- *
- * });
- *
- * test('should return -1 when not present', function() {
- *
- * });
- *
- * test('should return the index when present', function() {
- *
- * });
- *
- * suiteTeardown(function() {
- *
- * });
- * });
- * });
- *
- * @param {Suite} suite Root suite.
- */
-module.exports = function (suite) {
- var suites = [suite];
-
- suite.on('pre-require', function (context, file, mocha) {
- var common = require('./common')(suites, context, mocha);
-
- context.setup = common.beforeEach;
- context.teardown = common.afterEach;
- context.suiteSetup = common.before;
- context.suiteTeardown = common.after;
- context.run = mocha.options.delay && common.runWithSuite(suite);
-
- /**
- * Describe a "suite" with the given `title` and callback `fn` containing
- * nested suites and/or tests.
- */
- context.suite = function (title, fn) {
- return common.suite.create({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Pending suite.
- */
- context.suite.skip = function (title, fn) {
- return common.suite.skip({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Exclusive test-case.
- */
- context.suite.only = function (title, fn) {
- return common.suite.only({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Describe a specification or test-case with the given `title` and
- * callback `fn` acting as a thunk.
- */
- context.test = function (title, fn) {
- var suite = suites[0];
- if (suite.isPending()) {
- fn = null;
- }
- var test = new Test(title, fn);
- test.file = file;
- suite.addTest(test);
- return test;
- };
-
- /**
- * Exclusive test-case.
- */
-
- context.test.only = function (title, fn) {
- return common.test.only(mocha, context.test(title, fn));
- };
-
- context.test.skip = common.test.skip;
- context.test.retries = common.test.retries;
- });
-};
diff --git a/tests/lib/mocha-3.1.2/lib/mocha.js b/tests/lib/mocha-3.1.2/lib/mocha.js
deleted file mode 100644
index dcc1492f5a..0000000000
--- a/tests/lib/mocha-3.1.2/lib/mocha.js
+++ /dev/null
@@ -1,522 +0,0 @@
-'use strict';
-
-/*!
- * mocha
- * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
- * MIT Licensed
- */
-
-/**
- * Module dependencies.
- */
-
-var escapeRe = require('escape-string-regexp');
-var path = require('path');
-var reporters = require('./reporters');
-var utils = require('./utils');
-
-/**
- * Expose `Mocha`.
- */
-
-exports = module.exports = Mocha;
-
-/**
- * To require local UIs and reporters when running in node.
- */
-
-if (!process.browser) {
- var cwd = process.cwd();
- module.paths.push(cwd, path.join(cwd, 'node_modules'));
-}
-
-/**
- * Expose internals.
- */
-
-exports.utils = utils;
-exports.interfaces = require('./interfaces');
-exports.reporters = reporters;
-exports.Runnable = require('./runnable');
-exports.Context = require('./context');
-exports.Runner = require('./runner');
-exports.Suite = require('./suite');
-exports.Hook = require('./hook');
-exports.Test = require('./test');
-
-/**
- * Return image `name` path.
- *
- * @api private
- * @param {string} name
- * @return {string}
- */
-function image (name) {
- return path.join(__dirname, '../images', name + '.png');
-}
-
-/**
- * Set up mocha with `options`.
- *
- * Options:
- *
- * - `ui` name "bdd", "tdd", "exports" etc
- * - `reporter` reporter instance, defaults to `mocha.reporters.spec`
- * - `globals` array of accepted globals
- * - `timeout` timeout in milliseconds
- * - `retries` number of times to retry failed tests
- * - `bail` bail on the first test failure
- * - `slow` milliseconds to wait before considering a test slow
- * - `ignoreLeaks` ignore global leaks
- * - `fullTrace` display the full stack-trace on failing
- * - `grep` string or regexp to filter tests with
- *
- * @param {Object} options
- * @api public
- */
-function Mocha (options) {
- options = options || {};
- this.files = [];
- this.options = options;
- if (options.grep) {
- this.grep(new RegExp(options.grep));
- }
- if (options.fgrep) {
- this.fgrep(options.fgrep);
- }
- this.suite = new exports.Suite('', new exports.Context());
- this.ui(options.ui);
- this.bail(options.bail);
- this.reporter(options.reporter, options.reporterOptions);
- if (typeof options.timeout !== 'undefined' && options.timeout !== null) {
- this.timeout(options.timeout);
- }
- if (typeof options.retries !== 'undefined' && options.retries !== null) {
- this.retries(options.retries);
- }
- this.useColors(options.useColors);
- if (options.enableTimeouts !== null) {
- this.enableTimeouts(options.enableTimeouts);
- }
- if (options.slow) {
- this.slow(options.slow);
- }
-}
-
-/**
- * Enable or disable bailing on the first failure.
- *
- * @api public
- * @param {boolean} [bail]
- */
-Mocha.prototype.bail = function (bail) {
- if (!arguments.length) {
- bail = true;
- }
- this.suite.bail(bail);
- return this;
-};
-
-/**
- * Add test `file`.
- *
- * @api public
- * @param {string} file
- */
-Mocha.prototype.addFile = function (file) {
- this.files.push(file);
- return this;
-};
-
-/**
- * Set reporter to `reporter`, defaults to "spec".
- *
- * @param {String|Function} reporter name or constructor
- * @param {Object} reporterOptions optional options
- * @api public
- * @param {string|Function} reporter name or constructor
- * @param {Object} reporterOptions optional options
- */
-Mocha.prototype.reporter = function (reporter, reporterOptions) {
- if (typeof reporter === 'function') {
- this._reporter = reporter;
- } else {
- reporter = reporter || 'spec';
- var _reporter;
- // Try to load a built-in reporter.
- if (reporters[reporter]) {
- _reporter = reporters[reporter];
- }
- // Try to load reporters from process.cwd() and node_modules
- if (!_reporter) {
- try {
- _reporter = require(reporter);
- } catch (err) {
- err.message.indexOf('Cannot find module') !== -1
- ? console.warn('"' + reporter + '" reporter not found')
- : console.warn('"' + reporter + '" reporter blew up with error:\n' + err.stack);
- }
- }
- if (!_reporter && reporter === 'teamcity') {
- console.warn('The Teamcity reporter was moved to a package named ' +
- 'mocha-teamcity-reporter ' +
- '(https://npmjs.org/package/mocha-teamcity-reporter).');
- }
- if (!_reporter) {
- throw new Error('invalid reporter "' + reporter + '"');
- }
- this._reporter = _reporter;
- }
- this.options.reporterOptions = reporterOptions;
- return this;
-};
-
-/**
- * Set test UI `name`, defaults to "bdd".
- *
- * @api public
- * @param {string} bdd
- */
-Mocha.prototype.ui = function (name) {
- name = name || 'bdd';
- this._ui = exports.interfaces[name];
- if (!this._ui) {
- try {
- this._ui = require(name);
- } catch (err) {
- throw new Error('invalid interface "' + name + '"');
- }
- }
- this._ui = this._ui(this.suite);
-
- this.suite.on('pre-require', function (context) {
- exports.afterEach = context.afterEach || context.teardown;
- exports.after = context.after || context.suiteTeardown;
- exports.beforeEach = context.beforeEach || context.setup;
- exports.before = context.before || context.suiteSetup;
- exports.describe = context.describe || context.suite;
- exports.it = context.it || context.test;
- exports.setup = context.setup || context.beforeEach;
- exports.suiteSetup = context.suiteSetup || context.before;
- exports.suiteTeardown = context.suiteTeardown || context.after;
- exports.suite = context.suite || context.describe;
- exports.teardown = context.teardown || context.afterEach;
- exports.test = context.test || context.it;
- exports.run = context.run;
- });
-
- return this;
-};
-
-/**
- * Load registered files.
- *
- * @api private
- */
-Mocha.prototype.loadFiles = function (fn) {
- var self = this;
- var suite = this.suite;
- this.files.forEach(function (file) {
- file = path.resolve(file);
- suite.emit('pre-require', global, file, self);
- suite.emit('require', require(file), file, self);
- suite.emit('post-require', global, file, self);
- });
- fn && fn();
-};
-
-/**
- * Enable growl support.
- *
- * @api private
- */
-Mocha.prototype._growl = function (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: image('error') });
- } else {
- notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', {
- name: 'mocha',
- title: 'Passed',
- image: image('ok')
- });
- }
- });
-};
-
-/**
- * Escape string and add it to grep as a regexp.
- *
- * @api public
- * @param str
- * @returns {Mocha}
- */
-Mocha.prototype.fgrep = function (str) {
- return this.grep(new RegExp(escapeRe(str)));
-};
-
-/**
- * Add regexp to grep, if `re` is a string it is escaped.
- *
- * @param {RegExp|String} re
- * @return {Mocha}
- * @api public
- * @param {RegExp|string} re
- * @return {Mocha}
- */
-Mocha.prototype.grep = function (re) {
- if (utils.isString(re)) {
- // extract args if it's regex-like, i.e: [string, pattern, flag]
- var arg = re.match(/^\/(.*)\/(g|i|)$|.*/);
- this.options.grep = new RegExp(arg[1] || arg[0], arg[2]);
- } else {
- this.options.grep = re;
- }
- return this;
-};
-/**
- * Invert `.grep()` matches.
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.invert = function () {
- this.options.invert = true;
- return this;
-};
-
-/**
- * Ignore global leaks.
- *
- * @param {Boolean} ignore
- * @return {Mocha}
- * @api public
- * @param {boolean} ignore
- * @return {Mocha}
- */
-Mocha.prototype.ignoreLeaks = function (ignore) {
- this.options.ignoreLeaks = Boolean(ignore);
- return this;
-};
-
-/**
- * Enable global leak checking.
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.checkLeaks = function () {
- this.options.ignoreLeaks = false;
- return this;
-};
-
-/**
- * Display long stack-trace on failing
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.fullTrace = function () {
- this.options.fullStackTrace = true;
- return this;
-};
-
-/**
- * Enable growl support.
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.growl = function () {
- this.options.growl = true;
- return this;
-};
-
-/**
- * Ignore `globals` array or string.
- *
- * @param {Array|String} globals
- * @return {Mocha}
- * @api public
- * @param {Array|string} globals
- * @return {Mocha}
- */
-Mocha.prototype.globals = function (globals) {
- this.options.globals = (this.options.globals || []).concat(globals);
- return this;
-};
-
-/**
- * Emit color output.
- *
- * @param {Boolean} colors
- * @return {Mocha}
- * @api public
- * @param {boolean} colors
- * @return {Mocha}
- */
-Mocha.prototype.useColors = function (colors) {
- if (colors !== undefined) {
- this.options.useColors = colors;
- }
- return this;
-};
-
-/**
- * Use inline diffs rather than +/-.
- *
- * @param {Boolean} inlineDiffs
- * @return {Mocha}
- * @api public
- * @param {boolean} inlineDiffs
- * @return {Mocha}
- */
-Mocha.prototype.useInlineDiffs = function (inlineDiffs) {
- this.options.useInlineDiffs = inlineDiffs !== undefined && inlineDiffs;
- return this;
-};
-
-/**
- * Set the timeout in milliseconds.
- *
- * @param {Number} timeout
- * @return {Mocha}
- * @api public
- * @param {number} timeout
- * @return {Mocha}
- */
-Mocha.prototype.timeout = function (timeout) {
- this.suite.timeout(timeout);
- return this;
-};
-
-/**
- * Set the number of times to retry failed tests.
- *
- * @param {Number} retry times
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.retries = function (n) {
- this.suite.retries(n);
- return this;
-};
-
-/**
- * Set slowness threshold in milliseconds.
- *
- * @param {Number} slow
- * @return {Mocha}
- * @api public
- * @param {number} slow
- * @return {Mocha}
- */
-Mocha.prototype.slow = function (slow) {
- this.suite.slow(slow);
- return this;
-};
-
-/**
- * Enable timeouts.
- *
- * @param {Boolean} enabled
- * @return {Mocha}
- * @api public
- * @param {boolean} enabled
- * @return {Mocha}
- */
-Mocha.prototype.enableTimeouts = function (enabled) {
- this.suite.enableTimeouts(arguments.length && enabled !== undefined ? enabled : true);
- return this;
-};
-
-/**
- * Makes all tests async (accepting a callback)
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.asyncOnly = function () {
- this.options.asyncOnly = true;
- return this;
-};
-
-/**
- * Disable syntax highlighting (in browser).
- *
- * @api public
- */
-Mocha.prototype.noHighlighting = function () {
- this.options.noHighlighting = true;
- return this;
-};
-
-/**
- * Enable uncaught errors to propagate (in browser).
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.allowUncaught = function () {
- this.options.allowUncaught = true;
- return this;
-};
-
-/**
- * Delay root suite execution.
- * @returns {Mocha}
- */
-Mocha.prototype.delay = function delay () {
- this.options.delay = true;
- return this;
-};
-
-/**
- * Run tests and invoke `fn()` when complete.
- *
- * @api public
- * @param {Function} fn
- * @return {Runner}
- */
-Mocha.prototype.run = function (fn) {
- if (this.files.length) {
- this.loadFiles();
- }
- var suite = this.suite;
- var options = this.options;
- options.files = this.files;
- var runner = new exports.Runner(suite, options.delay);
- var reporter = new this._reporter(runner, options);
- runner.ignoreLeaks = options.ignoreLeaks !== false;
- runner.fullStackTrace = options.fullStackTrace;
- runner.hasOnly = options.hasOnly;
- runner.asyncOnly = options.asyncOnly;
- runner.allowUncaught = options.allowUncaught;
- if (options.grep) {
- runner.grep(options.grep, options.invert);
- }
- if (options.globals) {
- runner.globals(options.globals);
- }
- if (options.growl) {
- this._growl(runner, reporter);
- }
- if (options.useColors !== undefined) {
- exports.reporters.Base.useColors = options.useColors;
- }
- exports.reporters.Base.inlineDiffs = options.useInlineDiffs;
-
- function done (failures) {
- if (reporter.done) {
- reporter.done(failures, fn);
- } else {
- fn && fn(failures);
- }
- }
-
- return runner.run(done);
-};
diff --git a/tests/lib/mocha-3.1.2/lib/ms.js b/tests/lib/mocha-3.1.2/lib/ms.js
deleted file mode 100644
index 9590856052..0000000000
--- a/tests/lib/mocha-3.1.2/lib/ms.js
+++ /dev/null
@@ -1,130 +0,0 @@
-'use strict';
-
-/**
- * Helpers.
- */
-
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var y = d * 365.25;
-
-/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @api public
- * @param {string|number} val
- * @param {Object} options
- * @return {string|number}
- */
-module.exports = function (val, options) {
- options = options || {};
- if (typeof val === 'string') {
- return parse(val);
- }
- // https://github.com/mochajs/mocha/pull/1035
- return options['long'] ? longFormat(val) : shortFormat(val);
-};
-
-/**
- * Parse the given `str` and return milliseconds.
- *
- * @api private
- * @param {string} str
- * @return {number}
- */
-function parse (str) {
- var match = (/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i).exec(str);
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'y':
- return n * y;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 's':
- return n * s;
- case 'ms':
- return n;
- default:
- // No default case
- }
-}
-
-/**
- * Short format for `ms`.
- *
- * @api private
- * @param {number} ms
- * @return {string}
- */
-function shortFormat (ms) {
- if (ms >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (ms >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (ms >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (ms >= s) {
- return Math.round(ms / s) + 's';
- }
- return ms + 'ms';
-}
-
-/**
- * Long format for `ms`.
- *
- * @api private
- * @param {number} ms
- * @return {string}
- */
-function longFormat (ms) {
- return plural(ms, d, 'day') ||
- plural(ms, h, 'hour') ||
- plural(ms, m, 'minute') ||
- plural(ms, s, 'second') ||
- ms + ' ms';
-}
-
-/**
- * Pluralization helper.
- *
- * @api private
- * @param {number} ms
- * @param {number} n
- * @param {string} name
- */
-function plural (ms, n, name) {
- if (ms < n) {
- return;
- }
- if (ms < n * 1.5) {
- return Math.floor(ms / n) + ' ' + name;
- }
- return Math.ceil(ms / n) + ' ' + name + 's';
-}
diff --git a/tests/lib/mocha-3.1.2/lib/pending.js b/tests/lib/mocha-3.1.2/lib/pending.js
deleted file mode 100644
index c780104610..0000000000
--- a/tests/lib/mocha-3.1.2/lib/pending.js
+++ /dev/null
@@ -1,16 +0,0 @@
-'use strict';
-
-/**
- * Expose `Pending`.
- */
-
-module.exports = Pending;
-
-/**
- * Initialize a new `Pending` error with the given message.
- *
- * @param {string} message
- */
-function Pending (message) {
- this.message = message;
-}
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/base.js b/tests/lib/mocha-3.1.2/lib/reporters/base.js
deleted file mode 100644
index 205488426a..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/base.js
+++ /dev/null
@@ -1,491 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var tty = require('tty');
-var diff = require('diff');
-var ms = require('../ms');
-var utils = require('../utils');
-var supportsColor = process.browser ? null : require('supports-color');
-
-/**
- * Expose `Base`.
- */
-
-exports = module.exports = Base;
-
-/**
- * Save timer references to avoid Sinon interfering.
- * See: https://github.com/mochajs/mocha/issues/237
- */
-
-/* eslint-disable no-unused-vars, no-native-reassign */
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-/* eslint-enable no-unused-vars, no-native-reassign */
-
-/**
- * Check if both stdio streams are associated with a tty.
- */
-
-var isatty = tty.isatty(1) && tty.isatty(2);
-
-/**
- * Enable coloring by default, except in the browser interface.
- */
-
-exports.useColors = !process.browser && (supportsColor || (process.env.MOCHA_COLORS !== undefined));
-
-/**
- * Inline diffs instead of +/-
- */
-
-exports.inlineDiffs = false;
-
-/**
- * Default color map.
- */
-
-exports.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': 32,
- 'diff removed': 31
-};
-
-/**
- * Default symbol map.
- */
-
-exports.symbols = {
- ok: '✓',
- err: '✖',
- dot: '․',
- comma: ',',
- bang: '!'
-};
-
-// With node.js on Windows: use symbols available in terminal default fonts
-if (process.platform === 'win32') {
- exports.symbols.ok = '\u221A';
- exports.symbols.err = '\u00D7';
- exports.symbols.dot = '.';
-}
-
-/**
- * Color `str` with the given `type`,
- * allowing colors to be disabled,
- * as well as user-defined color
- * schemes.
- *
- * @param {string} type
- * @param {string} str
- * @return {string}
- * @api private
- */
-var color = exports.color = function (type, str) {
- if (!exports.useColors) {
- return String(str);
- }
- return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m';
-};
-
-/**
- * Expose term window size, with some defaults for when stderr is not a tty.
- */
-
-exports.window = {
- width: 75
-};
-
-if (isatty) {
- exports.window.width = process.stdout.getWindowSize
- ? process.stdout.getWindowSize(1)[0]
- : tty.getWindowSize()[1];
-}
-
-/**
- * Expose some basic cursor interactions that are common among reporters.
- */
-
-exports.cursor = {
- hide: function () {
- isatty && process.stdout.write('\u001b[?25l');
- },
-
- show: function () {
- isatty && process.stdout.write('\u001b[?25h');
- },
-
- deleteLine: function () {
- isatty && process.stdout.write('\u001b[2K');
- },
-
- beginningOfLine: function () {
- isatty && process.stdout.write('\u001b[0G');
- },
-
- CR: function () {
- if (isatty) {
- exports.cursor.deleteLine();
- exports.cursor.beginningOfLine();
- } else {
- process.stdout.write('\r');
- }
- }
-};
-
-/**
- * Outut the given `failures` as a list.
- *
- * @param {Array} failures
- * @api public
- */
-
-exports.list = function (failures) {
- console.log();
- failures.forEach(function (test, i) {
- // format
- var fmt = color('error title', ' %s) %s:\n') +
- color('error message', ' %s') +
- color('error stack', '\n%s\n');
-
- // msg
- var msg;
- var err = test.err;
- var message;
- if (err.message && typeof err.message.toString === 'function') {
- message = err.message + '';
- } else if (typeof err.inspect === 'function') {
- message = err.inspect() + '';
- } else {
- message = '';
- }
- var stack = err.stack || message;
- var index = message ? stack.indexOf(message) : -1;
- var actual = err.actual;
- var expected = err.expected;
- var escape = true;
-
- if (index === -1) {
- msg = message;
- } else {
- index += message.length;
- msg = stack.slice(0, index);
- // remove msg from stack
- stack = stack.slice(index + 1);
- }
-
- // uncaught
- if (err.uncaught) {
- msg = 'Uncaught ' + msg;
- }
- // explicitly show diff
- if (err.showDiff !== false && sameType(actual, expected) && expected !== undefined) {
- escape = false;
- if (!(utils.isString(actual) && utils.isString(expected))) {
- err.actual = actual = utils.stringify(actual);
- err.expected = expected = utils.stringify(expected);
- }
-
- fmt = color('error title', ' %s) %s:\n%s') + color('error stack', '\n%s\n');
- var match = message.match(/^([^:]+): expected/);
- msg = '\n ' + color('error message', match ? match[1] : msg);
-
- if (exports.inlineDiffs) {
- msg += inlineDiff(err, escape);
- } else {
- msg += unifiedDiff(err, escape);
- }
- }
-
- // indent stack trace
- stack = stack.replace(/^/gm, ' ');
-
- console.log(fmt, (i + 1), test.fullTitle(), msg, stack);
- });
-};
-
-/**
- * Initialize a new `Base` reporter.
- *
- * All other reporters generally
- * inherit from this reporter, providing
- * stats such as test duration, number
- * of tests passed / failed etc.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function Base (runner) {
- var stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 };
- var failures = this.failures = [];
-
- if (!runner) {
- return;
- }
- this.runner = runner;
-
- runner.stats = stats;
-
- runner.on('start', function () {
- stats.start = new Date();
- });
-
- runner.on('suite', function (suite) {
- stats.suites = stats.suites || 0;
- suite.root || stats.suites++;
- });
-
- runner.on('test end', function () {
- stats.tests = stats.tests || 0;
- stats.tests++;
- });
-
- runner.on('pass', function (test) {
- stats.passes = stats.passes || 0;
-
- if (test.duration > test.slow()) {
- test.speed = 'slow';
- } else if (test.duration > test.slow() / 2) {
- test.speed = 'medium';
- } else {
- test.speed = 'fast';
- }
-
- stats.passes++;
- });
-
- runner.on('fail', function (test, err) {
- stats.failures = stats.failures || 0;
- stats.failures++;
- test.err = err;
- failures.push(test);
- });
-
- runner.on('end', function () {
- stats.end = new Date();
- stats.duration = new Date() - stats.start;
- });
-
- runner.on('pending', function () {
- stats.pending++;
- });
-}
-
-/**
- * Output common epilogue used by many of
- * the bundled reporters.
- *
- * @api public
- */
-Base.prototype.epilogue = function () {
- var stats = this.stats;
- var fmt;
-
- console.log();
-
- // passes
- fmt = color('bright pass', ' ') +
- color('green', ' %d passing') +
- color('light', ' (%s)');
-
- console.log(fmt,
- stats.passes || 0,
- ms(stats.duration));
-
- // pending
- if (stats.pending) {
- fmt = color('pending', ' ') +
- color('pending', ' %d pending');
-
- console.log(fmt, stats.pending);
- }
-
- // failures
- if (stats.failures) {
- fmt = color('fail', ' %d failing');
-
- console.log(fmt, stats.failures);
-
- Base.list(this.failures);
- console.log();
- }
-
- console.log();
-};
-
-/**
- * Pad the given `str` to `len`.
- *
- * @api private
- * @param {string} str
- * @param {string} len
- * @return {string}
- */
-function pad (str, len) {
- str = String(str);
- return Array(len - str.length + 1).join(' ') + str;
-}
-
-/**
- * Returns an inline diff between 2 strings with coloured ANSI output
- *
- * @api private
- * @param {Error} err with actual/expected
- * @param {boolean} escape
- * @return {string} Diff
- */
-function inlineDiff (err, escape) {
- var msg = errorDiff(err, 'WordsWithSpace', escape);
-
- // linenos
- var lines = msg.split('\n');
- if (lines.length > 4) {
- var width = String(lines.length).length;
- msg = lines.map(function (str, i) {
- return pad(++i, width) + ' |' + ' ' + str;
- }).join('\n');
- }
-
- // legend
- msg = '\n' +
- color('diff removed', 'actual') +
- ' ' +
- color('diff added', 'expected') +
- '\n\n' +
- msg +
- '\n';
-
- // indent
- msg = msg.replace(/^/gm, ' ');
- return msg;
-}
-
-/**
- * Returns a unified diff between two strings.
- *
- * @api private
- * @param {Error} err with actual/expected
- * @param {boolean} escape
- * @return {string} The diff.
- */
-function unifiedDiff (err, escape) {
- var indent = ' ';
- function cleanUp (line) {
- if (escape) {
- line = escapeInvisibles(line);
- }
- if (line[0] === '+') {
- return indent + colorLines('diff added', line);
- }
- if (line[0] === '-') {
- return indent + colorLines('diff removed', line);
- }
- if (line.match(/@@/)) {
- return null;
- }
- if (line.match(/\\ No newline/)) {
- return null;
- }
- return indent + line;
- }
- function notBlank (line) {
- return typeof line !== 'undefined' && line !== null;
- }
- var msg = diff.createPatch('string', err.actual, err.expected);
- var lines = msg.split('\n').splice(4);
- return '\n ' +
- colorLines('diff added', '+ expected') + ' ' +
- colorLines('diff removed', '- actual') +
- '\n\n' +
- lines.map(cleanUp).filter(notBlank).join('\n');
-}
-
-/**
- * Return a character diff for `err`.
- *
- * @api private
- * @param {Error} err
- * @param {string} type
- * @param {boolean} escape
- * @return {string}
- */
-function errorDiff (err, type, escape) {
- var actual = escape ? escapeInvisibles(err.actual) : err.actual;
- var expected = escape ? escapeInvisibles(err.expected) : err.expected;
- return diff['diff' + type](actual, expected).map(function (str) {
- if (str.added) {
- return colorLines('diff added', str.value);
- }
- if (str.removed) {
- return colorLines('diff removed', str.value);
- }
- return str.value;
- }).join('');
-}
-
-/**
- * Returns a string with all invisible characters in plain text
- *
- * @api private
- * @param {string} line
- * @return {string}
- */
-function escapeInvisibles (line) {
- return line.replace(/\t/g, '<tab>')
- .replace(/\r/g, '<CR>')
- .replace(/\n/g, '<LF>\n');
-}
-
-/**
- * Color lines for `str`, using the color `name`.
- *
- * @api private
- * @param {string} name
- * @param {string} str
- * @return {string}
- */
-function colorLines (name, str) {
- return str.split('\n').map(function (str) {
- return color(name, str);
- }).join('\n');
-}
-
-/**
- * Object#toString reference.
- */
-var objToString = Object.prototype.toString;
-
-/**
- * Check that a / b have the same type.
- *
- * @api private
- * @param {Object} a
- * @param {Object} b
- * @return {boolean}
- */
-function sameType (a, b) {
- return objToString.call(a) === objToString.call(b);
-}
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/doc.js b/tests/lib/mocha-3.1.2/lib/reporters/doc.js
deleted file mode 100644
index aad1d92522..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/doc.js
+++ /dev/null
@@ -1,64 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var utils = require('../utils');
-
-/**
- * Expose `Doc`.
- */
-
-exports = module.exports = Doc;
-
-/**
- * Initialize a new `Doc` reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-function Doc (runner) {
- Base.call(this, runner);
-
- var indents = 2;
-
- function indent () {
- return Array(indents).join(' ');
- }
-
- runner.on('suite', function (suite) {
- if (suite.root) {
- return;
- }
- ++indents;
- console.log('%s<section class="suite">', indent());
- ++indents;
- console.log('%s<h1>%s</h1>', indent(), utils.escape(suite.title));
- console.log('%s<dl>', indent());
- });
-
- runner.on('suite end', function (suite) {
- if (suite.root) {
- return;
- }
- console.log('%s</dl>', indent());
- --indents;
- console.log('%s</section>', indent());
- --indents;
- });
-
- runner.on('pass', function (test) {
- console.log('%s <dt>%s</dt>', indent(), utils.escape(test.title));
- var code = utils.escape(utils.clean(test.body));
- console.log('%s <dd><pre><code>%s</code></pre></dd>', indent(), code);
- });
-
- runner.on('fail', function (test, err) {
- console.log('%s <dt class="error">%s</dt>', indent(), utils.escape(test.title));
- var code = utils.escape(utils.clean(test.body));
- console.log('%s <dd class="error"><pre><code>%s</code></pre></dd>', indent(), code);
- console.log('%s <dd class="error">%s</dd>', indent(), utils.escape(err));
- });
-}
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/dot.js b/tests/lib/mocha-3.1.2/lib/reporters/dot.js
deleted file mode 100644
index 81e106edd0..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/dot.js
+++ /dev/null
@@ -1,68 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-var color = Base.color;
-
-/**
- * Expose `Dot`.
- */
-
-exports = module.exports = Dot;
-
-/**
- * Initialize a new `Dot` matrix test reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function Dot (runner) {
- Base.call(this, runner);
-
- var self = this;
- var width = Base.window.width * 0.75 | 0;
- var n = -1;
-
- runner.on('start', function () {
- process.stdout.write('\n');
- });
-
- runner.on('pending', function () {
- if (++n % width === 0) {
- process.stdout.write('\n ');
- }
- process.stdout.write(color('pending', Base.symbols.comma));
- });
-
- runner.on('pass', function (test) {
- if (++n % width === 0) {
- process.stdout.write('\n ');
- }
- if (test.speed === 'slow') {
- process.stdout.write(color('bright yellow', Base.symbols.dot));
- } else {
- process.stdout.write(color(test.speed, Base.symbols.dot));
- }
- });
-
- runner.on('fail', function () {
- if (++n % width === 0) {
- process.stdout.write('\n ');
- }
- process.stdout.write(color('fail', Base.symbols.bang));
- });
-
- runner.on('end', function () {
- console.log();
- self.epilogue();
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(Dot, Base);
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/html.js b/tests/lib/mocha-3.1.2/lib/reporters/html.js
deleted file mode 100644
index 9b9817c509..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/html.js
+++ /dev/null
@@ -1,346 +0,0 @@
-'use strict';
-
-/* eslint-env browser */
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var utils = require('../utils');
-var Progress = require('../browser/progress');
-var escapeRe = require('escape-string-regexp');
-var escape = utils.escape;
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-/* eslint-disable no-unused-vars, no-native-reassign */
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-/* eslint-enable no-unused-vars, no-native-reassign */
-
-/**
- * Expose `HTML`.
- */
-
-exports = module.exports = HTML;
-
-/**
- * Stats template.
- */
-
-var statsTemplate = '<ul id="mocha-stats">' +
- '<li class="progress"><canvas width="40" height="40"></canvas></li>' +
- '<li class="passes"><a href="javascript:void(0);">passes:</a> <em>0</em></li>' +
- '<li class="failures"><a href="javascript:void(0);">failures:</a> <em>0</em></li>' +
- '<li class="duration">duration: <em>0</em>s</li>' +
- '</ul>';
-
-/**
- * Initialize a new `HTML` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function HTML (runner) {
- Base.call(this, runner);
-
- var self = this;
- var stats = this.stats;
- var stat = fragment(statsTemplate);
- var items = stat.getElementsByTagName('li');
- var passes = items[1].getElementsByTagName('em')[0];
- var passesLink = items[1].getElementsByTagName('a')[0];
- var failures = items[2].getElementsByTagName('em')[0];
- var failuresLink = items[2].getElementsByTagName('a')[0];
- var duration = items[3].getElementsByTagName('em')[0];
- var canvas = stat.getElementsByTagName('canvas')[0];
- var report = fragment('<ul id="mocha-report"></ul>');
- var stack = [report];
- var progress;
- var ctx;
- var root = document.getElementById('mocha');
-
- if (canvas.getContext) {
- var ratio = window.devicePixelRatio || 1;
- canvas.style.width = canvas.width;
- canvas.style.height = canvas.height;
- canvas.width *= ratio;
- canvas.height *= ratio;
- ctx = canvas.getContext('2d');
- ctx.scale(ratio, ratio);
- progress = new Progress();
- }
-
- if (!root) {
- return error('#mocha div missing, add it to your document');
- }
-
- // pass toggle
- on(passesLink, 'click', function (evt) {
- evt.preventDefault();
- unhide();
- var name = (/pass/).test(report.className) ? '' : ' pass';
- report.className = report.className.replace(/fail|pass/g, '') + name;
- if (report.className.trim()) {
- hideSuitesWithout('test pass');
- }
- });
-
- // failure toggle
- on(failuresLink, 'click', function (evt) {
- evt.preventDefault();
- unhide();
- var name = (/fail/).test(report.className) ? '' : ' fail';
- report.className = report.className.replace(/fail|pass/g, '') + name;
- if (report.className.trim()) {
- hideSuitesWithout('test fail');
- }
- });
-
- root.appendChild(stat);
- root.appendChild(report);
-
- if (progress) {
- progress.size(40);
- }
-
- runner.on('suite', function (suite) {
- if (suite.root) {
- return;
- }
-
- // suite
- var url = self.suiteURL(suite);
- var el = fragment('<li class="suite"><h1><a href="%s">%s</a></h1></li>', url, escape(suite.title));
-
- // container
- stack[0].appendChild(el);
- stack.unshift(document.createElement('ul'));
- el.appendChild(stack[0]);
- });
-
- runner.on('suite end', function (suite) {
- if (suite.root) {
- updateStats();
- return;
- }
- stack.shift();
- });
-
- runner.on('pass', function (test) {
- var url = self.testURL(test);
- var markup = '<li class="test pass %e"><h2>%e<span class="duration">%ems</span> ' +
- '<a href="%s" class="replay">‣</a></h2></li>';
- var el = fragment(markup, test.speed, test.title, test.duration, url);
- self.addCodeToggle(el, test.body);
- appendToStack(el);
- updateStats();
- });
-
- runner.on('fail', function (test) {
- var el = fragment('<li class="test fail"><h2>%e <a href="%e" class="replay">‣</a></h2></li>',
- test.title, self.testURL(test));
- var stackString; // Note: Includes leading newline
- var message = test.err.toString();
-
- // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we
- // check for the result of the stringifying.
- if (message === '[object Error]') {
- message = test.err.message;
- }
-
- if (test.err.stack) {
- var indexOfMessage = test.err.stack.indexOf(test.err.message);
- if (indexOfMessage === -1) {
- stackString = test.err.stack;
- } else {
- stackString = test.err.stack.substr(test.err.message.length + indexOfMessage);
- }
- } else if (test.err.sourceURL && test.err.line !== undefined) {
- // Safari doesn't give you a stack. Let's at least provide a source line.
- stackString = '\n(' + test.err.sourceURL + ':' + test.err.line + ')';
- }
-
- stackString = stackString || '';
-
- if (test.err.htmlMessage && stackString) {
- el.appendChild(fragment('<div class="html-error">%s\n<pre class="error">%e</pre></div>',
- test.err.htmlMessage, stackString));
- } else if (test.err.htmlMessage) {
- el.appendChild(fragment('<div class="html-error">%s</div>', test.err.htmlMessage));
- } else {
- el.appendChild(fragment('<pre class="error">%e%e</pre>', message, stackString));
- }
-
- self.addCodeToggle(el, test.body);
- appendToStack(el);
- updateStats();
- });
-
- runner.on('pending', function (test) {
- var el = fragment('<li class="test pass pending"><h2>%e</h2></li>', test.title);
- appendToStack(el);
- updateStats();
- });
-
- function appendToStack (el) {
- // Don't call .appendChild if #mocha-report was already .shift()'ed off the stack.
- if (stack[0]) {
- stack[0].appendChild(el);
- }
- }
-
- function updateStats () {
- // TODO: add to stats
- var percent = stats.tests / runner.total * 100 | 0;
- if (progress) {
- progress.update(percent).draw(ctx);
- }
-
- // update stats
- var ms = new Date() - stats.start;
- text(passes, stats.passes);
- text(failures, stats.failures);
- text(duration, (ms / 1000).toFixed(2));
- }
-}
-
-/**
- * Makes a URL, preserving querystring ("search") parameters.
- *
- * @param {string} s
- * @return {string} A new URL.
- */
-function makeUrl (s) {
- var search = window.location.search;
-
- // Remove previous grep query parameter if present
- if (search) {
- search = search.replace(/[?&]grep=[^&\s]*/g, '').replace(/^&/, '?');
- }
-
- return window.location.pathname + (search ? search + '&' : '?') + 'grep=' + encodeURIComponent(escapeRe(s));
-}
-
-/**
- * Provide suite URL.
- *
- * @param {Object} [suite]
- */
-HTML.prototype.suiteURL = function (suite) {
- return makeUrl(suite.fullTitle());
-};
-
-/**
- * Provide test URL.
- *
- * @param {Object} [test]
- */
-HTML.prototype.testURL = function (test) {
- return makeUrl(test.fullTitle());
-};
-
-/**
- * Adds code toggle functionality for the provided test's list element.
- *
- * @param {HTMLLIElement} el
- * @param {string} contents
- */
-HTML.prototype.addCodeToggle = function (el, contents) {
- var h2 = el.getElementsByTagName('h2')[0];
-
- on(h2, 'click', function () {
- pre.style.display = pre.style.display === 'none' ? 'block' : 'none';
- });
-
- var pre = fragment('<pre><code>%e</code></pre>', utils.clean(contents));
- el.appendChild(pre);
- pre.style.display = 'none';
-};
-
-/**
- * Display error `msg`.
- *
- * @param {string} msg
- */
-function error (msg) {
- document.body.appendChild(fragment('<div id="mocha-error">%s</div>', msg));
-}
-
-/**
- * Return a DOM fragment from `html`.
- *
- * @param {string} html
- */
-function fragment (html) {
- var args = arguments;
- var div = document.createElement('div');
- var i = 1;
-
- div.innerHTML = html.replace(/%([se])/g, function (_, type) {
- switch (type) {
- case 's': return String(args[i++]);
- case 'e': return escape(args[i++]);
- // no default
- }
- });
-
- return div.firstChild;
-}
-
-/**
- * Check for suites that do not have elements
- * with `classname`, and hide them.
- *
- * @param {text} classname
- */
-function hideSuitesWithout (classname) {
- var suites = document.getElementsByClassName('suite');
- for (var i = 0; i < suites.length; i++) {
- var els = suites[i].getElementsByClassName(classname);
- if (!els.length) {
- suites[i].className += ' hidden';
- }
- }
-}
-
-/**
- * Unhide .hidden suites.
- */
-function unhide () {
- var els = document.getElementsByClassName('suite hidden');
- for (var i = 0; i < els.length; ++i) {
- els[i].className = els[i].className.replace('suite hidden', 'suite');
- }
-}
-
-/**
- * Set an element's text contents.
- *
- * @param {HTMLElement} el
- * @param {string} contents
- */
-function text (el, contents) {
- if (el.textContent) {
- el.textContent = contents;
- } else {
- el.innerText = contents;
- }
-}
-
-/**
- * Listen on `event` with callback `fn`.
- */
-function on (el, event, fn) {
- if (el.addEventListener) {
- el.addEventListener(event, fn, false);
- } else {
- el.attachEvent('on' + event, fn);
- }
-}
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/index.js b/tests/lib/mocha-3.1.2/lib/reporters/index.js
deleted file mode 100644
index d3b5481e41..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-
-// Alias exports to a their normalized format Mocha#reporter to prevent a need
-// for dynamic (try/catch) requires, which Browserify doesn't handle.
-exports.Base = exports.base = require('./base');
-exports.Dot = exports.dot = require('./dot');
-exports.Doc = exports.doc = require('./doc');
-exports.TAP = exports.tap = require('./tap');
-exports.JSON = exports.json = require('./json');
-exports.HTML = exports.html = require('./html');
-exports.List = exports.list = require('./list');
-exports.Min = exports.min = require('./min');
-exports.Spec = exports.spec = require('./spec');
-exports.Nyan = exports.nyan = require('./nyan');
-exports.XUnit = exports.xunit = require('./xunit');
-exports.Markdown = exports.markdown = require('./markdown');
-exports.Progress = exports.progress = require('./progress');
-exports.Landing = exports.landing = require('./landing');
-exports.JSONStream = exports['json-stream'] = require('./json-stream');
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/json-stream.js b/tests/lib/mocha-3.1.2/lib/reporters/json-stream.js
deleted file mode 100644
index 6126e47ea1..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/json-stream.js
+++ /dev/null
@@ -1,63 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var JSON = require('json3');
-
-/**
- * Expose `List`.
- */
-
-exports = module.exports = List;
-
-/**
- * Initialize a new `List` test reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function List (runner) {
- Base.call(this, runner);
-
- var self = this;
- var total = runner.total;
-
- runner.on('start', function () {
- console.log(JSON.stringify(['start', { total: total }]));
- });
-
- runner.on('pass', function (test) {
- console.log(JSON.stringify(['pass', clean(test)]));
- });
-
- runner.on('fail', function (test, err) {
- test = clean(test);
- test.err = err.message;
- test.stack = err.stack || null;
- console.log(JSON.stringify(['fail', test]));
- });
-
- runner.on('end', function () {
- process.stdout.write(JSON.stringify(['end', self.stats]));
- });
-}
-
-/**
- * Return a plain-object representation of `test`
- * free of cyclic properties etc.
- *
- * @api private
- * @param {Object} test
- * @return {Object}
- */
-function clean (test) {
- return {
- title: test.title,
- fullTitle: test.fullTitle(),
- duration: test.duration,
- currentRetry: test.currentRetry()
- };
-}
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/json.js b/tests/lib/mocha-3.1.2/lib/reporters/json.js
deleted file mode 100644
index 259a782121..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/json.js
+++ /dev/null
@@ -1,92 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-
-/**
- * Expose `JSON`.
- */
-
-exports = module.exports = JSONReporter;
-
-/**
- * Initialize a new `JSON` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function JSONReporter (runner) {
- Base.call(this, runner);
-
- var self = this;
- var tests = [];
- var pending = [];
- var failures = [];
- var passes = [];
-
- runner.on('test end', function (test) {
- tests.push(test);
- });
-
- runner.on('pass', function (test) {
- passes.push(test);
- });
-
- runner.on('fail', function (test) {
- failures.push(test);
- });
-
- runner.on('pending', function (test) {
- pending.push(test);
- });
-
- runner.on('end', function () {
- var obj = {
- stats: self.stats,
- tests: tests.map(clean),
- pending: pending.map(clean),
- failures: failures.map(clean),
- passes: passes.map(clean)
- };
-
- runner.testResults = obj;
-
- process.stdout.write(JSON.stringify(obj, null, 2));
- });
-}
-
-/**
- * Return a plain-object representation of `test`
- * free of cyclic properties etc.
- *
- * @api private
- * @param {Object} test
- * @return {Object}
- */
-function clean (test) {
- return {
- title: test.title,
- fullTitle: test.fullTitle(),
- duration: test.duration,
- currentRetry: test.currentRetry(),
- err: errorJSON(test.err || {})
- };
-}
-
-/**
- * Transform `error` into a JSON object.
- *
- * @api private
- * @param {Error} err
- * @return {Object}
- */
-function errorJSON (err) {
- var res = {};
- Object.getOwnPropertyNames(err).forEach(function (key) {
- res[key] = err[key];
- }, err);
- return res;
-}
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/landing.js b/tests/lib/mocha-3.1.2/lib/reporters/landing.js
deleted file mode 100644
index b8c7b5f20c..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/landing.js
+++ /dev/null
@@ -1,94 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-var cursor = Base.cursor;
-var color = Base.color;
-
-/**
- * Expose `Landing`.
- */
-
-exports = module.exports = Landing;
-
-/**
- * Airplane color.
- */
-
-Base.colors.plane = 0;
-
-/**
- * Airplane crash color.
- */
-
-Base.colors['plane crash'] = 31;
-
-/**
- * Runway color.
- */
-
-Base.colors.runway = 90;
-
-/**
- * Initialize a new `Landing` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function Landing (runner) {
- Base.call(this, runner);
-
- var self = this;
- var width = Base.window.width * 0.75 | 0;
- var total = runner.total;
- var stream = process.stdout;
- var plane = color('plane', '✈');
- var crashed = -1;
- var n = 0;
-
- function runway () {
- var buf = Array(width).join('-');
- return ' ' + color('runway', buf);
- }
-
- runner.on('start', function () {
- stream.write('\n\n\n ');
- cursor.hide();
- });
-
- runner.on('test end', function (test) {
- // check if the plane crashed
- var col = crashed === -1 ? width * ++n / total | 0 : crashed;
-
- // show the crash
- if (test.state === 'failed') {
- plane = color('plane crash', '✈');
- crashed = col;
- }
-
- // render landing strip
- stream.write('\u001b[' + (width + 1) + 'D\u001b[2A');
- stream.write(runway());
- stream.write('\n ');
- stream.write(color('runway', Array(col).join('â‹…')));
- stream.write(plane);
- stream.write(color('runway', Array(width - col).join('â‹…') + '\n'));
- stream.write(runway());
- stream.write('\u001b[0m');
- });
-
- runner.on('end', function () {
- cursor.show();
- console.log();
- self.epilogue();
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(Landing, Base);
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/list.js b/tests/lib/mocha-3.1.2/lib/reporters/list.js
deleted file mode 100644
index 2e54314e91..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/list.js
+++ /dev/null
@@ -1,63 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-var color = Base.color;
-var cursor = Base.cursor;
-
-/**
- * Expose `List`.
- */
-
-exports = module.exports = List;
-
-/**
- * Initialize a new `List` test reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function List (runner) {
- Base.call(this, runner);
-
- var self = this;
- var n = 0;
-
- runner.on('start', function () {
- console.log();
- });
-
- runner.on('test', function (test) {
- process.stdout.write(color('pass', ' ' + test.fullTitle() + ': '));
- });
-
- runner.on('pending', function (test) {
- var fmt = color('checkmark', ' -') +
- color('pending', ' %s');
- console.log(fmt, test.fullTitle());
- });
-
- runner.on('pass', function (test) {
- var fmt = color('checkmark', ' ' + Base.symbols.dot) +
- color('pass', ' %s: ') +
- color(test.speed, '%dms');
- cursor.CR();
- console.log(fmt, test.fullTitle(), test.duration);
- });
-
- runner.on('fail', function (test) {
- cursor.CR();
- console.log(color('fail', ' %d) %s'), ++n, test.fullTitle());
- });
-
- runner.on('end', self.epilogue.bind(self));
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(List, Base);
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/markdown.js b/tests/lib/mocha-3.1.2/lib/reporters/markdown.js
deleted file mode 100644
index 9c06616ea9..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/markdown.js
+++ /dev/null
@@ -1,99 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var utils = require('../utils');
-
-/**
- * Constants
- */
-
-var SUITE_PREFIX = '$';
-
-/**
- * Expose `Markdown`.
- */
-
-exports = module.exports = Markdown;
-
-/**
- * Initialize a new `Markdown` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function Markdown (runner) {
- Base.call(this, runner);
-
- var level = 0;
- var buf = '';
-
- function title (str) {
- return Array(level).join('#') + ' ' + str;
- }
-
- function mapTOC (suite, obj) {
- var ret = obj;
- var key = SUITE_PREFIX + suite.title;
-
- obj = obj[key] = obj[key] || { suite: suite };
- suite.suites.forEach(function (suite) {
- mapTOC(suite, obj);
- });
-
- return ret;
- }
-
- function stringifyTOC (obj, level) {
- ++level;
- var buf = '';
- var link;
- for (var key in obj) {
- if (key === 'suite') {
- continue;
- }
- if (key !== SUITE_PREFIX) {
- link = ' - [' + key.substring(1) + ']';
- link += '(#' + utils.slug(obj[key].suite.fullTitle()) + ')\n';
- buf += Array(level).join(' ') + link;
- }
- buf += stringifyTOC(obj[key], level);
- }
- return buf;
- }
-
- function generateTOC (suite) {
- var obj = mapTOC(suite, {});
- return stringifyTOC(obj, 0);
- }
-
- generateTOC(runner.suite);
-
- runner.on('suite', function (suite) {
- ++level;
- var slug = utils.slug(suite.fullTitle());
- buf += '<a name="' + slug + '"></a>' + '\n';
- buf += title(suite.title) + '\n';
- });
-
- runner.on('suite end', function () {
- --level;
- });
-
- runner.on('pass', function (test) {
- var code = utils.clean(test.body);
- buf += test.title + '.\n';
- buf += '\n```js\n';
- buf += code + '\n';
- buf += '```\n\n';
- });
-
- runner.on('end', function () {
- process.stdout.write('# TOC\n');
- process.stdout.write(generateTOC(runner.suite));
- process.stdout.write(buf);
- });
-}
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/min.js b/tests/lib/mocha-3.1.2/lib/reporters/min.js
deleted file mode 100644
index 0d772f9601..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/min.js
+++ /dev/null
@@ -1,38 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-
-/**
- * Expose `Min`.
- */
-
-exports = module.exports = Min;
-
-/**
- * Initialize a new `Min` minimal test reporter (best used with --watch).
- *
- * @api public
- * @param {Runner} runner
- */
-function Min (runner) {
- Base.call(this, runner);
-
- runner.on('start', function () {
- // clear screen
- process.stdout.write('\u001b[2J');
- // set cursor position
- process.stdout.write('\u001b[1;3H');
- });
-
- runner.on('end', this.epilogue.bind(this));
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(Min, Base);
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/nyan.js b/tests/lib/mocha-3.1.2/lib/reporters/nyan.js
deleted file mode 100644
index 1be49a97b9..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/nyan.js
+++ /dev/null
@@ -1,263 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-
-/**
- * Expose `Dot`.
- */
-
-exports = module.exports = NyanCat;
-
-/**
- * Initialize a new `Dot` matrix test reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function NyanCat (runner) {
- Base.call(this, runner);
-
- var self = this;
- var width = Base.window.width * 0.75 | 0;
- var nyanCatWidth = this.nyanCatWidth = 11;
-
- this.colorIndex = 0;
- this.numberOfLines = 4;
- this.rainbowColors = self.generateColors();
- this.scoreboardWidth = 5;
- this.tick = 0;
- this.trajectories = [[], [], [], []];
- this.trajectoryWidthMax = (width - nyanCatWidth);
-
- runner.on('start', function () {
- Base.cursor.hide();
- self.draw();
- });
-
- runner.on('pending', function () {
- self.draw();
- });
-
- runner.on('pass', function () {
- self.draw();
- });
-
- runner.on('fail', function () {
- self.draw();
- });
-
- runner.on('end', function () {
- Base.cursor.show();
- for (var i = 0; i < self.numberOfLines; i++) {
- write('\n');
- }
- self.epilogue();
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(NyanCat, Base);
-
-/**
- * Draw the nyan cat
- *
- * @api private
- */
-
-NyanCat.prototype.draw = function () {
- this.appendRainbow();
- this.drawScoreboard();
- this.drawRainbow();
- this.drawNyanCat();
- this.tick = !this.tick;
-};
-
-/**
- * Draw the "scoreboard" showing the number
- * of passes, failures and pending tests.
- *
- * @api private
- */
-
-NyanCat.prototype.drawScoreboard = function () {
- var stats = this.stats;
-
- function draw (type, n) {
- write(' ');
- write(Base.color(type, n));
- write('\n');
- }
-
- draw('green', stats.passes);
- draw('fail', stats.failures);
- draw('pending', stats.pending);
- write('\n');
-
- this.cursorUp(this.numberOfLines);
-};
-
-/**
- * Append the rainbow.
- *
- * @api private
- */
-
-NyanCat.prototype.appendRainbow = function () {
- var segment = this.tick ? '_' : '-';
- var rainbowified = this.rainbowify(segment);
-
- for (var index = 0; index < this.numberOfLines; index++) {
- var trajectory = this.trajectories[index];
- if (trajectory.length >= this.trajectoryWidthMax) {
- trajectory.shift();
- }
- trajectory.push(rainbowified);
- }
-};
-
-/**
- * Draw the rainbow.
- *
- * @api private
- */
-
-NyanCat.prototype.drawRainbow = function () {
- var self = this;
-
- this.trajectories.forEach(function (line) {
- write('\u001b[' + self.scoreboardWidth + 'C');
- write(line.join(''));
- write('\n');
- });
-
- this.cursorUp(this.numberOfLines);
-};
-
-/**
- * Draw the nyan cat
- *
- * @api private
- */
-NyanCat.prototype.drawNyanCat = function () {
- var self = this;
- var startWidth = this.scoreboardWidth + this.trajectories[0].length;
- var dist = '\u001b[' + startWidth + 'C';
- var padding = '';
-
- write(dist);
- write('_,------,');
- write('\n');
-
- write(dist);
- padding = self.tick ? ' ' : ' ';
- write('_|' + padding + '/\\_/\\ ');
- write('\n');
-
- write(dist);
- padding = self.tick ? '_' : '__';
- var tail = self.tick ? '~' : '^';
- write(tail + '|' + padding + this.face() + ' ');
- write('\n');
-
- write(dist);
- padding = self.tick ? ' ' : ' ';
- write(padding + '"" "" ');
- write('\n');
-
- this.cursorUp(this.numberOfLines);
-};
-
-/**
- * Draw nyan cat face.
- *
- * @api private
- * @return {string}
- */
-
-NyanCat.prototype.face = function () {
- var stats = this.stats;
- if (stats.failures) {
- return '( x .x)';
- } else if (stats.pending) {
- return '( o .o)';
- } else if (stats.passes) {
- return '( ^ .^)';
- }
- return '( - .-)';
-};
-
-/**
- * Move cursor up `n`.
- *
- * @api private
- * @param {number} n
- */
-
-NyanCat.prototype.cursorUp = function (n) {
- write('\u001b[' + n + 'A');
-};
-
-/**
- * Move cursor down `n`.
- *
- * @api private
- * @param {number} n
- */
-
-NyanCat.prototype.cursorDown = function (n) {
- write('\u001b[' + n + 'B');
-};
-
-/**
- * Generate rainbow colors.
- *
- * @api private
- * @return {Array}
- */
-NyanCat.prototype.generateColors = function () {
- var colors = [];
-
- for (var i = 0; i < (6 * 7); i++) {
- var pi3 = Math.floor(Math.PI / 3);
- var n = (i * (1.0 / 6));
- var r = Math.floor(3 * Math.sin(n) + 3);
- var g = Math.floor(3 * Math.sin(n + 2 * pi3) + 3);
- var b = Math.floor(3 * Math.sin(n + 4 * pi3) + 3);
- colors.push(36 * r + 6 * g + b + 16);
- }
-
- return colors;
-};
-
-/**
- * Apply rainbow to the given `str`.
- *
- * @api private
- * @param {string} str
- * @return {string}
- */
-NyanCat.prototype.rainbowify = function (str) {
- if (!Base.useColors) {
- return str;
- }
- var color = this.rainbowColors[this.colorIndex % this.rainbowColors.length];
- this.colorIndex += 1;
- return '\u001b[38;5;' + color + 'm' + str + '\u001b[0m';
-};
-
-/**
- * Stdout helper.
- *
- * @param {string} string A message to write to stdout.
- */
-function write (string) {
- process.stdout.write(string);
-}
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/progress.js b/tests/lib/mocha-3.1.2/lib/reporters/progress.js
deleted file mode 100644
index 378ce38272..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/progress.js
+++ /dev/null
@@ -1,91 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-var color = Base.color;
-var cursor = Base.cursor;
-
-/**
- * Expose `Progress`.
- */
-
-exports = module.exports = Progress;
-
-/**
- * General progress bar color.
- */
-
-Base.colors.progress = 90;
-
-/**
- * Initialize a new `Progress` bar test reporter.
- *
- * @api public
- * @param {Runner} runner
- * @param {Object} options
- */
-function Progress (runner, options) {
- Base.call(this, runner);
-
- var self = this;
- var width = Base.window.width * 0.50 | 0;
- var total = runner.total;
- var complete = 0;
- var lastN = -1;
-
- // default chars
- options = options || {};
- options.open = options.open || '[';
- options.complete = options.complete || 'â–¬';
- options.incomplete = options.incomplete || Base.symbols.dot;
- options.close = options.close || ']';
- options.verbose = false;
-
- // tests started
- runner.on('start', function () {
- console.log();
- cursor.hide();
- });
-
- // tests complete
- runner.on('test end', function () {
- complete++;
-
- var percent = complete / total;
- var n = width * percent | 0;
- var i = width - n;
-
- if (n === lastN && !options.verbose) {
- // Don't re-render the line if it hasn't changed
- return;
- }
- lastN = n;
-
- cursor.CR();
- process.stdout.write('\u001b[J');
- process.stdout.write(color('progress', ' ' + options.open));
- process.stdout.write(Array(n).join(options.complete));
- process.stdout.write(Array(i).join(options.incomplete));
- process.stdout.write(color('progress', options.close));
- if (options.verbose) {
- process.stdout.write(color('progress', ' ' + complete + ' of ' + total));
- }
- });
-
- // tests are complete, output some stats
- // and the failures if any
- runner.on('end', function () {
- cursor.show();
- console.log();
- self.epilogue();
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(Progress, Base);
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/spec.js b/tests/lib/mocha-3.1.2/lib/reporters/spec.js
deleted file mode 100644
index 993aff8dd3..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/spec.js
+++ /dev/null
@@ -1,81 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-var color = Base.color;
-
-/**
- * Expose `Spec`.
- */
-
-exports = module.exports = Spec;
-
-/**
- * Initialize a new `Spec` test reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function Spec (runner) {
- Base.call(this, runner);
-
- var self = this;
- var indents = 0;
- var n = 0;
-
- function indent () {
- return Array(indents).join(' ');
- }
-
- runner.on('start', function () {
- console.log();
- });
-
- runner.on('suite', function (suite) {
- ++indents;
- console.log(color('suite', '%s%s'), indent(), suite.title);
- });
-
- runner.on('suite end', function () {
- --indents;
- if (indents === 1) {
- console.log();
- }
- });
-
- runner.on('pending', function (test) {
- var fmt = indent() + color('pending', ' - %s');
- console.log(fmt, test.title);
- });
-
- runner.on('pass', function (test) {
- var fmt;
- if (test.speed === 'fast') {
- fmt = indent() +
- color('checkmark', ' ' + Base.symbols.ok) +
- color('pass', ' %s');
- console.log(fmt, test.title);
- } else {
- fmt = indent() +
- color('checkmark', ' ' + Base.symbols.ok) +
- color('pass', ' %s') +
- color(test.speed, ' (%dms)');
- console.log(fmt, test.title, test.duration);
- }
- });
-
- runner.on('fail', function (test) {
- console.log(indent() + color('fail', ' %d) %s'), ++n, test.title);
- });
-
- runner.on('end', self.epilogue.bind(self));
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(Spec, Base);
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/tap.js b/tests/lib/mocha-3.1.2/lib/reporters/tap.js
deleted file mode 100644
index e37ac1b16f..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/tap.js
+++ /dev/null
@@ -1,70 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-
-/**
- * Expose `TAP`.
- */
-
-exports = module.exports = TAP;
-
-/**
- * Initialize a new `TAP` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function TAP (runner) {
- Base.call(this, runner);
-
- var n = 1;
- var passes = 0;
- var failures = 0;
-
- runner.on('start', function () {
- var total = runner.grepTotal(runner.suite);
- console.log('%d..%d', 1, total);
- });
-
- runner.on('test end', function () {
- ++n;
- });
-
- runner.on('pending', function (test) {
- console.log('ok %d %s # SKIP -', n, title(test));
- });
-
- runner.on('pass', function (test) {
- passes++;
- console.log('ok %d %s', n, title(test));
- });
-
- runner.on('fail', function (test, err) {
- failures++;
- console.log('not ok %d %s', n, title(test));
- if (err.stack) {
- console.log(err.stack.replace(/^/gm, ' '));
- }
- });
-
- runner.on('end', function () {
- console.log('# tests ' + (passes + failures));
- console.log('# pass ' + passes);
- console.log('# fail ' + failures);
- });
-}
-
-/**
- * Return a TAP-safe title of `test`
- *
- * @api private
- * @param {Object} test
- * @return {String}
- */
-function title (test) {
- return test.fullTitle().replace(/#/g, '');
-}
diff --git a/tests/lib/mocha-3.1.2/lib/reporters/xunit.js b/tests/lib/mocha-3.1.2/lib/reporters/xunit.js
deleted file mode 100644
index 08f7b4cac3..0000000000
--- a/tests/lib/mocha-3.1.2/lib/reporters/xunit.js
+++ /dev/null
@@ -1,168 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var utils = require('../utils');
-var inherits = utils.inherits;
-var fs = require('fs');
-var escape = utils.escape;
-var mkdirp = require('mkdirp');
-var path = require('path');
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-/* eslint-disable no-unused-vars, no-native-reassign */
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-/* eslint-enable no-unused-vars, no-native-reassign */
-
-/**
- * Expose `XUnit`.
- */
-
-exports = module.exports = XUnit;
-
-/**
- * Initialize a new `XUnit` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function XUnit (runner, options) {
- Base.call(this, runner);
-
- var stats = this.stats;
- var tests = [];
- var self = this;
-
- if (options.reporterOptions && options.reporterOptions.output) {
- if (!fs.createWriteStream) {
- throw new Error('file output not supported in browser');
- }
- mkdirp.sync(path.dirname(options.reporterOptions.output));
- self.fileStream = fs.createWriteStream(options.reporterOptions.output);
- }
-
- runner.on('pending', function (test) {
- tests.push(test);
- });
-
- runner.on('pass', function (test) {
- tests.push(test);
- });
-
- runner.on('fail', function (test) {
- tests.push(test);
- });
-
- runner.on('end', function () {
- self.write(tag('testsuite', {
- name: 'Mocha Tests',
- tests: stats.tests,
- failures: stats.failures,
- errors: stats.failures,
- skipped: stats.tests - stats.failures - stats.passes,
- timestamp: (new Date()).toUTCString(),
- time: (stats.duration / 1000) || 0
- }, false));
-
- tests.forEach(function (t) {
- self.test(t);
- });
-
- self.write('</testsuite>');
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(XUnit, Base);
-
-/**
- * Override done to close the stream (if it's a file).
- *
- * @param failures
- * @param {Function} fn
- */
-XUnit.prototype.done = function (failures, fn) {
- if (this.fileStream) {
- this.fileStream.end(function () {
- fn(failures);
- });
- } else {
- fn(failures);
- }
-};
-
-/**
- * Write out the given line.
- *
- * @param {string} line
- */
-XUnit.prototype.write = function (line) {
- if (this.fileStream) {
- this.fileStream.write(line + '\n');
- } else if (typeof process === 'object' && process.stdout) {
- process.stdout.write(line + '\n');
- } else {
- console.log(line);
- }
-};
-
-/**
- * Output tag for the given `test.`
- *
- * @param {Test} test
- */
-XUnit.prototype.test = function (test) {
- var attrs = {
- classname: test.parent.fullTitle(),
- name: test.title,
- time: (test.duration / 1000) || 0
- };
-
- if (test.state === 'failed') {
- var err = test.err;
- this.write(tag('testcase', attrs, false, tag('failure', {}, false, escape(err.message) + '\n' + escape(err.stack))));
- } else if (test.isPending()) {
- this.write(tag('testcase', attrs, false, tag('skipped', {}, true)));
- } else {
- this.write(tag('testcase', attrs, true));
- }
-};
-
-/**
- * HTML tag helper.
- *
- * @param name
- * @param attrs
- * @param close
- * @param content
- * @return {string}
- */
-function tag (name, attrs, close, content) {
- var end = close ? '/>' : '>';
- var pairs = [];
- var tag;
-
- for (var key in attrs) {
- if (Object.prototype.hasOwnProperty.call(attrs, key)) {
- pairs.push(key + '="' + escape(attrs[key]) + '"');
- }
- }
-
- tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end;
- if (content) {
- tag += content + '</' + name + end;
- }
- return tag;
-}
diff --git a/tests/lib/mocha-3.1.2/lib/runnable.js b/tests/lib/mocha-3.1.2/lib/runnable.js
deleted file mode 100644
index 3edd9abd3e..0000000000
--- a/tests/lib/mocha-3.1.2/lib/runnable.js
+++ /dev/null
@@ -1,384 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var EventEmitter = require('events').EventEmitter;
-var JSON = require('json3');
-var Pending = require('./pending');
-var debug = require('debug')('mocha:runnable');
-var milliseconds = require('./ms');
-var utils = require('./utils');
-var create = require('lodash.create');
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-/* eslint-disable no-unused-vars, no-native-reassign */
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-/* eslint-enable no-unused-vars, no-native-reassign */
-
-/**
- * Object#toString().
- */
-
-var toString = Object.prototype.toString;
-
-/**
- * Expose `Runnable`.
- */
-
-module.exports = Runnable;
-
-/**
- * Initialize a new `Runnable` with the given `title` and callback `fn`.
- *
- * @param {String} title
- * @param {Function} fn
- * @api private
- * @param {string} title
- * @param {Function} fn
- */
-function Runnable (title, fn) {
- this.title = title;
- this.fn = fn;
- this.body = (fn || '').toString();
- this.async = fn && fn.length;
- this.sync = !this.async;
- this._timeout = 2000;
- this._slow = 75;
- this._enableTimeouts = true;
- this.timedOut = false;
- this._trace = new Error('done() called multiple times');
- this._retries = -1;
- this._currentRetry = 0;
- this.pending = false;
-}
-
-/**
- * Inherit from `EventEmitter.prototype`.
- */
-Runnable.prototype = create(EventEmitter.prototype, {
- constructor: Runnable
-});
-
-/**
- * Set & get timeout `ms`.
- *
- * @api private
- * @param {number|string} ms
- * @return {Runnable|number} ms or Runnable instance.
- */
-Runnable.prototype.timeout = function (ms) {
- if (!arguments.length) {
- return this._timeout;
- }
- // see #1652 for reasoning
- if (ms === 0 || ms > Math.pow(2, 31)) {
- this._enableTimeouts = false;
- }
- if (typeof ms === 'string') {
- ms = milliseconds(ms);
- }
- debug('timeout %d', ms);
- this._timeout = ms;
- if (this.timer) {
- this.resetTimeout();
- }
- return this;
-};
-
-/**
- * Set & get slow `ms`.
- *
- * @api private
- * @param {number|string} ms
- * @return {Runnable|number} ms or Runnable instance.
- */
-Runnable.prototype.slow = function (ms) {
- if (typeof ms === 'undefined') {
- return this._slow;
- }
- if (typeof ms === 'string') {
- ms = milliseconds(ms);
- }
- debug('timeout %d', ms);
- this._slow = ms;
- return this;
-};
-
-/**
- * Set and get whether timeout is `enabled`.
- *
- * @api private
- * @param {boolean} enabled
- * @return {Runnable|boolean} enabled or Runnable instance.
- */
-Runnable.prototype.enableTimeouts = function (enabled) {
- if (!arguments.length) {
- return this._enableTimeouts;
- }
- debug('enableTimeouts %s', enabled);
- this._enableTimeouts = enabled;
- return this;
-};
-
-/**
- * Halt and mark as pending.
- *
- * @api public
- */
-Runnable.prototype.skip = function () {
- throw new Pending('sync skip');
-};
-
-/**
- * Check if this runnable or its parent suite is marked as pending.
- *
- * @api private
- */
-Runnable.prototype.isPending = function () {
- return this.pending || (this.parent && this.parent.isPending());
-};
-
-/**
- * Set number of retries.
- *
- * @api private
- */
-Runnable.prototype.retries = function (n) {
- if (!arguments.length) {
- return this._retries;
- }
- this._retries = n;
-};
-
-/**
- * Get current retry
- *
- * @api private
- */
-Runnable.prototype.currentRetry = function (n) {
- if (!arguments.length) {
- return this._currentRetry;
- }
- this._currentRetry = n;
-};
-
-/**
- * Return the full title generated by recursively concatenating the parent's
- * full title.
- *
- * @api public
- * @return {string}
- */
-Runnable.prototype.fullTitle = function () {
- return this.parent.fullTitle() + ' ' + this.title;
-};
-
-/**
- * Clear the timeout.
- *
- * @api private
- */
-Runnable.prototype.clearTimeout = function () {
- clearTimeout(this.timer);
-};
-
-/**
- * Inspect the runnable void of private properties.
- *
- * @api private
- * @return {string}
- */
-Runnable.prototype.inspect = function () {
- return JSON.stringify(this, function (key, val) {
- if (key[0] === '_') {
- return;
- }
- if (key === 'parent') {
- return '#<Suite>';
- }
- if (key === 'ctx') {
- return '#<Context>';
- }
- return val;
- }, 2);
-};
-
-/**
- * Reset the timeout.
- *
- * @api private
- */
-Runnable.prototype.resetTimeout = function () {
- var self = this;
- var ms = this.timeout() || 1e9;
-
- if (!this._enableTimeouts) {
- return;
- }
- this.clearTimeout();
- this.timer = setTimeout(function () {
- if (!self._enableTimeouts) {
- return;
- }
- self.callback(new Error('timeout of ' + ms + 'ms exceeded. Ensure the done() callback is being called in this test.'));
- self.timedOut = true;
- }, ms);
-};
-
-/**
- * Whitelist a list of globals for this test run.
- *
- * @api private
- * @param {string[]} globals
- */
-Runnable.prototype.globals = function (globals) {
- if (!arguments.length) {
- return this._allowedGlobals;
- }
- this._allowedGlobals = globals;
-};
-
-/**
- * Run the test and invoke `fn(err)`.
- *
- * @param {Function} fn
- * @api private
- */
-Runnable.prototype.run = function (fn) {
- var self = this;
- var start = new Date();
- var ctx = this.ctx;
- var finished;
- var emitted;
-
- // Sometimes the ctx exists, but it is not runnable
- if (ctx && ctx.runnable) {
- ctx.runnable(this);
- }
-
- // called multiple times
- function multiple (err) {
- if (emitted) {
- return;
- }
- emitted = true;
- self.emit('error', err || new Error('done() called multiple times; stacktrace may be inaccurate'));
- }
-
- // finished
- function done (err) {
- var ms = self.timeout();
- if (self.timedOut) {
- return;
- }
- if (finished) {
- return multiple(err || self._trace);
- }
-
- self.clearTimeout();
- self.duration = new Date() - start;
- finished = true;
- if (!err && self.duration > ms && self._enableTimeouts) {
- err = new Error('timeout of ' + ms + 'ms exceeded. Ensure the done() callback is being called in this test.');
- }
- fn(err);
- }
-
- // for .resetTimeout()
- this.callback = done;
-
- // explicit async with `done` argument
- if (this.async) {
- this.resetTimeout();
-
- // allows skip() to be used in an explicit async context
- this.skip = function asyncSkip () {
- done(new Pending('async skip call'));
- // halt execution. the Runnable will be marked pending
- // by the previous call, and the uncaught handler will ignore
- // the failure.
- throw new Pending('async skip; aborting execution');
- };
-
- if (this.allowUncaught) {
- return callFnAsync(this.fn);
- }
- try {
- callFnAsync(this.fn);
- } catch (err) {
- emitted = true;
- done(utils.getError(err));
- }
- return;
- }
-
- if (this.allowUncaught) {
- callFn(this.fn);
- done();
- return;
- }
-
- // sync or promise-returning
- try {
- if (this.isPending()) {
- done();
- } else {
- callFn(this.fn);
- }
- } catch (err) {
- emitted = true;
- done(utils.getError(err));
- }
-
- function callFn (fn) {
- var result = fn.call(ctx);
- if (result && typeof result.then === 'function') {
- self.resetTimeout();
- result
- .then(function () {
- done();
- // Return null so libraries like bluebird do not warn about
- // subsequently constructed Promises.
- return null;
- },
- function (reason) {
- done(reason || new Error('Promise rejected with no or falsy reason'));
- });
- } else {
- if (self.asyncOnly) {
- return done(new Error('--async-only option in use without declaring `done()` or returning a promise'));
- }
-
- done();
- }
- }
-
- function callFnAsync (fn) {
- var result = fn.call(ctx, function (err) {
- if (err instanceof Error || toString.call(err) === '[object Error]') {
- return done(err);
- }
- if (err) {
- if (Object.prototype.toString.call(err) === '[object Object]') {
- return done(new Error('done() invoked with non-Error: ' +
- JSON.stringify(err)));
- }
- return done(new Error('done() invoked with non-Error: ' + err));
- }
- if (result && utils.isPromise(result)) {
- return done(new Error('Resolution method is overspecified. Specify a callback *or* return a Promise; not both.'));
- }
-
- done();
- });
- }
-};
diff --git a/tests/lib/mocha-3.1.2/lib/runner.js b/tests/lib/mocha-3.1.2/lib/runner.js
deleted file mode 100644
index 697ffb65ac..0000000000
--- a/tests/lib/mocha-3.1.2/lib/runner.js
+++ /dev/null
@@ -1,963 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var EventEmitter = require('events').EventEmitter;
-var Pending = require('./pending');
-var utils = require('./utils');
-var inherits = utils.inherits;
-var debug = require('debug')('mocha:runner');
-var Runnable = require('./runnable');
-var filter = utils.filter;
-var indexOf = utils.indexOf;
-var some = utils.some;
-var keys = utils.keys;
-var stackFilter = utils.stackTraceFilter();
-var stringify = utils.stringify;
-var type = utils.type;
-var undefinedError = utils.undefinedError;
-var isArray = utils.isArray;
-
-/**
- * Non-enumerable globals.
- */
-
-var globals = [
- 'setTimeout',
- 'clearTimeout',
- 'setInterval',
- 'clearInterval',
- 'XMLHttpRequest',
- 'Date',
- 'setImmediate',
- 'clearImmediate'
-];
-
-/**
- * Expose `Runner`.
- */
-
-module.exports = Runner;
-
-/**
- * Initialize a `Runner` for the given `suite`.
- *
- * Events:
- *
- * - `start` execution started
- * - `end` execution complete
- * - `suite` (suite) test suite execution started
- * - `suite end` (suite) all tests (and sub-suites) have finished
- * - `test` (test) test execution started
- * - `test end` (test) test completed
- * - `hook` (hook) hook execution started
- * - `hook end` (hook) hook complete
- * - `pass` (test) test passed
- * - `fail` (test, err) test failed
- * - `pending` (test) test pending
- *
- * @api public
- * @param {Suite} suite Root suite
- * @param {boolean} [delay] Whether or not to delay execution of root suite
- * until ready.
- */
-function Runner (suite, delay) {
- var self = this;
- this._globals = [];
- this._abort = false;
- this._delay = delay;
- this.suite = suite;
- this.started = false;
- this.total = suite.total();
- this.failures = 0;
- this.on('test end', function (test) {
- self.checkGlobals(test);
- });
- this.on('hook end', function (hook) {
- self.checkGlobals(hook);
- });
- this._defaultGrep = /.*/;
- this.grep(this._defaultGrep);
- this.globals(this.globalProps().concat(extraGlobals()));
-}
-
-/**
- * Wrapper for setImmediate, process.nextTick, or browser polyfill.
- *
- * @param {Function} fn
- * @api private
- */
-Runner.immediately = global.setImmediate || process.nextTick;
-
-/**
- * Inherit from `EventEmitter.prototype`.
- */
-inherits(Runner, EventEmitter);
-
-/**
- * Run tests with full titles matching `re`. Updates runner.total
- * with number of tests matched.
- *
- * @param {RegExp} re
- * @param {Boolean} invert
- * @return {Runner} for chaining
- * @api public
- * @param {RegExp} re
- * @param {boolean} invert
- * @return {Runner} Runner instance.
- */
-Runner.prototype.grep = function (re, invert) {
- debug('grep %s', re);
- this._grep = re;
- this._invert = invert;
- this.total = this.grepTotal(this.suite);
- return this;
-};
-
-/**
- * Returns the number of tests matching the grep search for the
- * given suite.
- *
- * @param {Suite} suite
- * @return {Number}
- * @api public
- * @param {Suite} suite
- * @return {number}
- */
-Runner.prototype.grepTotal = function (suite) {
- var self = this;
- var total = 0;
-
- suite.eachTest(function (test) {
- var match = self._grep.test(test.fullTitle());
- if (self._invert) {
- match = !match;
- }
- if (match) {
- total++;
- }
- });
-
- return total;
-};
-
-/**
- * Return a list of global properties.
- *
- * @return {Array}
- * @api private
- */
-Runner.prototype.globalProps = function () {
- var props = keys(global);
-
- // non-enumerables
- for (var i = 0; i < globals.length; ++i) {
- if (~indexOf(props, globals[i])) {
- continue;
- }
- props.push(globals[i]);
- }
-
- return props;
-};
-
-/**
- * Allow the given `arr` of globals.
- *
- * @param {Array} arr
- * @return {Runner} for chaining
- * @api public
- * @param {Array} arr
- * @return {Runner} Runner instance.
- */
-Runner.prototype.globals = function (arr) {
- if (!arguments.length) {
- return this._globals;
- }
- debug('globals %j', arr);
- this._globals = this._globals.concat(arr);
- return this;
-};
-
-/**
- * Check for global variable leaks.
- *
- * @api private
- */
-Runner.prototype.checkGlobals = function (test) {
- if (this.ignoreLeaks) {
- return;
- }
- var ok = this._globals;
-
- var globals = this.globalProps();
- var leaks;
-
- if (test) {
- ok = ok.concat(test._allowedGlobals || []);
- }
-
- if (this.prevGlobalsLength === globals.length) {
- return;
- }
- this.prevGlobalsLength = globals.length;
-
- leaks = filterLeaks(ok, globals);
- this._globals = this._globals.concat(leaks);
-
- if (leaks.length > 1) {
- this.fail(test, new Error('global leaks detected: ' + leaks.join(', ') + ''));
- } else if (leaks.length) {
- this.fail(test, new Error('global leak detected: ' + leaks[0]));
- }
-};
-
-/**
- * Fail the given `test`.
- *
- * @api private
- * @param {Test} test
- * @param {Error} err
- */
-Runner.prototype.fail = function (test, err) {
- if (test.isPending()) {
- return;
- }
-
- ++this.failures;
- test.state = 'failed';
-
- if (!(err instanceof Error || err && typeof err.message === 'string')) {
- err = new Error('the ' + type(err) + ' ' + stringify(err) + ' was thrown, throw an Error :)');
- }
-
- try {
- err.stack = (this.fullStackTrace || !err.stack)
- ? err.stack
- : stackFilter(err.stack);
- } catch (ignored) {
- // some environments do not take kindly to monkeying with the stack
- }
-
- this.emit('fail', test, err);
-};
-
-/**
- * Fail the given `hook` with `err`.
- *
- * Hook failures work in the following pattern:
- * - If bail, then exit
- * - Failed `before` hook skips all tests in a suite and subsuites,
- * but jumps to corresponding `after` hook
- * - Failed `before each` hook skips remaining tests in a
- * suite and jumps to corresponding `after each` hook,
- * which is run only once
- * - Failed `after` hook does not alter
- * execution order
- * - Failed `after each` hook skips remaining tests in a
- * suite and subsuites, but executes other `after each`
- * hooks
- *
- * @api private
- * @param {Hook} hook
- * @param {Error} err
- */
-Runner.prototype.failHook = function (hook, err) {
- if (hook.ctx && hook.ctx.currentTest) {
- hook.originalTitle = hook.originalTitle || hook.title;
- hook.title = hook.originalTitle + ' for "' + hook.ctx.currentTest.title + '"';
- }
-
- this.fail(hook, err);
- if (this.suite.bail()) {
- this.emit('end');
- }
-};
-
-/**
- * Run hook `name` callbacks and then invoke `fn()`.
- *
- * @api private
- * @param {string} name
- * @param {Function} fn
- */
-
-Runner.prototype.hook = function (name, fn) {
- var suite = this.suite;
- var hooks = suite['_' + name];
- var self = this;
-
- function next (i) {
- var hook = hooks[i];
- if (!hook) {
- return fn();
- }
- self.currentRunnable = hook;
-
- hook.ctx.currentTest = self.test;
-
- self.emit('hook', hook);
-
- if (!hook.listeners('error').length) {
- hook.on('error', function (err) {
- self.failHook(hook, err);
- });
- }
-
- hook.run(function (err) {
- var testError = hook.error();
- if (testError) {
- self.fail(self.test, testError);
- }
- if (err) {
- if (err instanceof Pending) {
- if (name === 'beforeEach' || name === 'afterEach') {
- self.test.pending = true;
- } else {
- utils.forEach(suite.tests, function (test) {
- test.pending = true;
- });
- // a pending hook won't be executed twice.
- hook.pending = true;
- }
- } else {
- self.failHook(hook, err);
-
- // stop executing hooks, notify callee of hook err
- return fn(err);
- }
- }
- self.emit('hook end', hook);
- delete hook.ctx.currentTest;
- next(++i);
- });
- }
-
- Runner.immediately(function () {
- next(0);
- });
-};
-
-/**
- * Run hook `name` for the given array of `suites`
- * in order, and callback `fn(err, errSuite)`.
- *
- * @api private
- * @param {string} name
- * @param {Array} suites
- * @param {Function} fn
- */
-Runner.prototype.hooks = function (name, suites, fn) {
- var self = this;
- var orig = this.suite;
-
- function next (suite) {
- self.suite = suite;
-
- if (!suite) {
- self.suite = orig;
- return fn();
- }
-
- self.hook(name, function (err) {
- if (err) {
- var errSuite = self.suite;
- self.suite = orig;
- return fn(err, errSuite);
- }
-
- next(suites.pop());
- });
- }
-
- next(suites.pop());
-};
-
-/**
- * Run hooks from the top level down.
- *
- * @param {String} name
- * @param {Function} fn
- * @api private
- */
-Runner.prototype.hookUp = function (name, fn) {
- var suites = [this.suite].concat(this.parents()).reverse();
- this.hooks(name, suites, fn);
-};
-
-/**
- * Run hooks from the bottom up.
- *
- * @param {String} name
- * @param {Function} fn
- * @api private
- */
-Runner.prototype.hookDown = function (name, fn) {
- var suites = [this.suite].concat(this.parents());
- this.hooks(name, suites, fn);
-};
-
-/**
- * Return an array of parent Suites from
- * closest to furthest.
- *
- * @return {Array}
- * @api private
- */
-Runner.prototype.parents = function () {
- var suite = this.suite;
- var suites = [];
- while (suite.parent) {
- suite = suite.parent;
- suites.push(suite);
- }
- return suites;
-};
-
-/**
- * Run the current test and callback `fn(err)`.
- *
- * @param {Function} fn
- * @api private
- */
-Runner.prototype.runTest = function (fn) {
- var self = this;
- var test = this.test;
-
- if (!test) {
- return;
- }
- if (this.asyncOnly) {
- test.asyncOnly = true;
- }
-
- if (this.allowUncaught) {
- test.allowUncaught = true;
- return test.run(fn);
- }
- try {
- test.on('error', function (err) {
- self.fail(test, err);
- });
- test.run(fn);
- } catch (err) {
- fn(err);
- }
-};
-
-/**
- * Run tests in the given `suite` and invoke the callback `fn()` when complete.
- *
- * @api private
- * @param {Suite} suite
- * @param {Function} fn
- */
-Runner.prototype.runTests = function (suite, fn) {
- var self = this;
- var tests = suite.tests.slice();
- var test;
-
- function hookErr (_, errSuite, after) {
- // before/after Each hook for errSuite failed:
- var orig = self.suite;
-
- // for failed 'after each' hook start from errSuite parent,
- // otherwise start from errSuite itself
- self.suite = after ? errSuite.parent : errSuite;
-
- if (self.suite) {
- // call hookUp afterEach
- self.hookUp('afterEach', function (err2, errSuite2) {
- self.suite = orig;
- // some hooks may fail even now
- if (err2) {
- return hookErr(err2, errSuite2, true);
- }
- // report error suite
- fn(errSuite);
- });
- } else {
- // there is no need calling other 'after each' hooks
- self.suite = orig;
- fn(errSuite);
- }
- }
-
- function next (err, errSuite) {
- // if we bail after first err
- if (self.failures && suite._bail) {
- return fn();
- }
-
- if (self._abort) {
- return fn();
- }
-
- if (err) {
- return hookErr(err, errSuite, true);
- }
-
- // next test
- test = tests.shift();
-
- // all done
- if (!test) {
- return fn();
- }
-
- // grep
- var match = self._grep.test(test.fullTitle());
- if (self._invert) {
- match = !match;
- }
- if (!match) {
- // Run immediately only if we have defined a grep. When we
- // define a grep — It can cause maximum callstack error if
- // the grep is doing a large recursive loop by neglecting
- // all tests. The run immediately function also comes with
- // a performance cost. So we don't want to run immediately
- // if we run the whole test suite, because running the whole
- // test suite don't do any immediate recursive loops. Thus,
- // allowing a JS runtime to breathe.
- if (self._grep !== self._defaultGrep) {
- Runner.immediately(next);
- } else {
- next();
- }
- return;
- }
-
- if (test.isPending()) {
- self.emit('pending', test);
- self.emit('test end', test);
- return next();
- }
-
- // execute test and hook(s)
- self.emit('test', self.test = test);
- self.hookDown('beforeEach', function (err, errSuite) {
- if (test.isPending()) {
- self.emit('pending', test);
- self.emit('test end', test);
- return next();
- }
- if (err) {
- return hookErr(err, errSuite, false);
- }
- self.currentRunnable = self.test;
- self.runTest(function (err) {
- test = self.test;
- if (err) {
- var retry = test.currentRetry();
- if (err instanceof Pending) {
- test.pending = true;
- self.emit('pending', test);
- } else if (retry < test.retries()) {
- var clonedTest = test.clone();
- clonedTest.currentRetry(retry + 1);
- tests.unshift(clonedTest);
-
- // Early return + hook trigger so that it doesn't
- // increment the count wrong
- return self.hookUp('afterEach', next);
- } else {
- self.fail(test, err);
- }
- self.emit('test end', test);
-
- if (err instanceof Pending) {
- return next();
- }
-
- return self.hookUp('afterEach', next);
- }
-
- test.state = 'passed';
- self.emit('pass', test);
- self.emit('test end', test);
- self.hookUp('afterEach', next);
- });
- });
- }
-
- this.next = next;
- this.hookErr = hookErr;
- next();
-};
-
-/**
- * Run the given `suite` and invoke the callback `fn()` when complete.
- *
- * @api private
- * @param {Suite} suite
- * @param {Function} fn
- */
-Runner.prototype.runSuite = function (suite, fn) {
- var i = 0;
- var self = this;
- var total = this.grepTotal(suite);
- var afterAllHookCalled = false;
-
- debug('run suite %s', suite.fullTitle());
-
- if (!total || (self.failures && suite._bail)) {
- return fn();
- }
-
- this.emit('suite', this.suite = suite);
-
- function next (errSuite) {
- if (errSuite) {
- // current suite failed on a hook from errSuite
- if (errSuite === suite) {
- // if errSuite is current suite
- // continue to the next sibling suite
- return done();
- }
- // errSuite is among the parents of current suite
- // stop execution of errSuite and all sub-suites
- return done(errSuite);
- }
-
- if (self._abort) {
- return done();
- }
-
- var curr = suite.suites[i++];
- if (!curr) {
- return done();
- }
-
- // Avoid grep neglecting large number of tests causing a
- // huge recursive loop and thus a maximum call stack error.
- // See comment in `this.runTests()` for more information.
- if (self._grep !== self._defaultGrep) {
- Runner.immediately(function () {
- self.runSuite(curr, next);
- });
- } else {
- self.runSuite(curr, next);
- }
- }
-
- function done (errSuite) {
- self.suite = suite;
- self.nextSuite = next;
-
- if (afterAllHookCalled) {
- fn(errSuite);
- } else {
- // mark that the afterAll block has been called once
- // and so can be skipped if there is an error in it.
- afterAllHookCalled = true;
-
- // remove reference to test
- delete self.test;
-
- self.hook('afterAll', function () {
- self.emit('suite end', suite);
- fn(errSuite);
- });
- }
- }
-
- this.nextSuite = next;
-
- this.hook('beforeAll', function (err) {
- if (err) {
- return done();
- }
- self.runTests(suite, next);
- });
-};
-
-/**
- * Handle uncaught exceptions.
- *
- * @param {Error} err
- * @api private
- */
-Runner.prototype.uncaught = function (err) {
- if (err) {
- debug('uncaught exception %s', err !== function () {
- return this;
- }.call(err) ? err : (err.message || err));
- } else {
- debug('uncaught undefined exception');
- err = undefinedError();
- }
- err.uncaught = true;
-
- var runnable = this.currentRunnable;
-
- if (!runnable) {
- runnable = new Runnable('Uncaught error outside test suite');
- runnable.parent = this.suite;
-
- if (this.started) {
- this.fail(runnable, err);
- } else {
- // Can't recover from this failure
- this.emit('start');
- this.fail(runnable, err);
- this.emit('end');
- }
-
- return;
- }
-
- runnable.clearTimeout();
-
- // Ignore errors if complete or pending
- if (runnable.state || runnable.isPending()) {
- return;
- }
- this.fail(runnable, err);
-
- // recover from test
- if (runnable.type === 'test') {
- this.emit('test end', runnable);
- this.hookUp('afterEach', this.next);
- return;
- }
-
- // recover from hooks
- if (runnable.type === 'hook') {
- var errSuite = this.suite;
- // if hook failure is in afterEach block
- if (runnable.fullTitle().indexOf('after each') > -1) {
- return this.hookErr(err, errSuite, true);
- }
- // if hook failure is in beforeEach block
- if (runnable.fullTitle().indexOf('before each') > -1) {
- return this.hookErr(err, errSuite, false);
- }
- // if hook failure is in after or before blocks
- return this.nextSuite(errSuite);
- }
-
- // bail
- this.emit('end');
-};
-
-/**
- * Cleans up the references to all the deferred functions
- * (before/after/beforeEach/afterEach) and tests of a Suite.
- * These must be deleted otherwise a memory leak can happen,
- * as those functions may reference variables from closures,
- * thus those variables can never be garbage collected as long
- * as the deferred functions exist.
- *
- * @param {Suite} suite
- */
-function cleanSuiteReferences (suite) {
- function cleanArrReferences (arr) {
- for (var i = 0; i < arr.length; i++) {
- delete arr[i].fn;
- }
- }
-
- if (isArray(suite._beforeAll)) {
- cleanArrReferences(suite._beforeAll);
- }
-
- if (isArray(suite._beforeEach)) {
- cleanArrReferences(suite._beforeEach);
- }
-
- if (isArray(suite._afterAll)) {
- cleanArrReferences(suite._afterAll);
- }
-
- if (isArray(suite._afterEach)) {
- cleanArrReferences(suite._afterEach);
- }
-
- for (var i = 0; i < suite.tests.length; i++) {
- delete suite.tests[i].fn;
- }
-}
-
-/**
- * Run the root suite and invoke `fn(failures)`
- * on completion.
- *
- * @param {Function} fn
- * @return {Runner} for chaining
- * @api public
- * @param {Function} fn
- * @return {Runner} Runner instance.
- */
-Runner.prototype.run = function (fn) {
- var self = this;
- var rootSuite = this.suite;
-
- // If there is an `only` filter
- if (this.hasOnly) {
- filterOnly(rootSuite);
- }
-
- fn = fn || function () {};
-
- function uncaught (err) {
- self.uncaught(err);
- }
-
- function start () {
- self.started = true;
- self.emit('start');
- self.runSuite(rootSuite, function () {
- debug('finished running');
- self.emit('end');
- });
- }
-
- debug('start');
-
- // references cleanup to avoid memory leaks
- this.on('suite end', cleanSuiteReferences);
-
- // callback
- this.on('end', function () {
- debug('end');
- process.removeListener('uncaughtException', uncaught);
- fn(self.failures);
- });
-
- // uncaught exception
- process.on('uncaughtException', uncaught);
-
- if (this._delay) {
- // for reporters, I guess.
- // might be nice to debounce some dots while we wait.
- this.emit('waiting', rootSuite);
- rootSuite.once('run', start);
- } else {
- start();
- }
-
- return this;
-};
-
-/**
- * Cleanly abort execution.
- *
- * @api public
- * @return {Runner} Runner instance.
- */
-Runner.prototype.abort = function () {
- debug('aborting');
- this._abort = true;
-
- return this;
-};
-
-/**
- * Filter suites based on `isOnly` logic.
- *
- * @param {Array} suite
- * @returns {Boolean}
- * @api private
- */
-function filterOnly (suite) {
- if (suite._onlyTests.length) {
- // If the suite contains `only` tests, run those and ignore any nested suites.
- suite.tests = suite._onlyTests;
- suite.suites = [];
- } else {
- // Otherwise, do not run any of the tests in this suite.
- suite.tests = [];
- utils.forEach(suite._onlySuites, function (onlySuite) {
- // If there are other `only` tests/suites nested in the current `only` suite, then filter that `only` suite.
- // Otherwise, all of the tests on this `only` suite should be run, so don't filter it.
- if (hasOnly(onlySuite)) {
- filterOnly(onlySuite);
- }
- });
- // Run the `only` suites, as well as any other suites that have `only` tests/suites as descendants.
- suite.suites = filter(suite.suites, function (childSuite) {
- return indexOf(suite._onlySuites, childSuite) !== -1 || filterOnly(childSuite);
- });
- }
- // Keep the suite only if there is something to run
- return suite.tests.length || suite.suites.length;
-}
-
-/**
- * Determines whether a suite has an `only` test or suite as a descendant.
- *
- * @param {Array} suite
- * @returns {Boolean}
- * @api private
- */
-function hasOnly (suite) {
- return suite._onlyTests.length || suite._onlySuites.length || some(suite.suites, hasOnly);
-}
-
-/**
- * Filter leaks with the given globals flagged as `ok`.
- *
- * @api private
- * @param {Array} ok
- * @param {Array} globals
- * @return {Array}
- */
-function filterLeaks (ok, globals) {
- return filter(globals, function (key) {
- // Firefox and Chrome exposes iframes as index inside the window object
- if (/^\d+/.test(key)) {
- return false;
- }
-
- // in firefox
- // if runner runs in an iframe, this iframe's window.getInterface method
- // not init at first it is assigned in some seconds
- if (global.navigator && (/^getInterface/).test(key)) {
- return false;
- }
-
- // an iframe could be approached by window[iframeIndex]
- // in ie6,7,8 and opera, iframeIndex is enumerable, this could cause leak
- if (global.navigator && (/^\d+/).test(key)) {
- return false;
- }
-
- // Opera and IE expose global variables for HTML element IDs (issue #243)
- if (/^mocha-/.test(key)) {
- return false;
- }
-
- var matched = filter(ok, function (ok) {
- if (~ok.indexOf('*')) {
- return key.indexOf(ok.split('*')[0]) === 0;
- }
- return key === ok;
- });
- return !matched.length && (!global.navigator || key !== 'onerror');
- });
-}
-
-/**
- * Array of globals dependent on the environment.
- *
- * @return {Array}
- * @api private
- */
-function extraGlobals () {
- if (typeof process === 'object' && typeof process.version === 'string') {
- var parts = process.version.split('.');
- var nodeVersion = utils.reduce(parts, function (a, v) {
- return a << 8 | v;
- });
-
- // 'errno' was renamed to process._errno in v0.9.11.
-
- if (nodeVersion < 0x00090B) {
- return ['errno'];
- }
- }
-
- return [];
-}
diff --git a/tests/lib/mocha-3.1.2/lib/suite.js b/tests/lib/mocha-3.1.2/lib/suite.js
deleted file mode 100644
index 13617ab91d..0000000000
--- a/tests/lib/mocha-3.1.2/lib/suite.js
+++ /dev/null
@@ -1,402 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var EventEmitter = require('events').EventEmitter;
-var Hook = require('./hook');
-var utils = require('./utils');
-var inherits = utils.inherits;
-var debug = require('debug')('mocha:suite');
-var milliseconds = require('./ms');
-
-/**
- * Expose `Suite`.
- */
-
-exports = module.exports = Suite;
-
-/**
- * Create a new `Suite` with the given `title` and parent `Suite`. When a suite
- * with the same title is already present, that suite is returned to provide
- * nicer reporter and more flexible meta-testing.
- *
- * @api public
- * @param {Suite} parent
- * @param {string} title
- * @return {Suite}
- */
-exports.create = function (parent, title) {
- var suite = new Suite(title, parent.ctx);
- suite.parent = parent;
- title = suite.fullTitle();
- parent.addSuite(suite);
- return suite;
-};
-
-/**
- * Initialize a new `Suite` with the given `title` and `ctx`.
- *
- * @api private
- * @param {string} title
- * @param {Context} parentContext
- */
-function Suite (title, parentContext) {
- if (!utils.isString(title)) {
- throw new Error('Suite `title` should be a "string" but "' + typeof title + '" was given instead.');
- }
- this.title = title;
- function Context () {}
- Context.prototype = parentContext;
- this.ctx = new Context();
- this.suites = [];
- this.tests = [];
- this.pending = false;
- this._beforeEach = [];
- this._beforeAll = [];
- this._afterEach = [];
- this._afterAll = [];
- this.root = !title;
- this._timeout = 2000;
- this._enableTimeouts = true;
- this._slow = 75;
- this._bail = false;
- this._retries = -1;
- this._onlyTests = [];
- this._onlySuites = [];
- this.delayed = false;
-}
-
-/**
- * Inherit from `EventEmitter.prototype`.
- */
-inherits(Suite, EventEmitter);
-
-/**
- * Return a clone of this `Suite`.
- *
- * @api private
- * @return {Suite}
- */
-Suite.prototype.clone = function () {
- var suite = new Suite(this.title);
- debug('clone');
- suite.ctx = this.ctx;
- suite.timeout(this.timeout());
- suite.retries(this.retries());
- suite.enableTimeouts(this.enableTimeouts());
- suite.slow(this.slow());
- suite.bail(this.bail());
- return suite;
-};
-
-/**
- * Set timeout `ms` or short-hand such as "2s".
- *
- * @api private
- * @param {number|string} ms
- * @return {Suite|number} for chaining
- */
-Suite.prototype.timeout = function (ms) {
- if (!arguments.length) {
- return this._timeout;
- }
- if (ms.toString() === '0') {
- this._enableTimeouts = false;
- }
- if (typeof ms === 'string') {
- ms = milliseconds(ms);
- }
- debug('timeout %d', ms);
- this._timeout = parseInt(ms, 10);
- return this;
-};
-
-/**
- * Set number of times to retry a failed test.
- *
- * @api private
- * @param {number|string} n
- * @return {Suite|number} for chaining
- */
-Suite.prototype.retries = function (n) {
- if (!arguments.length) {
- return this._retries;
- }
- debug('retries %d', n);
- this._retries = parseInt(n, 10) || 0;
- return this;
-};
-
-/**
- * Set timeout to `enabled`.
- *
- * @api private
- * @param {boolean} enabled
- * @return {Suite|boolean} self or enabled
- */
-Suite.prototype.enableTimeouts = function (enabled) {
- if (!arguments.length) {
- return this._enableTimeouts;
- }
- debug('enableTimeouts %s', enabled);
- this._enableTimeouts = enabled;
- return this;
-};
-
-/**
- * Set slow `ms` or short-hand such as "2s".
- *
- * @api private
- * @param {number|string} ms
- * @return {Suite|number} for chaining
- */
-Suite.prototype.slow = function (ms) {
- if (!arguments.length) {
- return this._slow;
- }
- if (typeof ms === 'string') {
- ms = milliseconds(ms);
- }
- debug('slow %d', ms);
- this._slow = ms;
- return this;
-};
-
-/**
- * Sets whether to bail after first error.
- *
- * @api private
- * @param {boolean} bail
- * @return {Suite|number} for chaining
- */
-Suite.prototype.bail = function (bail) {
- if (!arguments.length) {
- return this._bail;
- }
- debug('bail %s', bail);
- this._bail = bail;
- return this;
-};
-
-/**
- * Check if this suite or its parent suite is marked as pending.
- *
- * @api private
- */
-Suite.prototype.isPending = function () {
- return this.pending || (this.parent && this.parent.isPending());
-};
-
-/**
- * Run `fn(test[, done])` before running tests.
- *
- * @api private
- * @param {string} title
- * @param {Function} fn
- * @return {Suite} for chaining
- */
-Suite.prototype.beforeAll = function (title, fn) {
- if (this.isPending()) {
- return this;
- }
- if (typeof title === 'function') {
- fn = title;
- title = fn.name;
- }
- title = '"before all" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.retries(this.retries());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._beforeAll.push(hook);
- this.emit('beforeAll', hook);
- return this;
-};
-
-/**
- * Run `fn(test[, done])` after running tests.
- *
- * @api private
- * @param {string} title
- * @param {Function} fn
- * @return {Suite} for chaining
- */
-Suite.prototype.afterAll = function (title, fn) {
- if (this.isPending()) {
- return this;
- }
- if (typeof title === 'function') {
- fn = title;
- title = fn.name;
- }
- title = '"after all" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.retries(this.retries());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._afterAll.push(hook);
- this.emit('afterAll', hook);
- return this;
-};
-
-/**
- * Run `fn(test[, done])` before each test case.
- *
- * @api private
- * @param {string} title
- * @param {Function} fn
- * @return {Suite} for chaining
- */
-Suite.prototype.beforeEach = function (title, fn) {
- if (this.isPending()) {
- return this;
- }
- if (typeof title === 'function') {
- fn = title;
- title = fn.name;
- }
- title = '"before each" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.retries(this.retries());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._beforeEach.push(hook);
- this.emit('beforeEach', hook);
- return this;
-};
-
-/**
- * Run `fn(test[, done])` after each test case.
- *
- * @api private
- * @param {string} title
- * @param {Function} fn
- * @return {Suite} for chaining
- */
-Suite.prototype.afterEach = function (title, fn) {
- if (this.isPending()) {
- return this;
- }
- if (typeof title === 'function') {
- fn = title;
- title = fn.name;
- }
- title = '"after each" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.retries(this.retries());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._afterEach.push(hook);
- this.emit('afterEach', hook);
- return this;
-};
-
-/**
- * Add a test `suite`.
- *
- * @api private
- * @param {Suite} suite
- * @return {Suite} for chaining
- */
-Suite.prototype.addSuite = function (suite) {
- suite.parent = this;
- suite.timeout(this.timeout());
- suite.retries(this.retries());
- suite.enableTimeouts(this.enableTimeouts());
- suite.slow(this.slow());
- suite.bail(this.bail());
- this.suites.push(suite);
- this.emit('suite', suite);
- return this;
-};
-
-/**
- * Add a `test` to this suite.
- *
- * @api private
- * @param {Test} test
- * @return {Suite} for chaining
- */
-Suite.prototype.addTest = function (test) {
- test.parent = this;
- test.timeout(this.timeout());
- test.retries(this.retries());
- test.enableTimeouts(this.enableTimeouts());
- test.slow(this.slow());
- test.ctx = this.ctx;
- this.tests.push(test);
- this.emit('test', test);
- return this;
-};
-
-/**
- * Return the full title generated by recursively concatenating the parent's
- * full title.
- *
- * @api public
- * @return {string}
- */
-Suite.prototype.fullTitle = function () {
- if (this.parent) {
- var full = this.parent.fullTitle();
- if (full) {
- return full + ' ' + this.title;
- }
- }
- return this.title;
-};
-
-/**
- * Return the total number of tests.
- *
- * @api public
- * @return {number}
- */
-Suite.prototype.total = function () {
- return utils.reduce(this.suites, function (sum, suite) {
- return sum + suite.total();
- }, 0) + this.tests.length;
-};
-
-/**
- * Iterates through each suite recursively to find all tests. Applies a
- * function in the format `fn(test)`.
- *
- * @api private
- * @param {Function} fn
- * @return {Suite}
- */
-Suite.prototype.eachTest = function (fn) {
- utils.forEach(this.tests, fn);
- utils.forEach(this.suites, function (suite) {
- suite.eachTest(fn);
- });
- return this;
-};
-
-/**
- * This will run the root suite if we happen to be running in delayed mode.
- */
-Suite.prototype.run = function run () {
- if (this.root) {
- this.emit('run');
- }
-};
diff --git a/tests/lib/mocha-3.1.2/lib/template.html b/tests/lib/mocha-3.1.2/lib/template.html
deleted file mode 100644
index 36c5e0b694..0000000000
--- a/tests/lib/mocha-3.1.2/lib/template.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="mocha.css" />
- </head>
- <body>
- <div id="mocha"></div>
- <script src="mocha.js"></script>
- <script>mocha.setup('bdd');</script>
- <script src="tests.js"></script>
- <script>
- mocha.run();
- </script>
- </body>
-</html>
diff --git a/tests/lib/mocha-3.1.2/lib/test.js b/tests/lib/mocha-3.1.2/lib/test.js
deleted file mode 100644
index 66bb57cb42..0000000000
--- a/tests/lib/mocha-3.1.2/lib/test.js
+++ /dev/null
@@ -1,52 +0,0 @@
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Runnable = require('./runnable');
-var create = require('lodash.create');
-var isString = require('./utils').isString;
-
-/**
- * Expose `Test`.
- */
-
-module.exports = Test;
-
-/**
- * Initialize a new `Test` with the given `title` and callback `fn`.
- *
- * @api private
- * @param {String} title
- * @param {Function} fn
- */
-function Test (title, fn) {
- if (!isString(title)) {
- throw new Error('Test `title` should be a "string" but "' + typeof title + '" was given instead.');
- }
- Runnable.call(this, title, fn);
- this.pending = !fn;
- this.type = 'test';
-}
-
-/**
- * Inherit from `Runnable.prototype`.
- */
-Test.prototype = create(Runnable.prototype, {
- constructor: Test
-});
-
-Test.prototype.clone = function () {
- var test = new Test(this.title, this.fn);
- test.timeout(this.timeout());
- test.slow(this.slow());
- test.enableTimeouts(this.enableTimeouts());
- test.retries(this.retries());
- test.currentRetry(this.currentRetry());
- test.globals(this.globals());
- test.parent = this.parent;
- test.file = this.file;
- test.ctx = this.ctx;
- return test;
-};
diff --git a/tests/lib/mocha-3.1.2/lib/to-iso-string/LICENSE b/tests/lib/mocha-3.1.2/lib/to-iso-string/LICENSE
deleted file mode 100644
index c25db56595..0000000000
--- a/tests/lib/mocha-3.1.2/lib/to-iso-string/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2016 Segment.io, Inc. (friends@segment.com)
-
-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.
diff --git a/tests/lib/mocha-3.1.2/lib/to-iso-string/index.js b/tests/lib/mocha-3.1.2/lib/to-iso-string/index.js
deleted file mode 100644
index cd28d7be71..0000000000
--- a/tests/lib/mocha-3.1.2/lib/to-iso-string/index.js
+++ /dev/null
@@ -1,37 +0,0 @@
-'use strict';
-
-/**
- * Pad a `number` with a ten's place zero.
- *
- * @param {number} number
- * @return {string}
- */
-function pad(number) {
- var n = number.toString();
- return n.length === 1 ? '0' + n : n;
-}
-
-/**
- * Turn a `date` into an ISO string.
- *
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
- *
- * @param {Date} date
- * @return {string}
- */
-function toISOString(date) {
- return date.getUTCFullYear()
- + '-' + pad(date.getUTCMonth() + 1)
- + '-' + pad(date.getUTCDate())
- + 'T' + pad(date.getUTCHours())
- + ':' + pad(date.getUTCMinutes())
- + ':' + pad(date.getUTCSeconds())
- + '.' + String((date.getUTCMilliseconds()/1000).toFixed(3)).slice(2, 5)
- + 'Z';
-}
-
-/*
- * Exports.
- */
-
-module.exports = toISOString;
diff --git a/tests/lib/mocha-3.1.2/lib/utils.js b/tests/lib/mocha-3.1.2/lib/utils.js
deleted file mode 100644
index 2af3aac448..0000000000
--- a/tests/lib/mocha-3.1.2/lib/utils.js
+++ /dev/null
@@ -1,802 +0,0 @@
-'use strict';
-
-/* eslint-env browser */
-
-/**
- * Module dependencies.
- */
-
-var JSON = require('json3');
-var basename = require('path').basename;
-var debug = require('debug')('mocha:watch');
-var exists = require('fs').existsSync || require('path').existsSync;
-var glob = require('glob');
-var path = require('path');
-var join = path.join;
-var readdirSync = require('fs').readdirSync;
-var statSync = require('fs').statSync;
-var watchFile = require('fs').watchFile;
-var toISOString = require('./to-iso-string');
-
-/**
- * Ignored directories.
- */
-
-var ignore = ['node_modules', '.git'];
-
-exports.inherits = require('util').inherits;
-
-/**
- * Escape special characters in the given string of html.
- *
- * @api private
- * @param {string} html
- * @return {string}
- */
-exports.escape = function (html) {
- return String(html)
- .replace(/&/g, '&amp;')
- .replace(/"/g, '&quot;')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;');
-};
-
-/**
- * Array#forEach (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Function} fn
- * @param {Object} scope
- */
-exports.forEach = function (arr, fn, scope) {
- for (var i = 0, l = arr.length; i < l; i++) {
- fn.call(scope, arr[i], i);
- }
-};
-
-/**
- * Test if the given obj is type of string.
- *
- * @api private
- * @param {Object} obj
- * @return {boolean}
- */
-exports.isString = function (obj) {
- return typeof obj === 'string';
-};
-
-/**
- * Array#map (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Function} fn
- * @param {Object} scope
- * @return {Array}
- */
-exports.map = function (arr, fn, scope) {
- var result = [];
- for (var i = 0, l = arr.length; i < l; i++) {
- result.push(fn.call(scope, arr[i], i, arr));
- }
- return result;
-};
-
-/**
- * Array#indexOf (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Object} obj to find index of
- * @param {number} start
- * @return {number}
- */
-var indexOf = exports.indexOf = function (arr, obj, start) {
- for (var i = start || 0, l = arr.length; i < l; i++) {
- if (arr[i] === obj) {
- return i;
- }
- }
- return -1;
-};
-
-/**
- * Array#reduce (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Function} fn
- * @param {Object} val Initial value.
- * @return {*}
- */
-var reduce = exports.reduce = function (arr, fn, val) {
- var rval = val;
-
- for (var i = 0, l = arr.length; i < l; i++) {
- rval = fn(rval, arr[i], i, arr);
- }
-
- return rval;
-};
-
-/**
- * Array#filter (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Function} fn
- * @return {Array}
- */
-exports.filter = function (arr, fn) {
- var ret = [];
-
- for (var i = 0, l = arr.length; i < l; i++) {
- var val = arr[i];
- if (fn(val, i, arr)) {
- ret.push(val);
- }
- }
-
- return ret;
-};
-
-/**
- * Array#some (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Function} fn
- * @return {Array}
- */
-exports.some = function (arr, fn) {
- for (var i = 0, l = arr.length; i < l; i++) {
- if (fn(arr[i])) {
- return true;
- }
- }
- return false;
-};
-
-/**
- * Object.keys (<=IE8)
- *
- * @api private
- * @param {Object} obj
- * @return {Array} keys
- */
-exports.keys = typeof Object.keys === 'function' ? Object.keys : function (obj) {
- var keys = [];
- var has = Object.prototype.hasOwnProperty; // for `window` on <=IE8
-
- for (var key in obj) {
- if (has.call(obj, key)) {
- keys.push(key);
- }
- }
-
- return keys;
-};
-
-/**
- * Watch the given `files` for changes
- * and invoke `fn(file)` on modification.
- *
- * @api private
- * @param {Array} files
- * @param {Function} fn
- */
-exports.watch = function (files, fn) {
- var options = { interval: 100 };
- files.forEach(function (file) {
- debug('file %s', file);
- watchFile(file, options, function (curr, prev) {
- if (prev.mtime < curr.mtime) {
- fn(file);
- }
- });
- });
-};
-
-/**
- * Array.isArray (<=IE8)
- *
- * @api private
- * @param {Object} obj
- * @return {Boolean}
- */
-var isArray = typeof Array.isArray === 'function' ? Array.isArray : function (obj) {
- return Object.prototype.toString.call(obj) === '[object Array]';
-};
-
-exports.isArray = isArray;
-
-/**
- * Buffer.prototype.toJSON polyfill.
- *
- * @type {Function}
- */
-if (typeof Buffer !== 'undefined' && Buffer.prototype) {
- Buffer.prototype.toJSON = Buffer.prototype.toJSON || function () {
- return Array.prototype.slice.call(this, 0);
- };
-}
-
-/**
- * Ignored files.
- *
- * @api private
- * @param {string} path
- * @return {boolean}
- */
-function ignored (path) {
- return !~ignore.indexOf(path);
-}
-
-/**
- * Lookup files in the given `dir`.
- *
- * @api private
- * @param {string} dir
- * @param {string[]} [ext=['.js']]
- * @param {Array} [ret=[]]
- * @return {Array}
- */
-exports.files = function (dir, ext, ret) {
- ret = ret || [];
- ext = ext || ['js'];
-
- var re = new RegExp('\\.(' + ext.join('|') + ')$');
-
- readdirSync(dir)
- .filter(ignored)
- .forEach(function (path) {
- path = join(dir, path);
- if (statSync(path).isDirectory()) {
- exports.files(path, ext, ret);
- } else if (path.match(re)) {
- ret.push(path);
- }
- });
-
- return ret;
-};
-
-/**
- * Compute a slug from the given `str`.
- *
- * @api private
- * @param {string} str
- * @return {string}
- */
-exports.slug = function (str) {
- return str
- .toLowerCase()
- .replace(/ +/g, '-')
- .replace(/[^-\w]/g, '');
-};
-
-/**
- * Strip the function definition from `str`, and re-indent for pre whitespace.
- *
- * @param {string} str
- * @return {string}
- */
-exports.clean = function (str) {
- str = str
- .replace(/\r\n?|[\n\u2028\u2029]/g, '\n').replace(/^\uFEFF/, '')
- // (traditional)-> space/name parameters body (lambda)-> parameters body multi-statement/single keep body content
- .replace(/^function(?:\s*|\s+[^(]*)\([^)]*\)\s*\{((?:.|\n)*?)\s*\}$|^\([^)]*\)\s*=>\s*(?:\{((?:.|\n)*?)\s*\}|((?:.|\n)*))$/, '$1$2$3');
-
- var spaces = str.match(/^\n?( *)/)[1].length;
- var tabs = str.match(/^\n?(\t*)/)[1].length;
- var re = new RegExp('^\n?' + (tabs ? '\t' : ' ') + '{' + (tabs || spaces) + '}', 'gm');
-
- str = str.replace(re, '');
-
- return exports.trim(str);
-};
-
-/**
- * Trim the given `str`.
- *
- * @api private
- * @param {string} str
- * @return {string}
- */
-exports.trim = function (str) {
- return str.replace(/^\s+|\s+$/g, '');
-};
-
-/**
- * Parse the given `qs`.
- *
- * @api private
- * @param {string} qs
- * @return {Object}
- */
-exports.parseQuery = function (qs) {
- return reduce(qs.replace('?', '').split('&'), function (obj, pair) {
- var i = pair.indexOf('=');
- var key = pair.slice(0, i);
- var val = pair.slice(++i);
-
- obj[key] = decodeURIComponent(val);
- return obj;
- }, {});
-};
-
-/**
- * Highlight the given string of `js`.
- *
- * @api private
- * @param {string} js
- * @return {string}
- */
-function highlight (js) {
- return js
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;')
- .replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>')
- .replace(/('.*?')/gm, '<span class="string">$1</span>')
- .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
- .replace(/(\d+)/gm, '<span class="number">$1</span>')
- .replace(/\bnew[ \t]+(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
- .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>');
-}
-
-/**
- * Highlight the contents of tag `name`.
- *
- * @api private
- * @param {string} name
- */
-exports.highlightTags = function (name) {
- var code = document.getElementById('mocha').getElementsByTagName(name);
- for (var i = 0, len = code.length; i < len; ++i) {
- code[i].innerHTML = highlight(code[i].innerHTML);
- }
-};
-
-/**
- * If a value could have properties, and has none, this function is called,
- * which returns a string representation of the empty value.
- *
- * Functions w/ no properties return `'[Function]'`
- * Arrays w/ length === 0 return `'[]'`
- * Objects w/ no properties return `'{}'`
- * All else: return result of `value.toString()`
- *
- * @api private
- * @param {*} value The value to inspect.
- * @param {string} typeHint The type of the value
- * @returns {string}
- */
-function emptyRepresentation (value, typeHint) {
- switch (typeHint) {
- case 'function':
- return '[Function]';
- case 'object':
- return '{}';
- case 'array':
- return '[]';
- default:
- return value.toString();
- }
-}
-
-/**
- * Takes some variable and asks `Object.prototype.toString()` what it thinks it
- * is.
- *
- * @api private
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString
- * @param {*} value The value to test.
- * @returns {string} Computed type
- * @example
- * type({}) // 'object'
- * type([]) // 'array'
- * type(1) // 'number'
- * type(false) // 'boolean'
- * type(Infinity) // 'number'
- * type(null) // 'null'
- * type(new Date()) // 'date'
- * type(/foo/) // 'regexp'
- * type('type') // 'string'
- * type(global) // 'global'
- * type(new String('foo') // 'object'
- */
-var type = exports.type = function type (value) {
- if (value === undefined) {
- return 'undefined';
- } else if (value === null) {
- return 'null';
- } else if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) {
- return 'buffer';
- }
- return Object.prototype.toString.call(value)
- .replace(/^\[.+\s(.+?)\]$/, '$1')
- .toLowerCase();
-};
-
-/**
- * Stringify `value`. Different behavior depending on type of value:
- *
- * - If `value` is undefined or null, return `'[undefined]'` or `'[null]'`, respectively.
- * - If `value` is not an object, function or array, return result of `value.toString()` wrapped in double-quotes.
- * - If `value` is an *empty* object, function, or array, return result of function
- * {@link emptyRepresentation}.
- * - If `value` has properties, call {@link exports.canonicalize} on it, then return result of
- * JSON.stringify().
- *
- * @api private
- * @see exports.type
- * @param {*} value
- * @return {string}
- */
-exports.stringify = function (value) {
- var typeHint = type(value);
-
- if (!~indexOf(['object', 'array', 'function'], typeHint)) {
- if (typeHint === 'buffer') {
- var json = value.toJSON();
- // Based on the toJSON result
- return jsonStringify(json.data && json.type ? json.data : json, 2)
- .replace(/,(\n|$)/g, '$1');
- }
-
- // IE7/IE8 has a bizarre String constructor; needs to be coerced
- // into an array and back to obj.
- if (typeHint === 'string' && typeof value === 'object') {
- value = reduce(value.split(''), function (acc, char, idx) {
- acc[idx] = char;
- return acc;
- }, {});
- typeHint = 'object';
- } else {
- return jsonStringify(value);
- }
- }
-
- for (var prop in value) {
- if (Object.prototype.hasOwnProperty.call(value, prop)) {
- return jsonStringify(exports.canonicalize(value, null, typeHint), 2).replace(/,(\n|$)/g, '$1');
- }
- }
-
- return emptyRepresentation(value, typeHint);
-};
-
-/**
- * like JSON.stringify but more sense.
- *
- * @api private
- * @param {Object} object
- * @param {number=} spaces
- * @param {number=} depth
- * @returns {*}
- */
-function jsonStringify (object, spaces, depth) {
- if (typeof spaces === 'undefined') {
- // primitive types
- return _stringify(object);
- }
-
- depth = depth || 1;
- var space = spaces * depth;
- var str = isArray(object) ? '[' : '{';
- var end = isArray(object) ? ']' : '}';
- var length = typeof object.length === 'number' ? object.length : exports.keys(object).length;
- // `.repeat()` polyfill
- function repeat (s, n) {
- return new Array(n).join(s);
- }
-
- function _stringify (val) {
- switch (type(val)) {
- case 'null':
- case 'undefined':
- val = '[' + val + ']';
- break;
- case 'array':
- case 'object':
- val = jsonStringify(val, spaces, depth + 1);
- break;
- case 'boolean':
- case 'regexp':
- case 'symbol':
- case 'number':
- val = val === 0 && (1 / val) === -Infinity // `-0`
- ? '-0'
- : val.toString();
- break;
- case 'date':
- var sDate;
- if (isNaN(val.getTime())) { // Invalid date
- sDate = val.toString();
- } else {
- sDate = val.toISOString ? val.toISOString() : toISOString(val);
- }
- val = '[Date: ' + sDate + ']';
- break;
- case 'buffer':
- var json = val.toJSON();
- // Based on the toJSON result
- json = json.data && json.type ? json.data : json;
- val = '[Buffer: ' + jsonStringify(json, 2, depth + 1) + ']';
- break;
- default:
- val = (val === '[Function]' || val === '[Circular]')
- ? val
- : JSON.stringify(val); // string
- }
- return val;
- }
-
- for (var i in object) {
- if (!Object.prototype.hasOwnProperty.call(object, i)) {
- continue; // not my business
- }
- --length;
- str += '\n ' + repeat(' ', space) +
- (isArray(object) ? '' : '"' + i + '": ') + // key
- _stringify(object[i]) + // value
- (length ? ',' : ''); // comma
- }
-
- return str +
- // [], {}
- (str.length !== 1 ? '\n' + repeat(' ', --space) + end : end);
-}
-
-/**
- * Test if a value is a buffer.
- *
- * @api private
- * @param {*} value The value to test.
- * @return {boolean} True if `value` is a buffer, otherwise false
- */
-exports.isBuffer = function (value) {
- return typeof Buffer !== 'undefined' && Buffer.isBuffer(value);
-};
-
-/**
- * Return a new Thing that has the keys in sorted order. Recursive.
- *
- * If the Thing...
- * - has already been seen, return string `'[Circular]'`
- * - is `undefined`, return string `'[undefined]'`
- * - is `null`, return value `null`
- * - is some other primitive, return the value
- * - is not a primitive or an `Array`, `Object`, or `Function`, return the value of the Thing's `toString()` method
- * - is a non-empty `Array`, `Object`, or `Function`, return the result of calling this function again.
- * - is an empty `Array`, `Object`, or `Function`, return the result of calling `emptyRepresentation()`
- *
- * @api private
- * @see {@link exports.stringify}
- * @param {*} value Thing to inspect. May or may not have properties.
- * @param {Array} [stack=[]] Stack of seen values
- * @param {string} [typeHint] Type hint
- * @return {(Object|Array|Function|string|undefined)}
- */
-exports.canonicalize = function canonicalize (value, stack, typeHint) {
- var canonicalizedObj;
- /* eslint-disable no-unused-vars */
- var prop;
- /* eslint-enable no-unused-vars */
- typeHint = typeHint || type(value);
- function withStack (value, fn) {
- stack.push(value);
- fn();
- stack.pop();
- }
-
- stack = stack || [];
-
- if (indexOf(stack, value) !== -1) {
- return '[Circular]';
- }
-
- switch (typeHint) {
- case 'undefined':
- case 'buffer':
- case 'null':
- canonicalizedObj = value;
- break;
- case 'array':
- withStack(value, function () {
- canonicalizedObj = exports.map(value, function (item) {
- return exports.canonicalize(item, stack);
- });
- });
- break;
- case 'function':
- /* eslint-disable guard-for-in */
- for (prop in value) {
- canonicalizedObj = {};
- break;
- }
- /* eslint-enable guard-for-in */
- if (!canonicalizedObj) {
- canonicalizedObj = emptyRepresentation(value, typeHint);
- break;
- }
- /* falls through */
- case 'object':
- canonicalizedObj = canonicalizedObj || {};
- withStack(value, function () {
- exports.forEach(exports.keys(value).sort(), function (key) {
- canonicalizedObj[key] = exports.canonicalize(value[key], stack);
- });
- });
- break;
- case 'date':
- case 'number':
- case 'regexp':
- case 'boolean':
- case 'symbol':
- canonicalizedObj = value;
- break;
- default:
- canonicalizedObj = value + '';
- }
-
- return canonicalizedObj;
-};
-
-/**
- * Lookup file names at the given `path`.
- *
- * @api public
- * @param {string} path Base path to start searching from.
- * @param {string[]} extensions File extensions to look for.
- * @param {boolean} recursive Whether or not to recurse into subdirectories.
- * @return {string[]} An array of paths.
- */
-exports.lookupFiles = function lookupFiles (path, extensions, recursive) {
- var files = [];
- var re = new RegExp('\\.(' + extensions.join('|') + ')$');
-
- if (!exists(path)) {
- if (exists(path + '.js')) {
- path += '.js';
- } else {
- files = glob.sync(path);
- if (!files.length) {
- throw new Error("cannot resolve path (or pattern) '" + path + "'");
- }
- return files;
- }
- }
-
- try {
- var stat = statSync(path);
- if (stat.isFile()) {
- return path;
- }
- } catch (err) {
- // ignore error
- return;
- }
-
- readdirSync(path).forEach(function (file) {
- file = join(path, file);
- try {
- var stat = statSync(file);
- if (stat.isDirectory()) {
- if (recursive) {
- files = files.concat(lookupFiles(file, extensions, recursive));
- }
- return;
- }
- } catch (err) {
- // ignore error
- return;
- }
- if (!stat.isFile() || !re.test(file) || basename(file)[0] === '.') {
- return;
- }
- files.push(file);
- });
-
- return files;
-};
-
-/**
- * Generate an undefined error with a message warning the user.
- *
- * @return {Error}
- */
-
-exports.undefinedError = function () {
- return new Error('Caught undefined error, did you throw without specifying what?');
-};
-
-/**
- * Generate an undefined error if `err` is not defined.
- *
- * @param {Error} err
- * @return {Error}
- */
-
-exports.getError = function (err) {
- return err || exports.undefinedError();
-};
-
-/**
- * @summary
- * This Filter based on `mocha-clean` module.(see: `github.com/rstacruz/mocha-clean`)
- * @description
- * When invoking this function you get a filter function that get the Error.stack as an input,
- * and return a prettify output.
- * (i.e: strip Mocha and internal node functions from stack trace).
- * @returns {Function}
- */
-exports.stackTraceFilter = function () {
- // TODO: Replace with `process.browser`
- var is = typeof document === 'undefined' ? { node: true } : { browser: true };
- var slash = path.sep;
- var cwd;
- if (is.node) {
- cwd = process.cwd() + slash;
- } else {
- cwd = (typeof location === 'undefined' ? window.location : location).href.replace(/\/[^\/]*$/, '/');
- slash = '/';
- }
-
- function isMochaInternal (line) {
- return (~line.indexOf('node_modules' + slash + 'mocha' + slash)) ||
- (~line.indexOf('node_modules' + slash + 'mocha.js')) ||
- (~line.indexOf('bower_components' + slash + 'mocha.js')) ||
- (~line.indexOf(slash + 'mocha.js'));
- }
-
- function isNodeInternal (line) {
- return (~line.indexOf('(timers.js:')) ||
- (~line.indexOf('(events.js:')) ||
- (~line.indexOf('(node.js:')) ||
- (~line.indexOf('(module.js:')) ||
- (~line.indexOf('GeneratorFunctionPrototype.next (native)')) ||
- false;
- }
-
- return function (stack) {
- stack = stack.split('\n');
-
- stack = reduce(stack, function (list, line) {
- if (isMochaInternal(line)) {
- return list;
- }
-
- if (is.node && isNodeInternal(line)) {
- return list;
- }
-
- // Clean up cwd(absolute)
- if (/\(?.+:\d+:\d+\)?$/.test(line)) {
- line = line.replace(cwd, '');
- }
-
- list.push(line);
- return list;
- }, []);
-
- return stack.join('\n');
- };
-};
-
-/**
- * Crude, but effective.
- * @api
- * @param {*} value
- * @returns {boolean} Whether or not `value` is a Promise
- */
-exports.isPromise = function isPromise (value) {
- return typeof value === 'object' && typeof value.then === 'function';
-};
-
-/**
- * It's a noop.
- * @api
- */
-exports.noop = function () {};
diff --git a/tests/lib/mocha-3.1.2/media/logo.svg b/tests/lib/mocha-3.1.2/media/logo.svg
deleted file mode 100644
index bc3cb4b5df..0000000000
--- a/tests/lib/mocha-3.1.2/media/logo.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="612px" height="792px" viewBox="0 0 612 792" enable-background="new 0 0 612 792" xml:space="preserve">
-<circle fill="#8A6343" cx="306" cy="396" r="306"/>
-<text transform="matrix(1 0 0 1 72.1431 424.7633)" fill="#FFFFFF" font-family="'HelveticaNeue'" font-size="153">mocha</text>
-</svg>
diff --git a/tests/lib/mocha-3.1.2/mocha.css b/tests/lib/mocha-3.1.2/mocha.css
deleted file mode 100644
index ec96b003c9..0000000000
--- a/tests/lib/mocha-3.1.2/mocha.css
+++ /dev/null
@@ -1,326 +0,0 @@
-@charset "utf-8";
-
-body {
- margin:0;
-}
-
-#mocha {
- font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
- margin: 60px 50px;
-}
-
-#mocha ul,
-#mocha li {
- 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: normal;
- 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: black;
-}
-
-#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 .html-error {
- overflow: auto;
- color: black;
- line-height: 1.5;
- display: block;
- float: left;
- clear: left;
- font: 12px/1.5 monaco, monospace;
- margin: 5px;
- padding: 15px;
- border: 1px solid #eee;
- max-width: 85%; /*(1)*/
- max-width: -webkit-calc(100% - 42px);
- max-width: -moz-calc(100% - 42px);
- max-width: calc(100% - 42px); /*(2)*/
- max-height: 300px;
- word-wrap: break-word;
- border-bottom-color: #ddd;
- -webkit-box-shadow: 0 1px 3px #eee;
- -moz-box-shadow: 0 1px 3px #eee;
- box-shadow: 0 1px 3px #eee;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- border-radius: 3px;
-}
-
-#mocha .test .html-error pre.error {
- border: none;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
- -webkit-box-shadow: 0;
- -moz-box-shadow: 0;
- box-shadow: 0;
- padding: 0;
- margin: 0;
- margin-top: 18px;
- max-height: none;
-}
-
-/**
- * (1): approximate for browsers not supporting calc
- * (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)
- * ^^ seriously
- */
-#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%; /*(1)*/
- max-width: -webkit-calc(100% - 42px);
- max-width: -moz-calc(100% - 42px);
- max-width: calc(100% - 42px); /*(2)*/
- word-wrap: break-word;
- border-bottom-color: #ddd;
- -webkit-box-shadow: 0 1px 3px #eee;
- -moz-box-shadow: 0 1px 3px #eee;
- box-shadow: 0 1px 3px #eee;
- -webkit-border-radius: 3px;
- -moz-border-radius: 3px;
- 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;
- -webkit-border-radius: 15px;
- -moz-border-radius: 15px;
- border-radius: 15px;
- -webkit-transition:opacity 200ms;
- -moz-transition:opacity 200ms;
- -o-transition:opacity 200ms;
- transition: opacity 200ms;
- opacity: 0.3;
- color: #888;
-}
-
-#mocha .test:hover a.replay {
- opacity: 1;
-}
-
-#mocha-report.pass .test.fail {
- display: none;
-}
-
-#mocha-report.fail .test.pass {
- display: none;
-}
-
-#mocha-report.pending .test.pass,
-#mocha-report.pending .test.fail {
- 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;
-
- /**
- * Set safe initial values, so mochas .progress does not inherit these
- * properties from Bootstrap .progress (which causes .progress height to
- * equal line height set in Bootstrap).
- */
- height: auto;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
- background-color: initial;
-}
-
-#mocha-stats em {
- color: black;
-}
-
-#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 0px;
- }
-
- #mocha #stats {
- position: absolute;
- }
-}
diff --git a/tests/lib/mocha-3.1.2/mocha.js b/tests/lib/mocha-3.1.2/mocha.js
deleted file mode 100644
index 16d5619e27..0000000000
--- a/tests/lib/mocha-3.1.2/mocha.js
+++ /dev/null
@@ -1,15556 +0,0 @@
-(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-(function (process,global){
-'use strict';
-
-/* eslint no-unused-vars: off */
-/* eslint-env commonjs */
-
-/**
- * Shim process.stdout.
- */
-
-process.stdout = require('browser-stdout')();
-
-var Mocha = require('./lib/mocha');
-
-/**
- * Create a Mocha instance.
- *
- * @return {undefined}
- */
-
-var mocha = new Mocha({ reporter: 'html' });
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-
-var uncaughtExceptionHandlers = [];
-
-var originalOnerrorHandler = global.onerror;
-
-/**
- * Remove uncaughtException listener.
- * Revert to original onerror handler if previously defined.
- */
-
-process.removeListener = function (e, fn) {
- if (e === 'uncaughtException') {
- if (originalOnerrorHandler) {
- global.onerror = originalOnerrorHandler;
- } else {
- global.onerror = function () {};
- }
- var i = Mocha.utils.indexOf(uncaughtExceptionHandlers, fn);
- if (i !== -1) {
- uncaughtExceptionHandlers.splice(i, 1);
- }
- }
-};
-
-/**
- * Implements uncaughtException listener.
- */
-
-process.on = function (e, fn) {
- if (e === 'uncaughtException') {
- global.onerror = function (err, url, line) {
- fn(new Error(err + ' (' + url + ':' + line + ')'));
- return !mocha.allowUncaught;
- };
- uncaughtExceptionHandlers.push(fn);
- }
-};
-
-// The BDD UI is registered by default, but no UI will be functional in the
-// browser without an explicit call to the overridden `mocha.ui` (see below).
-// Ensure that this default UI does not expose its methods to the global scope.
-mocha.suite.removeAllListeners('pre-require');
-
-var immediateQueue = [];
-var immediateTimeout;
-
-function timeslice () {
- var immediateStart = new Date().getTime();
- while (immediateQueue.length && (new Date().getTime() - immediateStart) < 100) {
- immediateQueue.shift()();
- }
- if (immediateQueue.length) {
- immediateTimeout = setTimeout(timeslice, 0);
- } else {
- immediateTimeout = null;
- }
-}
-
-/**
- * High-performance override of Runner.immediately.
- */
-
-Mocha.Runner.immediately = function (callback) {
- immediateQueue.push(callback);
- if (!immediateTimeout) {
- immediateTimeout = setTimeout(timeslice, 0);
- }
-};
-
-/**
- * Function to allow assertion libraries to throw errors directly into mocha.
- * This is useful when running tests in a browser because window.onerror will
- * only receive the 'message' attribute of the Error.
- */
-mocha.throwError = function (err) {
- Mocha.utils.forEach(uncaughtExceptionHandlers, function (fn) {
- fn(err);
- });
- throw err;
-};
-
-/**
- * Override ui to ensure that the ui functions are initialized.
- * Normally this would happen in Mocha.prototype.loadFiles.
- */
-
-mocha.ui = function (ui) {
- Mocha.prototype.ui.call(this, ui);
- this.suite.emit('pre-require', global, null, this);
- return this;
-};
-
-/**
- * Setup mocha with the given setting options.
- */
-
-mocha.setup = function (opts) {
- if (typeof opts === 'string') {
- opts = { ui: opts };
- }
- for (var opt in opts) {
- if (opts.hasOwnProperty(opt)) {
- this[opt](opts[opt]);
- }
- }
- return this;
-};
-
-/**
- * Run mocha, returning the Runner.
- */
-
-mocha.run = function (fn) {
- var options = mocha.options;
- mocha.globals('location');
-
- var query = Mocha.utils.parseQuery(global.location.search || '');
- if (query.grep) {
- mocha.grep(query.grep);
- }
- if (query.fgrep) {
- mocha.fgrep(query.fgrep);
- }
- if (query.invert) {
- mocha.invert();
- }
-
- return Mocha.prototype.run.call(mocha, function (err) {
- // The DOM Document is not available in Web Workers.
- var document = global.document;
- if (document && document.getElementById('mocha') && options.noHighlighting !== true) {
- Mocha.utils.highlightTags('code');
- }
- if (fn) {
- fn(err);
- }
- });
-};
-
-/**
- * Expose the process shim.
- * https://github.com/mochajs/mocha/pull/916
- */
-
-Mocha.process = process;
-
-/**
- * Expose mocha.
- */
-
-global.Mocha = Mocha;
-global.mocha = mocha;
-
-// this allows test/acceptance/required-tokens.js to pass; thus,
-// you can now do `const describe = require('mocha').describe` in a
-// browser context (assuming browserification). should fix #880
-module.exports = global;
-
-}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./lib/mocha":14,"_process":67,"browser-stdout":41}],2:[function(require,module,exports){
-'use strict';
-
-function noop () {}
-
-module.exports = function () {
- return noop;
-};
-
-},{}],3:[function(require,module,exports){
-'use strict';
-
-/**
- * Module exports.
- */
-
-exports.EventEmitter = EventEmitter;
-
-/**
- * Object#toString reference.
- */
-var objToString = Object.prototype.toString;
-
-/**
- * Check if a value is an array.
- *
- * @api private
- * @param {*} val The value to test.
- * @return {boolean} true if the value is an array, otherwise false.
- */
-function isArray (val) {
- return objToString.call(val) === '[object Array]';
-}
-
-/**
- * Event emitter constructor.
- *
- * @api public
- */
-function EventEmitter () {}
-
-/**
- * Add a listener.
- *
- * @api public
- * @param {string} name Event name.
- * @param {Function} fn Event handler.
- * @return {EventEmitter} Emitter instance.
- */
-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
- * @param {string} name Event name.
- * @param {Function} fn Event handler.
- * @return {EventEmitter} Emitter instance.
- */
-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;
-};
-
-/**
- * Remove a listener.
- *
- * @api public
- * @param {string} name Event name.
- * @param {Function} fn Event handler.
- * @return {EventEmitter} Emitter instance.
- */
-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;
-};
-
-/**
- * Remove all listeners for an event.
- *
- * @api public
- * @param {string} name Event name.
- * @return {EventEmitter} Emitter instance.
- */
-EventEmitter.prototype.removeAllListeners = function (name) {
- if (name === undefined) {
- this.$events = {};
- return this;
- }
-
- if (this.$events && this.$events[name]) {
- this.$events[name] = null;
- }
-
- return this;
-};
-
-/**
- * Get all listeners for a given event.
- *
- * @api public
- * @param {string} name Event name.
- * @return {EventEmitter} Emitter instance.
- */
-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];
-};
-
-/**
- * Emit an event.
- *
- * @api public
- * @param {string} name Event name.
- * @return {boolean} true if at least one handler was invoked, else false.
- */
-EventEmitter.prototype.emit = function (name) {
- if (!this.$events) {
- return false;
- }
-
- var handler = this.$events[name];
-
- if (!handler) {
- return false;
- }
-
- var args = Array.prototype.slice.call(arguments, 1);
-
- if (typeof handler === 'function') {
- 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;
-};
-
-},{}],4:[function(require,module,exports){
-'use strict';
-
-/**
- * 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 `size`.
- *
- * @api public
- * @param {number} size
- * @return {Progress} Progress instance.
- */
-Progress.prototype.size = function (size) {
- this._size = size;
- return this;
-};
-
-/**
- * Set text to `text`.
- *
- * @api public
- * @param {string} text
- * @return {Progress} Progress instance.
- */
-Progress.prototype.text = function (text) {
- this._text = text;
- return this;
-};
-
-/**
- * Set font size to `size`.
- *
- * @api public
- * @param {number} size
- * @return {Progress} Progress instance.
- */
-Progress.prototype.fontSize = function (size) {
- this._fontSize = size;
- return this;
-};
-
-/**
- * Set font to `family`.
- *
- * @param {string} family
- * @return {Progress} Progress instance.
- */
-Progress.prototype.font = function (family) {
- this._font = family;
- return this;
-};
-
-/**
- * Update percentage to `n`.
- *
- * @param {number} n
- * @return {Progress} Progress instance.
- */
-Progress.prototype.update = function (n) {
- this.percent = n;
- return this;
-};
-
-/**
- * Draw on `ctx`.
- *
- * @param {CanvasRenderingContext2d} ctx
- * @return {Progress} Progress instance.
- */
-Progress.prototype.draw = function (ctx) {
- try {
- var percent = Math.min(this.percent, 100);
- var size = this._size;
- var half = size / 2;
- var x = half;
- var y = half;
- var rad = half - 1;
- var 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) + '%';
- var w = ctx.measureText(text).width;
-
- ctx.fillText(text, x - w / 2 + 1, y + fontSize / 2 - 1);
- } catch (err) {
- // don't fail if we can't render progress
- }
- return this;
-};
-
-},{}],5:[function(require,module,exports){
-(function (global){
-'use strict';
-
-exports.isatty = function isatty () {
- return true;
-};
-
-exports.getWindowSize = function getWindowSize () {
- if ('innerHeight' in global) {
- return [global.innerHeight, global.innerWidth];
- }
- // In a Web Worker, the DOM Window is not available.
- return [640, 480];
-};
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],6:[function(require,module,exports){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var JSON = require('json3');
-
-/**
- * Expose `Context`.
- */
-
-module.exports = Context;
-
-/**
- * Initialize a new `Context`.
- *
- * @api private
- */
-function Context () {}
-
-/**
- * Set or get the context `Runnable` to `runnable`.
- *
- * @api private
- * @param {Runnable} runnable
- * @return {Context}
- */
-Context.prototype.runnable = function (runnable) {
- if (!arguments.length) {
- return this._runnable;
- }
- this.test = this._runnable = runnable;
- return this;
-};
-
-/**
- * Set test timeout `ms`.
- *
- * @api private
- * @param {number} ms
- * @return {Context} self
- */
-Context.prototype.timeout = function (ms) {
- if (!arguments.length) {
- return this.runnable().timeout();
- }
- this.runnable().timeout(ms);
- return this;
-};
-
-/**
- * Set test timeout `enabled`.
- *
- * @api private
- * @param {boolean} enabled
- * @return {Context} self
- */
-Context.prototype.enableTimeouts = function (enabled) {
- this.runnable().enableTimeouts(enabled);
- return this;
-};
-
-/**
- * Set test slowness threshold `ms`.
- *
- * @api private
- * @param {number} ms
- * @return {Context} self
- */
-Context.prototype.slow = function (ms) {
- this.runnable().slow(ms);
- return this;
-};
-
-/**
- * Mark a test as skipped.
- *
- * @api private
- * @return {Context} self
- */
-Context.prototype.skip = function () {
- this.runnable().skip();
- return this;
-};
-
-/**
- * Allow a number of retries on failed tests
- *
- * @api private
- * @param {number} n
- * @return {Context} self
- */
-Context.prototype.retries = function (n) {
- if (!arguments.length) {
- return this.runnable().retries();
- }
- this.runnable().retries(n);
- return this;
-};
-
-/**
- * Inspect the context void of `._runnable`.
- *
- * @api private
- * @return {string}
- */
-Context.prototype.inspect = function () {
- return JSON.stringify(this, function (key, val) {
- return key === 'runnable' || key === 'test' ? undefined : val;
- }, 2);
-};
-
-},{"json3":54}],7:[function(require,module,exports){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Runnable = require('./runnable');
-var inherits = require('./utils').inherits;
-
-/**
- * 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`.
- */
-inherits(Hook, Runnable);
-
-/**
- * Get or set the test `err`.
- *
- * @param {Error} err
- * @return {Error}
- * @api public
- */
-Hook.prototype.error = function (err) {
- if (!arguments.length) {
- err = this._error;
- this._error = null;
- return err;
- }
-
- this._error = err;
-};
-
-},{"./runnable":33,"./utils":38}],8:[function(require,module,exports){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Test = require('../test');
-
-/**
- * BDD-style interface:
- *
- * describe('Array', function() {
- * describe('#indexOf()', function() {
- * it('should return -1 when not present', function() {
- * // ...
- * });
- *
- * it('should return the index when present', function() {
- * // ...
- * });
- * });
- * });
- *
- * @param {Suite} suite Root suite.
- */
-module.exports = function (suite) {
- var suites = [suite];
-
- suite.on('pre-require', function (context, file, mocha) {
- var common = require('./common')(suites, context, mocha);
-
- context.before = common.before;
- context.after = common.after;
- context.beforeEach = common.beforeEach;
- context.afterEach = common.afterEach;
- context.run = mocha.options.delay && common.runWithSuite(suite);
- /**
- * Describe a "suite" with the given `title`
- * and callback `fn` containing nested suites
- * and/or tests.
- */
-
- context.describe = context.context = function (title, fn) {
- return common.suite.create({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Pending describe.
- */
-
- context.xdescribe = context.xcontext = context.describe.skip = function (title, fn) {
- return common.suite.skip({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Exclusive suite.
- */
-
- context.describe.only = function (title, fn) {
- return common.suite.only({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Describe a specification or test-case
- * with the given `title` and callback `fn`
- * acting as a thunk.
- */
-
- context.it = context.specify = function (title, fn) {
- var suite = suites[0];
- if (suite.isPending()) {
- fn = null;
- }
- var test = new Test(title, fn);
- test.file = file;
- suite.addTest(test);
- return test;
- };
-
- /**
- * Exclusive test-case.
- */
-
- context.it.only = function (title, fn) {
- return common.test.only(mocha, context.it(title, fn));
- };
-
- /**
- * Pending test case.
- */
-
- context.xit = context.xspecify = context.it.skip = function (title) {
- context.it(title);
- };
-
- /**
- * Number of attempts to retry.
- */
- context.it.retries = function (n) {
- context.retries(n);
- };
- });
-};
-
-},{"../test":36,"./common":9}],9:[function(require,module,exports){
-'use strict';
-
-var Suite = require('../suite');
-
-/**
- * Functions common to more than one interface.
- *
- * @param {Suite[]} suites
- * @param {Context} context
- * @param {Mocha} mocha
- * @return {Object} An object containing common functions.
- */
-module.exports = function (suites, context, mocha) {
- return {
- /**
- * This is only present if flag --delay is passed into Mocha. It triggers
- * root suite execution.
- *
- * @param {Suite} suite The root wuite.
- * @return {Function} A function which runs the root suite
- */
- runWithSuite: function runWithSuite (suite) {
- return function run () {
- suite.run();
- };
- },
-
- /**
- * Execute before running tests.
- *
- * @param {string} name
- * @param {Function} fn
- */
- before: function (name, fn) {
- suites[0].beforeAll(name, fn);
- },
-
- /**
- * Execute after running tests.
- *
- * @param {string} name
- * @param {Function} fn
- */
- after: function (name, fn) {
- suites[0].afterAll(name, fn);
- },
-
- /**
- * Execute before each test case.
- *
- * @param {string} name
- * @param {Function} fn
- */
- beforeEach: function (name, fn) {
- suites[0].beforeEach(name, fn);
- },
-
- /**
- * Execute after each test case.
- *
- * @param {string} name
- * @param {Function} fn
- */
- afterEach: function (name, fn) {
- suites[0].afterEach(name, fn);
- },
-
- suite: {
- /**
- * Create an exclusive Suite; convenience function
- * See docstring for create() below.
- *
- * @param {Object} opts
- * @returns {Suite}
- */
- only: function only (opts) {
- mocha.options.hasOnly = true;
- opts.isOnly = true;
- return this.create(opts);
- },
-
- /**
- * Create a Suite, but skip it; convenience function
- * See docstring for create() below.
- *
- * @param {Object} opts
- * @returns {Suite}
- */
- skip: function skip (opts) {
- opts.pending = true;
- return this.create(opts);
- },
-
- /**
- * Creates a suite.
- * @param {Object} opts Options
- * @param {string} opts.title Title of Suite
- * @param {Function} [opts.fn] Suite Function (not always applicable)
- * @param {boolean} [opts.pending] Is Suite pending?
- * @param {string} [opts.file] Filepath where this Suite resides
- * @param {boolean} [opts.isOnly] Is Suite exclusive?
- * @returns {Suite}
- */
- create: function create (opts) {
- var suite = Suite.create(suites[0], opts.title);
- suite.pending = Boolean(opts.pending);
- suite.file = opts.file;
- suites.unshift(suite);
- if (opts.isOnly) {
- suite.parent._onlySuites = suite.parent._onlySuites.concat(suite);
- mocha.options.hasOnly = true;
- }
- if (typeof opts.fn === 'function') {
- opts.fn.call(suite);
- suites.shift();
- } else if (typeof opts.fn === 'undefined' && !suite.pending) {
- throw new Error('Suite "' + suite.fullTitle() + '" was defined but no callback was supplied. Supply a callback or explicitly skip the suite.');
- }
-
- return suite;
- }
- },
-
- test: {
-
- /**
- * Exclusive test-case.
- *
- * @param {Object} mocha
- * @param {Function} test
- * @returns {*}
- */
- only: function (mocha, test) {
- test.parent._onlyTests = test.parent._onlyTests.concat(test);
- mocha.options.hasOnly = true;
- return test;
- },
-
- /**
- * Pending test case.
- *
- * @param {string} title
- */
- skip: function (title) {
- context.test(title);
- },
-
- /**
- * Number of retry attempts
- *
- * @param {number} n
- */
- retries: function (n) {
- context.retries(n);
- }
- }
- };
-};
-
-},{"../suite":35}],10:[function(require,module,exports){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Suite = require('../suite');
-var Test = require('../test');
-
-/**
- * Exports-style (as Node.js module) interface:
- *
- * exports.Array = {
- * '#indexOf()': {
- * 'should return -1 when the value is not present': function() {
- *
- * },
- *
- * 'should return the correct index when the value is present': function() {
- *
- * }
- * }
- * };
- *
- * @param {Suite} suite Root suite.
- */
-module.exports = function (suite) {
- var suites = [suite];
-
- suite.on('require', visit);
-
- function visit (obj, file) {
- var suite;
- for (var key in obj) {
- if (typeof obj[key] === 'function') {
- var fn = obj[key];
- switch (key) {
- case 'before':
- suites[0].beforeAll(fn);
- break;
- case 'after':
- suites[0].afterAll(fn);
- break;
- case 'beforeEach':
- suites[0].beforeEach(fn);
- break;
- case 'afterEach':
- suites[0].afterEach(fn);
- break;
- default:
- var test = new Test(key, fn);
- test.file = file;
- suites[0].addTest(test);
- }
- } else {
- suite = Suite.create(suites[0], key);
- suites.unshift(suite);
- visit(obj[key], file);
- suites.shift();
- }
- }
- }
-};
-
-},{"../suite":35,"../test":36}],11:[function(require,module,exports){
-'use strict';
-
-exports.bdd = require('./bdd');
-exports.tdd = require('./tdd');
-exports.qunit = require('./qunit');
-exports.exports = require('./exports');
-
-},{"./bdd":8,"./exports":10,"./qunit":12,"./tdd":13}],12:[function(require,module,exports){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Test = require('../test');
-
-/**
- * QUnit-style interface:
- *
- * suite('Array');
- *
- * test('#length', function() {
- * var arr = [1,2,3];
- * ok(arr.length == 3);
- * });
- *
- * test('#indexOf()', function() {
- * var arr = [1,2,3];
- * ok(arr.indexOf(1) == 0);
- * ok(arr.indexOf(2) == 1);
- * ok(arr.indexOf(3) == 2);
- * });
- *
- * suite('String');
- *
- * test('#length', function() {
- * ok('foo'.length == 3);
- * });
- *
- * @param {Suite} suite Root suite.
- */
-module.exports = function (suite) {
- var suites = [suite];
-
- suite.on('pre-require', function (context, file, mocha) {
- var common = require('./common')(suites, context, mocha);
-
- context.before = common.before;
- context.after = common.after;
- context.beforeEach = common.beforeEach;
- context.afterEach = common.afterEach;
- context.run = mocha.options.delay && common.runWithSuite(suite);
- /**
- * Describe a "suite" with the given `title`.
- */
-
- context.suite = function (title) {
- if (suites.length > 1) {
- suites.shift();
- }
- return common.suite.create({
- title: title,
- file: file,
- fn: false
- });
- };
-
- /**
- * Exclusive Suite.
- */
-
- context.suite.only = function (title) {
- if (suites.length > 1) {
- suites.shift();
- }
- return common.suite.only({
- title: title,
- file: file,
- fn: false
- });
- };
-
- /**
- * Describe a specification or test-case
- * with the given `title` and callback `fn`
- * acting as a thunk.
- */
-
- context.test = function (title, fn) {
- var test = new Test(title, fn);
- test.file = file;
- suites[0].addTest(test);
- return test;
- };
-
- /**
- * Exclusive test-case.
- */
-
- context.test.only = function (title, fn) {
- return common.test.only(mocha, context.test(title, fn));
- };
-
- context.test.skip = common.test.skip;
- context.test.retries = common.test.retries;
- });
-};
-
-},{"../test":36,"./common":9}],13:[function(require,module,exports){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Test = require('../test');
-
-/**
- * TDD-style interface:
- *
- * suite('Array', function() {
- * suite('#indexOf()', function() {
- * suiteSetup(function() {
- *
- * });
- *
- * test('should return -1 when not present', function() {
- *
- * });
- *
- * test('should return the index when present', function() {
- *
- * });
- *
- * suiteTeardown(function() {
- *
- * });
- * });
- * });
- *
- * @param {Suite} suite Root suite.
- */
-module.exports = function (suite) {
- var suites = [suite];
-
- suite.on('pre-require', function (context, file, mocha) {
- var common = require('./common')(suites, context, mocha);
-
- context.setup = common.beforeEach;
- context.teardown = common.afterEach;
- context.suiteSetup = common.before;
- context.suiteTeardown = common.after;
- context.run = mocha.options.delay && common.runWithSuite(suite);
-
- /**
- * Describe a "suite" with the given `title` and callback `fn` containing
- * nested suites and/or tests.
- */
- context.suite = function (title, fn) {
- return common.suite.create({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Pending suite.
- */
- context.suite.skip = function (title, fn) {
- return common.suite.skip({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Exclusive test-case.
- */
- context.suite.only = function (title, fn) {
- return common.suite.only({
- title: title,
- file: file,
- fn: fn
- });
- };
-
- /**
- * Describe a specification or test-case with the given `title` and
- * callback `fn` acting as a thunk.
- */
- context.test = function (title, fn) {
- var suite = suites[0];
- if (suite.isPending()) {
- fn = null;
- }
- var test = new Test(title, fn);
- test.file = file;
- suite.addTest(test);
- return test;
- };
-
- /**
- * Exclusive test-case.
- */
-
- context.test.only = function (title, fn) {
- return common.test.only(mocha, context.test(title, fn));
- };
-
- context.test.skip = common.test.skip;
- context.test.retries = common.test.retries;
- });
-};
-
-},{"../test":36,"./common":9}],14:[function(require,module,exports){
-(function (process,global,__dirname){
-'use strict';
-
-/*!
- * mocha
- * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
- * MIT Licensed
- */
-
-/**
- * Module dependencies.
- */
-
-var escapeRe = require('escape-string-regexp');
-var path = require('path');
-var reporters = require('./reporters');
-var utils = require('./utils');
-
-/**
- * Expose `Mocha`.
- */
-
-exports = module.exports = Mocha;
-
-/**
- * To require local UIs and reporters when running in node.
- */
-
-if (!process.browser) {
- var cwd = process.cwd();
- module.paths.push(cwd, path.join(cwd, 'node_modules'));
-}
-
-/**
- * Expose internals.
- */
-
-exports.utils = utils;
-exports.interfaces = require('./interfaces');
-exports.reporters = reporters;
-exports.Runnable = require('./runnable');
-exports.Context = require('./context');
-exports.Runner = require('./runner');
-exports.Suite = require('./suite');
-exports.Hook = require('./hook');
-exports.Test = require('./test');
-
-/**
- * Return image `name` path.
- *
- * @api private
- * @param {string} name
- * @return {string}
- */
-function image (name) {
- return path.join(__dirname, '../images', name + '.png');
-}
-
-/**
- * Set up mocha with `options`.
- *
- * Options:
- *
- * - `ui` name "bdd", "tdd", "exports" etc
- * - `reporter` reporter instance, defaults to `mocha.reporters.spec`
- * - `globals` array of accepted globals
- * - `timeout` timeout in milliseconds
- * - `retries` number of times to retry failed tests
- * - `bail` bail on the first test failure
- * - `slow` milliseconds to wait before considering a test slow
- * - `ignoreLeaks` ignore global leaks
- * - `fullTrace` display the full stack-trace on failing
- * - `grep` string or regexp to filter tests with
- *
- * @param {Object} options
- * @api public
- */
-function Mocha (options) {
- options = options || {};
- this.files = [];
- this.options = options;
- if (options.grep) {
- this.grep(new RegExp(options.grep));
- }
- if (options.fgrep) {
- this.fgrep(options.fgrep);
- }
- this.suite = new exports.Suite('', new exports.Context());
- this.ui(options.ui);
- this.bail(options.bail);
- this.reporter(options.reporter, options.reporterOptions);
- if (typeof options.timeout !== 'undefined' && options.timeout !== null) {
- this.timeout(options.timeout);
- }
- if (typeof options.retries !== 'undefined' && options.retries !== null) {
- this.retries(options.retries);
- }
- this.useColors(options.useColors);
- if (options.enableTimeouts !== null) {
- this.enableTimeouts(options.enableTimeouts);
- }
- if (options.slow) {
- this.slow(options.slow);
- }
-}
-
-/**
- * Enable or disable bailing on the first failure.
- *
- * @api public
- * @param {boolean} [bail]
- */
-Mocha.prototype.bail = function (bail) {
- if (!arguments.length) {
- bail = true;
- }
- this.suite.bail(bail);
- return this;
-};
-
-/**
- * Add test `file`.
- *
- * @api public
- * @param {string} file
- */
-Mocha.prototype.addFile = function (file) {
- this.files.push(file);
- return this;
-};
-
-/**
- * Set reporter to `reporter`, defaults to "spec".
- *
- * @param {String|Function} reporter name or constructor
- * @param {Object} reporterOptions optional options
- * @api public
- * @param {string|Function} reporter name or constructor
- * @param {Object} reporterOptions optional options
- */
-Mocha.prototype.reporter = function (reporter, reporterOptions) {
- if (typeof reporter === 'function') {
- this._reporter = reporter;
- } else {
- reporter = reporter || 'spec';
- var _reporter;
- // Try to load a built-in reporter.
- if (reporters[reporter]) {
- _reporter = reporters[reporter];
- }
- // Try to load reporters from process.cwd() and node_modules
- if (!_reporter) {
- try {
- _reporter = require(reporter);
- } catch (err) {
- err.message.indexOf('Cannot find module') !== -1
- ? console.warn('"' + reporter + '" reporter not found')
- : console.warn('"' + reporter + '" reporter blew up with error:\n' + err.stack);
- }
- }
- if (!_reporter && reporter === 'teamcity') {
- console.warn('The Teamcity reporter was moved to a package named ' +
- 'mocha-teamcity-reporter ' +
- '(https://npmjs.org/package/mocha-teamcity-reporter).');
- }
- if (!_reporter) {
- throw new Error('invalid reporter "' + reporter + '"');
- }
- this._reporter = _reporter;
- }
- this.options.reporterOptions = reporterOptions;
- return this;
-};
-
-/**
- * Set test UI `name`, defaults to "bdd".
- *
- * @api public
- * @param {string} bdd
- */
-Mocha.prototype.ui = function (name) {
- name = name || 'bdd';
- this._ui = exports.interfaces[name];
- if (!this._ui) {
- try {
- this._ui = require(name);
- } catch (err) {
- throw new Error('invalid interface "' + name + '"');
- }
- }
- this._ui = this._ui(this.suite);
-
- this.suite.on('pre-require', function (context) {
- exports.afterEach = context.afterEach || context.teardown;
- exports.after = context.after || context.suiteTeardown;
- exports.beforeEach = context.beforeEach || context.setup;
- exports.before = context.before || context.suiteSetup;
- exports.describe = context.describe || context.suite;
- exports.it = context.it || context.test;
- exports.setup = context.setup || context.beforeEach;
- exports.suiteSetup = context.suiteSetup || context.before;
- exports.suiteTeardown = context.suiteTeardown || context.after;
- exports.suite = context.suite || context.describe;
- exports.teardown = context.teardown || context.afterEach;
- exports.test = context.test || context.it;
- exports.run = context.run;
- });
-
- return this;
-};
-
-/**
- * Load registered files.
- *
- * @api private
- */
-Mocha.prototype.loadFiles = function (fn) {
- var self = this;
- var suite = this.suite;
- this.files.forEach(function (file) {
- file = path.resolve(file);
- suite.emit('pre-require', global, file, self);
- suite.emit('require', require(file), file, self);
- suite.emit('post-require', global, file, self);
- });
- fn && fn();
-};
-
-/**
- * Enable growl support.
- *
- * @api private
- */
-Mocha.prototype._growl = function (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: image('error') });
- } else {
- notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', {
- name: 'mocha',
- title: 'Passed',
- image: image('ok')
- });
- }
- });
-};
-
-/**
- * Escape string and add it to grep as a regexp.
- *
- * @api public
- * @param str
- * @returns {Mocha}
- */
-Mocha.prototype.fgrep = function (str) {
- return this.grep(new RegExp(escapeRe(str)));
-};
-
-/**
- * Add regexp to grep, if `re` is a string it is escaped.
- *
- * @param {RegExp|String} re
- * @return {Mocha}
- * @api public
- * @param {RegExp|string} re
- * @return {Mocha}
- */
-Mocha.prototype.grep = function (re) {
- if (utils.isString(re)) {
- // extract args if it's regex-like, i.e: [string, pattern, flag]
- var arg = re.match(/^\/(.*)\/(g|i|)$|.*/);
- this.options.grep = new RegExp(arg[1] || arg[0], arg[2]);
- } else {
- this.options.grep = re;
- }
- return this;
-};
-/**
- * Invert `.grep()` matches.
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.invert = function () {
- this.options.invert = true;
- return this;
-};
-
-/**
- * Ignore global leaks.
- *
- * @param {Boolean} ignore
- * @return {Mocha}
- * @api public
- * @param {boolean} ignore
- * @return {Mocha}
- */
-Mocha.prototype.ignoreLeaks = function (ignore) {
- this.options.ignoreLeaks = Boolean(ignore);
- return this;
-};
-
-/**
- * Enable global leak checking.
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.checkLeaks = function () {
- this.options.ignoreLeaks = false;
- return this;
-};
-
-/**
- * Display long stack-trace on failing
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.fullTrace = function () {
- this.options.fullStackTrace = true;
- return this;
-};
-
-/**
- * Enable growl support.
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.growl = function () {
- this.options.growl = true;
- return this;
-};
-
-/**
- * Ignore `globals` array or string.
- *
- * @param {Array|String} globals
- * @return {Mocha}
- * @api public
- * @param {Array|string} globals
- * @return {Mocha}
- */
-Mocha.prototype.globals = function (globals) {
- this.options.globals = (this.options.globals || []).concat(globals);
- return this;
-};
-
-/**
- * Emit color output.
- *
- * @param {Boolean} colors
- * @return {Mocha}
- * @api public
- * @param {boolean} colors
- * @return {Mocha}
- */
-Mocha.prototype.useColors = function (colors) {
- if (colors !== undefined) {
- this.options.useColors = colors;
- }
- return this;
-};
-
-/**
- * Use inline diffs rather than +/-.
- *
- * @param {Boolean} inlineDiffs
- * @return {Mocha}
- * @api public
- * @param {boolean} inlineDiffs
- * @return {Mocha}
- */
-Mocha.prototype.useInlineDiffs = function (inlineDiffs) {
- this.options.useInlineDiffs = inlineDiffs !== undefined && inlineDiffs;
- return this;
-};
-
-/**
- * Set the timeout in milliseconds.
- *
- * @param {Number} timeout
- * @return {Mocha}
- * @api public
- * @param {number} timeout
- * @return {Mocha}
- */
-Mocha.prototype.timeout = function (timeout) {
- this.suite.timeout(timeout);
- return this;
-};
-
-/**
- * Set the number of times to retry failed tests.
- *
- * @param {Number} retry times
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.retries = function (n) {
- this.suite.retries(n);
- return this;
-};
-
-/**
- * Set slowness threshold in milliseconds.
- *
- * @param {Number} slow
- * @return {Mocha}
- * @api public
- * @param {number} slow
- * @return {Mocha}
- */
-Mocha.prototype.slow = function (slow) {
- this.suite.slow(slow);
- return this;
-};
-
-/**
- * Enable timeouts.
- *
- * @param {Boolean} enabled
- * @return {Mocha}
- * @api public
- * @param {boolean} enabled
- * @return {Mocha}
- */
-Mocha.prototype.enableTimeouts = function (enabled) {
- this.suite.enableTimeouts(arguments.length && enabled !== undefined ? enabled : true);
- return this;
-};
-
-/**
- * Makes all tests async (accepting a callback)
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.asyncOnly = function () {
- this.options.asyncOnly = true;
- return this;
-};
-
-/**
- * Disable syntax highlighting (in browser).
- *
- * @api public
- */
-Mocha.prototype.noHighlighting = function () {
- this.options.noHighlighting = true;
- return this;
-};
-
-/**
- * Enable uncaught errors to propagate (in browser).
- *
- * @return {Mocha}
- * @api public
- */
-Mocha.prototype.allowUncaught = function () {
- this.options.allowUncaught = true;
- return this;
-};
-
-/**
- * Delay root suite execution.
- * @returns {Mocha}
- */
-Mocha.prototype.delay = function delay () {
- this.options.delay = true;
- return this;
-};
-
-/**
- * Run tests and invoke `fn()` when complete.
- *
- * @api public
- * @param {Function} fn
- * @return {Runner}
- */
-Mocha.prototype.run = function (fn) {
- if (this.files.length) {
- this.loadFiles();
- }
- var suite = this.suite;
- var options = this.options;
- options.files = this.files;
- var runner = new exports.Runner(suite, options.delay);
- var reporter = new this._reporter(runner, options);
- runner.ignoreLeaks = options.ignoreLeaks !== false;
- runner.fullStackTrace = options.fullStackTrace;
- runner.hasOnly = options.hasOnly;
- runner.asyncOnly = options.asyncOnly;
- runner.allowUncaught = options.allowUncaught;
- if (options.grep) {
- runner.grep(options.grep, options.invert);
- }
- if (options.globals) {
- runner.globals(options.globals);
- }
- if (options.growl) {
- this._growl(runner, reporter);
- }
- if (options.useColors !== undefined) {
- exports.reporters.Base.useColors = options.useColors;
- }
- exports.reporters.Base.inlineDiffs = options.useInlineDiffs;
-
- function done (failures) {
- if (reporter.done) {
- reporter.done(failures, fn);
- } else {
- fn && fn(failures);
- }
- }
-
- return runner.run(done);
-};
-
-}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},"/lib")
-},{"./context":6,"./hook":7,"./interfaces":11,"./reporters":21,"./runnable":33,"./runner":34,"./suite":35,"./test":36,"./utils":38,"_process":67,"escape-string-regexp":47,"growl":49,"path":42}],15:[function(require,module,exports){
-'use strict';
-
-/**
- * Helpers.
- */
-
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var y = d * 365.25;
-
-/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @api public
- * @param {string|number} val
- * @param {Object} options
- * @return {string|number}
- */
-module.exports = function (val, options) {
- options = options || {};
- if (typeof val === 'string') {
- return parse(val);
- }
- // https://github.com/mochajs/mocha/pull/1035
- return options['long'] ? longFormat(val) : shortFormat(val);
-};
-
-/**
- * Parse the given `str` and return milliseconds.
- *
- * @api private
- * @param {string} str
- * @return {number}
- */
-function parse (str) {
- var match = (/^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i).exec(str);
- if (!match) {
- return;
- }
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'y':
- return n * y;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 's':
- return n * s;
- case 'ms':
- return n;
- default:
- // No default case
- }
-}
-
-/**
- * Short format for `ms`.
- *
- * @api private
- * @param {number} ms
- * @return {string}
- */
-function shortFormat (ms) {
- if (ms >= d) {
- return Math.round(ms / d) + 'd';
- }
- if (ms >= h) {
- return Math.round(ms / h) + 'h';
- }
- if (ms >= m) {
- return Math.round(ms / m) + 'm';
- }
- if (ms >= s) {
- return Math.round(ms / s) + 's';
- }
- return ms + 'ms';
-}
-
-/**
- * Long format for `ms`.
- *
- * @api private
- * @param {number} ms
- * @return {string}
- */
-function longFormat (ms) {
- return plural(ms, d, 'day') ||
- plural(ms, h, 'hour') ||
- plural(ms, m, 'minute') ||
- plural(ms, s, 'second') ||
- ms + ' ms';
-}
-
-/**
- * Pluralization helper.
- *
- * @api private
- * @param {number} ms
- * @param {number} n
- * @param {string} name
- */
-function plural (ms, n, name) {
- if (ms < n) {
- return;
- }
- if (ms < n * 1.5) {
- return Math.floor(ms / n) + ' ' + name;
- }
- return Math.ceil(ms / n) + ' ' + name + 's';
-}
-
-},{}],16:[function(require,module,exports){
-'use strict';
-
-/**
- * Expose `Pending`.
- */
-
-module.exports = Pending;
-
-/**
- * Initialize a new `Pending` error with the given message.
- *
- * @param {string} message
- */
-function Pending (message) {
- this.message = message;
-}
-
-},{}],17:[function(require,module,exports){
-(function (process,global){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var tty = require('tty');
-var diff = require('diff');
-var ms = require('../ms');
-var utils = require('../utils');
-var supportsColor = process.browser ? null : require('supports-color');
-
-/**
- * Expose `Base`.
- */
-
-exports = module.exports = Base;
-
-/**
- * Save timer references to avoid Sinon interfering.
- * See: https://github.com/mochajs/mocha/issues/237
- */
-
-/* eslint-disable no-unused-vars, no-native-reassign */
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-/* eslint-enable no-unused-vars, no-native-reassign */
-
-/**
- * Check if both stdio streams are associated with a tty.
- */
-
-var isatty = tty.isatty(1) && tty.isatty(2);
-
-/**
- * Enable coloring by default, except in the browser interface.
- */
-
-exports.useColors = !process.browser && (supportsColor || (process.env.MOCHA_COLORS !== undefined));
-
-/**
- * Inline diffs instead of +/-
- */
-
-exports.inlineDiffs = false;
-
-/**
- * Default color map.
- */
-
-exports.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': 32,
- 'diff removed': 31
-};
-
-/**
- * Default symbol map.
- */
-
-exports.symbols = {
- ok: '✓',
- err: '✖',
- dot: '․',
- comma: ',',
- bang: '!'
-};
-
-// With node.js on Windows: use symbols available in terminal default fonts
-if (process.platform === 'win32') {
- exports.symbols.ok = '\u221A';
- exports.symbols.err = '\u00D7';
- exports.symbols.dot = '.';
-}
-
-/**
- * Color `str` with the given `type`,
- * allowing colors to be disabled,
- * as well as user-defined color
- * schemes.
- *
- * @param {string} type
- * @param {string} str
- * @return {string}
- * @api private
- */
-var color = exports.color = function (type, str) {
- if (!exports.useColors) {
- return String(str);
- }
- return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m';
-};
-
-/**
- * Expose term window size, with some defaults for when stderr is not a tty.
- */
-
-exports.window = {
- width: 75
-};
-
-if (isatty) {
- exports.window.width = process.stdout.getWindowSize
- ? process.stdout.getWindowSize(1)[0]
- : tty.getWindowSize()[1];
-}
-
-/**
- * Expose some basic cursor interactions that are common among reporters.
- */
-
-exports.cursor = {
- hide: function () {
- isatty && process.stdout.write('\u001b[?25l');
- },
-
- show: function () {
- isatty && process.stdout.write('\u001b[?25h');
- },
-
- deleteLine: function () {
- isatty && process.stdout.write('\u001b[2K');
- },
-
- beginningOfLine: function () {
- isatty && process.stdout.write('\u001b[0G');
- },
-
- CR: function () {
- if (isatty) {
- exports.cursor.deleteLine();
- exports.cursor.beginningOfLine();
- } else {
- process.stdout.write('\r');
- }
- }
-};
-
-/**
- * Outut the given `failures` as a list.
- *
- * @param {Array} failures
- * @api public
- */
-
-exports.list = function (failures) {
- console.log();
- failures.forEach(function (test, i) {
- // format
- var fmt = color('error title', ' %s) %s:\n') +
- color('error message', ' %s') +
- color('error stack', '\n%s\n');
-
- // msg
- var msg;
- var err = test.err;
- var message;
- if (err.message && typeof err.message.toString === 'function') {
- message = err.message + '';
- } else if (typeof err.inspect === 'function') {
- message = err.inspect() + '';
- } else {
- message = '';
- }
- var stack = err.stack || message;
- var index = message ? stack.indexOf(message) : -1;
- var actual = err.actual;
- var expected = err.expected;
- var escape = true;
-
- if (index === -1) {
- msg = message;
- } else {
- index += message.length;
- msg = stack.slice(0, index);
- // remove msg from stack
- stack = stack.slice(index + 1);
- }
-
- // uncaught
- if (err.uncaught) {
- msg = 'Uncaught ' + msg;
- }
- // explicitly show diff
- if (err.showDiff !== false && sameType(actual, expected) && expected !== undefined) {
- escape = false;
- if (!(utils.isString(actual) && utils.isString(expected))) {
- err.actual = actual = utils.stringify(actual);
- err.expected = expected = utils.stringify(expected);
- }
-
- fmt = color('error title', ' %s) %s:\n%s') + color('error stack', '\n%s\n');
- var match = message.match(/^([^:]+): expected/);
- msg = '\n ' + color('error message', match ? match[1] : msg);
-
- if (exports.inlineDiffs) {
- msg += inlineDiff(err, escape);
- } else {
- msg += unifiedDiff(err, escape);
- }
- }
-
- // indent stack trace
- stack = stack.replace(/^/gm, ' ');
-
- console.log(fmt, (i + 1), test.fullTitle(), msg, stack);
- });
-};
-
-/**
- * Initialize a new `Base` reporter.
- *
- * All other reporters generally
- * inherit from this reporter, providing
- * stats such as test duration, number
- * of tests passed / failed etc.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function Base (runner) {
- var stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 };
- var failures = this.failures = [];
-
- if (!runner) {
- return;
- }
- this.runner = runner;
-
- runner.stats = stats;
-
- runner.on('start', function () {
- stats.start = new Date();
- });
-
- runner.on('suite', function (suite) {
- stats.suites = stats.suites || 0;
- suite.root || stats.suites++;
- });
-
- runner.on('test end', function () {
- stats.tests = stats.tests || 0;
- stats.tests++;
- });
-
- runner.on('pass', function (test) {
- stats.passes = stats.passes || 0;
-
- if (test.duration > test.slow()) {
- test.speed = 'slow';
- } else if (test.duration > test.slow() / 2) {
- test.speed = 'medium';
- } else {
- test.speed = 'fast';
- }
-
- stats.passes++;
- });
-
- runner.on('fail', function (test, err) {
- stats.failures = stats.failures || 0;
- stats.failures++;
- test.err = err;
- failures.push(test);
- });
-
- runner.on('end', function () {
- stats.end = new Date();
- stats.duration = new Date() - stats.start;
- });
-
- runner.on('pending', function () {
- stats.pending++;
- });
-}
-
-/**
- * Output common epilogue used by many of
- * the bundled reporters.
- *
- * @api public
- */
-Base.prototype.epilogue = function () {
- var stats = this.stats;
- var fmt;
-
- console.log();
-
- // passes
- fmt = color('bright pass', ' ') +
- color('green', ' %d passing') +
- color('light', ' (%s)');
-
- console.log(fmt,
- stats.passes || 0,
- ms(stats.duration));
-
- // pending
- if (stats.pending) {
- fmt = color('pending', ' ') +
- color('pending', ' %d pending');
-
- console.log(fmt, stats.pending);
- }
-
- // failures
- if (stats.failures) {
- fmt = color('fail', ' %d failing');
-
- console.log(fmt, stats.failures);
-
- Base.list(this.failures);
- console.log();
- }
-
- console.log();
-};
-
-/**
- * Pad the given `str` to `len`.
- *
- * @api private
- * @param {string} str
- * @param {string} len
- * @return {string}
- */
-function pad (str, len) {
- str = String(str);
- return Array(len - str.length + 1).join(' ') + str;
-}
-
-/**
- * Returns an inline diff between 2 strings with coloured ANSI output
- *
- * @api private
- * @param {Error} err with actual/expected
- * @param {boolean} escape
- * @return {string} Diff
- */
-function inlineDiff (err, escape) {
- var msg = errorDiff(err, 'WordsWithSpace', escape);
-
- // linenos
- var lines = msg.split('\n');
- if (lines.length > 4) {
- var width = String(lines.length).length;
- msg = lines.map(function (str, i) {
- return pad(++i, width) + ' |' + ' ' + str;
- }).join('\n');
- }
-
- // legend
- msg = '\n' +
- color('diff removed', 'actual') +
- ' ' +
- color('diff added', 'expected') +
- '\n\n' +
- msg +
- '\n';
-
- // indent
- msg = msg.replace(/^/gm, ' ');
- return msg;
-}
-
-/**
- * Returns a unified diff between two strings.
- *
- * @api private
- * @param {Error} err with actual/expected
- * @param {boolean} escape
- * @return {string} The diff.
- */
-function unifiedDiff (err, escape) {
- var indent = ' ';
- function cleanUp (line) {
- if (escape) {
- line = escapeInvisibles(line);
- }
- if (line[0] === '+') {
- return indent + colorLines('diff added', line);
- }
- if (line[0] === '-') {
- return indent + colorLines('diff removed', line);
- }
- if (line.match(/@@/)) {
- return null;
- }
- if (line.match(/\\ No newline/)) {
- return null;
- }
- return indent + line;
- }
- function notBlank (line) {
- return typeof line !== 'undefined' && line !== null;
- }
- var msg = diff.createPatch('string', err.actual, err.expected);
- var lines = msg.split('\n').splice(4);
- return '\n ' +
- colorLines('diff added', '+ expected') + ' ' +
- colorLines('diff removed', '- actual') +
- '\n\n' +
- lines.map(cleanUp).filter(notBlank).join('\n');
-}
-
-/**
- * Return a character diff for `err`.
- *
- * @api private
- * @param {Error} err
- * @param {string} type
- * @param {boolean} escape
- * @return {string}
- */
-function errorDiff (err, type, escape) {
- var actual = escape ? escapeInvisibles(err.actual) : err.actual;
- var expected = escape ? escapeInvisibles(err.expected) : err.expected;
- return diff['diff' + type](actual, expected).map(function (str) {
- if (str.added) {
- return colorLines('diff added', str.value);
- }
- if (str.removed) {
- return colorLines('diff removed', str.value);
- }
- return str.value;
- }).join('');
-}
-
-/**
- * Returns a string with all invisible characters in plain text
- *
- * @api private
- * @param {string} line
- * @return {string}
- */
-function escapeInvisibles (line) {
- return line.replace(/\t/g, '<tab>')
- .replace(/\r/g, '<CR>')
- .replace(/\n/g, '<LF>\n');
-}
-
-/**
- * Color lines for `str`, using the color `name`.
- *
- * @api private
- * @param {string} name
- * @param {string} str
- * @return {string}
- */
-function colorLines (name, str) {
- return str.split('\n').map(function (str) {
- return color(name, str);
- }).join('\n');
-}
-
-/**
- * Object#toString reference.
- */
-var objToString = Object.prototype.toString;
-
-/**
- * Check that a / b have the same type.
- *
- * @api private
- * @param {Object} a
- * @param {Object} b
- * @return {boolean}
- */
-function sameType (a, b) {
- return objToString.call(a) === objToString.call(b);
-}
-
-}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../ms":15,"../utils":38,"_process":67,"diff":46,"supports-color":42,"tty":5}],18:[function(require,module,exports){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var utils = require('../utils');
-
-/**
- * Expose `Doc`.
- */
-
-exports = module.exports = Doc;
-
-/**
- * Initialize a new `Doc` reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-function Doc (runner) {
- Base.call(this, runner);
-
- var indents = 2;
-
- function indent () {
- return Array(indents).join(' ');
- }
-
- runner.on('suite', function (suite) {
- if (suite.root) {
- return;
- }
- ++indents;
- console.log('%s<section class="suite">', indent());
- ++indents;
- console.log('%s<h1>%s</h1>', indent(), utils.escape(suite.title));
- console.log('%s<dl>', indent());
- });
-
- runner.on('suite end', function (suite) {
- if (suite.root) {
- return;
- }
- console.log('%s</dl>', indent());
- --indents;
- console.log('%s</section>', indent());
- --indents;
- });
-
- runner.on('pass', function (test) {
- console.log('%s <dt>%s</dt>', indent(), utils.escape(test.title));
- var code = utils.escape(utils.clean(test.body));
- console.log('%s <dd><pre><code>%s</code></pre></dd>', indent(), code);
- });
-
- runner.on('fail', function (test, err) {
- console.log('%s <dt class="error">%s</dt>', indent(), utils.escape(test.title));
- var code = utils.escape(utils.clean(test.body));
- console.log('%s <dd class="error"><pre><code>%s</code></pre></dd>', indent(), code);
- console.log('%s <dd class="error">%s</dd>', indent(), utils.escape(err));
- });
-}
-
-},{"../utils":38,"./base":17}],19:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-var color = Base.color;
-
-/**
- * Expose `Dot`.
- */
-
-exports = module.exports = Dot;
-
-/**
- * Initialize a new `Dot` matrix test reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function Dot (runner) {
- Base.call(this, runner);
-
- var self = this;
- var width = Base.window.width * 0.75 | 0;
- var n = -1;
-
- runner.on('start', function () {
- process.stdout.write('\n');
- });
-
- runner.on('pending', function () {
- if (++n % width === 0) {
- process.stdout.write('\n ');
- }
- process.stdout.write(color('pending', Base.symbols.comma));
- });
-
- runner.on('pass', function (test) {
- if (++n % width === 0) {
- process.stdout.write('\n ');
- }
- if (test.speed === 'slow') {
- process.stdout.write(color('bright yellow', Base.symbols.dot));
- } else {
- process.stdout.write(color(test.speed, Base.symbols.dot));
- }
- });
-
- runner.on('fail', function () {
- if (++n % width === 0) {
- process.stdout.write('\n ');
- }
- process.stdout.write(color('fail', Base.symbols.bang));
- });
-
- runner.on('end', function () {
- console.log();
- self.epilogue();
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(Dot, Base);
-
-}).call(this,require('_process'))
-},{"../utils":38,"./base":17,"_process":67}],20:[function(require,module,exports){
-(function (global){
-'use strict';
-
-/* eslint-env browser */
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var utils = require('../utils');
-var Progress = require('../browser/progress');
-var escapeRe = require('escape-string-regexp');
-var escape = utils.escape;
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-/* eslint-disable no-unused-vars, no-native-reassign */
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-/* eslint-enable no-unused-vars, no-native-reassign */
-
-/**
- * Expose `HTML`.
- */
-
-exports = module.exports = HTML;
-
-/**
- * Stats template.
- */
-
-var statsTemplate = '<ul id="mocha-stats">' +
- '<li class="progress"><canvas width="40" height="40"></canvas></li>' +
- '<li class="passes"><a href="javascript:void(0);">passes:</a> <em>0</em></li>' +
- '<li class="failures"><a href="javascript:void(0);">failures:</a> <em>0</em></li>' +
- '<li class="duration">duration: <em>0</em>s</li>' +
- '</ul>';
-
-/**
- * Initialize a new `HTML` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function HTML (runner) {
- Base.call(this, runner);
-
- var self = this;
- var stats = this.stats;
- var stat = fragment(statsTemplate);
- var items = stat.getElementsByTagName('li');
- var passes = items[1].getElementsByTagName('em')[0];
- var passesLink = items[1].getElementsByTagName('a')[0];
- var failures = items[2].getElementsByTagName('em')[0];
- var failuresLink = items[2].getElementsByTagName('a')[0];
- var duration = items[3].getElementsByTagName('em')[0];
- var canvas = stat.getElementsByTagName('canvas')[0];
- var report = fragment('<ul id="mocha-report"></ul>');
- var stack = [report];
- var progress;
- var ctx;
- var root = document.getElementById('mocha');
-
- if (canvas.getContext) {
- var ratio = window.devicePixelRatio || 1;
- canvas.style.width = canvas.width;
- canvas.style.height = canvas.height;
- canvas.width *= ratio;
- canvas.height *= ratio;
- ctx = canvas.getContext('2d');
- ctx.scale(ratio, ratio);
- progress = new Progress();
- }
-
- if (!root) {
- return error('#mocha div missing, add it to your document');
- }
-
- // pass toggle
- on(passesLink, 'click', function (evt) {
- evt.preventDefault();
- unhide();
- var name = (/pass/).test(report.className) ? '' : ' pass';
- report.className = report.className.replace(/fail|pass/g, '') + name;
- if (report.className.trim()) {
- hideSuitesWithout('test pass');
- }
- });
-
- // failure toggle
- on(failuresLink, 'click', function (evt) {
- evt.preventDefault();
- unhide();
- var name = (/fail/).test(report.className) ? '' : ' fail';
- report.className = report.className.replace(/fail|pass/g, '') + name;
- if (report.className.trim()) {
- hideSuitesWithout('test fail');
- }
- });
-
- root.appendChild(stat);
- root.appendChild(report);
-
- if (progress) {
- progress.size(40);
- }
-
- runner.on('suite', function (suite) {
- if (suite.root) {
- return;
- }
-
- // suite
- var url = self.suiteURL(suite);
- var el = fragment('<li class="suite"><h1><a href="%s">%s</a></h1></li>', url, escape(suite.title));
-
- // container
- stack[0].appendChild(el);
- stack.unshift(document.createElement('ul'));
- el.appendChild(stack[0]);
- });
-
- runner.on('suite end', function (suite) {
- if (suite.root) {
- updateStats();
- return;
- }
- stack.shift();
- });
-
- runner.on('pass', function (test) {
- var url = self.testURL(test);
- var markup = '<li class="test pass %e"><h2>%e<span class="duration">%ems</span> ' +
- '<a href="%s" class="replay">‣</a></h2></li>';
- var el = fragment(markup, test.speed, test.title, test.duration, url);
- self.addCodeToggle(el, test.body);
- appendToStack(el);
- updateStats();
- });
-
- runner.on('fail', function (test) {
- var el = fragment('<li class="test fail"><h2>%e <a href="%e" class="replay">‣</a></h2></li>',
- test.title, self.testURL(test));
- var stackString; // Note: Includes leading newline
- var message = test.err.toString();
-
- // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we
- // check for the result of the stringifying.
- if (message === '[object Error]') {
- message = test.err.message;
- }
-
- if (test.err.stack) {
- var indexOfMessage = test.err.stack.indexOf(test.err.message);
- if (indexOfMessage === -1) {
- stackString = test.err.stack;
- } else {
- stackString = test.err.stack.substr(test.err.message.length + indexOfMessage);
- }
- } else if (test.err.sourceURL && test.err.line !== undefined) {
- // Safari doesn't give you a stack. Let's at least provide a source line.
- stackString = '\n(' + test.err.sourceURL + ':' + test.err.line + ')';
- }
-
- stackString = stackString || '';
-
- if (test.err.htmlMessage && stackString) {
- el.appendChild(fragment('<div class="html-error">%s\n<pre class="error">%e</pre></div>',
- test.err.htmlMessage, stackString));
- } else if (test.err.htmlMessage) {
- el.appendChild(fragment('<div class="html-error">%s</div>', test.err.htmlMessage));
- } else {
- el.appendChild(fragment('<pre class="error">%e%e</pre>', message, stackString));
- }
-
- self.addCodeToggle(el, test.body);
- appendToStack(el);
- updateStats();
- });
-
- runner.on('pending', function (test) {
- var el = fragment('<li class="test pass pending"><h2>%e</h2></li>', test.title);
- appendToStack(el);
- updateStats();
- });
-
- function appendToStack (el) {
- // Don't call .appendChild if #mocha-report was already .shift()'ed off the stack.
- if (stack[0]) {
- stack[0].appendChild(el);
- }
- }
-
- function updateStats () {
- // TODO: add to stats
- var percent = stats.tests / runner.total * 100 | 0;
- if (progress) {
- progress.update(percent).draw(ctx);
- }
-
- // update stats
- var ms = new Date() - stats.start;
- text(passes, stats.passes);
- text(failures, stats.failures);
- text(duration, (ms / 1000).toFixed(2));
- }
-}
-
-/**
- * Makes a URL, preserving querystring ("search") parameters.
- *
- * @param {string} s
- * @return {string} A new URL.
- */
-function makeUrl (s) {
- var search = window.location.search;
-
- // Remove previous grep query parameter if present
- if (search) {
- search = search.replace(/[?&]grep=[^&\s]*/g, '').replace(/^&/, '?');
- }
-
- return window.location.pathname + (search ? search + '&' : '?') + 'grep=' + encodeURIComponent(escapeRe(s));
-}
-
-/**
- * Provide suite URL.
- *
- * @param {Object} [suite]
- */
-HTML.prototype.suiteURL = function (suite) {
- return makeUrl(suite.fullTitle());
-};
-
-/**
- * Provide test URL.
- *
- * @param {Object} [test]
- */
-HTML.prototype.testURL = function (test) {
- return makeUrl(test.fullTitle());
-};
-
-/**
- * Adds code toggle functionality for the provided test's list element.
- *
- * @param {HTMLLIElement} el
- * @param {string} contents
- */
-HTML.prototype.addCodeToggle = function (el, contents) {
- var h2 = el.getElementsByTagName('h2')[0];
-
- on(h2, 'click', function () {
- pre.style.display = pre.style.display === 'none' ? 'block' : 'none';
- });
-
- var pre = fragment('<pre><code>%e</code></pre>', utils.clean(contents));
- el.appendChild(pre);
- pre.style.display = 'none';
-};
-
-/**
- * Display error `msg`.
- *
- * @param {string} msg
- */
-function error (msg) {
- document.body.appendChild(fragment('<div id="mocha-error">%s</div>', msg));
-}
-
-/**
- * Return a DOM fragment from `html`.
- *
- * @param {string} html
- */
-function fragment (html) {
- var args = arguments;
- var div = document.createElement('div');
- var i = 1;
-
- div.innerHTML = html.replace(/%([se])/g, function (_, type) {
- switch (type) {
- case 's': return String(args[i++]);
- case 'e': return escape(args[i++]);
- // no default
- }
- });
-
- return div.firstChild;
-}
-
-/**
- * Check for suites that do not have elements
- * with `classname`, and hide them.
- *
- * @param {text} classname
- */
-function hideSuitesWithout (classname) {
- var suites = document.getElementsByClassName('suite');
- for (var i = 0; i < suites.length; i++) {
- var els = suites[i].getElementsByClassName(classname);
- if (!els.length) {
- suites[i].className += ' hidden';
- }
- }
-}
-
-/**
- * Unhide .hidden suites.
- */
-function unhide () {
- var els = document.getElementsByClassName('suite hidden');
- for (var i = 0; i < els.length; ++i) {
- els[i].className = els[i].className.replace('suite hidden', 'suite');
- }
-}
-
-/**
- * Set an element's text contents.
- *
- * @param {HTMLElement} el
- * @param {string} contents
- */
-function text (el, contents) {
- if (el.textContent) {
- el.textContent = contents;
- } else {
- el.innerText = contents;
- }
-}
-
-/**
- * Listen on `event` with callback `fn`.
- */
-function on (el, event, fn) {
- if (el.addEventListener) {
- el.addEventListener(event, fn, false);
- } else {
- el.attachEvent('on' + event, fn);
- }
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../browser/progress":4,"../utils":38,"./base":17,"escape-string-regexp":47}],21:[function(require,module,exports){
-'use strict';
-
-// Alias exports to a their normalized format Mocha#reporter to prevent a need
-// for dynamic (try/catch) requires, which Browserify doesn't handle.
-exports.Base = exports.base = require('./base');
-exports.Dot = exports.dot = require('./dot');
-exports.Doc = exports.doc = require('./doc');
-exports.TAP = exports.tap = require('./tap');
-exports.JSON = exports.json = require('./json');
-exports.HTML = exports.html = require('./html');
-exports.List = exports.list = require('./list');
-exports.Min = exports.min = require('./min');
-exports.Spec = exports.spec = require('./spec');
-exports.Nyan = exports.nyan = require('./nyan');
-exports.XUnit = exports.xunit = require('./xunit');
-exports.Markdown = exports.markdown = require('./markdown');
-exports.Progress = exports.progress = require('./progress');
-exports.Landing = exports.landing = require('./landing');
-exports.JSONStream = exports['json-stream'] = require('./json-stream');
-
-},{"./base":17,"./doc":18,"./dot":19,"./html":20,"./json":23,"./json-stream":22,"./landing":24,"./list":25,"./markdown":26,"./min":27,"./nyan":28,"./progress":29,"./spec":30,"./tap":31,"./xunit":32}],22:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var JSON = require('json3');
-
-/**
- * Expose `List`.
- */
-
-exports = module.exports = List;
-
-/**
- * Initialize a new `List` test reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function List (runner) {
- Base.call(this, runner);
-
- var self = this;
- var total = runner.total;
-
- runner.on('start', function () {
- console.log(JSON.stringify(['start', { total: total }]));
- });
-
- runner.on('pass', function (test) {
- console.log(JSON.stringify(['pass', clean(test)]));
- });
-
- runner.on('fail', function (test, err) {
- test = clean(test);
- test.err = err.message;
- test.stack = err.stack || null;
- console.log(JSON.stringify(['fail', test]));
- });
-
- runner.on('end', function () {
- process.stdout.write(JSON.stringify(['end', self.stats]));
- });
-}
-
-/**
- * Return a plain-object representation of `test`
- * free of cyclic properties etc.
- *
- * @api private
- * @param {Object} test
- * @return {Object}
- */
-function clean (test) {
- return {
- title: test.title,
- fullTitle: test.fullTitle(),
- duration: test.duration,
- currentRetry: test.currentRetry()
- };
-}
-
-}).call(this,require('_process'))
-},{"./base":17,"_process":67,"json3":54}],23:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-
-/**
- * Expose `JSON`.
- */
-
-exports = module.exports = JSONReporter;
-
-/**
- * Initialize a new `JSON` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function JSONReporter (runner) {
- Base.call(this, runner);
-
- var self = this;
- var tests = [];
- var pending = [];
- var failures = [];
- var passes = [];
-
- runner.on('test end', function (test) {
- tests.push(test);
- });
-
- runner.on('pass', function (test) {
- passes.push(test);
- });
-
- runner.on('fail', function (test) {
- failures.push(test);
- });
-
- runner.on('pending', function (test) {
- pending.push(test);
- });
-
- runner.on('end', function () {
- var obj = {
- stats: self.stats,
- tests: tests.map(clean),
- pending: pending.map(clean),
- failures: failures.map(clean),
- passes: passes.map(clean)
- };
-
- runner.testResults = obj;
-
- process.stdout.write(JSON.stringify(obj, null, 2));
- });
-}
-
-/**
- * Return a plain-object representation of `test`
- * free of cyclic properties etc.
- *
- * @api private
- * @param {Object} test
- * @return {Object}
- */
-function clean (test) {
- return {
- title: test.title,
- fullTitle: test.fullTitle(),
- duration: test.duration,
- currentRetry: test.currentRetry(),
- err: errorJSON(test.err || {})
- };
-}
-
-/**
- * Transform `error` into a JSON object.
- *
- * @api private
- * @param {Error} err
- * @return {Object}
- */
-function errorJSON (err) {
- var res = {};
- Object.getOwnPropertyNames(err).forEach(function (key) {
- res[key] = err[key];
- }, err);
- return res;
-}
-
-}).call(this,require('_process'))
-},{"./base":17,"_process":67}],24:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-var cursor = Base.cursor;
-var color = Base.color;
-
-/**
- * Expose `Landing`.
- */
-
-exports = module.exports = Landing;
-
-/**
- * Airplane color.
- */
-
-Base.colors.plane = 0;
-
-/**
- * Airplane crash color.
- */
-
-Base.colors['plane crash'] = 31;
-
-/**
- * Runway color.
- */
-
-Base.colors.runway = 90;
-
-/**
- * Initialize a new `Landing` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function Landing (runner) {
- Base.call(this, runner);
-
- var self = this;
- var width = Base.window.width * 0.75 | 0;
- var total = runner.total;
- var stream = process.stdout;
- var plane = color('plane', '✈');
- var crashed = -1;
- var n = 0;
-
- function runway () {
- var buf = Array(width).join('-');
- return ' ' + color('runway', buf);
- }
-
- runner.on('start', function () {
- stream.write('\n\n\n ');
- cursor.hide();
- });
-
- runner.on('test end', function (test) {
- // check if the plane crashed
- var col = crashed === -1 ? width * ++n / total | 0 : crashed;
-
- // show the crash
- if (test.state === 'failed') {
- plane = color('plane crash', '✈');
- crashed = col;
- }
-
- // render landing strip
- stream.write('\u001b[' + (width + 1) + 'D\u001b[2A');
- stream.write(runway());
- stream.write('\n ');
- stream.write(color('runway', Array(col).join('â‹…')));
- stream.write(plane);
- stream.write(color('runway', Array(width - col).join('â‹…') + '\n'));
- stream.write(runway());
- stream.write('\u001b[0m');
- });
-
- runner.on('end', function () {
- cursor.show();
- console.log();
- self.epilogue();
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(Landing, Base);
-
-}).call(this,require('_process'))
-},{"../utils":38,"./base":17,"_process":67}],25:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-var color = Base.color;
-var cursor = Base.cursor;
-
-/**
- * Expose `List`.
- */
-
-exports = module.exports = List;
-
-/**
- * Initialize a new `List` test reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function List (runner) {
- Base.call(this, runner);
-
- var self = this;
- var n = 0;
-
- runner.on('start', function () {
- console.log();
- });
-
- runner.on('test', function (test) {
- process.stdout.write(color('pass', ' ' + test.fullTitle() + ': '));
- });
-
- runner.on('pending', function (test) {
- var fmt = color('checkmark', ' -') +
- color('pending', ' %s');
- console.log(fmt, test.fullTitle());
- });
-
- runner.on('pass', function (test) {
- var fmt = color('checkmark', ' ' + Base.symbols.dot) +
- color('pass', ' %s: ') +
- color(test.speed, '%dms');
- cursor.CR();
- console.log(fmt, test.fullTitle(), test.duration);
- });
-
- runner.on('fail', function (test) {
- cursor.CR();
- console.log(color('fail', ' %d) %s'), ++n, test.fullTitle());
- });
-
- runner.on('end', self.epilogue.bind(self));
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(List, Base);
-
-}).call(this,require('_process'))
-},{"../utils":38,"./base":17,"_process":67}],26:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var utils = require('../utils');
-
-/**
- * Constants
- */
-
-var SUITE_PREFIX = '$';
-
-/**
- * Expose `Markdown`.
- */
-
-exports = module.exports = Markdown;
-
-/**
- * Initialize a new `Markdown` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function Markdown (runner) {
- Base.call(this, runner);
-
- var level = 0;
- var buf = '';
-
- function title (str) {
- return Array(level).join('#') + ' ' + str;
- }
-
- function mapTOC (suite, obj) {
- var ret = obj;
- var key = SUITE_PREFIX + suite.title;
-
- obj = obj[key] = obj[key] || { suite: suite };
- suite.suites.forEach(function (suite) {
- mapTOC(suite, obj);
- });
-
- return ret;
- }
-
- function stringifyTOC (obj, level) {
- ++level;
- var buf = '';
- var link;
- for (var key in obj) {
- if (key === 'suite') {
- continue;
- }
- if (key !== SUITE_PREFIX) {
- link = ' - [' + key.substring(1) + ']';
- link += '(#' + utils.slug(obj[key].suite.fullTitle()) + ')\n';
- buf += Array(level).join(' ') + link;
- }
- buf += stringifyTOC(obj[key], level);
- }
- return buf;
- }
-
- function generateTOC (suite) {
- var obj = mapTOC(suite, {});
- return stringifyTOC(obj, 0);
- }
-
- generateTOC(runner.suite);
-
- runner.on('suite', function (suite) {
- ++level;
- var slug = utils.slug(suite.fullTitle());
- buf += '<a name="' + slug + '"></a>' + '\n';
- buf += title(suite.title) + '\n';
- });
-
- runner.on('suite end', function () {
- --level;
- });
-
- runner.on('pass', function (test) {
- var code = utils.clean(test.body);
- buf += test.title + '.\n';
- buf += '\n```js\n';
- buf += code + '\n';
- buf += '```\n\n';
- });
-
- runner.on('end', function () {
- process.stdout.write('# TOC\n');
- process.stdout.write(generateTOC(runner.suite));
- process.stdout.write(buf);
- });
-}
-
-}).call(this,require('_process'))
-},{"../utils":38,"./base":17,"_process":67}],27:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-
-/**
- * Expose `Min`.
- */
-
-exports = module.exports = Min;
-
-/**
- * Initialize a new `Min` minimal test reporter (best used with --watch).
- *
- * @api public
- * @param {Runner} runner
- */
-function Min (runner) {
- Base.call(this, runner);
-
- runner.on('start', function () {
- // clear screen
- process.stdout.write('\u001b[2J');
- // set cursor position
- process.stdout.write('\u001b[1;3H');
- });
-
- runner.on('end', this.epilogue.bind(this));
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(Min, Base);
-
-}).call(this,require('_process'))
-},{"../utils":38,"./base":17,"_process":67}],28:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-
-/**
- * Expose `Dot`.
- */
-
-exports = module.exports = NyanCat;
-
-/**
- * Initialize a new `Dot` matrix test reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function NyanCat (runner) {
- Base.call(this, runner);
-
- var self = this;
- var width = Base.window.width * 0.75 | 0;
- var nyanCatWidth = this.nyanCatWidth = 11;
-
- this.colorIndex = 0;
- this.numberOfLines = 4;
- this.rainbowColors = self.generateColors();
- this.scoreboardWidth = 5;
- this.tick = 0;
- this.trajectories = [[], [], [], []];
- this.trajectoryWidthMax = (width - nyanCatWidth);
-
- runner.on('start', function () {
- Base.cursor.hide();
- self.draw();
- });
-
- runner.on('pending', function () {
- self.draw();
- });
-
- runner.on('pass', function () {
- self.draw();
- });
-
- runner.on('fail', function () {
- self.draw();
- });
-
- runner.on('end', function () {
- Base.cursor.show();
- for (var i = 0; i < self.numberOfLines; i++) {
- write('\n');
- }
- self.epilogue();
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(NyanCat, Base);
-
-/**
- * Draw the nyan cat
- *
- * @api private
- */
-
-NyanCat.prototype.draw = function () {
- this.appendRainbow();
- this.drawScoreboard();
- this.drawRainbow();
- this.drawNyanCat();
- this.tick = !this.tick;
-};
-
-/**
- * Draw the "scoreboard" showing the number
- * of passes, failures and pending tests.
- *
- * @api private
- */
-
-NyanCat.prototype.drawScoreboard = function () {
- var stats = this.stats;
-
- function draw (type, n) {
- write(' ');
- write(Base.color(type, n));
- write('\n');
- }
-
- draw('green', stats.passes);
- draw('fail', stats.failures);
- draw('pending', stats.pending);
- write('\n');
-
- this.cursorUp(this.numberOfLines);
-};
-
-/**
- * Append the rainbow.
- *
- * @api private
- */
-
-NyanCat.prototype.appendRainbow = function () {
- var segment = this.tick ? '_' : '-';
- var rainbowified = this.rainbowify(segment);
-
- for (var index = 0; index < this.numberOfLines; index++) {
- var trajectory = this.trajectories[index];
- if (trajectory.length >= this.trajectoryWidthMax) {
- trajectory.shift();
- }
- trajectory.push(rainbowified);
- }
-};
-
-/**
- * Draw the rainbow.
- *
- * @api private
- */
-
-NyanCat.prototype.drawRainbow = function () {
- var self = this;
-
- this.trajectories.forEach(function (line) {
- write('\u001b[' + self.scoreboardWidth + 'C');
- write(line.join(''));
- write('\n');
- });
-
- this.cursorUp(this.numberOfLines);
-};
-
-/**
- * Draw the nyan cat
- *
- * @api private
- */
-NyanCat.prototype.drawNyanCat = function () {
- var self = this;
- var startWidth = this.scoreboardWidth + this.trajectories[0].length;
- var dist = '\u001b[' + startWidth + 'C';
- var padding = '';
-
- write(dist);
- write('_,------,');
- write('\n');
-
- write(dist);
- padding = self.tick ? ' ' : ' ';
- write('_|' + padding + '/\\_/\\ ');
- write('\n');
-
- write(dist);
- padding = self.tick ? '_' : '__';
- var tail = self.tick ? '~' : '^';
- write(tail + '|' + padding + this.face() + ' ');
- write('\n');
-
- write(dist);
- padding = self.tick ? ' ' : ' ';
- write(padding + '"" "" ');
- write('\n');
-
- this.cursorUp(this.numberOfLines);
-};
-
-/**
- * Draw nyan cat face.
- *
- * @api private
- * @return {string}
- */
-
-NyanCat.prototype.face = function () {
- var stats = this.stats;
- if (stats.failures) {
- return '( x .x)';
- } else if (stats.pending) {
- return '( o .o)';
- } else if (stats.passes) {
- return '( ^ .^)';
- }
- return '( - .-)';
-};
-
-/**
- * Move cursor up `n`.
- *
- * @api private
- * @param {number} n
- */
-
-NyanCat.prototype.cursorUp = function (n) {
- write('\u001b[' + n + 'A');
-};
-
-/**
- * Move cursor down `n`.
- *
- * @api private
- * @param {number} n
- */
-
-NyanCat.prototype.cursorDown = function (n) {
- write('\u001b[' + n + 'B');
-};
-
-/**
- * Generate rainbow colors.
- *
- * @api private
- * @return {Array}
- */
-NyanCat.prototype.generateColors = function () {
- var colors = [];
-
- for (var i = 0; i < (6 * 7); i++) {
- var pi3 = Math.floor(Math.PI / 3);
- var n = (i * (1.0 / 6));
- var r = Math.floor(3 * Math.sin(n) + 3);
- var g = Math.floor(3 * Math.sin(n + 2 * pi3) + 3);
- var b = Math.floor(3 * Math.sin(n + 4 * pi3) + 3);
- colors.push(36 * r + 6 * g + b + 16);
- }
-
- return colors;
-};
-
-/**
- * Apply rainbow to the given `str`.
- *
- * @api private
- * @param {string} str
- * @return {string}
- */
-NyanCat.prototype.rainbowify = function (str) {
- if (!Base.useColors) {
- return str;
- }
- var color = this.rainbowColors[this.colorIndex % this.rainbowColors.length];
- this.colorIndex += 1;
- return '\u001b[38;5;' + color + 'm' + str + '\u001b[0m';
-};
-
-/**
- * Stdout helper.
- *
- * @param {string} string A message to write to stdout.
- */
-function write (string) {
- process.stdout.write(string);
-}
-
-}).call(this,require('_process'))
-},{"../utils":38,"./base":17,"_process":67}],29:[function(require,module,exports){
-(function (process){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-var color = Base.color;
-var cursor = Base.cursor;
-
-/**
- * Expose `Progress`.
- */
-
-exports = module.exports = Progress;
-
-/**
- * General progress bar color.
- */
-
-Base.colors.progress = 90;
-
-/**
- * Initialize a new `Progress` bar test reporter.
- *
- * @api public
- * @param {Runner} runner
- * @param {Object} options
- */
-function Progress (runner, options) {
- Base.call(this, runner);
-
- var self = this;
- var width = Base.window.width * 0.50 | 0;
- var total = runner.total;
- var complete = 0;
- var lastN = -1;
-
- // default chars
- options = options || {};
- options.open = options.open || '[';
- options.complete = options.complete || 'â–¬';
- options.incomplete = options.incomplete || Base.symbols.dot;
- options.close = options.close || ']';
- options.verbose = false;
-
- // tests started
- runner.on('start', function () {
- console.log();
- cursor.hide();
- });
-
- // tests complete
- runner.on('test end', function () {
- complete++;
-
- var percent = complete / total;
- var n = width * percent | 0;
- var i = width - n;
-
- if (n === lastN && !options.verbose) {
- // Don't re-render the line if it hasn't changed
- return;
- }
- lastN = n;
-
- cursor.CR();
- process.stdout.write('\u001b[J');
- process.stdout.write(color('progress', ' ' + options.open));
- process.stdout.write(Array(n).join(options.complete));
- process.stdout.write(Array(i).join(options.incomplete));
- process.stdout.write(color('progress', options.close));
- if (options.verbose) {
- process.stdout.write(color('progress', ' ' + complete + ' of ' + total));
- }
- });
-
- // tests are complete, output some stats
- // and the failures if any
- runner.on('end', function () {
- cursor.show();
- console.log();
- self.epilogue();
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(Progress, Base);
-
-}).call(this,require('_process'))
-},{"../utils":38,"./base":17,"_process":67}],30:[function(require,module,exports){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var inherits = require('../utils').inherits;
-var color = Base.color;
-
-/**
- * Expose `Spec`.
- */
-
-exports = module.exports = Spec;
-
-/**
- * Initialize a new `Spec` test reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function Spec (runner) {
- Base.call(this, runner);
-
- var self = this;
- var indents = 0;
- var n = 0;
-
- function indent () {
- return Array(indents).join(' ');
- }
-
- runner.on('start', function () {
- console.log();
- });
-
- runner.on('suite', function (suite) {
- ++indents;
- console.log(color('suite', '%s%s'), indent(), suite.title);
- });
-
- runner.on('suite end', function () {
- --indents;
- if (indents === 1) {
- console.log();
- }
- });
-
- runner.on('pending', function (test) {
- var fmt = indent() + color('pending', ' - %s');
- console.log(fmt, test.title);
- });
-
- runner.on('pass', function (test) {
- var fmt;
- if (test.speed === 'fast') {
- fmt = indent() +
- color('checkmark', ' ' + Base.symbols.ok) +
- color('pass', ' %s');
- console.log(fmt, test.title);
- } else {
- fmt = indent() +
- color('checkmark', ' ' + Base.symbols.ok) +
- color('pass', ' %s') +
- color(test.speed, ' (%dms)');
- console.log(fmt, test.title, test.duration);
- }
- });
-
- runner.on('fail', function (test) {
- console.log(indent() + color('fail', ' %d) %s'), ++n, test.title);
- });
-
- runner.on('end', self.epilogue.bind(self));
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(Spec, Base);
-
-},{"../utils":38,"./base":17}],31:[function(require,module,exports){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-
-/**
- * Expose `TAP`.
- */
-
-exports = module.exports = TAP;
-
-/**
- * Initialize a new `TAP` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function TAP (runner) {
- Base.call(this, runner);
-
- var n = 1;
- var passes = 0;
- var failures = 0;
-
- runner.on('start', function () {
- var total = runner.grepTotal(runner.suite);
- console.log('%d..%d', 1, total);
- });
-
- runner.on('test end', function () {
- ++n;
- });
-
- runner.on('pending', function (test) {
- console.log('ok %d %s # SKIP -', n, title(test));
- });
-
- runner.on('pass', function (test) {
- passes++;
- console.log('ok %d %s', n, title(test));
- });
-
- runner.on('fail', function (test, err) {
- failures++;
- console.log('not ok %d %s', n, title(test));
- if (err.stack) {
- console.log(err.stack.replace(/^/gm, ' '));
- }
- });
-
- runner.on('end', function () {
- console.log('# tests ' + (passes + failures));
- console.log('# pass ' + passes);
- console.log('# fail ' + failures);
- });
-}
-
-/**
- * Return a TAP-safe title of `test`
- *
- * @api private
- * @param {Object} test
- * @return {String}
- */
-function title (test) {
- return test.fullTitle().replace(/#/g, '');
-}
-
-},{"./base":17}],32:[function(require,module,exports){
-(function (process,global){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-var utils = require('../utils');
-var inherits = utils.inherits;
-var fs = require('fs');
-var escape = utils.escape;
-var mkdirp = require('mkdirp');
-var path = require('path');
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-/* eslint-disable no-unused-vars, no-native-reassign */
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-/* eslint-enable no-unused-vars, no-native-reassign */
-
-/**
- * Expose `XUnit`.
- */
-
-exports = module.exports = XUnit;
-
-/**
- * Initialize a new `XUnit` reporter.
- *
- * @api public
- * @param {Runner} runner
- */
-function XUnit (runner, options) {
- Base.call(this, runner);
-
- var stats = this.stats;
- var tests = [];
- var self = this;
-
- if (options.reporterOptions && options.reporterOptions.output) {
- if (!fs.createWriteStream) {
- throw new Error('file output not supported in browser');
- }
- mkdirp.sync(path.dirname(options.reporterOptions.output));
- self.fileStream = fs.createWriteStream(options.reporterOptions.output);
- }
-
- runner.on('pending', function (test) {
- tests.push(test);
- });
-
- runner.on('pass', function (test) {
- tests.push(test);
- });
-
- runner.on('fail', function (test) {
- tests.push(test);
- });
-
- runner.on('end', function () {
- self.write(tag('testsuite', {
- name: 'Mocha Tests',
- tests: stats.tests,
- failures: stats.failures,
- errors: stats.failures,
- skipped: stats.tests - stats.failures - stats.passes,
- timestamp: (new Date()).toUTCString(),
- time: (stats.duration / 1000) || 0
- }, false));
-
- tests.forEach(function (t) {
- self.test(t);
- });
-
- self.write('</testsuite>');
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-inherits(XUnit, Base);
-
-/**
- * Override done to close the stream (if it's a file).
- *
- * @param failures
- * @param {Function} fn
- */
-XUnit.prototype.done = function (failures, fn) {
- if (this.fileStream) {
- this.fileStream.end(function () {
- fn(failures);
- });
- } else {
- fn(failures);
- }
-};
-
-/**
- * Write out the given line.
- *
- * @param {string} line
- */
-XUnit.prototype.write = function (line) {
- if (this.fileStream) {
- this.fileStream.write(line + '\n');
- } else if (typeof process === 'object' && process.stdout) {
- process.stdout.write(line + '\n');
- } else {
- console.log(line);
- }
-};
-
-/**
- * Output tag for the given `test.`
- *
- * @param {Test} test
- */
-XUnit.prototype.test = function (test) {
- var attrs = {
- classname: test.parent.fullTitle(),
- name: test.title,
- time: (test.duration / 1000) || 0
- };
-
- if (test.state === 'failed') {
- var err = test.err;
- this.write(tag('testcase', attrs, false, tag('failure', {}, false, escape(err.message) + '\n' + escape(err.stack))));
- } else if (test.isPending()) {
- this.write(tag('testcase', attrs, false, tag('skipped', {}, true)));
- } else {
- this.write(tag('testcase', attrs, true));
- }
-};
-
-/**
- * HTML tag helper.
- *
- * @param name
- * @param attrs
- * @param close
- * @param content
- * @return {string}
- */
-function tag (name, attrs, close, content) {
- var end = close ? '/>' : '>';
- var pairs = [];
- var tag;
-
- for (var key in attrs) {
- if (Object.prototype.hasOwnProperty.call(attrs, key)) {
- pairs.push(key + '="' + escape(attrs[key]) + '"');
- }
- }
-
- tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end;
- if (content) {
- tag += content + '</' + name + end;
- }
- return tag;
-}
-
-}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"../utils":38,"./base":17,"_process":67,"fs":42,"mkdirp":64,"path":42}],33:[function(require,module,exports){
-(function (global){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var EventEmitter = require('events').EventEmitter;
-var JSON = require('json3');
-var Pending = require('./pending');
-var debug = require('debug')('mocha:runnable');
-var milliseconds = require('./ms');
-var utils = require('./utils');
-var create = require('lodash.create');
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-/* eslint-disable no-unused-vars, no-native-reassign */
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-/* eslint-enable no-unused-vars, no-native-reassign */
-
-/**
- * Object#toString().
- */
-
-var toString = Object.prototype.toString;
-
-/**
- * Expose `Runnable`.
- */
-
-module.exports = Runnable;
-
-/**
- * Initialize a new `Runnable` with the given `title` and callback `fn`.
- *
- * @param {String} title
- * @param {Function} fn
- * @api private
- * @param {string} title
- * @param {Function} fn
- */
-function Runnable (title, fn) {
- this.title = title;
- this.fn = fn;
- this.body = (fn || '').toString();
- this.async = fn && fn.length;
- this.sync = !this.async;
- this._timeout = 2000;
- this._slow = 75;
- this._enableTimeouts = true;
- this.timedOut = false;
- this._trace = new Error('done() called multiple times');
- this._retries = -1;
- this._currentRetry = 0;
- this.pending = false;
-}
-
-/**
- * Inherit from `EventEmitter.prototype`.
- */
-Runnable.prototype = create(EventEmitter.prototype, {
- constructor: Runnable
-});
-
-/**
- * Set & get timeout `ms`.
- *
- * @api private
- * @param {number|string} ms
- * @return {Runnable|number} ms or Runnable instance.
- */
-Runnable.prototype.timeout = function (ms) {
- if (!arguments.length) {
- return this._timeout;
- }
- // see #1652 for reasoning
- if (ms === 0 || ms > Math.pow(2, 31)) {
- this._enableTimeouts = false;
- }
- if (typeof ms === 'string') {
- ms = milliseconds(ms);
- }
- debug('timeout %d', ms);
- this._timeout = ms;
- if (this.timer) {
- this.resetTimeout();
- }
- return this;
-};
-
-/**
- * Set & get slow `ms`.
- *
- * @api private
- * @param {number|string} ms
- * @return {Runnable|number} ms or Runnable instance.
- */
-Runnable.prototype.slow = function (ms) {
- if (typeof ms === 'undefined') {
- return this._slow;
- }
- if (typeof ms === 'string') {
- ms = milliseconds(ms);
- }
- debug('timeout %d', ms);
- this._slow = ms;
- return this;
-};
-
-/**
- * Set and get whether timeout is `enabled`.
- *
- * @api private
- * @param {boolean} enabled
- * @return {Runnable|boolean} enabled or Runnable instance.
- */
-Runnable.prototype.enableTimeouts = function (enabled) {
- if (!arguments.length) {
- return this._enableTimeouts;
- }
- debug('enableTimeouts %s', enabled);
- this._enableTimeouts = enabled;
- return this;
-};
-
-/**
- * Halt and mark as pending.
- *
- * @api public
- */
-Runnable.prototype.skip = function () {
- throw new Pending('sync skip');
-};
-
-/**
- * Check if this runnable or its parent suite is marked as pending.
- *
- * @api private
- */
-Runnable.prototype.isPending = function () {
- return this.pending || (this.parent && this.parent.isPending());
-};
-
-/**
- * Set number of retries.
- *
- * @api private
- */
-Runnable.prototype.retries = function (n) {
- if (!arguments.length) {
- return this._retries;
- }
- this._retries = n;
-};
-
-/**
- * Get current retry
- *
- * @api private
- */
-Runnable.prototype.currentRetry = function (n) {
- if (!arguments.length) {
- return this._currentRetry;
- }
- this._currentRetry = n;
-};
-
-/**
- * Return the full title generated by recursively concatenating the parent's
- * full title.
- *
- * @api public
- * @return {string}
- */
-Runnable.prototype.fullTitle = function () {
- return this.parent.fullTitle() + ' ' + this.title;
-};
-
-/**
- * Clear the timeout.
- *
- * @api private
- */
-Runnable.prototype.clearTimeout = function () {
- clearTimeout(this.timer);
-};
-
-/**
- * Inspect the runnable void of private properties.
- *
- * @api private
- * @return {string}
- */
-Runnable.prototype.inspect = function () {
- return JSON.stringify(this, function (key, val) {
- if (key[0] === '_') {
- return;
- }
- if (key === 'parent') {
- return '#<Suite>';
- }
- if (key === 'ctx') {
- return '#<Context>';
- }
- return val;
- }, 2);
-};
-
-/**
- * Reset the timeout.
- *
- * @api private
- */
-Runnable.prototype.resetTimeout = function () {
- var self = this;
- var ms = this.timeout() || 1e9;
-
- if (!this._enableTimeouts) {
- return;
- }
- this.clearTimeout();
- this.timer = setTimeout(function () {
- if (!self._enableTimeouts) {
- return;
- }
- self.callback(new Error('timeout of ' + ms + 'ms exceeded. Ensure the done() callback is being called in this test.'));
- self.timedOut = true;
- }, ms);
-};
-
-/**
- * Whitelist a list of globals for this test run.
- *
- * @api private
- * @param {string[]} globals
- */
-Runnable.prototype.globals = function (globals) {
- if (!arguments.length) {
- return this._allowedGlobals;
- }
- this._allowedGlobals = globals;
-};
-
-/**
- * Run the test and invoke `fn(err)`.
- *
- * @param {Function} fn
- * @api private
- */
-Runnable.prototype.run = function (fn) {
- var self = this;
- var start = new Date();
- var ctx = this.ctx;
- var finished;
- var emitted;
-
- // Sometimes the ctx exists, but it is not runnable
- if (ctx && ctx.runnable) {
- ctx.runnable(this);
- }
-
- // called multiple times
- function multiple (err) {
- if (emitted) {
- return;
- }
- emitted = true;
- self.emit('error', err || new Error('done() called multiple times; stacktrace may be inaccurate'));
- }
-
- // finished
- function done (err) {
- var ms = self.timeout();
- if (self.timedOut) {
- return;
- }
- if (finished) {
- return multiple(err || self._trace);
- }
-
- self.clearTimeout();
- self.duration = new Date() - start;
- finished = true;
- if (!err && self.duration > ms && self._enableTimeouts) {
- err = new Error('timeout of ' + ms + 'ms exceeded. Ensure the done() callback is being called in this test.');
- }
- fn(err);
- }
-
- // for .resetTimeout()
- this.callback = done;
-
- // explicit async with `done` argument
- if (this.async) {
- this.resetTimeout();
-
- // allows skip() to be used in an explicit async context
- this.skip = function asyncSkip () {
- done(new Pending('async skip call'));
- // halt execution. the Runnable will be marked pending
- // by the previous call, and the uncaught handler will ignore
- // the failure.
- throw new Pending('async skip; aborting execution');
- };
-
- if (this.allowUncaught) {
- return callFnAsync(this.fn);
- }
- try {
- callFnAsync(this.fn);
- } catch (err) {
- emitted = true;
- done(utils.getError(err));
- }
- return;
- }
-
- if (this.allowUncaught) {
- callFn(this.fn);
- done();
- return;
- }
-
- // sync or promise-returning
- try {
- if (this.isPending()) {
- done();
- } else {
- callFn(this.fn);
- }
- } catch (err) {
- emitted = true;
- done(utils.getError(err));
- }
-
- function callFn (fn) {
- var result = fn.call(ctx);
- if (result && typeof result.then === 'function') {
- self.resetTimeout();
- result
- .then(function () {
- done();
- // Return null so libraries like bluebird do not warn about
- // subsequently constructed Promises.
- return null;
- },
- function (reason) {
- done(reason || new Error('Promise rejected with no or falsy reason'));
- });
- } else {
- if (self.asyncOnly) {
- return done(new Error('--async-only option in use without declaring `done()` or returning a promise'));
- }
-
- done();
- }
- }
-
- function callFnAsync (fn) {
- var result = fn.call(ctx, function (err) {
- if (err instanceof Error || toString.call(err) === '[object Error]') {
- return done(err);
- }
- if (err) {
- if (Object.prototype.toString.call(err) === '[object Object]') {
- return done(new Error('done() invoked with non-Error: ' +
- JSON.stringify(err)));
- }
- return done(new Error('done() invoked with non-Error: ' + err));
- }
- if (result && utils.isPromise(result)) {
- return done(new Error('Resolution method is overspecified. Specify a callback *or* return a Promise; not both.'));
- }
-
- done();
- });
- }
-};
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./ms":15,"./pending":16,"./utils":38,"debug":2,"events":3,"json3":54,"lodash.create":60}],34:[function(require,module,exports){
-(function (process,global){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var EventEmitter = require('events').EventEmitter;
-var Pending = require('./pending');
-var utils = require('./utils');
-var inherits = utils.inherits;
-var debug = require('debug')('mocha:runner');
-var Runnable = require('./runnable');
-var filter = utils.filter;
-var indexOf = utils.indexOf;
-var some = utils.some;
-var keys = utils.keys;
-var stackFilter = utils.stackTraceFilter();
-var stringify = utils.stringify;
-var type = utils.type;
-var undefinedError = utils.undefinedError;
-var isArray = utils.isArray;
-
-/**
- * Non-enumerable globals.
- */
-
-var globals = [
- 'setTimeout',
- 'clearTimeout',
- 'setInterval',
- 'clearInterval',
- 'XMLHttpRequest',
- 'Date',
- 'setImmediate',
- 'clearImmediate'
-];
-
-/**
- * Expose `Runner`.
- */
-
-module.exports = Runner;
-
-/**
- * Initialize a `Runner` for the given `suite`.
- *
- * Events:
- *
- * - `start` execution started
- * - `end` execution complete
- * - `suite` (suite) test suite execution started
- * - `suite end` (suite) all tests (and sub-suites) have finished
- * - `test` (test) test execution started
- * - `test end` (test) test completed
- * - `hook` (hook) hook execution started
- * - `hook end` (hook) hook complete
- * - `pass` (test) test passed
- * - `fail` (test, err) test failed
- * - `pending` (test) test pending
- *
- * @api public
- * @param {Suite} suite Root suite
- * @param {boolean} [delay] Whether or not to delay execution of root suite
- * until ready.
- */
-function Runner (suite, delay) {
- var self = this;
- this._globals = [];
- this._abort = false;
- this._delay = delay;
- this.suite = suite;
- this.started = false;
- this.total = suite.total();
- this.failures = 0;
- this.on('test end', function (test) {
- self.checkGlobals(test);
- });
- this.on('hook end', function (hook) {
- self.checkGlobals(hook);
- });
- this._defaultGrep = /.*/;
- this.grep(this._defaultGrep);
- this.globals(this.globalProps().concat(extraGlobals()));
-}
-
-/**
- * Wrapper for setImmediate, process.nextTick, or browser polyfill.
- *
- * @param {Function} fn
- * @api private
- */
-Runner.immediately = global.setImmediate || process.nextTick;
-
-/**
- * Inherit from `EventEmitter.prototype`.
- */
-inherits(Runner, EventEmitter);
-
-/**
- * Run tests with full titles matching `re`. Updates runner.total
- * with number of tests matched.
- *
- * @param {RegExp} re
- * @param {Boolean} invert
- * @return {Runner} for chaining
- * @api public
- * @param {RegExp} re
- * @param {boolean} invert
- * @return {Runner} Runner instance.
- */
-Runner.prototype.grep = function (re, invert) {
- debug('grep %s', re);
- this._grep = re;
- this._invert = invert;
- this.total = this.grepTotal(this.suite);
- return this;
-};
-
-/**
- * Returns the number of tests matching the grep search for the
- * given suite.
- *
- * @param {Suite} suite
- * @return {Number}
- * @api public
- * @param {Suite} suite
- * @return {number}
- */
-Runner.prototype.grepTotal = function (suite) {
- var self = this;
- var total = 0;
-
- suite.eachTest(function (test) {
- var match = self._grep.test(test.fullTitle());
- if (self._invert) {
- match = !match;
- }
- if (match) {
- total++;
- }
- });
-
- return total;
-};
-
-/**
- * Return a list of global properties.
- *
- * @return {Array}
- * @api private
- */
-Runner.prototype.globalProps = function () {
- var props = keys(global);
-
- // non-enumerables
- for (var i = 0; i < globals.length; ++i) {
- if (~indexOf(props, globals[i])) {
- continue;
- }
- props.push(globals[i]);
- }
-
- return props;
-};
-
-/**
- * Allow the given `arr` of globals.
- *
- * @param {Array} arr
- * @return {Runner} for chaining
- * @api public
- * @param {Array} arr
- * @return {Runner} Runner instance.
- */
-Runner.prototype.globals = function (arr) {
- if (!arguments.length) {
- return this._globals;
- }
- debug('globals %j', arr);
- this._globals = this._globals.concat(arr);
- return this;
-};
-
-/**
- * Check for global variable leaks.
- *
- * @api private
- */
-Runner.prototype.checkGlobals = function (test) {
- if (this.ignoreLeaks) {
- return;
- }
- var ok = this._globals;
-
- var globals = this.globalProps();
- var leaks;
-
- if (test) {
- ok = ok.concat(test._allowedGlobals || []);
- }
-
- if (this.prevGlobalsLength === globals.length) {
- return;
- }
- this.prevGlobalsLength = globals.length;
-
- leaks = filterLeaks(ok, globals);
- this._globals = this._globals.concat(leaks);
-
- if (leaks.length > 1) {
- this.fail(test, new Error('global leaks detected: ' + leaks.join(', ') + ''));
- } else if (leaks.length) {
- this.fail(test, new Error('global leak detected: ' + leaks[0]));
- }
-};
-
-/**
- * Fail the given `test`.
- *
- * @api private
- * @param {Test} test
- * @param {Error} err
- */
-Runner.prototype.fail = function (test, err) {
- if (test.isPending()) {
- return;
- }
-
- ++this.failures;
- test.state = 'failed';
-
- if (!(err instanceof Error || err && typeof err.message === 'string')) {
- err = new Error('the ' + type(err) + ' ' + stringify(err) + ' was thrown, throw an Error :)');
- }
-
- try {
- err.stack = (this.fullStackTrace || !err.stack)
- ? err.stack
- : stackFilter(err.stack);
- } catch (ignored) {
- // some environments do not take kindly to monkeying with the stack
- }
-
- this.emit('fail', test, err);
-};
-
-/**
- * Fail the given `hook` with `err`.
- *
- * Hook failures work in the following pattern:
- * - If bail, then exit
- * - Failed `before` hook skips all tests in a suite and subsuites,
- * but jumps to corresponding `after` hook
- * - Failed `before each` hook skips remaining tests in a
- * suite and jumps to corresponding `after each` hook,
- * which is run only once
- * - Failed `after` hook does not alter
- * execution order
- * - Failed `after each` hook skips remaining tests in a
- * suite and subsuites, but executes other `after each`
- * hooks
- *
- * @api private
- * @param {Hook} hook
- * @param {Error} err
- */
-Runner.prototype.failHook = function (hook, err) {
- if (hook.ctx && hook.ctx.currentTest) {
- hook.originalTitle = hook.originalTitle || hook.title;
- hook.title = hook.originalTitle + ' for "' + hook.ctx.currentTest.title + '"';
- }
-
- this.fail(hook, err);
- if (this.suite.bail()) {
- this.emit('end');
- }
-};
-
-/**
- * Run hook `name` callbacks and then invoke `fn()`.
- *
- * @api private
- * @param {string} name
- * @param {Function} fn
- */
-
-Runner.prototype.hook = function (name, fn) {
- var suite = this.suite;
- var hooks = suite['_' + name];
- var self = this;
-
- function next (i) {
- var hook = hooks[i];
- if (!hook) {
- return fn();
- }
- self.currentRunnable = hook;
-
- hook.ctx.currentTest = self.test;
-
- self.emit('hook', hook);
-
- if (!hook.listeners('error').length) {
- hook.on('error', function (err) {
- self.failHook(hook, err);
- });
- }
-
- hook.run(function (err) {
- var testError = hook.error();
- if (testError) {
- self.fail(self.test, testError);
- }
- if (err) {
- if (err instanceof Pending) {
- if (name === 'beforeEach' || name === 'afterEach') {
- self.test.pending = true;
- } else {
- utils.forEach(suite.tests, function (test) {
- test.pending = true;
- });
- // a pending hook won't be executed twice.
- hook.pending = true;
- }
- } else {
- self.failHook(hook, err);
-
- // stop executing hooks, notify callee of hook err
- return fn(err);
- }
- }
- self.emit('hook end', hook);
- delete hook.ctx.currentTest;
- next(++i);
- });
- }
-
- Runner.immediately(function () {
- next(0);
- });
-};
-
-/**
- * Run hook `name` for the given array of `suites`
- * in order, and callback `fn(err, errSuite)`.
- *
- * @api private
- * @param {string} name
- * @param {Array} suites
- * @param {Function} fn
- */
-Runner.prototype.hooks = function (name, suites, fn) {
- var self = this;
- var orig = this.suite;
-
- function next (suite) {
- self.suite = suite;
-
- if (!suite) {
- self.suite = orig;
- return fn();
- }
-
- self.hook(name, function (err) {
- if (err) {
- var errSuite = self.suite;
- self.suite = orig;
- return fn(err, errSuite);
- }
-
- next(suites.pop());
- });
- }
-
- next(suites.pop());
-};
-
-/**
- * Run hooks from the top level down.
- *
- * @param {String} name
- * @param {Function} fn
- * @api private
- */
-Runner.prototype.hookUp = function (name, fn) {
- var suites = [this.suite].concat(this.parents()).reverse();
- this.hooks(name, suites, fn);
-};
-
-/**
- * Run hooks from the bottom up.
- *
- * @param {String} name
- * @param {Function} fn
- * @api private
- */
-Runner.prototype.hookDown = function (name, fn) {
- var suites = [this.suite].concat(this.parents());
- this.hooks(name, suites, fn);
-};
-
-/**
- * Return an array of parent Suites from
- * closest to furthest.
- *
- * @return {Array}
- * @api private
- */
-Runner.prototype.parents = function () {
- var suite = this.suite;
- var suites = [];
- while (suite.parent) {
- suite = suite.parent;
- suites.push(suite);
- }
- return suites;
-};
-
-/**
- * Run the current test and callback `fn(err)`.
- *
- * @param {Function} fn
- * @api private
- */
-Runner.prototype.runTest = function (fn) {
- var self = this;
- var test = this.test;
-
- if (!test) {
- return;
- }
- if (this.asyncOnly) {
- test.asyncOnly = true;
- }
-
- if (this.allowUncaught) {
- test.allowUncaught = true;
- return test.run(fn);
- }
- try {
- test.on('error', function (err) {
- self.fail(test, err);
- });
- test.run(fn);
- } catch (err) {
- fn(err);
- }
-};
-
-/**
- * Run tests in the given `suite` and invoke the callback `fn()` when complete.
- *
- * @api private
- * @param {Suite} suite
- * @param {Function} fn
- */
-Runner.prototype.runTests = function (suite, fn) {
- var self = this;
- var tests = suite.tests.slice();
- var test;
-
- function hookErr (_, errSuite, after) {
- // before/after Each hook for errSuite failed:
- var orig = self.suite;
-
- // for failed 'after each' hook start from errSuite parent,
- // otherwise start from errSuite itself
- self.suite = after ? errSuite.parent : errSuite;
-
- if (self.suite) {
- // call hookUp afterEach
- self.hookUp('afterEach', function (err2, errSuite2) {
- self.suite = orig;
- // some hooks may fail even now
- if (err2) {
- return hookErr(err2, errSuite2, true);
- }
- // report error suite
- fn(errSuite);
- });
- } else {
- // there is no need calling other 'after each' hooks
- self.suite = orig;
- fn(errSuite);
- }
- }
-
- function next (err, errSuite) {
- // if we bail after first err
- if (self.failures && suite._bail) {
- return fn();
- }
-
- if (self._abort) {
- return fn();
- }
-
- if (err) {
- return hookErr(err, errSuite, true);
- }
-
- // next test
- test = tests.shift();
-
- // all done
- if (!test) {
- return fn();
- }
-
- // grep
- var match = self._grep.test(test.fullTitle());
- if (self._invert) {
- match = !match;
- }
- if (!match) {
- // Run immediately only if we have defined a grep. When we
- // define a grep — It can cause maximum callstack error if
- // the grep is doing a large recursive loop by neglecting
- // all tests. The run immediately function also comes with
- // a performance cost. So we don't want to run immediately
- // if we run the whole test suite, because running the whole
- // test suite don't do any immediate recursive loops. Thus,
- // allowing a JS runtime to breathe.
- if (self._grep !== self._defaultGrep) {
- Runner.immediately(next);
- } else {
- next();
- }
- return;
- }
-
- if (test.isPending()) {
- self.emit('pending', test);
- self.emit('test end', test);
- return next();
- }
-
- // execute test and hook(s)
- self.emit('test', self.test = test);
- self.hookDown('beforeEach', function (err, errSuite) {
- if (test.isPending()) {
- self.emit('pending', test);
- self.emit('test end', test);
- return next();
- }
- if (err) {
- return hookErr(err, errSuite, false);
- }
- self.currentRunnable = self.test;
- self.runTest(function (err) {
- test = self.test;
- if (err) {
- var retry = test.currentRetry();
- if (err instanceof Pending) {
- test.pending = true;
- self.emit('pending', test);
- } else if (retry < test.retries()) {
- var clonedTest = test.clone();
- clonedTest.currentRetry(retry + 1);
- tests.unshift(clonedTest);
-
- // Early return + hook trigger so that it doesn't
- // increment the count wrong
- return self.hookUp('afterEach', next);
- } else {
- self.fail(test, err);
- }
- self.emit('test end', test);
-
- if (err instanceof Pending) {
- return next();
- }
-
- return self.hookUp('afterEach', next);
- }
-
- test.state = 'passed';
- self.emit('pass', test);
- self.emit('test end', test);
- self.hookUp('afterEach', next);
- });
- });
- }
-
- this.next = next;
- this.hookErr = hookErr;
- next();
-};
-
-/**
- * Run the given `suite` and invoke the callback `fn()` when complete.
- *
- * @api private
- * @param {Suite} suite
- * @param {Function} fn
- */
-Runner.prototype.runSuite = function (suite, fn) {
- var i = 0;
- var self = this;
- var total = this.grepTotal(suite);
- var afterAllHookCalled = false;
-
- debug('run suite %s', suite.fullTitle());
-
- if (!total || (self.failures && suite._bail)) {
- return fn();
- }
-
- this.emit('suite', this.suite = suite);
-
- function next (errSuite) {
- if (errSuite) {
- // current suite failed on a hook from errSuite
- if (errSuite === suite) {
- // if errSuite is current suite
- // continue to the next sibling suite
- return done();
- }
- // errSuite is among the parents of current suite
- // stop execution of errSuite and all sub-suites
- return done(errSuite);
- }
-
- if (self._abort) {
- return done();
- }
-
- var curr = suite.suites[i++];
- if (!curr) {
- return done();
- }
-
- // Avoid grep neglecting large number of tests causing a
- // huge recursive loop and thus a maximum call stack error.
- // See comment in `this.runTests()` for more information.
- if (self._grep !== self._defaultGrep) {
- Runner.immediately(function () {
- self.runSuite(curr, next);
- });
- } else {
- self.runSuite(curr, next);
- }
- }
-
- function done (errSuite) {
- self.suite = suite;
- self.nextSuite = next;
-
- if (afterAllHookCalled) {
- fn(errSuite);
- } else {
- // mark that the afterAll block has been called once
- // and so can be skipped if there is an error in it.
- afterAllHookCalled = true;
-
- // remove reference to test
- delete self.test;
-
- self.hook('afterAll', function () {
- self.emit('suite end', suite);
- fn(errSuite);
- });
- }
- }
-
- this.nextSuite = next;
-
- this.hook('beforeAll', function (err) {
- if (err) {
- return done();
- }
- self.runTests(suite, next);
- });
-};
-
-/**
- * Handle uncaught exceptions.
- *
- * @param {Error} err
- * @api private
- */
-Runner.prototype.uncaught = function (err) {
- if (err) {
- debug('uncaught exception %s', err !== function () {
- return this;
- }.call(err) ? err : (err.message || err));
- } else {
- debug('uncaught undefined exception');
- err = undefinedError();
- }
- err.uncaught = true;
-
- var runnable = this.currentRunnable;
-
- if (!runnable) {
- runnable = new Runnable('Uncaught error outside test suite');
- runnable.parent = this.suite;
-
- if (this.started) {
- this.fail(runnable, err);
- } else {
- // Can't recover from this failure
- this.emit('start');
- this.fail(runnable, err);
- this.emit('end');
- }
-
- return;
- }
-
- runnable.clearTimeout();
-
- // Ignore errors if complete or pending
- if (runnable.state || runnable.isPending()) {
- return;
- }
- this.fail(runnable, err);
-
- // recover from test
- if (runnable.type === 'test') {
- this.emit('test end', runnable);
- this.hookUp('afterEach', this.next);
- return;
- }
-
- // recover from hooks
- if (runnable.type === 'hook') {
- var errSuite = this.suite;
- // if hook failure is in afterEach block
- if (runnable.fullTitle().indexOf('after each') > -1) {
- return this.hookErr(err, errSuite, true);
- }
- // if hook failure is in beforeEach block
- if (runnable.fullTitle().indexOf('before each') > -1) {
- return this.hookErr(err, errSuite, false);
- }
- // if hook failure is in after or before blocks
- return this.nextSuite(errSuite);
- }
-
- // bail
- this.emit('end');
-};
-
-/**
- * Cleans up the references to all the deferred functions
- * (before/after/beforeEach/afterEach) and tests of a Suite.
- * These must be deleted otherwise a memory leak can happen,
- * as those functions may reference variables from closures,
- * thus those variables can never be garbage collected as long
- * as the deferred functions exist.
- *
- * @param {Suite} suite
- */
-function cleanSuiteReferences (suite) {
- function cleanArrReferences (arr) {
- for (var i = 0; i < arr.length; i++) {
- delete arr[i].fn;
- }
- }
-
- if (isArray(suite._beforeAll)) {
- cleanArrReferences(suite._beforeAll);
- }
-
- if (isArray(suite._beforeEach)) {
- cleanArrReferences(suite._beforeEach);
- }
-
- if (isArray(suite._afterAll)) {
- cleanArrReferences(suite._afterAll);
- }
-
- if (isArray(suite._afterEach)) {
- cleanArrReferences(suite._afterEach);
- }
-
- for (var i = 0; i < suite.tests.length; i++) {
- delete suite.tests[i].fn;
- }
-}
-
-/**
- * Run the root suite and invoke `fn(failures)`
- * on completion.
- *
- * @param {Function} fn
- * @return {Runner} for chaining
- * @api public
- * @param {Function} fn
- * @return {Runner} Runner instance.
- */
-Runner.prototype.run = function (fn) {
- var self = this;
- var rootSuite = this.suite;
-
- // If there is an `only` filter
- if (this.hasOnly) {
- filterOnly(rootSuite);
- }
-
- fn = fn || function () {};
-
- function uncaught (err) {
- self.uncaught(err);
- }
-
- function start () {
- self.started = true;
- self.emit('start');
- self.runSuite(rootSuite, function () {
- debug('finished running');
- self.emit('end');
- });
- }
-
- debug('start');
-
- // references cleanup to avoid memory leaks
- this.on('suite end', cleanSuiteReferences);
-
- // callback
- this.on('end', function () {
- debug('end');
- process.removeListener('uncaughtException', uncaught);
- fn(self.failures);
- });
-
- // uncaught exception
- process.on('uncaughtException', uncaught);
-
- if (this._delay) {
- // for reporters, I guess.
- // might be nice to debounce some dots while we wait.
- this.emit('waiting', rootSuite);
- rootSuite.once('run', start);
- } else {
- start();
- }
-
- return this;
-};
-
-/**
- * Cleanly abort execution.
- *
- * @api public
- * @return {Runner} Runner instance.
- */
-Runner.prototype.abort = function () {
- debug('aborting');
- this._abort = true;
-
- return this;
-};
-
-/**
- * Filter suites based on `isOnly` logic.
- *
- * @param {Array} suite
- * @returns {Boolean}
- * @api private
- */
-function filterOnly (suite) {
- if (suite._onlyTests.length) {
- // If the suite contains `only` tests, run those and ignore any nested suites.
- suite.tests = suite._onlyTests;
- suite.suites = [];
- } else {
- // Otherwise, do not run any of the tests in this suite.
- suite.tests = [];
- utils.forEach(suite._onlySuites, function (onlySuite) {
- // If there are other `only` tests/suites nested in the current `only` suite, then filter that `only` suite.
- // Otherwise, all of the tests on this `only` suite should be run, so don't filter it.
- if (hasOnly(onlySuite)) {
- filterOnly(onlySuite);
- }
- });
- // Run the `only` suites, as well as any other suites that have `only` tests/suites as descendants.
- suite.suites = filter(suite.suites, function (childSuite) {
- return indexOf(suite._onlySuites, childSuite) !== -1 || filterOnly(childSuite);
- });
- }
- // Keep the suite only if there is something to run
- return suite.tests.length || suite.suites.length;
-}
-
-/**
- * Determines whether a suite has an `only` test or suite as a descendant.
- *
- * @param {Array} suite
- * @returns {Boolean}
- * @api private
- */
-function hasOnly (suite) {
- return suite._onlyTests.length || suite._onlySuites.length || some(suite.suites, hasOnly);
-}
-
-/**
- * Filter leaks with the given globals flagged as `ok`.
- *
- * @api private
- * @param {Array} ok
- * @param {Array} globals
- * @return {Array}
- */
-function filterLeaks (ok, globals) {
- return filter(globals, function (key) {
- // Firefox and Chrome exposes iframes as index inside the window object
- if (/^\d+/.test(key)) {
- return false;
- }
-
- // in firefox
- // if runner runs in an iframe, this iframe's window.getInterface method
- // not init at first it is assigned in some seconds
- if (global.navigator && (/^getInterface/).test(key)) {
- return false;
- }
-
- // an iframe could be approached by window[iframeIndex]
- // in ie6,7,8 and opera, iframeIndex is enumerable, this could cause leak
- if (global.navigator && (/^\d+/).test(key)) {
- return false;
- }
-
- // Opera and IE expose global variables for HTML element IDs (issue #243)
- if (/^mocha-/.test(key)) {
- return false;
- }
-
- var matched = filter(ok, function (ok) {
- if (~ok.indexOf('*')) {
- return key.indexOf(ok.split('*')[0]) === 0;
- }
- return key === ok;
- });
- return !matched.length && (!global.navigator || key !== 'onerror');
- });
-}
-
-/**
- * Array of globals dependent on the environment.
- *
- * @return {Array}
- * @api private
- */
-function extraGlobals () {
- if (typeof process === 'object' && typeof process.version === 'string') {
- var parts = process.version.split('.');
- var nodeVersion = utils.reduce(parts, function (a, v) {
- return a << 8 | v;
- });
-
- // 'errno' was renamed to process._errno in v0.9.11.
-
- if (nodeVersion < 0x00090B) {
- return ['errno'];
- }
- }
-
- return [];
-}
-
-}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./pending":16,"./runnable":33,"./utils":38,"_process":67,"debug":2,"events":3}],35:[function(require,module,exports){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var EventEmitter = require('events').EventEmitter;
-var Hook = require('./hook');
-var utils = require('./utils');
-var inherits = utils.inherits;
-var debug = require('debug')('mocha:suite');
-var milliseconds = require('./ms');
-
-/**
- * Expose `Suite`.
- */
-
-exports = module.exports = Suite;
-
-/**
- * Create a new `Suite` with the given `title` and parent `Suite`. When a suite
- * with the same title is already present, that suite is returned to provide
- * nicer reporter and more flexible meta-testing.
- *
- * @api public
- * @param {Suite} parent
- * @param {string} title
- * @return {Suite}
- */
-exports.create = function (parent, title) {
- var suite = new Suite(title, parent.ctx);
- suite.parent = parent;
- title = suite.fullTitle();
- parent.addSuite(suite);
- return suite;
-};
-
-/**
- * Initialize a new `Suite` with the given `title` and `ctx`.
- *
- * @api private
- * @param {string} title
- * @param {Context} parentContext
- */
-function Suite (title, parentContext) {
- if (!utils.isString(title)) {
- throw new Error('Suite `title` should be a "string" but "' + typeof title + '" was given instead.');
- }
- this.title = title;
- function Context () {}
- Context.prototype = parentContext;
- this.ctx = new Context();
- this.suites = [];
- this.tests = [];
- this.pending = false;
- this._beforeEach = [];
- this._beforeAll = [];
- this._afterEach = [];
- this._afterAll = [];
- this.root = !title;
- this._timeout = 2000;
- this._enableTimeouts = true;
- this._slow = 75;
- this._bail = false;
- this._retries = -1;
- this._onlyTests = [];
- this._onlySuites = [];
- this.delayed = false;
-}
-
-/**
- * Inherit from `EventEmitter.prototype`.
- */
-inherits(Suite, EventEmitter);
-
-/**
- * Return a clone of this `Suite`.
- *
- * @api private
- * @return {Suite}
- */
-Suite.prototype.clone = function () {
- var suite = new Suite(this.title);
- debug('clone');
- suite.ctx = this.ctx;
- suite.timeout(this.timeout());
- suite.retries(this.retries());
- suite.enableTimeouts(this.enableTimeouts());
- suite.slow(this.slow());
- suite.bail(this.bail());
- return suite;
-};
-
-/**
- * Set timeout `ms` or short-hand such as "2s".
- *
- * @api private
- * @param {number|string} ms
- * @return {Suite|number} for chaining
- */
-Suite.prototype.timeout = function (ms) {
- if (!arguments.length) {
- return this._timeout;
- }
- if (ms.toString() === '0') {
- this._enableTimeouts = false;
- }
- if (typeof ms === 'string') {
- ms = milliseconds(ms);
- }
- debug('timeout %d', ms);
- this._timeout = parseInt(ms, 10);
- return this;
-};
-
-/**
- * Set number of times to retry a failed test.
- *
- * @api private
- * @param {number|string} n
- * @return {Suite|number} for chaining
- */
-Suite.prototype.retries = function (n) {
- if (!arguments.length) {
- return this._retries;
- }
- debug('retries %d', n);
- this._retries = parseInt(n, 10) || 0;
- return this;
-};
-
-/**
- * Set timeout to `enabled`.
- *
- * @api private
- * @param {boolean} enabled
- * @return {Suite|boolean} self or enabled
- */
-Suite.prototype.enableTimeouts = function (enabled) {
- if (!arguments.length) {
- return this._enableTimeouts;
- }
- debug('enableTimeouts %s', enabled);
- this._enableTimeouts = enabled;
- return this;
-};
-
-/**
- * Set slow `ms` or short-hand such as "2s".
- *
- * @api private
- * @param {number|string} ms
- * @return {Suite|number} for chaining
- */
-Suite.prototype.slow = function (ms) {
- if (!arguments.length) {
- return this._slow;
- }
- if (typeof ms === 'string') {
- ms = milliseconds(ms);
- }
- debug('slow %d', ms);
- this._slow = ms;
- return this;
-};
-
-/**
- * Sets whether to bail after first error.
- *
- * @api private
- * @param {boolean} bail
- * @return {Suite|number} for chaining
- */
-Suite.prototype.bail = function (bail) {
- if (!arguments.length) {
- return this._bail;
- }
- debug('bail %s', bail);
- this._bail = bail;
- return this;
-};
-
-/**
- * Check if this suite or its parent suite is marked as pending.
- *
- * @api private
- */
-Suite.prototype.isPending = function () {
- return this.pending || (this.parent && this.parent.isPending());
-};
-
-/**
- * Run `fn(test[, done])` before running tests.
- *
- * @api private
- * @param {string} title
- * @param {Function} fn
- * @return {Suite} for chaining
- */
-Suite.prototype.beforeAll = function (title, fn) {
- if (this.isPending()) {
- return this;
- }
- if (typeof title === 'function') {
- fn = title;
- title = fn.name;
- }
- title = '"before all" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.retries(this.retries());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._beforeAll.push(hook);
- this.emit('beforeAll', hook);
- return this;
-};
-
-/**
- * Run `fn(test[, done])` after running tests.
- *
- * @api private
- * @param {string} title
- * @param {Function} fn
- * @return {Suite} for chaining
- */
-Suite.prototype.afterAll = function (title, fn) {
- if (this.isPending()) {
- return this;
- }
- if (typeof title === 'function') {
- fn = title;
- title = fn.name;
- }
- title = '"after all" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.retries(this.retries());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._afterAll.push(hook);
- this.emit('afterAll', hook);
- return this;
-};
-
-/**
- * Run `fn(test[, done])` before each test case.
- *
- * @api private
- * @param {string} title
- * @param {Function} fn
- * @return {Suite} for chaining
- */
-Suite.prototype.beforeEach = function (title, fn) {
- if (this.isPending()) {
- return this;
- }
- if (typeof title === 'function') {
- fn = title;
- title = fn.name;
- }
- title = '"before each" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.retries(this.retries());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._beforeEach.push(hook);
- this.emit('beforeEach', hook);
- return this;
-};
-
-/**
- * Run `fn(test[, done])` after each test case.
- *
- * @api private
- * @param {string} title
- * @param {Function} fn
- * @return {Suite} for chaining
- */
-Suite.prototype.afterEach = function (title, fn) {
- if (this.isPending()) {
- return this;
- }
- if (typeof title === 'function') {
- fn = title;
- title = fn.name;
- }
- title = '"after each" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.retries(this.retries());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._afterEach.push(hook);
- this.emit('afterEach', hook);
- return this;
-};
-
-/**
- * Add a test `suite`.
- *
- * @api private
- * @param {Suite} suite
- * @return {Suite} for chaining
- */
-Suite.prototype.addSuite = function (suite) {
- suite.parent = this;
- suite.timeout(this.timeout());
- suite.retries(this.retries());
- suite.enableTimeouts(this.enableTimeouts());
- suite.slow(this.slow());
- suite.bail(this.bail());
- this.suites.push(suite);
- this.emit('suite', suite);
- return this;
-};
-
-/**
- * Add a `test` to this suite.
- *
- * @api private
- * @param {Test} test
- * @return {Suite} for chaining
- */
-Suite.prototype.addTest = function (test) {
- test.parent = this;
- test.timeout(this.timeout());
- test.retries(this.retries());
- test.enableTimeouts(this.enableTimeouts());
- test.slow(this.slow());
- test.ctx = this.ctx;
- this.tests.push(test);
- this.emit('test', test);
- return this;
-};
-
-/**
- * Return the full title generated by recursively concatenating the parent's
- * full title.
- *
- * @api public
- * @return {string}
- */
-Suite.prototype.fullTitle = function () {
- if (this.parent) {
- var full = this.parent.fullTitle();
- if (full) {
- return full + ' ' + this.title;
- }
- }
- return this.title;
-};
-
-/**
- * Return the total number of tests.
- *
- * @api public
- * @return {number}
- */
-Suite.prototype.total = function () {
- return utils.reduce(this.suites, function (sum, suite) {
- return sum + suite.total();
- }, 0) + this.tests.length;
-};
-
-/**
- * Iterates through each suite recursively to find all tests. Applies a
- * function in the format `fn(test)`.
- *
- * @api private
- * @param {Function} fn
- * @return {Suite}
- */
-Suite.prototype.eachTest = function (fn) {
- utils.forEach(this.tests, fn);
- utils.forEach(this.suites, function (suite) {
- suite.eachTest(fn);
- });
- return this;
-};
-
-/**
- * This will run the root suite if we happen to be running in delayed mode.
- */
-Suite.prototype.run = function run () {
- if (this.root) {
- this.emit('run');
- }
-};
-
-},{"./hook":7,"./ms":15,"./utils":38,"debug":2,"events":3}],36:[function(require,module,exports){
-'use strict';
-
-/**
- * Module dependencies.
- */
-
-var Runnable = require('./runnable');
-var create = require('lodash.create');
-var isString = require('./utils').isString;
-
-/**
- * Expose `Test`.
- */
-
-module.exports = Test;
-
-/**
- * Initialize a new `Test` with the given `title` and callback `fn`.
- *
- * @api private
- * @param {String} title
- * @param {Function} fn
- */
-function Test (title, fn) {
- if (!isString(title)) {
- throw new Error('Test `title` should be a "string" but "' + typeof title + '" was given instead.');
- }
- Runnable.call(this, title, fn);
- this.pending = !fn;
- this.type = 'test';
-}
-
-/**
- * Inherit from `Runnable.prototype`.
- */
-Test.prototype = create(Runnable.prototype, {
- constructor: Test
-});
-
-Test.prototype.clone = function () {
- var test = new Test(this.title, this.fn);
- test.timeout(this.timeout());
- test.slow(this.slow());
- test.enableTimeouts(this.enableTimeouts());
- test.retries(this.retries());
- test.currentRetry(this.currentRetry());
- test.globals(this.globals());
- test.parent = this.parent;
- test.file = this.file;
- test.ctx = this.ctx;
- return test;
-};
-
-},{"./runnable":33,"./utils":38,"lodash.create":60}],37:[function(require,module,exports){
-'use strict';
-
-/**
- * Pad a `number` with a ten's place zero.
- *
- * @param {number} number
- * @return {string}
- */
-function pad(number) {
- var n = number.toString();
- return n.length === 1 ? '0' + n : n;
-}
-
-/**
- * Turn a `date` into an ISO string.
- *
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
- *
- * @param {Date} date
- * @return {string}
- */
-function toISOString(date) {
- return date.getUTCFullYear()
- + '-' + pad(date.getUTCMonth() + 1)
- + '-' + pad(date.getUTCDate())
- + 'T' + pad(date.getUTCHours())
- + ':' + pad(date.getUTCMinutes())
- + ':' + pad(date.getUTCSeconds())
- + '.' + String((date.getUTCMilliseconds()/1000).toFixed(3)).slice(2, 5)
- + 'Z';
-}
-
-/*
- * Exports.
- */
-
-module.exports = toISOString;
-
-},{}],38:[function(require,module,exports){
-(function (process,Buffer){
-'use strict';
-
-/* eslint-env browser */
-
-/**
- * Module dependencies.
- */
-
-var JSON = require('json3');
-var basename = require('path').basename;
-var debug = require('debug')('mocha:watch');
-var exists = require('fs').existsSync || require('path').existsSync;
-var glob = require('glob');
-var path = require('path');
-var join = path.join;
-var readdirSync = require('fs').readdirSync;
-var statSync = require('fs').statSync;
-var watchFile = require('fs').watchFile;
-var toISOString = require('./to-iso-string');
-
-/**
- * Ignored directories.
- */
-
-var ignore = ['node_modules', '.git'];
-
-exports.inherits = require('util').inherits;
-
-/**
- * Escape special characters in the given string of html.
- *
- * @api private
- * @param {string} html
- * @return {string}
- */
-exports.escape = function (html) {
- return String(html)
- .replace(/&/g, '&amp;')
- .replace(/"/g, '&quot;')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;');
-};
-
-/**
- * Array#forEach (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Function} fn
- * @param {Object} scope
- */
-exports.forEach = function (arr, fn, scope) {
- for (var i = 0, l = arr.length; i < l; i++) {
- fn.call(scope, arr[i], i);
- }
-};
-
-/**
- * Test if the given obj is type of string.
- *
- * @api private
- * @param {Object} obj
- * @return {boolean}
- */
-exports.isString = function (obj) {
- return typeof obj === 'string';
-};
-
-/**
- * Array#map (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Function} fn
- * @param {Object} scope
- * @return {Array}
- */
-exports.map = function (arr, fn, scope) {
- var result = [];
- for (var i = 0, l = arr.length; i < l; i++) {
- result.push(fn.call(scope, arr[i], i, arr));
- }
- return result;
-};
-
-/**
- * Array#indexOf (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Object} obj to find index of
- * @param {number} start
- * @return {number}
- */
-var indexOf = exports.indexOf = function (arr, obj, start) {
- for (var i = start || 0, l = arr.length; i < l; i++) {
- if (arr[i] === obj) {
- return i;
- }
- }
- return -1;
-};
-
-/**
- * Array#reduce (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Function} fn
- * @param {Object} val Initial value.
- * @return {*}
- */
-var reduce = exports.reduce = function (arr, fn, val) {
- var rval = val;
-
- for (var i = 0, l = arr.length; i < l; i++) {
- rval = fn(rval, arr[i], i, arr);
- }
-
- return rval;
-};
-
-/**
- * Array#filter (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Function} fn
- * @return {Array}
- */
-exports.filter = function (arr, fn) {
- var ret = [];
-
- for (var i = 0, l = arr.length; i < l; i++) {
- var val = arr[i];
- if (fn(val, i, arr)) {
- ret.push(val);
- }
- }
-
- return ret;
-};
-
-/**
- * Array#some (<=IE8)
- *
- * @api private
- * @param {Array} arr
- * @param {Function} fn
- * @return {Array}
- */
-exports.some = function (arr, fn) {
- for (var i = 0, l = arr.length; i < l; i++) {
- if (fn(arr[i])) {
- return true;
- }
- }
- return false;
-};
-
-/**
- * Object.keys (<=IE8)
- *
- * @api private
- * @param {Object} obj
- * @return {Array} keys
- */
-exports.keys = typeof Object.keys === 'function' ? Object.keys : function (obj) {
- var keys = [];
- var has = Object.prototype.hasOwnProperty; // for `window` on <=IE8
-
- for (var key in obj) {
- if (has.call(obj, key)) {
- keys.push(key);
- }
- }
-
- return keys;
-};
-
-/**
- * Watch the given `files` for changes
- * and invoke `fn(file)` on modification.
- *
- * @api private
- * @param {Array} files
- * @param {Function} fn
- */
-exports.watch = function (files, fn) {
- var options = { interval: 100 };
- files.forEach(function (file) {
- debug('file %s', file);
- watchFile(file, options, function (curr, prev) {
- if (prev.mtime < curr.mtime) {
- fn(file);
- }
- });
- });
-};
-
-/**
- * Array.isArray (<=IE8)
- *
- * @api private
- * @param {Object} obj
- * @return {Boolean}
- */
-var isArray = typeof Array.isArray === 'function' ? Array.isArray : function (obj) {
- return Object.prototype.toString.call(obj) === '[object Array]';
-};
-
-exports.isArray = isArray;
-
-/**
- * Buffer.prototype.toJSON polyfill.
- *
- * @type {Function}
- */
-if (typeof Buffer !== 'undefined' && Buffer.prototype) {
- Buffer.prototype.toJSON = Buffer.prototype.toJSON || function () {
- return Array.prototype.slice.call(this, 0);
- };
-}
-
-/**
- * Ignored files.
- *
- * @api private
- * @param {string} path
- * @return {boolean}
- */
-function ignored (path) {
- return !~ignore.indexOf(path);
-}
-
-/**
- * Lookup files in the given `dir`.
- *
- * @api private
- * @param {string} dir
- * @param {string[]} [ext=['.js']]
- * @param {Array} [ret=[]]
- * @return {Array}
- */
-exports.files = function (dir, ext, ret) {
- ret = ret || [];
- ext = ext || ['js'];
-
- var re = new RegExp('\\.(' + ext.join('|') + ')$');
-
- readdirSync(dir)
- .filter(ignored)
- .forEach(function (path) {
- path = join(dir, path);
- if (statSync(path).isDirectory()) {
- exports.files(path, ext, ret);
- } else if (path.match(re)) {
- ret.push(path);
- }
- });
-
- return ret;
-};
-
-/**
- * Compute a slug from the given `str`.
- *
- * @api private
- * @param {string} str
- * @return {string}
- */
-exports.slug = function (str) {
- return str
- .toLowerCase()
- .replace(/ +/g, '-')
- .replace(/[^-\w]/g, '');
-};
-
-/**
- * Strip the function definition from `str`, and re-indent for pre whitespace.
- *
- * @param {string} str
- * @return {string}
- */
-exports.clean = function (str) {
- str = str
- .replace(/\r\n?|[\n\u2028\u2029]/g, '\n').replace(/^\uFEFF/, '')
- // (traditional)-> space/name parameters body (lambda)-> parameters body multi-statement/single keep body content
- .replace(/^function(?:\s*|\s+[^(]*)\([^)]*\)\s*\{((?:.|\n)*?)\s*\}$|^\([^)]*\)\s*=>\s*(?:\{((?:.|\n)*?)\s*\}|((?:.|\n)*))$/, '$1$2$3');
-
- var spaces = str.match(/^\n?( *)/)[1].length;
- var tabs = str.match(/^\n?(\t*)/)[1].length;
- var re = new RegExp('^\n?' + (tabs ? '\t' : ' ') + '{' + (tabs || spaces) + '}', 'gm');
-
- str = str.replace(re, '');
-
- return exports.trim(str);
-};
-
-/**
- * Trim the given `str`.
- *
- * @api private
- * @param {string} str
- * @return {string}
- */
-exports.trim = function (str) {
- return str.replace(/^\s+|\s+$/g, '');
-};
-
-/**
- * Parse the given `qs`.
- *
- * @api private
- * @param {string} qs
- * @return {Object}
- */
-exports.parseQuery = function (qs) {
- return reduce(qs.replace('?', '').split('&'), function (obj, pair) {
- var i = pair.indexOf('=');
- var key = pair.slice(0, i);
- var val = pair.slice(++i);
-
- obj[key] = decodeURIComponent(val);
- return obj;
- }, {});
-};
-
-/**
- * Highlight the given string of `js`.
- *
- * @api private
- * @param {string} js
- * @return {string}
- */
-function highlight (js) {
- return js
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;')
- .replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>')
- .replace(/('.*?')/gm, '<span class="string">$1</span>')
- .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
- .replace(/(\d+)/gm, '<span class="number">$1</span>')
- .replace(/\bnew[ \t]+(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
- .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>');
-}
-
-/**
- * Highlight the contents of tag `name`.
- *
- * @api private
- * @param {string} name
- */
-exports.highlightTags = function (name) {
- var code = document.getElementById('mocha').getElementsByTagName(name);
- for (var i = 0, len = code.length; i < len; ++i) {
- code[i].innerHTML = highlight(code[i].innerHTML);
- }
-};
-
-/**
- * If a value could have properties, and has none, this function is called,
- * which returns a string representation of the empty value.
- *
- * Functions w/ no properties return `'[Function]'`
- * Arrays w/ length === 0 return `'[]'`
- * Objects w/ no properties return `'{}'`
- * All else: return result of `value.toString()`
- *
- * @api private
- * @param {*} value The value to inspect.
- * @param {string} typeHint The type of the value
- * @returns {string}
- */
-function emptyRepresentation (value, typeHint) {
- switch (typeHint) {
- case 'function':
- return '[Function]';
- case 'object':
- return '{}';
- case 'array':
- return '[]';
- default:
- return value.toString();
- }
-}
-
-/**
- * Takes some variable and asks `Object.prototype.toString()` what it thinks it
- * is.
- *
- * @api private
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString
- * @param {*} value The value to test.
- * @returns {string} Computed type
- * @example
- * type({}) // 'object'
- * type([]) // 'array'
- * type(1) // 'number'
- * type(false) // 'boolean'
- * type(Infinity) // 'number'
- * type(null) // 'null'
- * type(new Date()) // 'date'
- * type(/foo/) // 'regexp'
- * type('type') // 'string'
- * type(global) // 'global'
- * type(new String('foo') // 'object'
- */
-var type = exports.type = function type (value) {
- if (value === undefined) {
- return 'undefined';
- } else if (value === null) {
- return 'null';
- } else if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) {
- return 'buffer';
- }
- return Object.prototype.toString.call(value)
- .replace(/^\[.+\s(.+?)\]$/, '$1')
- .toLowerCase();
-};
-
-/**
- * Stringify `value`. Different behavior depending on type of value:
- *
- * - If `value` is undefined or null, return `'[undefined]'` or `'[null]'`, respectively.
- * - If `value` is not an object, function or array, return result of `value.toString()` wrapped in double-quotes.
- * - If `value` is an *empty* object, function, or array, return result of function
- * {@link emptyRepresentation}.
- * - If `value` has properties, call {@link exports.canonicalize} on it, then return result of
- * JSON.stringify().
- *
- * @api private
- * @see exports.type
- * @param {*} value
- * @return {string}
- */
-exports.stringify = function (value) {
- var typeHint = type(value);
-
- if (!~indexOf(['object', 'array', 'function'], typeHint)) {
- if (typeHint === 'buffer') {
- var json = value.toJSON();
- // Based on the toJSON result
- return jsonStringify(json.data && json.type ? json.data : json, 2)
- .replace(/,(\n|$)/g, '$1');
- }
-
- // IE7/IE8 has a bizarre String constructor; needs to be coerced
- // into an array and back to obj.
- if (typeHint === 'string' && typeof value === 'object') {
- value = reduce(value.split(''), function (acc, char, idx) {
- acc[idx] = char;
- return acc;
- }, {});
- typeHint = 'object';
- } else {
- return jsonStringify(value);
- }
- }
-
- for (var prop in value) {
- if (Object.prototype.hasOwnProperty.call(value, prop)) {
- return jsonStringify(exports.canonicalize(value, null, typeHint), 2).replace(/,(\n|$)/g, '$1');
- }
- }
-
- return emptyRepresentation(value, typeHint);
-};
-
-/**
- * like JSON.stringify but more sense.
- *
- * @api private
- * @param {Object} object
- * @param {number=} spaces
- * @param {number=} depth
- * @returns {*}
- */
-function jsonStringify (object, spaces, depth) {
- if (typeof spaces === 'undefined') {
- // primitive types
- return _stringify(object);
- }
-
- depth = depth || 1;
- var space = spaces * depth;
- var str = isArray(object) ? '[' : '{';
- var end = isArray(object) ? ']' : '}';
- var length = typeof object.length === 'number' ? object.length : exports.keys(object).length;
- // `.repeat()` polyfill
- function repeat (s, n) {
- return new Array(n).join(s);
- }
-
- function _stringify (val) {
- switch (type(val)) {
- case 'null':
- case 'undefined':
- val = '[' + val + ']';
- break;
- case 'array':
- case 'object':
- val = jsonStringify(val, spaces, depth + 1);
- break;
- case 'boolean':
- case 'regexp':
- case 'symbol':
- case 'number':
- val = val === 0 && (1 / val) === -Infinity // `-0`
- ? '-0'
- : val.toString();
- break;
- case 'date':
- var sDate;
- if (isNaN(val.getTime())) { // Invalid date
- sDate = val.toString();
- } else {
- sDate = val.toISOString ? val.toISOString() : toISOString(val);
- }
- val = '[Date: ' + sDate + ']';
- break;
- case 'buffer':
- var json = val.toJSON();
- // Based on the toJSON result
- json = json.data && json.type ? json.data : json;
- val = '[Buffer: ' + jsonStringify(json, 2, depth + 1) + ']';
- break;
- default:
- val = (val === '[Function]' || val === '[Circular]')
- ? val
- : JSON.stringify(val); // string
- }
- return val;
- }
-
- for (var i in object) {
- if (!Object.prototype.hasOwnProperty.call(object, i)) {
- continue; // not my business
- }
- --length;
- str += '\n ' + repeat(' ', space) +
- (isArray(object) ? '' : '"' + i + '": ') + // key
- _stringify(object[i]) + // value
- (length ? ',' : ''); // comma
- }
-
- return str +
- // [], {}
- (str.length !== 1 ? '\n' + repeat(' ', --space) + end : end);
-}
-
-/**
- * Test if a value is a buffer.
- *
- * @api private
- * @param {*} value The value to test.
- * @return {boolean} True if `value` is a buffer, otherwise false
- */
-exports.isBuffer = function (value) {
- return typeof Buffer !== 'undefined' && Buffer.isBuffer(value);
-};
-
-/**
- * Return a new Thing that has the keys in sorted order. Recursive.
- *
- * If the Thing...
- * - has already been seen, return string `'[Circular]'`
- * - is `undefined`, return string `'[undefined]'`
- * - is `null`, return value `null`
- * - is some other primitive, return the value
- * - is not a primitive or an `Array`, `Object`, or `Function`, return the value of the Thing's `toString()` method
- * - is a non-empty `Array`, `Object`, or `Function`, return the result of calling this function again.
- * - is an empty `Array`, `Object`, or `Function`, return the result of calling `emptyRepresentation()`
- *
- * @api private
- * @see {@link exports.stringify}
- * @param {*} value Thing to inspect. May or may not have properties.
- * @param {Array} [stack=[]] Stack of seen values
- * @param {string} [typeHint] Type hint
- * @return {(Object|Array|Function|string|undefined)}
- */
-exports.canonicalize = function canonicalize (value, stack, typeHint) {
- var canonicalizedObj;
- /* eslint-disable no-unused-vars */
- var prop;
- /* eslint-enable no-unused-vars */
- typeHint = typeHint || type(value);
- function withStack (value, fn) {
- stack.push(value);
- fn();
- stack.pop();
- }
-
- stack = stack || [];
-
- if (indexOf(stack, value) !== -1) {
- return '[Circular]';
- }
-
- switch (typeHint) {
- case 'undefined':
- case 'buffer':
- case 'null':
- canonicalizedObj = value;
- break;
- case 'array':
- withStack(value, function () {
- canonicalizedObj = exports.map(value, function (item) {
- return exports.canonicalize(item, stack);
- });
- });
- break;
- case 'function':
- /* eslint-disable guard-for-in */
- for (prop in value) {
- canonicalizedObj = {};
- break;
- }
- /* eslint-enable guard-for-in */
- if (!canonicalizedObj) {
- canonicalizedObj = emptyRepresentation(value, typeHint);
- break;
- }
- /* falls through */
- case 'object':
- canonicalizedObj = canonicalizedObj || {};
- withStack(value, function () {
- exports.forEach(exports.keys(value).sort(), function (key) {
- canonicalizedObj[key] = exports.canonicalize(value[key], stack);
- });
- });
- break;
- case 'date':
- case 'number':
- case 'regexp':
- case 'boolean':
- case 'symbol':
- canonicalizedObj = value;
- break;
- default:
- canonicalizedObj = value + '';
- }
-
- return canonicalizedObj;
-};
-
-/**
- * Lookup file names at the given `path`.
- *
- * @api public
- * @param {string} path Base path to start searching from.
- * @param {string[]} extensions File extensions to look for.
- * @param {boolean} recursive Whether or not to recurse into subdirectories.
- * @return {string[]} An array of paths.
- */
-exports.lookupFiles = function lookupFiles (path, extensions, recursive) {
- var files = [];
- var re = new RegExp('\\.(' + extensions.join('|') + ')$');
-
- if (!exists(path)) {
- if (exists(path + '.js')) {
- path += '.js';
- } else {
- files = glob.sync(path);
- if (!files.length) {
- throw new Error("cannot resolve path (or pattern) '" + path + "'");
- }
- return files;
- }
- }
-
- try {
- var stat = statSync(path);
- if (stat.isFile()) {
- return path;
- }
- } catch (err) {
- // ignore error
- return;
- }
-
- readdirSync(path).forEach(function (file) {
- file = join(path, file);
- try {
- var stat = statSync(file);
- if (stat.isDirectory()) {
- if (recursive) {
- files = files.concat(lookupFiles(file, extensions, recursive));
- }
- return;
- }
- } catch (err) {
- // ignore error
- return;
- }
- if (!stat.isFile() || !re.test(file) || basename(file)[0] === '.') {
- return;
- }
- files.push(file);
- });
-
- return files;
-};
-
-/**
- * Generate an undefined error with a message warning the user.
- *
- * @return {Error}
- */
-
-exports.undefinedError = function () {
- return new Error('Caught undefined error, did you throw without specifying what?');
-};
-
-/**
- * Generate an undefined error if `err` is not defined.
- *
- * @param {Error} err
- * @return {Error}
- */
-
-exports.getError = function (err) {
- return err || exports.undefinedError();
-};
-
-/**
- * @summary
- * This Filter based on `mocha-clean` module.(see: `github.com/rstacruz/mocha-clean`)
- * @description
- * When invoking this function you get a filter function that get the Error.stack as an input,
- * and return a prettify output.
- * (i.e: strip Mocha and internal node functions from stack trace).
- * @returns {Function}
- */
-exports.stackTraceFilter = function () {
- // TODO: Replace with `process.browser`
- var is = typeof document === 'undefined' ? { node: true } : { browser: true };
- var slash = path.sep;
- var cwd;
- if (is.node) {
- cwd = process.cwd() + slash;
- } else {
- cwd = (typeof location === 'undefined' ? window.location : location).href.replace(/\/[^\/]*$/, '/');
- slash = '/';
- }
-
- function isMochaInternal (line) {
- return (~line.indexOf('node_modules' + slash + 'mocha' + slash)) ||
- (~line.indexOf('node_modules' + slash + 'mocha.js')) ||
- (~line.indexOf('bower_components' + slash + 'mocha.js')) ||
- (~line.indexOf(slash + 'mocha.js'));
- }
-
- function isNodeInternal (line) {
- return (~line.indexOf('(timers.js:')) ||
- (~line.indexOf('(events.js:')) ||
- (~line.indexOf('(node.js:')) ||
- (~line.indexOf('(module.js:')) ||
- (~line.indexOf('GeneratorFunctionPrototype.next (native)')) ||
- false;
- }
-
- return function (stack) {
- stack = stack.split('\n');
-
- stack = reduce(stack, function (list, line) {
- if (isMochaInternal(line)) {
- return list;
- }
-
- if (is.node && isNodeInternal(line)) {
- return list;
- }
-
- // Clean up cwd(absolute)
- if (/\(?.+:\d+:\d+\)?$/.test(line)) {
- line = line.replace(cwd, '');
- }
-
- list.push(line);
- return list;
- }, []);
-
- return stack.join('\n');
- };
-};
-
-/**
- * Crude, but effective.
- * @api
- * @param {*} value
- * @returns {boolean} Whether or not `value` is a Promise
- */
-exports.isPromise = function isPromise (value) {
- return typeof value === 'object' && typeof value.then === 'function';
-};
-
-/**
- * It's a noop.
- * @api
- */
-exports.noop = function () {};
-
-}).call(this,require('_process'),require("buffer").Buffer)
-},{"./to-iso-string":37,"_process":67,"buffer":44,"debug":2,"fs":42,"glob":42,"json3":54,"path":42,"util":84}],39:[function(require,module,exports){
-'use strict'
-
-exports.byteLength = byteLength
-exports.toByteArray = toByteArray
-exports.fromByteArray = fromByteArray
-
-var lookup = []
-var revLookup = []
-var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
-
-var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
-for (var i = 0, len = code.length; i < len; ++i) {
- lookup[i] = code[i]
- revLookup[code.charCodeAt(i)] = i
-}
-
-revLookup['-'.charCodeAt(0)] = 62
-revLookup['_'.charCodeAt(0)] = 63
-
-function placeHoldersCount (b64) {
- var len = b64.length
- if (len % 4 > 0) {
- throw new Error('Invalid string. Length must be a multiple of 4')
- }
-
- // the number of equal signs (place holders)
- // if there are two placeholders, than the two characters before it
- // represent one byte
- // if there is only one, then the three characters before it represent 2 bytes
- // this is just a cheap hack to not do indexOf twice
- return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
-}
-
-function byteLength (b64) {
- // base64 is 4/3 + up to two characters of the original data
- return b64.length * 3 / 4 - placeHoldersCount(b64)
-}
-
-function toByteArray (b64) {
- var i, j, l, tmp, placeHolders, arr
- var len = b64.length
- placeHolders = placeHoldersCount(b64)
-
- arr = new Arr(len * 3 / 4 - placeHolders)
-
- // if there are placeholders, only get up to the last complete 4 chars
- l = placeHolders > 0 ? len - 4 : len
-
- var L = 0
-
- for (i = 0, j = 0; i < l; i += 4, j += 3) {
- tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
- arr[L++] = (tmp >> 16) & 0xFF
- arr[L++] = (tmp >> 8) & 0xFF
- arr[L++] = tmp & 0xFF
- }
-
- if (placeHolders === 2) {
- tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
- arr[L++] = tmp & 0xFF
- } else if (placeHolders === 1) {
- tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
- arr[L++] = (tmp >> 8) & 0xFF
- arr[L++] = tmp & 0xFF
- }
-
- return arr
-}
-
-function tripletToBase64 (num) {
- return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
-}
-
-function encodeChunk (uint8, start, end) {
- var tmp
- var output = []
- for (var i = start; i < end; i += 3) {
- tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
- output.push(tripletToBase64(tmp))
- }
- return output.join('')
-}
-
-function fromByteArray (uint8) {
- var tmp
- var len = uint8.length
- var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
- var output = ''
- var parts = []
- var maxChunkLength = 16383 // must be multiple of 3
-
- // go through the array every three bytes, we'll deal with trailing stuff later
- for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
- parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
- }
-
- // pad the end with zeros, but make sure to not forget the extra bytes
- if (extraBytes === 1) {
- tmp = uint8[len - 1]
- output += lookup[tmp >> 2]
- output += lookup[(tmp << 4) & 0x3F]
- output += '=='
- } else if (extraBytes === 2) {
- tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
- output += lookup[tmp >> 10]
- output += lookup[(tmp >> 4) & 0x3F]
- output += lookup[(tmp << 2) & 0x3F]
- output += '='
- }
-
- parts.push(output)
-
- return parts.join('')
-}
-
-},{}],40:[function(require,module,exports){
-
-},{}],41:[function(require,module,exports){
-(function (process){
-var WritableStream = require('stream').Writable
-var inherits = require('util').inherits
-
-module.exports = BrowserStdout
-
-
-inherits(BrowserStdout, WritableStream)
-
-function BrowserStdout(opts) {
- if (!(this instanceof BrowserStdout)) return new BrowserStdout(opts)
-
- opts = opts || {}
- WritableStream.call(this, opts)
- this.label = (opts.label !== undefined) ? opts.label : 'stdout'
-}
-
-BrowserStdout.prototype._write = function(chunks, encoding, cb) {
- var output = chunks.toString ? chunks.toString() : chunks
- if (this.label === false) {
- console.log(output)
- } else {
- console.log(this.label+':', output)
- }
- process.nextTick(cb)
-}
-
-}).call(this,require('_process'))
-},{"_process":67,"stream":79,"util":84}],42:[function(require,module,exports){
-arguments[4][40][0].apply(exports,arguments)
-},{"dup":40}],43:[function(require,module,exports){
-(function (global){
-'use strict';
-
-var buffer = require('buffer');
-var Buffer = buffer.Buffer;
-var SlowBuffer = buffer.SlowBuffer;
-var MAX_LEN = buffer.kMaxLength || 2147483647;
-exports.alloc = function alloc(size, fill, encoding) {
- if (typeof Buffer.alloc === 'function') {
- return Buffer.alloc(size, fill, encoding);
- }
- if (typeof encoding === 'number') {
- throw new TypeError('encoding must not be number');
- }
- if (typeof size !== 'number') {
- throw new TypeError('size must be a number');
- }
- if (size > MAX_LEN) {
- throw new RangeError('size is too large');
- }
- var enc = encoding;
- var _fill = fill;
- if (_fill === undefined) {
- enc = undefined;
- _fill = 0;
- }
- var buf = new Buffer(size);
- if (typeof _fill === 'string') {
- var fillBuf = new Buffer(_fill, enc);
- var flen = fillBuf.length;
- var i = -1;
- while (++i < size) {
- buf[i] = fillBuf[i % flen];
- }
- } else {
- buf.fill(_fill);
- }
- return buf;
-}
-exports.allocUnsafe = function allocUnsafe(size) {
- if (typeof Buffer.allocUnsafe === 'function') {
- return Buffer.allocUnsafe(size);
- }
- if (typeof size !== 'number') {
- throw new TypeError('size must be a number');
- }
- if (size > MAX_LEN) {
- throw new RangeError('size is too large');
- }
- return new Buffer(size);
-}
-exports.from = function from(value, encodingOrOffset, length) {
- if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {
- return Buffer.from(value, encodingOrOffset, length);
- }
- if (typeof value === 'number') {
- throw new TypeError('"value" argument must not be a number');
- }
- if (typeof value === 'string') {
- return new Buffer(value, encodingOrOffset);
- }
- if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
- var offset = encodingOrOffset;
- if (arguments.length === 1) {
- return new Buffer(value);
- }
- if (typeof offset === 'undefined') {
- offset = 0;
- }
- var len = length;
- if (typeof len === 'undefined') {
- len = value.byteLength - offset;
- }
- if (offset >= value.byteLength) {
- throw new RangeError('\'offset\' is out of bounds');
- }
- if (len > value.byteLength - offset) {
- throw new RangeError('\'length\' is out of bounds');
- }
- return new Buffer(value.slice(offset, offset + len));
- }
- if (Buffer.isBuffer(value)) {
- var out = new Buffer(value.length);
- value.copy(out, 0, 0, value.length);
- return out;
- }
- if (value) {
- if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {
- return new Buffer(value);
- }
- if (value.type === 'Buffer' && Array.isArray(value.data)) {
- return new Buffer(value.data);
- }
- }
-
- throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');
-}
-exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
- if (typeof Buffer.allocUnsafeSlow === 'function') {
- return Buffer.allocUnsafeSlow(size);
- }
- if (typeof size !== 'number') {
- throw new TypeError('size must be a number');
- }
- if (size >= MAX_LEN) {
- throw new RangeError('size is too large');
- }
- return new SlowBuffer(size);
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"buffer":44}],44:[function(require,module,exports){
-(function (global){
-/*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
- * @license MIT
- */
-/* eslint-disable no-proto */
-
-'use strict'
-
-var base64 = require('base64-js')
-var ieee754 = require('ieee754')
-var isArray = require('isarray')
-
-exports.Buffer = Buffer
-exports.SlowBuffer = SlowBuffer
-exports.INSPECT_MAX_BYTES = 50
-
-/**
- * If `Buffer.TYPED_ARRAY_SUPPORT`:
- * === true Use Uint8Array implementation (fastest)
- * === false Use Object implementation (most compatible, even IE6)
- *
- * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
- * Opera 11.6+, iOS 4.2+.
- *
- * Due to various browser bugs, sometimes the Object implementation will be used even
- * when the browser supports typed arrays.
- *
- * Note:
- *
- * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
- * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
- *
- * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
- *
- * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
- * incorrect length in some situations.
-
- * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
- * get the Object implementation, which is slower but behaves correctly.
- */
-Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
- ? global.TYPED_ARRAY_SUPPORT
- : typedArraySupport()
-
-/*
- * Export kMaxLength after typed array support is determined.
- */
-exports.kMaxLength = kMaxLength()
-
-function typedArraySupport () {
- try {
- var arr = new Uint8Array(1)
- arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
- return arr.foo() === 42 && // typed array instances can be augmented
- typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
- arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
- } catch (e) {
- return false
- }
-}
-
-function kMaxLength () {
- return Buffer.TYPED_ARRAY_SUPPORT
- ? 0x7fffffff
- : 0x3fffffff
-}
-
-function createBuffer (that, length) {
- if (kMaxLength() < length) {
- throw new RangeError('Invalid typed array length')
- }
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- // Return an augmented `Uint8Array` instance, for best performance
- that = new Uint8Array(length)
- that.__proto__ = Buffer.prototype
- } else {
- // Fallback: Return an object instance of the Buffer class
- if (that === null) {
- that = new Buffer(length)
- }
- that.length = length
- }
-
- return that
-}
-
-/**
- * The Buffer constructor returns instances of `Uint8Array` that have their
- * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
- * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
- * and the `Uint8Array` methods. Square bracket notation works as expected -- it
- * returns a single octet.
- *
- * The `Uint8Array` prototype remains unmodified.
- */
-
-function Buffer (arg, encodingOrOffset, length) {
- if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
- return new Buffer(arg, encodingOrOffset, length)
- }
-
- // Common case.
- if (typeof arg === 'number') {
- if (typeof encodingOrOffset === 'string') {
- throw new Error(
- 'If encoding is specified then the first argument must be a string'
- )
- }
- return allocUnsafe(this, arg)
- }
- return from(this, arg, encodingOrOffset, length)
-}
-
-Buffer.poolSize = 8192 // not used by this implementation
-
-// TODO: Legacy, not needed anymore. Remove in next major version.
-Buffer._augment = function (arr) {
- arr.__proto__ = Buffer.prototype
- return arr
-}
-
-function from (that, value, encodingOrOffset, length) {
- if (typeof value === 'number') {
- throw new TypeError('"value" argument must not be a number')
- }
-
- if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
- return fromArrayBuffer(that, value, encodingOrOffset, length)
- }
-
- if (typeof value === 'string') {
- return fromString(that, value, encodingOrOffset)
- }
-
- return fromObject(that, value)
-}
-
-/**
- * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
- * if value is a number.
- * Buffer.from(str[, encoding])
- * Buffer.from(array)
- * Buffer.from(buffer)
- * Buffer.from(arrayBuffer[, byteOffset[, length]])
- **/
-Buffer.from = function (value, encodingOrOffset, length) {
- return from(null, value, encodingOrOffset, length)
-}
-
-if (Buffer.TYPED_ARRAY_SUPPORT) {
- Buffer.prototype.__proto__ = Uint8Array.prototype
- Buffer.__proto__ = Uint8Array
- if (typeof Symbol !== 'undefined' && Symbol.species &&
- Buffer[Symbol.species] === Buffer) {
- // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
- Object.defineProperty(Buffer, Symbol.species, {
- value: null,
- configurable: true
- })
- }
-}
-
-function assertSize (size) {
- if (typeof size !== 'number') {
- throw new TypeError('"size" argument must be a number')
- } else if (size < 0) {
- throw new RangeError('"size" argument must not be negative')
- }
-}
-
-function alloc (that, size, fill, encoding) {
- assertSize(size)
- if (size <= 0) {
- return createBuffer(that, size)
- }
- if (fill !== undefined) {
- // Only pay attention to encoding if it's a string. This
- // prevents accidentally sending in a number that would
- // be interpretted as a start offset.
- return typeof encoding === 'string'
- ? createBuffer(that, size).fill(fill, encoding)
- : createBuffer(that, size).fill(fill)
- }
- return createBuffer(that, size)
-}
-
-/**
- * Creates a new filled Buffer instance.
- * alloc(size[, fill[, encoding]])
- **/
-Buffer.alloc = function (size, fill, encoding) {
- return alloc(null, size, fill, encoding)
-}
-
-function allocUnsafe (that, size) {
- assertSize(size)
- that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
- if (!Buffer.TYPED_ARRAY_SUPPORT) {
- for (var i = 0; i < size; ++i) {
- that[i] = 0
- }
- }
- return that
-}
-
-/**
- * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
- * */
-Buffer.allocUnsafe = function (size) {
- return allocUnsafe(null, size)
-}
-/**
- * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
- */
-Buffer.allocUnsafeSlow = function (size) {
- return allocUnsafe(null, size)
-}
-
-function fromString (that, string, encoding) {
- if (typeof encoding !== 'string' || encoding === '') {
- encoding = 'utf8'
- }
-
- if (!Buffer.isEncoding(encoding)) {
- throw new TypeError('"encoding" must be a valid string encoding')
- }
-
- var length = byteLength(string, encoding) | 0
- that = createBuffer(that, length)
-
- var actual = that.write(string, encoding)
-
- if (actual !== length) {
- // Writing a hex string, for example, that contains invalid characters will
- // cause everything after the first invalid character to be ignored. (e.g.
- // 'abxxcd' will be treated as 'ab')
- that = that.slice(0, actual)
- }
-
- return that
-}
-
-function fromArrayLike (that, array) {
- var length = array.length < 0 ? 0 : checked(array.length) | 0
- that = createBuffer(that, length)
- for (var i = 0; i < length; i += 1) {
- that[i] = array[i] & 255
- }
- return that
-}
-
-function fromArrayBuffer (that, array, byteOffset, length) {
- array.byteLength // this throws if `array` is not a valid ArrayBuffer
-
- if (byteOffset < 0 || array.byteLength < byteOffset) {
- throw new RangeError('\'offset\' is out of bounds')
- }
-
- if (array.byteLength < byteOffset + (length || 0)) {
- throw new RangeError('\'length\' is out of bounds')
- }
-
- if (byteOffset === undefined && length === undefined) {
- array = new Uint8Array(array)
- } else if (length === undefined) {
- array = new Uint8Array(array, byteOffset)
- } else {
- array = new Uint8Array(array, byteOffset, length)
- }
-
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- // Return an augmented `Uint8Array` instance, for best performance
- that = array
- that.__proto__ = Buffer.prototype
- } else {
- // Fallback: Return an object instance of the Buffer class
- that = fromArrayLike(that, array)
- }
- return that
-}
-
-function fromObject (that, obj) {
- if (Buffer.isBuffer(obj)) {
- var len = checked(obj.length) | 0
- that = createBuffer(that, len)
-
- if (that.length === 0) {
- return that
- }
-
- obj.copy(that, 0, 0, len)
- return that
- }
-
- if (obj) {
- if ((typeof ArrayBuffer !== 'undefined' &&
- obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
- if (typeof obj.length !== 'number' || isnan(obj.length)) {
- return createBuffer(that, 0)
- }
- return fromArrayLike(that, obj)
- }
-
- if (obj.type === 'Buffer' && isArray(obj.data)) {
- return fromArrayLike(that, obj.data)
- }
- }
-
- throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
-}
-
-function checked (length) {
- // Note: cannot use `length < kMaxLength()` here because that fails when
- // length is NaN (which is otherwise coerced to zero.)
- if (length >= kMaxLength()) {
- throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
- 'size: 0x' + kMaxLength().toString(16) + ' bytes')
- }
- return length | 0
-}
-
-function SlowBuffer (length) {
- if (+length != length) { // eslint-disable-line eqeqeq
- length = 0
- }
- return Buffer.alloc(+length)
-}
-
-Buffer.isBuffer = function isBuffer (b) {
- return !!(b != null && b._isBuffer)
-}
-
-Buffer.compare = function compare (a, b) {
- if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
- throw new TypeError('Arguments must be Buffers')
- }
-
- if (a === b) return 0
-
- var x = a.length
- var y = b.length
-
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
- if (a[i] !== b[i]) {
- x = a[i]
- y = b[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
-}
-
-Buffer.isEncoding = function isEncoding (encoding) {
- switch (String(encoding).toLowerCase()) {
- case 'hex':
- case 'utf8':
- case 'utf-8':
- case 'ascii':
- case 'latin1':
- case 'binary':
- case 'base64':
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return true
- default:
- return false
- }
-}
-
-Buffer.concat = function concat (list, length) {
- if (!isArray(list)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
-
- if (list.length === 0) {
- return Buffer.alloc(0)
- }
-
- var i
- if (length === undefined) {
- length = 0
- for (i = 0; i < list.length; ++i) {
- length += list[i].length
- }
- }
-
- var buffer = Buffer.allocUnsafe(length)
- var pos = 0
- for (i = 0; i < list.length; ++i) {
- var buf = list[i]
- if (!Buffer.isBuffer(buf)) {
- throw new TypeError('"list" argument must be an Array of Buffers')
- }
- buf.copy(buffer, pos)
- pos += buf.length
- }
- return buffer
-}
-
-function byteLength (string, encoding) {
- if (Buffer.isBuffer(string)) {
- return string.length
- }
- if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
- (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
- return string.byteLength
- }
- if (typeof string !== 'string') {
- string = '' + string
- }
-
- var len = string.length
- if (len === 0) return 0
-
- // Use a for loop to avoid recursion
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'ascii':
- case 'latin1':
- case 'binary':
- return len
- case 'utf8':
- case 'utf-8':
- case undefined:
- return utf8ToBytes(string).length
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return len * 2
- case 'hex':
- return len >>> 1
- case 'base64':
- return base64ToBytes(string).length
- default:
- if (loweredCase) return utf8ToBytes(string).length // assume utf8
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
-}
-Buffer.byteLength = byteLength
-
-function slowToString (encoding, start, end) {
- var loweredCase = false
-
- // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
- // property of a typed array.
-
- // This behaves neither like String nor Uint8Array in that we set start/end
- // to their upper/lower bounds if the value passed is out of range.
- // undefined is handled specially as per ECMA-262 6th Edition,
- // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
- if (start === undefined || start < 0) {
- start = 0
- }
- // Return early if start > this.length. Done here to prevent potential uint32
- // coercion fail below.
- if (start > this.length) {
- return ''
- }
-
- if (end === undefined || end > this.length) {
- end = this.length
- }
-
- if (end <= 0) {
- return ''
- }
-
- // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
- end >>>= 0
- start >>>= 0
-
- if (end <= start) {
- return ''
- }
-
- if (!encoding) encoding = 'utf8'
-
- while (true) {
- switch (encoding) {
- case 'hex':
- return hexSlice(this, start, end)
-
- case 'utf8':
- case 'utf-8':
- return utf8Slice(this, start, end)
-
- case 'ascii':
- return asciiSlice(this, start, end)
-
- case 'latin1':
- case 'binary':
- return latin1Slice(this, start, end)
-
- case 'base64':
- return base64Slice(this, start, end)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return utf16leSlice(this, start, end)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = (encoding + '').toLowerCase()
- loweredCase = true
- }
- }
-}
-
-// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
-// Buffer instances.
-Buffer.prototype._isBuffer = true
-
-function swap (b, n, m) {
- var i = b[n]
- b[n] = b[m]
- b[m] = i
-}
-
-Buffer.prototype.swap16 = function swap16 () {
- var len = this.length
- if (len % 2 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 16-bits')
- }
- for (var i = 0; i < len; i += 2) {
- swap(this, i, i + 1)
- }
- return this
-}
-
-Buffer.prototype.swap32 = function swap32 () {
- var len = this.length
- if (len % 4 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 32-bits')
- }
- for (var i = 0; i < len; i += 4) {
- swap(this, i, i + 3)
- swap(this, i + 1, i + 2)
- }
- return this
-}
-
-Buffer.prototype.swap64 = function swap64 () {
- var len = this.length
- if (len % 8 !== 0) {
- throw new RangeError('Buffer size must be a multiple of 64-bits')
- }
- for (var i = 0; i < len; i += 8) {
- swap(this, i, i + 7)
- swap(this, i + 1, i + 6)
- swap(this, i + 2, i + 5)
- swap(this, i + 3, i + 4)
- }
- return this
-}
-
-Buffer.prototype.toString = function toString () {
- var length = this.length | 0
- if (length === 0) return ''
- if (arguments.length === 0) return utf8Slice(this, 0, length)
- return slowToString.apply(this, arguments)
-}
-
-Buffer.prototype.equals = function equals (b) {
- if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
- if (this === b) return true
- return Buffer.compare(this, b) === 0
-}
-
-Buffer.prototype.inspect = function inspect () {
- var str = ''
- var max = exports.INSPECT_MAX_BYTES
- if (this.length > 0) {
- str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
- if (this.length > max) str += ' ... '
- }
- return '<Buffer ' + str + '>'
-}
-
-Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
- if (!Buffer.isBuffer(target)) {
- throw new TypeError('Argument must be a Buffer')
- }
-
- if (start === undefined) {
- start = 0
- }
- if (end === undefined) {
- end = target ? target.length : 0
- }
- if (thisStart === undefined) {
- thisStart = 0
- }
- if (thisEnd === undefined) {
- thisEnd = this.length
- }
-
- if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
- throw new RangeError('out of range index')
- }
-
- if (thisStart >= thisEnd && start >= end) {
- return 0
- }
- if (thisStart >= thisEnd) {
- return -1
- }
- if (start >= end) {
- return 1
- }
-
- start >>>= 0
- end >>>= 0
- thisStart >>>= 0
- thisEnd >>>= 0
-
- if (this === target) return 0
-
- var x = thisEnd - thisStart
- var y = end - start
- var len = Math.min(x, y)
-
- var thisCopy = this.slice(thisStart, thisEnd)
- var targetCopy = target.slice(start, end)
-
- for (var i = 0; i < len; ++i) {
- if (thisCopy[i] !== targetCopy[i]) {
- x = thisCopy[i]
- y = targetCopy[i]
- break
- }
- }
-
- if (x < y) return -1
- if (y < x) return 1
- return 0
-}
-
-// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
-// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
-//
-// Arguments:
-// - buffer - a Buffer to search
-// - val - a string, Buffer, or number
-// - byteOffset - an index into `buffer`; will be clamped to an int32
-// - encoding - an optional encoding, relevant is val is a string
-// - dir - true for indexOf, false for lastIndexOf
-function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
- // Empty buffer means no match
- if (buffer.length === 0) return -1
-
- // Normalize byteOffset
- if (typeof byteOffset === 'string') {
- encoding = byteOffset
- byteOffset = 0
- } else if (byteOffset > 0x7fffffff) {
- byteOffset = 0x7fffffff
- } else if (byteOffset < -0x80000000) {
- byteOffset = -0x80000000
- }
- byteOffset = +byteOffset // Coerce to Number.
- if (isNaN(byteOffset)) {
- // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
- byteOffset = dir ? 0 : (buffer.length - 1)
- }
-
- // Normalize byteOffset: negative offsets start from the end of the buffer
- if (byteOffset < 0) byteOffset = buffer.length + byteOffset
- if (byteOffset >= buffer.length) {
- if (dir) return -1
- else byteOffset = buffer.length - 1
- } else if (byteOffset < 0) {
- if (dir) byteOffset = 0
- else return -1
- }
-
- // Normalize val
- if (typeof val === 'string') {
- val = Buffer.from(val, encoding)
- }
-
- // Finally, search either indexOf (if dir is true) or lastIndexOf
- if (Buffer.isBuffer(val)) {
- // Special case: looking for empty string/buffer always fails
- if (val.length === 0) {
- return -1
- }
- return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
- } else if (typeof val === 'number') {
- val = val & 0xFF // Search for a byte value [0-255]
- if (Buffer.TYPED_ARRAY_SUPPORT &&
- typeof Uint8Array.prototype.indexOf === 'function') {
- if (dir) {
- return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
- } else {
- return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
- }
- }
- return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
- }
-
- throw new TypeError('val must be string, number or Buffer')
-}
-
-function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
- var indexSize = 1
- var arrLength = arr.length
- var valLength = val.length
-
- if (encoding !== undefined) {
- encoding = String(encoding).toLowerCase()
- if (encoding === 'ucs2' || encoding === 'ucs-2' ||
- encoding === 'utf16le' || encoding === 'utf-16le') {
- if (arr.length < 2 || val.length < 2) {
- return -1
- }
- indexSize = 2
- arrLength /= 2
- valLength /= 2
- byteOffset /= 2
- }
- }
-
- function read (buf, i) {
- if (indexSize === 1) {
- return buf[i]
- } else {
- return buf.readUInt16BE(i * indexSize)
- }
- }
-
- var i
- if (dir) {
- var foundIndex = -1
- for (i = byteOffset; i < arrLength; i++) {
- if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
- if (foundIndex === -1) foundIndex = i
- if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
- } else {
- if (foundIndex !== -1) i -= i - foundIndex
- foundIndex = -1
- }
- }
- } else {
- if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
- for (i = byteOffset; i >= 0; i--) {
- var found = true
- for (var j = 0; j < valLength; j++) {
- if (read(arr, i + j) !== read(val, j)) {
- found = false
- break
- }
- }
- if (found) return i
- }
- }
-
- return -1
-}
-
-Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
- return this.indexOf(val, byteOffset, encoding) !== -1
-}
-
-Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
-}
-
-Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
- return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
-}
-
-function hexWrite (buf, string, offset, length) {
- offset = Number(offset) || 0
- var remaining = buf.length - offset
- if (!length) {
- length = remaining
- } else {
- length = Number(length)
- if (length > remaining) {
- length = remaining
- }
- }
-
- // must be an even number of digits
- var strLen = string.length
- if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
-
- if (length > strLen / 2) {
- length = strLen / 2
- }
- for (var i = 0; i < length; ++i) {
- var parsed = parseInt(string.substr(i * 2, 2), 16)
- if (isNaN(parsed)) return i
- buf[offset + i] = parsed
- }
- return i
-}
-
-function utf8Write (buf, string, offset, length) {
- return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
-}
-
-function asciiWrite (buf, string, offset, length) {
- return blitBuffer(asciiToBytes(string), buf, offset, length)
-}
-
-function latin1Write (buf, string, offset, length) {
- return asciiWrite(buf, string, offset, length)
-}
-
-function base64Write (buf, string, offset, length) {
- return blitBuffer(base64ToBytes(string), buf, offset, length)
-}
-
-function ucs2Write (buf, string, offset, length) {
- return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
-}
-
-Buffer.prototype.write = function write (string, offset, length, encoding) {
- // Buffer#write(string)
- if (offset === undefined) {
- encoding = 'utf8'
- length = this.length
- offset = 0
- // Buffer#write(string, encoding)
- } else if (length === undefined && typeof offset === 'string') {
- encoding = offset
- length = this.length
- offset = 0
- // Buffer#write(string, offset[, length][, encoding])
- } else if (isFinite(offset)) {
- offset = offset | 0
- if (isFinite(length)) {
- length = length | 0
- if (encoding === undefined) encoding = 'utf8'
- } else {
- encoding = length
- length = undefined
- }
- // legacy write(string, encoding, offset, length) - remove in v0.13
- } else {
- throw new Error(
- 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
- )
- }
-
- var remaining = this.length - offset
- if (length === undefined || length > remaining) length = remaining
-
- if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
- throw new RangeError('Attempt to write outside buffer bounds')
- }
-
- if (!encoding) encoding = 'utf8'
-
- var loweredCase = false
- for (;;) {
- switch (encoding) {
- case 'hex':
- return hexWrite(this, string, offset, length)
-
- case 'utf8':
- case 'utf-8':
- return utf8Write(this, string, offset, length)
-
- case 'ascii':
- return asciiWrite(this, string, offset, length)
-
- case 'latin1':
- case 'binary':
- return latin1Write(this, string, offset, length)
-
- case 'base64':
- // Warning: maxLength not taken into account in base64Write
- return base64Write(this, string, offset, length)
-
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return ucs2Write(this, string, offset, length)
-
- default:
- if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
- encoding = ('' + encoding).toLowerCase()
- loweredCase = true
- }
- }
-}
-
-Buffer.prototype.toJSON = function toJSON () {
- return {
- type: 'Buffer',
- data: Array.prototype.slice.call(this._arr || this, 0)
- }
-}
-
-function base64Slice (buf, start, end) {
- if (start === 0 && end === buf.length) {
- return base64.fromByteArray(buf)
- } else {
- return base64.fromByteArray(buf.slice(start, end))
- }
-}
-
-function utf8Slice (buf, start, end) {
- end = Math.min(buf.length, end)
- var res = []
-
- var i = start
- while (i < end) {
- var firstByte = buf[i]
- var codePoint = null
- var bytesPerSequence = (firstByte > 0xEF) ? 4
- : (firstByte > 0xDF) ? 3
- : (firstByte > 0xBF) ? 2
- : 1
-
- if (i + bytesPerSequence <= end) {
- var secondByte, thirdByte, fourthByte, tempCodePoint
-
- switch (bytesPerSequence) {
- case 1:
- if (firstByte < 0x80) {
- codePoint = firstByte
- }
- break
- case 2:
- secondByte = buf[i + 1]
- if ((secondByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
- if (tempCodePoint > 0x7F) {
- codePoint = tempCodePoint
- }
- }
- break
- case 3:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
- if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
- codePoint = tempCodePoint
- }
- }
- break
- case 4:
- secondByte = buf[i + 1]
- thirdByte = buf[i + 2]
- fourthByte = buf[i + 3]
- if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
- tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
- if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
- codePoint = tempCodePoint
- }
- }
- }
- }
-
- if (codePoint === null) {
- // we did not generate a valid codePoint so insert a
- // replacement char (U+FFFD) and advance only 1 byte
- codePoint = 0xFFFD
- bytesPerSequence = 1
- } else if (codePoint > 0xFFFF) {
- // encode to utf16 (surrogate pair dance)
- codePoint -= 0x10000
- res.push(codePoint >>> 10 & 0x3FF | 0xD800)
- codePoint = 0xDC00 | codePoint & 0x3FF
- }
-
- res.push(codePoint)
- i += bytesPerSequence
- }
-
- return decodeCodePointsArray(res)
-}
-
-// Based on http://stackoverflow.com/a/22747272/680742, the browser with
-// the lowest limit is Chrome, with 0x10000 args.
-// We go 1 magnitude less, for safety
-var MAX_ARGUMENTS_LENGTH = 0x1000
-
-function decodeCodePointsArray (codePoints) {
- var len = codePoints.length
- if (len <= MAX_ARGUMENTS_LENGTH) {
- return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
- }
-
- // Decode in chunks to avoid "call stack size exceeded".
- var res = ''
- var i = 0
- while (i < len) {
- res += String.fromCharCode.apply(
- String,
- codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
- )
- }
- return res
-}
-
-function asciiSlice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i] & 0x7F)
- }
- return ret
-}
-
-function latin1Slice (buf, start, end) {
- var ret = ''
- end = Math.min(buf.length, end)
-
- for (var i = start; i < end; ++i) {
- ret += String.fromCharCode(buf[i])
- }
- return ret
-}
-
-function hexSlice (buf, start, end) {
- var len = buf.length
-
- if (!start || start < 0) start = 0
- if (!end || end < 0 || end > len) end = len
-
- var out = ''
- for (var i = start; i < end; ++i) {
- out += toHex(buf[i])
- }
- return out
-}
-
-function utf16leSlice (buf, start, end) {
- var bytes = buf.slice(start, end)
- var res = ''
- for (var i = 0; i < bytes.length; i += 2) {
- res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
- }
- return res
-}
-
-Buffer.prototype.slice = function slice (start, end) {
- var len = this.length
- start = ~~start
- end = end === undefined ? len : ~~end
-
- if (start < 0) {
- start += len
- if (start < 0) start = 0
- } else if (start > len) {
- start = len
- }
-
- if (end < 0) {
- end += len
- if (end < 0) end = 0
- } else if (end > len) {
- end = len
- }
-
- if (end < start) end = start
-
- var newBuf
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- newBuf = this.subarray(start, end)
- newBuf.__proto__ = Buffer.prototype
- } else {
- var sliceLen = end - start
- newBuf = new Buffer(sliceLen, undefined)
- for (var i = 0; i < sliceLen; ++i) {
- newBuf[i] = this[i + start]
- }
- }
-
- return newBuf
-}
-
-/*
- * Need to make sure that buffer isn't trying to write out of bounds.
- */
-function checkOffset (offset, ext, length) {
- if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
- if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
-}
-
-Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
-
- return val
-}
-
-Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) {
- checkOffset(offset, byteLength, this.length)
- }
-
- var val = this[offset + --byteLength]
- var mul = 1
- while (byteLength > 0 && (mul *= 0x100)) {
- val += this[offset + --byteLength] * mul
- }
-
- return val
-}
-
-Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length)
- return this[offset]
-}
-
-Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- return this[offset] | (this[offset + 1] << 8)
-}
-
-Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- return (this[offset] << 8) | this[offset + 1]
-}
-
-Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return ((this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16)) +
- (this[offset + 3] * 0x1000000)
-}
-
-Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] * 0x1000000) +
- ((this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- this[offset + 3])
-}
-
-Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var val = this[offset]
- var mul = 1
- var i = 0
- while (++i < byteLength && (mul *= 0x100)) {
- val += this[offset + i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
-}
-
-Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) checkOffset(offset, byteLength, this.length)
-
- var i = byteLength
- var mul = 1
- var val = this[offset + --i]
- while (i > 0 && (mul *= 0x100)) {
- val += this[offset + --i] * mul
- }
- mul *= 0x80
-
- if (val >= mul) val -= Math.pow(2, 8 * byteLength)
-
- return val
-}
-
-Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 1, this.length)
- if (!(this[offset] & 0x80)) return (this[offset])
- return ((0xff - this[offset] + 1) * -1)
-}
-
-Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset] | (this[offset + 1] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
-}
-
-Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 2, this.length)
- var val = this[offset + 1] | (this[offset] << 8)
- return (val & 0x8000) ? val | 0xFFFF0000 : val
-}
-
-Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset]) |
- (this[offset + 1] << 8) |
- (this[offset + 2] << 16) |
- (this[offset + 3] << 24)
-}
-
-Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
-
- return (this[offset] << 24) |
- (this[offset + 1] << 16) |
- (this[offset + 2] << 8) |
- (this[offset + 3])
-}
-
-Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, true, 23, 4)
-}
-
-Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 4, this.length)
- return ieee754.read(this, offset, false, 23, 4)
-}
-
-Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, true, 52, 8)
-}
-
-Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
- if (!noAssert) checkOffset(offset, 8, this.length)
- return ieee754.read(this, offset, false, 52, 8)
-}
-
-function checkInt (buf, value, offset, ext, max, min) {
- if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
- if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
-}
-
-Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var mul = 1
- var i = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- byteLength = byteLength | 0
- if (!noAssert) {
- var maxBytes = Math.pow(2, 8 * byteLength) - 1
- checkInt(this, value, offset, byteLength, maxBytes, 0)
- }
-
- var i = byteLength - 1
- var mul = 1
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- this[offset + i] = (value / mul) & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
- this[offset] = (value & 0xff)
- return offset + 1
-}
-
-function objectWriteUInt16 (buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffff + value + 1
- for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
- buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
- (littleEndian ? i : 1 - i) * 8
- }
-}
-
-Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- } else {
- objectWriteUInt16(this, value, offset, true)
- }
- return offset + 2
-}
-
-Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- } else {
- objectWriteUInt16(this, value, offset, false)
- }
- return offset + 2
-}
-
-function objectWriteUInt32 (buf, value, offset, littleEndian) {
- if (value < 0) value = 0xffffffff + value + 1
- for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
- buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
- }
-}
-
-Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset + 3] = (value >>> 24)
- this[offset + 2] = (value >>> 16)
- this[offset + 1] = (value >>> 8)
- this[offset] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, true)
- }
- return offset + 4
-}
-
-Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, false)
- }
- return offset + 4
-}
-
-Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = 0
- var mul = 1
- var sub = 0
- this[offset] = value & 0xFF
- while (++i < byteLength && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) {
- var limit = Math.pow(2, 8 * byteLength - 1)
-
- checkInt(this, value, offset, byteLength, limit - 1, -limit)
- }
-
- var i = byteLength - 1
- var mul = 1
- var sub = 0
- this[offset + i] = value & 0xFF
- while (--i >= 0 && (mul *= 0x100)) {
- if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
- sub = 1
- }
- this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
- }
-
- return offset + byteLength
-}
-
-Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
- if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
- if (value < 0) value = 0xff + value + 1
- this[offset] = (value & 0xff)
- return offset + 1
-}
-
-Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- } else {
- objectWriteUInt16(this, value, offset, true)
- }
- return offset + 2
-}
-
-Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 8)
- this[offset + 1] = (value & 0xff)
- } else {
- objectWriteUInt16(this, value, offset, false)
- }
- return offset + 2
-}
-
-Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value & 0xff)
- this[offset + 1] = (value >>> 8)
- this[offset + 2] = (value >>> 16)
- this[offset + 3] = (value >>> 24)
- } else {
- objectWriteUInt32(this, value, offset, true)
- }
- return offset + 4
-}
-
-Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
- value = +value
- offset = offset | 0
- if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
- if (value < 0) value = 0xffffffff + value + 1
- if (Buffer.TYPED_ARRAY_SUPPORT) {
- this[offset] = (value >>> 24)
- this[offset + 1] = (value >>> 16)
- this[offset + 2] = (value >>> 8)
- this[offset + 3] = (value & 0xff)
- } else {
- objectWriteUInt32(this, value, offset, false)
- }
- return offset + 4
-}
-
-function checkIEEE754 (buf, value, offset, ext, max, min) {
- if (offset + ext > buf.length) throw new RangeError('Index out of range')
- if (offset < 0) throw new RangeError('Index out of range')
-}
-
-function writeFloat (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
- }
- ieee754.write(buf, value, offset, littleEndian, 23, 4)
- return offset + 4
-}
-
-Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
- return writeFloat(this, value, offset, true, noAssert)
-}
-
-Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
- return writeFloat(this, value, offset, false, noAssert)
-}
-
-function writeDouble (buf, value, offset, littleEndian, noAssert) {
- if (!noAssert) {
- checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
- }
- ieee754.write(buf, value, offset, littleEndian, 52, 8)
- return offset + 8
-}
-
-Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
- return writeDouble(this, value, offset, true, noAssert)
-}
-
-Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
- return writeDouble(this, value, offset, false, noAssert)
-}
-
-// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
-Buffer.prototype.copy = function copy (target, targetStart, start, end) {
- if (!start) start = 0
- if (!end && end !== 0) end = this.length
- if (targetStart >= target.length) targetStart = target.length
- if (!targetStart) targetStart = 0
- if (end > 0 && end < start) end = start
-
- // Copy 0 bytes; we're done
- if (end === start) return 0
- if (target.length === 0 || this.length === 0) return 0
-
- // Fatal error conditions
- if (targetStart < 0) {
- throw new RangeError('targetStart out of bounds')
- }
- if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
- if (end < 0) throw new RangeError('sourceEnd out of bounds')
-
- // Are we oob?
- if (end > this.length) end = this.length
- if (target.length - targetStart < end - start) {
- end = target.length - targetStart + start
- }
-
- var len = end - start
- var i
-
- if (this === target && start < targetStart && targetStart < end) {
- // descending copy from end
- for (i = len - 1; i >= 0; --i) {
- target[i + targetStart] = this[i + start]
- }
- } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
- // ascending copy from start
- for (i = 0; i < len; ++i) {
- target[i + targetStart] = this[i + start]
- }
- } else {
- Uint8Array.prototype.set.call(
- target,
- this.subarray(start, start + len),
- targetStart
- )
- }
-
- return len
-}
-
-// Usage:
-// buffer.fill(number[, offset[, end]])
-// buffer.fill(buffer[, offset[, end]])
-// buffer.fill(string[, offset[, end]][, encoding])
-Buffer.prototype.fill = function fill (val, start, end, encoding) {
- // Handle string cases:
- if (typeof val === 'string') {
- if (typeof start === 'string') {
- encoding = start
- start = 0
- end = this.length
- } else if (typeof end === 'string') {
- encoding = end
- end = this.length
- }
- if (val.length === 1) {
- var code = val.charCodeAt(0)
- if (code < 256) {
- val = code
- }
- }
- if (encoding !== undefined && typeof encoding !== 'string') {
- throw new TypeError('encoding must be a string')
- }
- if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
- throw new TypeError('Unknown encoding: ' + encoding)
- }
- } else if (typeof val === 'number') {
- val = val & 255
- }
-
- // Invalid ranges are not set to a default, so can range check early.
- if (start < 0 || this.length < start || this.length < end) {
- throw new RangeError('Out of range index')
- }
-
- if (end <= start) {
- return this
- }
-
- start = start >>> 0
- end = end === undefined ? this.length : end >>> 0
-
- if (!val) val = 0
-
- var i
- if (typeof val === 'number') {
- for (i = start; i < end; ++i) {
- this[i] = val
- }
- } else {
- var bytes = Buffer.isBuffer(val)
- ? val
- : utf8ToBytes(new Buffer(val, encoding).toString())
- var len = bytes.length
- for (i = 0; i < end - start; ++i) {
- this[i + start] = bytes[i % len]
- }
- }
-
- return this
-}
-
-// HELPER FUNCTIONS
-// ================
-
-var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
-
-function base64clean (str) {
- // Node strips out invalid characters like \n and \t from the string, base64-js does not
- str = stringtrim(str).replace(INVALID_BASE64_RE, '')
- // Node converts strings with length < 2 to ''
- if (str.length < 2) return ''
- // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
- while (str.length % 4 !== 0) {
- str = str + '='
- }
- return str
-}
-
-function stringtrim (str) {
- if (str.trim) return str.trim()
- return str.replace(/^\s+|\s+$/g, '')
-}
-
-function toHex (n) {
- if (n < 16) return '0' + n.toString(16)
- return n.toString(16)
-}
-
-function utf8ToBytes (string, units) {
- units = units || Infinity
- var codePoint
- var length = string.length
- var leadSurrogate = null
- var bytes = []
-
- for (var i = 0; i < length; ++i) {
- codePoint = string.charCodeAt(i)
-
- // is surrogate component
- if (codePoint > 0xD7FF && codePoint < 0xE000) {
- // last char was a lead
- if (!leadSurrogate) {
- // no lead yet
- if (codePoint > 0xDBFF) {
- // unexpected trail
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- } else if (i + 1 === length) {
- // unpaired lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- continue
- }
-
- // valid lead
- leadSurrogate = codePoint
-
- continue
- }
-
- // 2 leads in a row
- if (codePoint < 0xDC00) {
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- leadSurrogate = codePoint
- continue
- }
-
- // valid surrogate pair
- codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
- } else if (leadSurrogate) {
- // valid bmp char, but last char was a lead
- if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- }
-
- leadSurrogate = null
-
- // encode utf8
- if (codePoint < 0x80) {
- if ((units -= 1) < 0) break
- bytes.push(codePoint)
- } else if (codePoint < 0x800) {
- if ((units -= 2) < 0) break
- bytes.push(
- codePoint >> 0x6 | 0xC0,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x10000) {
- if ((units -= 3) < 0) break
- bytes.push(
- codePoint >> 0xC | 0xE0,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else if (codePoint < 0x110000) {
- if ((units -= 4) < 0) break
- bytes.push(
- codePoint >> 0x12 | 0xF0,
- codePoint >> 0xC & 0x3F | 0x80,
- codePoint >> 0x6 & 0x3F | 0x80,
- codePoint & 0x3F | 0x80
- )
- } else {
- throw new Error('Invalid code point')
- }
- }
-
- return bytes
-}
-
-function asciiToBytes (str) {
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- // Node's code seems to be doing this and not & 0x7F..
- byteArray.push(str.charCodeAt(i) & 0xFF)
- }
- return byteArray
-}
-
-function utf16leToBytes (str, units) {
- var c, hi, lo
- var byteArray = []
- for (var i = 0; i < str.length; ++i) {
- if ((units -= 2) < 0) break
-
- c = str.charCodeAt(i)
- hi = c >> 8
- lo = c % 256
- byteArray.push(lo)
- byteArray.push(hi)
- }
-
- return byteArray
-}
-
-function base64ToBytes (str) {
- return base64.toByteArray(base64clean(str))
-}
-
-function blitBuffer (src, dst, offset, length) {
- for (var i = 0; i < length; ++i) {
- if ((i + offset >= dst.length) || (i >= src.length)) break
- dst[i + offset] = src[i]
- }
- return i
-}
-
-function isnan (val) {
- return val !== val // eslint-disable-line no-self-compare
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"base64-js":39,"ieee754":50,"isarray":53}],45:[function(require,module,exports){
-(function (Buffer){
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// 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.
-
-// NOTE: These type checking functions intentionally don't use `instanceof`
-// because it is fragile and can be easily faked with `Object.create()`.
-
-function isArray(arg) {
- if (Array.isArray) {
- return Array.isArray(arg);
- }
- return objectToString(arg) === '[object Array]';
-}
-exports.isArray = isArray;
-
-function isBoolean(arg) {
- return typeof arg === 'boolean';
-}
-exports.isBoolean = isBoolean;
-
-function isNull(arg) {
- return arg === null;
-}
-exports.isNull = isNull;
-
-function isNullOrUndefined(arg) {
- return arg == null;
-}
-exports.isNullOrUndefined = isNullOrUndefined;
-
-function isNumber(arg) {
- return typeof arg === 'number';
-}
-exports.isNumber = isNumber;
-
-function isString(arg) {
- return typeof arg === 'string';
-}
-exports.isString = isString;
-
-function isSymbol(arg) {
- return typeof arg === 'symbol';
-}
-exports.isSymbol = isSymbol;
-
-function isUndefined(arg) {
- return arg === void 0;
-}
-exports.isUndefined = isUndefined;
-
-function isRegExp(re) {
- return objectToString(re) === '[object RegExp]';
-}
-exports.isRegExp = isRegExp;
-
-function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
-}
-exports.isObject = isObject;
-
-function isDate(d) {
- return objectToString(d) === '[object Date]';
-}
-exports.isDate = isDate;
-
-function isError(e) {
- return (objectToString(e) === '[object Error]' || e instanceof Error);
-}
-exports.isError = isError;
-
-function isFunction(arg) {
- return typeof arg === 'function';
-}
-exports.isFunction = isFunction;
-
-function isPrimitive(arg) {
- return arg === null ||
- typeof arg === 'boolean' ||
- typeof arg === 'number' ||
- typeof arg === 'string' ||
- typeof arg === 'symbol' || // ES6 symbol
- typeof arg === 'undefined';
-}
-exports.isPrimitive = isPrimitive;
-
-exports.isBuffer = Buffer.isBuffer;
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
-
-}).call(this,{"isBuffer":require("../../is-buffer/index.js")})
-},{"../../is-buffer/index.js":52}],46:[function(require,module,exports){
-/* See LICENSE file for terms of use */
-
-/*
- * 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
- */
-(function(global, undefined) {
- var objectPrototypeToString = Object.prototype.toString;
-
- /*istanbul ignore next*/
- function map(arr, mapper, that) {
- if (Array.prototype.map) {
- return Array.prototype.map.call(arr, mapper, that);
- }
-
- var other = new Array(arr.length);
-
- for (var i = 0, n = arr.length; i < n; i++) {
- other[i] = mapper.call(that, arr[i], i, arr);
- }
- return other;
- }
- 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;
- }
-
- // This function handles the presence of circular references by bailing out when encountering an
- // object that is already on the "stack" of items being processed.
- function canonicalize(obj, stack, replacementStack) {
- stack = stack || [];
- replacementStack = replacementStack || [];
-
- var i;
-
- for (i = 0; i < stack.length; i += 1) {
- if (stack[i] === obj) {
- return replacementStack[i];
- }
- }
-
- var canonicalizedObj;
-
- if ('[object Array]' === objectPrototypeToString.call(obj)) {
- stack.push(obj);
- canonicalizedObj = new Array(obj.length);
- replacementStack.push(canonicalizedObj);
- for (i = 0; i < obj.length; i += 1) {
- canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack);
- }
- stack.pop();
- replacementStack.pop();
- } else if (typeof obj === 'object' && obj !== null) {
- stack.push(obj);
- canonicalizedObj = {};
- replacementStack.push(canonicalizedObj);
- var sortedKeys = [],
- key;
- for (key in obj) {
- sortedKeys.push(key);
- }
- sortedKeys.sort();
- for (i = 0; i < sortedKeys.length; i += 1) {
- key = sortedKeys[i];
- canonicalizedObj[key] = canonicalize(obj[key], stack, replacementStack);
- }
- stack.pop();
- replacementStack.pop();
- } else {
- canonicalizedObj = obj;
- }
- return canonicalizedObj;
- }
-
- function buildValues(components, newString, oldString, useLongestToken) {
- var componentPos = 0,
- componentLen = components.length,
- newPos = 0,
- oldPos = 0;
-
- for (; componentPos < componentLen; componentPos++) {
- var component = components[componentPos];
- if (!component.removed) {
- if (!component.added && useLongestToken) {
- var value = newString.slice(newPos, newPos + component.count);
- value = map(value, function(value, i) {
- var oldValue = oldString[oldPos + i];
- return oldValue.length > value.length ? oldValue : value;
- });
-
- component.value = value.join('');
- } else {
- component.value = newString.slice(newPos, newPos + component.count).join('');
- }
- newPos += component.count;
-
- // Common case
- if (!component.added) {
- oldPos += component.count;
- }
- } else {
- component.value = oldString.slice(oldPos, oldPos + component.count).join('');
- oldPos += component.count;
-
- // Reverse add and remove so removes are output first to match common convention
- // The diffing algorithm is tied to add then remove output and this is the simplest
- // route to get the desired output with minimal overhead.
- if (componentPos && components[componentPos - 1].added) {
- var tmp = components[componentPos - 1];
- components[componentPos - 1] = components[componentPos];
- components[componentPos] = tmp;
- }
- }
- }
-
- return components;
- }
-
- function Diff(ignoreWhitespace) {
- this.ignoreWhitespace = ignoreWhitespace;
- }
- Diff.prototype = {
- diff: function(oldString, newString, callback) {
- var self = this;
-
- function done(value) {
- if (callback) {
- setTimeout(function() { callback(undefined, value); }, 0);
- return true;
- } else {
- return value;
- }
- }
-
- // Handle the identity case (this is due to unrolling editLength == 0
- if (newString === oldString) {
- return done([{ value: newString }]);
- }
- if (!newString) {
- return done([{ value: oldString, removed: true }]);
- }
- if (!oldString) {
- return done([{ value: newString, added: true }]);
- }
-
- newString = this.tokenize(newString);
- oldString = this.tokenize(oldString);
-
- var newLen = newString.length, oldLen = oldString.length;
- var editLength = 1;
- var maxEditLength = newLen + oldLen;
- var bestPath = [{ newPos: -1, components: [] }];
-
- // Seed editLength = 0, i.e. the content starts with the same values
- var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
- if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
- // Identity per the equality and tokenizer
- return done([{value: newString.join('')}]);
- }
-
- // Main worker method. checks all permutations of a given edit length for acceptance.
- function execEditLength() {
- 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,
- canRemove = removePath && 0 <= oldPos && oldPos < oldLen;
- if (!canAdd && !canRemove) {
- // If this path is a terminal then prune
- 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);
- self.pushComponent(basePath.components, undefined, true);
- } else {
- basePath = addPath; // No need to clone, we've pulled it from the list
- basePath.newPos++;
- self.pushComponent(basePath.components, true, undefined);
- }
-
- oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
-
- // If we have hit the end of both strings, then we are done
- if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
- return done(buildValues(basePath.components, newString, oldString, self.useLongestToken));
- } else {
- // Otherwise track this path as a potential candidate and continue.
- bestPath[diagonalPath] = basePath;
- }
- }
-
- editLength++;
- }
-
- // Performs the length of edit iteration. Is a bit fugly as this has to support the
- // sync and async mode which is never fun. Loops over execEditLength until a value
- // is produced.
- if (callback) {
- (function exec() {
- setTimeout(function() {
- // This should not happen, but we want to be safe.
- /*istanbul ignore next */
- if (editLength > maxEditLength) {
- return callback();
- }
-
- if (!execEditLength()) {
- exec();
- }
- }, 0);
- }());
- } else {
- while (editLength <= maxEditLength) {
- var ret = execEditLength();
- if (ret) {
- return ret;
- }
- }
- }
- },
-
- pushComponent: function(components, 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] = {count: last.count + 1, added: added, removed: removed };
- } else {
- components.push({count: 1, added: added, removed: removed });
- }
- },
- extractCommon: function(basePath, newString, oldString, diagonalPath) {
- var newLen = newString.length,
- oldLen = oldString.length,
- newPos = basePath.newPos,
- oldPos = newPos - diagonalPath,
-
- commonCount = 0;
- while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
- newPos++;
- oldPos++;
- commonCount++;
- }
-
- if (commonCount) {
- basePath.components.push({count: commonCount});
- }
-
- basePath.newPos = newPos;
- return oldPos;
- },
-
- equals: function(left, right) {
- var reWhitespace = /\S/;
- return left === right || (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right));
- },
- tokenize: function(value) {
- return value.split('');
- }
- };
-
- var CharDiff = new Diff();
-
- var WordDiff = new Diff(true);
- var WordWithSpaceDiff = new Diff();
- WordDiff.tokenize = WordWithSpaceDiff.tokenize = function(value) {
- return removeEmpty(value.split(/(\s+|\b)/));
- };
-
- var CssDiff = new Diff(true);
- CssDiff.tokenize = function(value) {
- return removeEmpty(value.split(/([{}:;,]|\s+)/));
- };
-
- var LineDiff = new Diff();
-
- var TrimmedLineDiff = new Diff();
- TrimmedLineDiff.ignoreTrim = true;
-
- LineDiff.tokenize = TrimmedLineDiff.tokenize = function(value) {
- var retLines = [],
- lines = value.split(/^/m);
- for (var i = 0; i < lines.length; i++) {
- var line = lines[i],
- lastLine = lines[i - 1],
- lastLineLastChar = lastLine && lastLine[lastLine.length - 1];
-
- // Merge lines that may contain windows new lines
- if (line === '\n' && lastLineLastChar === '\r') {
- retLines[retLines.length - 1] = retLines[retLines.length - 1].slice(0, -1) + '\r\n';
- } else {
- if (this.ignoreTrim) {
- line = line.trim();
- // add a newline unless this is the last line.
- if (i < lines.length - 1) {
- line += '\n';
- }
- }
- retLines.push(line);
- }
- }
-
- return retLines;
- };
-
- var PatchDiff = new Diff();
- PatchDiff.tokenize = function(value) {
- var ret = [],
- linesAndNewlines = value.split(/(\n|\r\n)/);
-
- // Ignore the final empty token that occurs if the string ends with a new line
- if (!linesAndNewlines[linesAndNewlines.length - 1]) {
- linesAndNewlines.pop();
- }
-
- // Merge the content and line separators into single tokens
- for (var i = 0; i < linesAndNewlines.length; i++) {
- var line = linesAndNewlines[i];
-
- if (i % 2) {
- ret[ret.length - 1] += line;
- } else {
- ret.push(line);
- }
- }
- return ret;
- };
-
- var SentenceDiff = new Diff();
- SentenceDiff.tokenize = function(value) {
- return removeEmpty(value.split(/(\S.+?[.!?])(?=\s+|$)/));
- };
-
- var JsonDiff = new Diff();
- // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
- // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
- JsonDiff.useLongestToken = true;
- JsonDiff.tokenize = LineDiff.tokenize;
- JsonDiff.equals = function(left, right) {
- return LineDiff.equals(left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'));
- };
-
- var JsDiff = {
- Diff: Diff,
-
- diffChars: function(oldStr, newStr, callback) { return CharDiff.diff(oldStr, newStr, callback); },
- diffWords: function(oldStr, newStr, callback) { return WordDiff.diff(oldStr, newStr, callback); },
- diffWordsWithSpace: function(oldStr, newStr, callback) { return WordWithSpaceDiff.diff(oldStr, newStr, callback); },
- diffLines: function(oldStr, newStr, callback) { return LineDiff.diff(oldStr, newStr, callback); },
- diffTrimmedLines: function(oldStr, newStr, callback) { return TrimmedLineDiff.diff(oldStr, newStr, callback); },
-
- diffSentences: function(oldStr, newStr, callback) { return SentenceDiff.diff(oldStr, newStr, callback); },
-
- diffCss: function(oldStr, newStr, callback) { return CssDiff.diff(oldStr, newStr, callback); },
- diffJson: function(oldObj, newObj, callback) {
- return JsonDiff.diff(
- typeof oldObj === 'string' ? oldObj : JSON.stringify(canonicalize(oldObj), undefined, ' '),
- typeof newObj === 'string' ? newObj : JSON.stringify(canonicalize(newObj), undefined, ' '),
- callback
- );
- },
-
- createTwoFilesPatch: function(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader) {
- var ret = [];
-
- if (oldFileName == newFileName) {
- ret.push('Index: ' + oldFileName);
- }
- ret.push('===================================================================');
- ret.push('--- ' + oldFileName + (typeof oldHeader === 'undefined' ? '' : '\t' + oldHeader));
- ret.push('+++ ' + newFileName + (typeof newHeader === 'undefined' ? '' : '\t' + newHeader));
-
- var diff = PatchDiff.diff(oldStr, newStr);
- diff.push({value: '', lines: []}); // Append an empty value to make cleanup easier
-
- // Formats a given set of lines for printing as context lines in a patch
- function contextLines(lines) {
- return map(lines, function(entry) { return ' ' + entry; });
- }
-
- // Outputs the no newline at end of file warning if needed
- 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;
-
- // 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 we have previous context, start with that
- 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;
- }
- }
-
- // Output our changes
- curRange.push.apply(curRange, map(lines, function(entry) {
- return (current.added ? '+' : '-') + entry;
- }));
- eofNL(curRange, i, current);
-
- // Track the updated file position
- if (current.added) {
- newLine += lines.length;
- } else {
- oldLine += lines.length;
- }
- } else {
- // Identical context lines. Track line changes
- 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';
- },
-
- createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) {
- return JsDiff.createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader);
- },
-
- applyPatch: function(oldStr, uniDiff) {
- var diffstr = uniDiff.split('\n'),
- hunks = [],
- i = 0,
- remEOFNL = false,
- addEOFNL = false;
-
- // Skip to the first change hunk
- while (i < diffstr.length && !(/^@@/.test(diffstr[i]))) {
- i++;
- }
-
- // Parse the unified diff
- for (; i < diffstr.length; i++) {
- if (diffstr[i][0] === '@') {
- var chnukHeader = diffstr[i].split(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/);
- hunks.unshift({
- start: chnukHeader[3],
- oldlength: +chnukHeader[2],
- removed: [],
- newlength: chnukHeader[4],
- added: []
- });
- } else if (diffstr[i][0] === '+') {
- hunks[0].added.push(diffstr[i].substr(1));
- } else if (diffstr[i][0] === '-') {
- hunks[0].removed.push(diffstr[i].substr(1));
- } else if (diffstr[i][0] === ' ') {
- hunks[0].added.push(diffstr[i].substr(1));
- hunks[0].removed.push(diffstr[i].substr(1));
- } else if (diffstr[i][0] === '\\') {
- if (diffstr[i - 1][0] === '+') {
- remEOFNL = true;
- } else if (diffstr[i - 1][0] === '-') {
- addEOFNL = true;
- }
- }
- }
-
- // Apply the diff to the input
- var lines = oldStr.split('\n');
- for (i = hunks.length - 1; i >= 0; i--) {
- var hunk = hunks[i];
- // Sanity check the input string. Bail if we don't match.
- for (var j = 0; j < hunk.oldlength; j++) {
- if (lines[hunk.start - 1 + j] !== hunk.removed[j]) {
- return false;
- }
- }
- Array.prototype.splice.apply(lines, [hunk.start - 1, hunk.oldlength].concat(hunk.added));
- }
-
- // Handle EOFNL insertion/removal
- if (remEOFNL) {
- while (!lines[lines.length - 1]) {
- lines.pop();
- }
- } else if (addEOFNL) {
- lines.push('');
- }
- return lines.join('\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('');
- },
-
- // See: http://code.google.com/p/google-diff-match-patch/wiki/API
- convertChangesToDMP: function(changes) {
- var ret = [],
- change,
- operation;
- for (var i = 0; i < changes.length; i++) {
- change = changes[i];
- if (change.added) {
- operation = 1;
- } else if (change.removed) {
- operation = -1;
- } else {
- operation = 0;
- }
-
- ret.push([operation, change.value]);
- }
- return ret;
- },
-
- canonicalize: canonicalize
- };
-
- /*istanbul ignore next */
- /*global module */
- if (typeof module !== 'undefined' && module.exports) {
- module.exports = JsDiff;
- } else if (false) {
- /*global define */
- define([], function() { return JsDiff; });
- } else if (typeof global.JsDiff === 'undefined') {
- global.JsDiff = JsDiff;
- }
-}(this));
-
-},{}],47:[function(require,module,exports){
-'use strict';
-
-var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
-
-module.exports = function (str) {
- if (typeof str !== 'string') {
- throw new TypeError('Expected a string');
- }
-
- return str.replace(matchOperatorsRe, '\\$&');
-};
-
-},{}],48:[function(require,module,exports){
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// 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.
-
-function EventEmitter() {
- this._events = this._events || {};
- this._maxListeners = this._maxListeners || undefined;
-}
-module.exports = EventEmitter;
-
-// Backwards-compat with node 0.10.x
-EventEmitter.EventEmitter = EventEmitter;
-
-EventEmitter.prototype._events = undefined;
-EventEmitter.prototype._maxListeners = undefined;
-
-// By default EventEmitters will print a warning if more than 10 listeners are
-// added to it. This is a useful default which helps finding memory leaks.
-EventEmitter.defaultMaxListeners = 10;
-
-// Obviously not all Emitters should be limited to 10. This function allows
-// that to be increased. Set to zero for unlimited.
-EventEmitter.prototype.setMaxListeners = function(n) {
- if (!isNumber(n) || n < 0 || isNaN(n))
- throw TypeError('n must be a positive number');
- this._maxListeners = n;
- return this;
-};
-
-EventEmitter.prototype.emit = function(type) {
- var er, handler, len, args, i, listeners;
-
- if (!this._events)
- this._events = {};
-
- // If there is no 'error' event listener then throw.
- if (type === 'error') {
- if (!this._events.error ||
- (isObject(this._events.error) && !this._events.error.length)) {
- er = arguments[1];
- if (er instanceof Error) {
- throw er; // Unhandled 'error' event
- } else {
- // At least give some kind of context to the user
- var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
- err.context = er;
- throw err;
- }
- }
- }
-
- handler = this._events[type];
-
- if (isUndefined(handler))
- return false;
-
- if (isFunction(handler)) {
- switch (arguments.length) {
- // fast cases
- case 1:
- handler.call(this);
- break;
- case 2:
- handler.call(this, arguments[1]);
- break;
- case 3:
- handler.call(this, arguments[1], arguments[2]);
- break;
- // slower
- default:
- args = Array.prototype.slice.call(arguments, 1);
- handler.apply(this, args);
- }
- } else if (isObject(handler)) {
- args = Array.prototype.slice.call(arguments, 1);
- listeners = handler.slice();
- len = listeners.length;
- for (i = 0; i < len; i++)
- listeners[i].apply(this, args);
- }
-
- return true;
-};
-
-EventEmitter.prototype.addListener = function(type, listener) {
- var m;
-
- if (!isFunction(listener))
- throw TypeError('listener must be a function');
-
- if (!this._events)
- this._events = {};
-
- // To avoid recursion in the case that type === "newListener"! Before
- // adding it to the listeners, first emit "newListener".
- if (this._events.newListener)
- this.emit('newListener', type,
- isFunction(listener.listener) ?
- listener.listener : listener);
-
- if (!this._events[type])
- // Optimize the case of one listener. Don't need the extra array object.
- this._events[type] = listener;
- else if (isObject(this._events[type]))
- // If we've already got an array, just append.
- this._events[type].push(listener);
- else
- // Adding the second element, need to change to array.
- this._events[type] = [this._events[type], listener];
-
- // Check for listener leak
- if (isObject(this._events[type]) && !this._events[type].warned) {
- if (!isUndefined(this._maxListeners)) {
- m = this._maxListeners;
- } else {
- m = EventEmitter.defaultMaxListeners;
- }
-
- if (m && m > 0 && this._events[type].length > m) {
- this._events[type].warned = true;
- console.error('(node) warning: possible EventEmitter memory ' +
- 'leak detected. %d listeners added. ' +
- 'Use emitter.setMaxListeners() to increase limit.',
- this._events[type].length);
- if (typeof console.trace === 'function') {
- // not supported in IE 10
- console.trace();
- }
- }
- }
-
- return this;
-};
-
-EventEmitter.prototype.on = EventEmitter.prototype.addListener;
-
-EventEmitter.prototype.once = function(type, listener) {
- if (!isFunction(listener))
- throw TypeError('listener must be a function');
-
- var fired = false;
-
- function g() {
- this.removeListener(type, g);
-
- if (!fired) {
- fired = true;
- listener.apply(this, arguments);
- }
- }
-
- g.listener = listener;
- this.on(type, g);
-
- return this;
-};
-
-// emits a 'removeListener' event iff the listener was removed
-EventEmitter.prototype.removeListener = function(type, listener) {
- var list, position, length, i;
-
- if (!isFunction(listener))
- throw TypeError('listener must be a function');
-
- if (!this._events || !this._events[type])
- return this;
-
- list = this._events[type];
- length = list.length;
- position = -1;
-
- if (list === listener ||
- (isFunction(list.listener) && list.listener === listener)) {
- delete this._events[type];
- if (this._events.removeListener)
- this.emit('removeListener', type, listener);
-
- } else if (isObject(list)) {
- for (i = length; i-- > 0;) {
- if (list[i] === listener ||
- (list[i].listener && list[i].listener === listener)) {
- position = i;
- break;
- }
- }
-
- if (position < 0)
- return this;
-
- if (list.length === 1) {
- list.length = 0;
- delete this._events[type];
- } else {
- list.splice(position, 1);
- }
-
- if (this._events.removeListener)
- this.emit('removeListener', type, listener);
- }
-
- return this;
-};
-
-EventEmitter.prototype.removeAllListeners = function(type) {
- var key, listeners;
-
- if (!this._events)
- return this;
-
- // not listening for removeListener, no need to emit
- if (!this._events.removeListener) {
- if (arguments.length === 0)
- this._events = {};
- else if (this._events[type])
- delete this._events[type];
- return this;
- }
-
- // emit removeListener for all listeners on all events
- if (arguments.length === 0) {
- for (key in this._events) {
- if (key === 'removeListener') continue;
- this.removeAllListeners(key);
- }
- this.removeAllListeners('removeListener');
- this._events = {};
- return this;
- }
-
- listeners = this._events[type];
-
- if (isFunction(listeners)) {
- this.removeListener(type, listeners);
- } else if (listeners) {
- // LIFO order
- while (listeners.length)
- this.removeListener(type, listeners[listeners.length - 1]);
- }
- delete this._events[type];
-
- return this;
-};
-
-EventEmitter.prototype.listeners = function(type) {
- var ret;
- if (!this._events || !this._events[type])
- ret = [];
- else if (isFunction(this._events[type]))
- ret = [this._events[type]];
- else
- ret = this._events[type].slice();
- return ret;
-};
-
-EventEmitter.prototype.listenerCount = function(type) {
- if (this._events) {
- var evlistener = this._events[type];
-
- if (isFunction(evlistener))
- return 1;
- else if (evlistener)
- return evlistener.length;
- }
- return 0;
-};
-
-EventEmitter.listenerCount = function(emitter, type) {
- return emitter.listenerCount(type);
-};
-
-function isFunction(arg) {
- return typeof arg === 'function';
-}
-
-function isNumber(arg) {
- return typeof arg === 'number';
-}
-
-function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
-}
-
-function isUndefined(arg) {
- return arg === void 0;
-}
-
-},{}],49:[function(require,module,exports){
-(function (process){
-// Growl - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
-
-/**
- * Module dependencies.
- */
-
-var exec = require('child_process').exec
- , fs = require('fs')
- , path = require('path')
- , exists = fs.existsSync || path.existsSync
- , os = require('os')
- , quote = JSON.stringify
- , cmd;
-
-function which(name) {
- var paths = process.env.PATH.split(':');
- var loc;
-
- for (var i = 0, len = paths.length; i < len; ++i) {
- loc = path.join(paths[i], name);
- if (exists(loc)) return loc;
- }
-}
-
-switch(os.type()) {
- case 'Darwin':
- if (which('terminal-notifier')) {
- cmd = {
- type: "Darwin-NotificationCenter"
- , pkg: "terminal-notifier"
- , msg: '-message'
- , title: '-title'
- , subtitle: '-subtitle'
- , icon: '-appIcon'
- , sound: '-sound'
- , url: '-open'
- , priority: {
- cmd: '-execute'
- , range: []
- }
- };
- } else {
- cmd = {
- type: "Darwin-Growl"
- , pkg: "growlnotify"
- , msg: '-m'
- , sticky: '--sticky'
- , priority: {
- cmd: '--priority'
- , range: [
- -2
- , -1
- , 0
- , 1
- , 2
- , "Very Low"
- , "Moderate"
- , "Normal"
- , "High"
- , "Emergency"
- ]
- }
- };
- }
- break;
- case 'Linux':
- if (which('growl')) {
- cmd = {
- type: "Linux-Growl"
- , pkg: "growl"
- , msg: '-m'
- , title: '-title'
- , subtitle: '-subtitle'
- , host: {
- cmd: '-H'
- , hostname: '192.168.33.1'
- }
- };
- } else {
- cmd = {
- type: "Linux"
- , pkg: "notify-send"
- , msg: ''
- , sticky: '-t 0'
- , icon: '-i'
- , priority: {
- cmd: '-u'
- , range: [
- "low"
- , "normal"
- , "critical"
- ]
- }
- };
- }
- break;
- case 'Windows_NT':
- cmd = {
- type: "Windows"
- , pkg: "growlnotify"
- , msg: ''
- , sticky: '/s:true'
- , title: '/t:'
- , icon: '/i:'
- , url: '/cu:'
- , priority: {
- cmd: '/p:'
- , range: [
- -2
- , -1
- , 0
- , 1
- , 2
- ]
- }
- };
- break;
-}
-
-/**
- * Expose `growl`.
- */
-
-exports = module.exports = growl;
-
-/**
- * Node-growl version.
- */
-
-exports.version = '1.4.1'
-
-/**
- * Send growl notification _msg_ with _options_.
- *
- * Options:
- *
- * - title Notification title
- * - sticky Make the notification stick (defaults to false)
- * - priority Specify an int or named key (default is 0)
- * - name Application name (defaults to growlnotify)
- * - sound Sound efect ( in OSx defined in preferences -> sound -> effects) * works only in OSX > 10.8x
- * - image
- * - path to an icon sets --iconpath
- * - path to an image sets --image
- * - capitalized word sets --appIcon
- * - filename uses extname as --icon
- * - otherwise treated as --icon
- *
- * Examples:
- *
- * growl('New email')
- * growl('5 new emails', { title: 'Thunderbird' })
- * growl('5 new emails', { title: 'Thunderbird', sound: 'Purr' })
- * growl('Email sent', function(){
- * // ... notification sent
- * })
- *
- * @param {string} msg
- * @param {object} options
- * @param {function} fn
- * @api public
- */
-
-function growl(msg, options, fn) {
- var image
- , args
- , options = options || {}
- , fn = fn || function(){};
-
- if (options.exec) {
- cmd = {
- type: "Custom"
- , pkg: options.exec
- , range: []
- };
- }
-
- // noop
- if (!cmd) return fn(new Error('growl not supported on this platform'));
- args = [cmd.pkg];
-
- // image
- if (image = options.image) {
- switch(cmd.type) {
- case 'Darwin-Growl':
- var flag, ext = path.extname(image).substr(1)
- flag = flag || ext == 'icns' && 'iconpath'
- flag = flag || /^[A-Z]/.test(image) && 'appIcon'
- flag = flag || /^png|gif|jpe?g$/.test(ext) && 'image'
- flag = flag || ext && (image = ext) && 'icon'
- flag = flag || 'icon'
- args.push('--' + flag, quote(image))
- break;
- case 'Darwin-NotificationCenter':
- args.push(cmd.icon, quote(image));
- break;
- case 'Linux':
- args.push(cmd.icon, quote(image));
- // libnotify defaults to sticky, set a hint for transient notifications
- if (!options.sticky) args.push('--hint=int:transient:1');
- break;
- case 'Windows':
- args.push(cmd.icon + quote(image));
- break;
- }
- }
-
- // sticky
- if (options.sticky) args.push(cmd.sticky);
-
- // priority
- if (options.priority) {
- var priority = options.priority + '';
- var checkindexOf = cmd.priority.range.indexOf(priority);
- if (~cmd.priority.range.indexOf(priority)) {
- args.push(cmd.priority, options.priority);
- }
- }
-
- //sound
- if(options.sound && cmd.type === 'Darwin-NotificationCenter'){
- args.push(cmd.sound, options.sound)
- }
-
- // name
- if (options.name && cmd.type === "Darwin-Growl") {
- args.push('--name', options.name);
- }
-
- switch(cmd.type) {
- case 'Darwin-Growl':
- args.push(cmd.msg);
- args.push(quote(msg).replace(/\\n/g, '\n'));
- if (options.title) args.push(quote(options.title));
- break;
- case 'Darwin-NotificationCenter':
- args.push(cmd.msg);
- var stringifiedMsg = quote(msg);
- var escapedMsg = stringifiedMsg.replace(/\\n/g, '\n');
- args.push(escapedMsg);
- if (options.title) {
- args.push(cmd.title);
- args.push(quote(options.title));
- }
- if (options.subtitle) {
- args.push(cmd.subtitle);
- args.push(quote(options.subtitle));
- }
- if (options.url) {
- args.push(cmd.url);
- args.push(quote(options.url));
- }
- break;
- case 'Linux-Growl':
- args.push(cmd.msg);
- args.push(quote(msg).replace(/\\n/g, '\n'));
- if (options.title) args.push(quote(options.title));
- if (cmd.host) {
- args.push(cmd.host.cmd, cmd.host.hostname)
- }
- break;
- case 'Linux':
- if (options.title) {
- args.push(quote(options.title));
- args.push(cmd.msg);
- args.push(quote(msg).replace(/\\n/g, '\n'));
- } else {
- args.push(quote(msg).replace(/\\n/g, '\n'));
- }
- break;
- case 'Windows':
- args.push(quote(msg).replace(/\\n/g, '\n'));
- if (options.title) args.push(cmd.title + quote(options.title));
- if (options.url) args.push(cmd.url + quote(options.url));
- break;
- case 'Custom':
- args[0] = (function(origCommand) {
- var message = options.title
- ? options.title + ': ' + msg
- : msg;
- var command = origCommand.replace(/(^|[^%])%s/g, '$1' + quote(message));
- if (command === origCommand) args.push(quote(message));
- return command;
- })(args[0]);
- break;
- }
-
- // execute
- exec(args.join(' '), fn);
-};
-
-}).call(this,require('_process'))
-},{"_process":67,"child_process":42,"fs":42,"os":65,"path":42}],50:[function(require,module,exports){
-exports.read = function (buffer, offset, isLE, mLen, nBytes) {
- var e, m
- var eLen = nBytes * 8 - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var nBits = -7
- var i = isLE ? (nBytes - 1) : 0
- var d = isLE ? -1 : 1
- var s = buffer[offset + i]
-
- i += d
-
- e = s & ((1 << (-nBits)) - 1)
- s >>= (-nBits)
- nBits += eLen
- for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
-
- m = e & ((1 << (-nBits)) - 1)
- e >>= (-nBits)
- nBits += mLen
- for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
-
- if (e === 0) {
- e = 1 - eBias
- } else if (e === eMax) {
- return m ? NaN : ((s ? -1 : 1) * Infinity)
- } else {
- m = m + Math.pow(2, mLen)
- e = e - eBias
- }
- return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
-}
-
-exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
- var e, m, c
- var eLen = nBytes * 8 - mLen - 1
- var eMax = (1 << eLen) - 1
- var eBias = eMax >> 1
- var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
- var i = isLE ? 0 : (nBytes - 1)
- var d = isLE ? 1 : -1
- var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
-
- value = Math.abs(value)
-
- if (isNaN(value) || value === Infinity) {
- m = isNaN(value) ? 1 : 0
- e = eMax
- } else {
- e = Math.floor(Math.log(value) / Math.LN2)
- if (value * (c = Math.pow(2, -e)) < 1) {
- e--
- c *= 2
- }
- if (e + eBias >= 1) {
- value += rt / c
- } else {
- value += rt * Math.pow(2, 1 - eBias)
- }
- if (value * c >= 2) {
- e++
- c /= 2
- }
-
- if (e + eBias >= eMax) {
- m = 0
- e = eMax
- } else if (e + eBias >= 1) {
- m = (value * c - 1) * Math.pow(2, mLen)
- e = e + eBias
- } else {
- m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
- e = 0
- }
- }
-
- for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
-
- e = (e << mLen) | m
- eLen += mLen
- for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
-
- buffer[offset + i - d] |= s * 128
-}
-
-},{}],51:[function(require,module,exports){
-if (typeof Object.create === 'function') {
- // implementation from standard node.js 'util' module
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- ctor.prototype = Object.create(superCtor.prototype, {
- constructor: {
- value: ctor,
- enumerable: false,
- writable: true,
- configurable: true
- }
- });
- };
-} else {
- // old school shim for old browsers
- module.exports = function inherits(ctor, superCtor) {
- ctor.super_ = superCtor
- var TempCtor = function () {}
- TempCtor.prototype = superCtor.prototype
- ctor.prototype = new TempCtor()
- ctor.prototype.constructor = ctor
- }
-}
-
-},{}],52:[function(require,module,exports){
-/*!
- * Determine if an object is a Buffer
- *
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
- * @license MIT
- */
-
-// The _isBuffer check is for Safari 5-7 support, because it's missing
-// Object.prototype.constructor. Remove this eventually
-module.exports = function (obj) {
- return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
-}
-
-function isBuffer (obj) {
- return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
-}
-
-// For Node v0.10 support. Remove this eventually.
-function isSlowBuffer (obj) {
- return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
-}
-
-},{}],53:[function(require,module,exports){
-var toString = {}.toString;
-
-module.exports = Array.isArray || function (arr) {
- return toString.call(arr) == '[object Array]';
-};
-
-},{}],54:[function(require,module,exports){
-(function (global){
-/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */
-;(function () {
- // Detect the `define` function exposed by asynchronous module loaders. The
- // strict `define` check is necessary for compatibility with `r.js`.
- var isLoader = false;
-
- // A set of types used to distinguish objects from primitives.
- var objectTypes = {
- "function": true,
- "object": true
- };
-
- // Detect the `exports` object exposed by CommonJS implementations.
- var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
-
- // Use the `global` object exposed by Node (including Browserify via
- // `insert-module-globals`), Narwhal, and Ringo as the default context,
- // and the `window` object in browsers. Rhino exports a `global` function
- // instead.
- var root = objectTypes[typeof window] && window || this,
- freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == "object" && global;
-
- if (freeGlobal && (freeGlobal["global"] === freeGlobal || freeGlobal["window"] === freeGlobal || freeGlobal["self"] === freeGlobal)) {
- root = freeGlobal;
- }
-
- // Public: Initializes JSON 3 using the given `context` object, attaching the
- // `stringify` and `parse` functions to the specified `exports` object.
- function runInContext(context, exports) {
- context || (context = root["Object"]());
- exports || (exports = root["Object"]());
-
- // Native constructor aliases.
- var Number = context["Number"] || root["Number"],
- String = context["String"] || root["String"],
- Object = context["Object"] || root["Object"],
- Date = context["Date"] || root["Date"],
- SyntaxError = context["SyntaxError"] || root["SyntaxError"],
- TypeError = context["TypeError"] || root["TypeError"],
- Math = context["Math"] || root["Math"],
- nativeJSON = context["JSON"] || root["JSON"];
-
- // Delegate to the native `stringify` and `parse` implementations.
- if (typeof nativeJSON == "object" && nativeJSON) {
- exports.stringify = nativeJSON.stringify;
- exports.parse = nativeJSON.parse;
- }
-
- // Convenience aliases.
- var objectProto = Object.prototype,
- getClass = objectProto.toString,
- isProperty, forEach, undef;
-
- // Test the `Date#getUTC*` methods. Based on work by @Yaffle.
- var isExtended = new Date(-3509827334573292);
- try {
- // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical
- // results for certain dates in Opera >= 10.53.
- isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&
- // Safari < 2.0.2 stores the internal millisecond time value correctly,
- // but clips the values returned by the date methods to the range of
- // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]).
- isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;
- } catch (exception) {}
-
- // Internal: Determines whether the native `JSON.stringify` and `parse`
- // implementations are spec-compliant. Based on work by Ken Snyder.
- function has(name) {
- if (has[name] !== undef) {
- // Return cached feature test result.
- return has[name];
- }
- var isSupported;
- if (name == "bug-string-char-index") {
- // IE <= 7 doesn't support accessing string characters using square
- // bracket notation. IE 8 only supports this for primitives.
- isSupported = "a"[0] != "a";
- } else if (name == "json") {
- // Indicates whether both `JSON.stringify` and `JSON.parse` are
- // supported.
- isSupported = has("json-stringify") && has("json-parse");
- } else {
- var value, serialized = '{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';
- // Test `JSON.stringify`.
- if (name == "json-stringify") {
- var stringify = exports.stringify, stringifySupported = typeof stringify == "function" && isExtended;
- if (stringifySupported) {
- // A test function object with a custom `toJSON` method.
- (value = function () {
- return 1;
- }).toJSON = value;
- try {
- stringifySupported =
- // Firefox 3.1b1 and b2 serialize string, number, and boolean
- // primitives as object literals.
- stringify(0) === "0" &&
- // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object
- // literals.
- stringify(new Number()) === "0" &&
- stringify(new String()) == '""' &&
- // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or
- // does not define a canonical JSON representation (this applies to
- // objects with `toJSON` properties as well, *unless* they are nested
- // within an object or array).
- stringify(getClass) === undef &&
- // IE 8 serializes `undefined` as `"undefined"`. Safari <= 5.1.7 and
- // FF 3.1b3 pass this test.
- stringify(undef) === undef &&
- // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,
- // respectively, if the value is omitted entirely.
- stringify() === undef &&
- // FF 3.1b1, 2 throw an error if the given value is not a number,
- // string, array, object, Boolean, or `null` literal. This applies to
- // objects with custom `toJSON` methods as well, unless they are nested
- // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`
- // methods entirely.
- stringify(value) === "1" &&
- stringify([value]) == "[1]" &&
- // Prototype <= 1.6.1 serializes `[undefined]` as `"[]"` instead of
- // `"[null]"`.
- stringify([undef]) == "[null]" &&
- // YUI 3.0.0b1 fails to serialize `null` literals.
- stringify(null) == "null" &&
- // FF 3.1b1, 2 halts serialization if an array contains a function:
- // `[1, true, getClass, 1]` serializes as "[1,true,],". FF 3.1b3
- // elides non-JSON values from objects and arrays, unless they
- // define custom `toJSON` methods.
- stringify([undef, getClass, null]) == "[null,null,null]" &&
- // Simple serialization test. FF 3.1b1 uses Unicode escape sequences
- // where character escape codes are expected (e.g., `\b` => `\u0008`).
- stringify({ "a": [value, true, false, null, "\x00\b\n\f\r\t"] }) == serialized &&
- // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.
- stringify(null, value) === "1" &&
- stringify([1, 2], null, 1) == "[\n 1,\n 2\n]" &&
- // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly
- // serialize extended years.
- stringify(new Date(-8.64e15)) == '"-271821-04-20T00:00:00.000Z"' &&
- // The milliseconds are optional in ES 5, but required in 5.1.
- stringify(new Date(8.64e15)) == '"+275760-09-13T00:00:00.000Z"' &&
- // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative
- // four-digit years instead of six-digit years. Credits: @Yaffle.
- stringify(new Date(-621987552e5)) == '"-000001-01-01T00:00:00.000Z"' &&
- // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond
- // values less than 1000. Credits: @Yaffle.
- stringify(new Date(-1)) == '"1969-12-31T23:59:59.999Z"';
- } catch (exception) {
- stringifySupported = false;
- }
- }
- isSupported = stringifySupported;
- }
- // Test `JSON.parse`.
- if (name == "json-parse") {
- var parse = exports.parse;
- if (typeof parse == "function") {
- try {
- // FF 3.1b1, b2 will throw an exception if a bare literal is provided.
- // Conforming implementations should also coerce the initial argument to
- // a string prior to parsing.
- if (parse("0") === 0 && !parse(false)) {
- // Simple parsing test.
- value = parse(serialized);
- var parseSupported = value["a"].length == 5 && value["a"][0] === 1;
- if (parseSupported) {
- try {
- // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.
- parseSupported = !parse('"\t"');
- } catch (exception) {}
- if (parseSupported) {
- try {
- // FF 4.0 and 4.0.1 allow leading `+` signs and leading
- // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow
- // certain octal literals.
- parseSupported = parse("01") !== 1;
- } catch (exception) {}
- }
- if (parseSupported) {
- try {
- // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal
- // points. These environments, along with FF 3.1b1 and 2,
- // also allow trailing commas in JSON objects and arrays.
- parseSupported = parse("1.") !== 1;
- } catch (exception) {}
- }
- }
- }
- } catch (exception) {
- parseSupported = false;
- }
- }
- isSupported = parseSupported;
- }
- }
- return has[name] = !!isSupported;
- }
-
- if (!has("json")) {
- // Common `[[Class]]` name aliases.
- var functionClass = "[object Function]",
- dateClass = "[object Date]",
- numberClass = "[object Number]",
- stringClass = "[object String]",
- arrayClass = "[object Array]",
- booleanClass = "[object Boolean]";
-
- // Detect incomplete support for accessing string characters by index.
- var charIndexBuggy = has("bug-string-char-index");
-
- // Define additional utility methods if the `Date` methods are buggy.
- if (!isExtended) {
- var floor = Math.floor;
- // A mapping between the months of the year and the number of days between
- // January 1st and the first of the respective month.
- var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
- // Internal: Calculates the number of days between the Unix epoch and the
- // first day of the given month.
- var getDay = function (year, month) {
- return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);
- };
- }
-
- // Internal: Determines if a property is a direct property of the given
- // object. Delegates to the native `Object#hasOwnProperty` method.
- if (!(isProperty = objectProto.hasOwnProperty)) {
- isProperty = function (property) {
- var members = {}, constructor;
- if ((members.__proto__ = null, members.__proto__ = {
- // The *proto* property cannot be set multiple times in recent
- // versions of Firefox and SeaMonkey.
- "toString": 1
- }, members).toString != getClass) {
- // Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`, but
- // supports the mutable *proto* property.
- isProperty = function (property) {
- // Capture and break the object's prototype chain (see section 8.6.2
- // of the ES 5.1 spec). The parenthesized expression prevents an
- // unsafe transformation by the Closure Compiler.
- var original = this.__proto__, result = property in (this.__proto__ = null, this);
- // Restore the original prototype chain.
- this.__proto__ = original;
- return result;
- };
- } else {
- // Capture a reference to the top-level `Object` constructor.
- constructor = members.constructor;
- // Use the `constructor` property to simulate `Object#hasOwnProperty` in
- // other environments.
- isProperty = function (property) {
- var parent = (this.constructor || constructor).prototype;
- return property in this && !(property in parent && this[property] === parent[property]);
- };
- }
- members = null;
- return isProperty.call(this, property);
- };
- }
-
- // Internal: Normalizes the `for...in` iteration algorithm across
- // environments. Each enumerated key is yielded to a `callback` function.
- forEach = function (object, callback) {
- var size = 0, Properties, members, property;
-
- // Tests for bugs in the current environment's `for...in` algorithm. The
- // `valueOf` property inherits the non-enumerable flag from
- // `Object.prototype` in older versions of IE, Netscape, and Mozilla.
- (Properties = function () {
- this.valueOf = 0;
- }).prototype.valueOf = 0;
-
- // Iterate over a new instance of the `Properties` class.
- members = new Properties();
- for (property in members) {
- // Ignore all properties inherited from `Object.prototype`.
- if (isProperty.call(members, property)) {
- size++;
- }
- }
- Properties = members = null;
-
- // Normalize the iteration algorithm.
- if (!size) {
- // A list of non-enumerable properties inherited from `Object.prototype`.
- members = ["valueOf", "toString", "toLocaleString", "propertyIsEnumerable", "isPrototypeOf", "hasOwnProperty", "constructor"];
- // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable
- // properties.
- forEach = function (object, callback) {
- var isFunction = getClass.call(object) == functionClass, property, length;
- var hasProperty = !isFunction && typeof object.constructor != "function" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;
- for (property in object) {
- // Gecko <= 1.0 enumerates the `prototype` property of functions under
- // certain conditions; IE does not.
- if (!(isFunction && property == "prototype") && hasProperty.call(object, property)) {
- callback(property);
- }
- }
- // Manually invoke the callback for each non-enumerable property.
- for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));
- };
- } else if (size == 2) {
- // Safari <= 2.0.4 enumerates shadowed properties twice.
- forEach = function (object, callback) {
- // Create a set of iterated properties.
- var members = {}, isFunction = getClass.call(object) == functionClass, property;
- for (property in object) {
- // Store each property name to prevent double enumeration. The
- // `prototype` property of functions is not enumerated due to cross-
- // environment inconsistencies.
- if (!(isFunction && property == "prototype") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) {
- callback(property);
- }
- }
- };
- } else {
- // No bugs detected; use the standard `for...in` algorithm.
- forEach = function (object, callback) {
- var isFunction = getClass.call(object) == functionClass, property, isConstructor;
- for (property in object) {
- if (!(isFunction && property == "prototype") && isProperty.call(object, property) && !(isConstructor = property === "constructor")) {
- callback(property);
- }
- }
- // Manually invoke the callback for the `constructor` property due to
- // cross-environment inconsistencies.
- if (isConstructor || isProperty.call(object, (property = "constructor"))) {
- callback(property);
- }
- };
- }
- return forEach(object, callback);
- };
-
- // Public: Serializes a JavaScript `value` as a JSON string. The optional
- // `filter` argument may specify either a function that alters how object and
- // array members are serialized, or an array of strings and numbers that
- // indicates which properties should be serialized. The optional `width`
- // argument may be either a string or number that specifies the indentation
- // level of the output.
- if (!has("json-stringify")) {
- // Internal: A map of control characters and their escaped equivalents.
- var Escapes = {
- 92: "\\\\",
- 34: '\\"',
- 8: "\\b",
- 12: "\\f",
- 10: "\\n",
- 13: "\\r",
- 9: "\\t"
- };
-
- // Internal: Converts `value` into a zero-padded string such that its
- // length is at least equal to `width`. The `width` must be <= 6.
- var leadingZeroes = "000000";
- var toPaddedString = function (width, value) {
- // The `|| 0` expression is necessary to work around a bug in
- // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== "0"`.
- return (leadingZeroes + (value || 0)).slice(-width);
- };
-
- // Internal: Double-quotes a string `value`, replacing all ASCII control
- // characters (characters with code unit values between 0 and 31) with
- // their escaped equivalents. This is an implementation of the
- // `Quote(value)` operation defined in ES 5.1 section 15.12.3.
- var unicodePrefix = "\\u00";
- var quote = function (value) {
- var result = '"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10;
- var symbols = useCharIndex && (charIndexBuggy ? value.split("") : value);
- for (; index < length; index++) {
- var charCode = value.charCodeAt(index);
- // If the character is a control character, append its Unicode or
- // shorthand escape sequence; otherwise, append the character as-is.
- switch (charCode) {
- case 8: case 9: case 10: case 12: case 13: case 34: case 92:
- result += Escapes[charCode];
- break;
- default:
- if (charCode < 32) {
- result += unicodePrefix + toPaddedString(2, charCode.toString(16));
- break;
- }
- result += useCharIndex ? symbols[index] : value.charAt(index);
- }
- }
- return result + '"';
- };
-
- // Internal: Recursively serializes an object. Implements the
- // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.
- var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {
- var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result;
- try {
- // Necessary for host object support.
- value = object[property];
- } catch (exception) {}
- if (typeof value == "object" && value) {
- className = getClass.call(value);
- if (className == dateClass && !isProperty.call(value, "toJSON")) {
- if (value > -1 / 0 && value < 1 / 0) {
- // Dates are serialized according to the `Date#toJSON` method
- // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15
- // for the ISO 8601 date time string format.
- if (getDay) {
- // Manually compute the year, month, date, hours, minutes,
- // seconds, and milliseconds if the `getUTC*` methods are
- // buggy. Adapted from @Yaffle's `date-shim` project.
- date = floor(value / 864e5);
- for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);
- for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);
- date = 1 + date - getDay(year, month);
- // The `time` value specifies the time within the day (see ES
- // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used
- // to compute `A modulo B`, as the `%` operator does not
- // correspond to the `modulo` operation for negative numbers.
- time = (value % 864e5 + 864e5) % 864e5;
- // The hours, minutes, seconds, and milliseconds are obtained by
- // decomposing the time within the day. See section 15.9.1.10.
- hours = floor(time / 36e5) % 24;
- minutes = floor(time / 6e4) % 60;
- seconds = floor(time / 1e3) % 60;
- milliseconds = time % 1e3;
- } else {
- year = value.getUTCFullYear();
- month = value.getUTCMonth();
- date = value.getUTCDate();
- hours = value.getUTCHours();
- minutes = value.getUTCMinutes();
- seconds = value.getUTCSeconds();
- milliseconds = value.getUTCMilliseconds();
- }
- // Serialize extended years correctly.
- value = (year <= 0 || year >= 1e4 ? (year < 0 ? "-" : "+") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +
- "-" + toPaddedString(2, month + 1) + "-" + toPaddedString(2, date) +
- // Months, dates, hours, minutes, and seconds should have two
- // digits; milliseconds should have three.
- "T" + toPaddedString(2, hours) + ":" + toPaddedString(2, minutes) + ":" + toPaddedString(2, seconds) +
- // Milliseconds are optional in ES 5.0, but required in 5.1.
- "." + toPaddedString(3, milliseconds) + "Z";
- } else {
- value = null;
- }
- } else if (typeof value.toJSON == "function" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, "toJSON"))) {
- // Prototype <= 1.6.1 adds non-standard `toJSON` methods to the
- // `Number`, `String`, `Date`, and `Array` prototypes. JSON 3
- // ignores all `toJSON` methods on these objects unless they are
- // defined directly on an instance.
- value = value.toJSON(property);
- }
- }
- if (callback) {
- // If a replacement function was provided, call it to obtain the value
- // for serialization.
- value = callback.call(object, property, value);
- }
- if (value === null) {
- return "null";
- }
- className = getClass.call(value);
- if (className == booleanClass) {
- // Booleans are represented literally.
- return "" + value;
- } else if (className == numberClass) {
- // JSON numbers must be finite. `Infinity` and `NaN` are serialized as
- // `"null"`.
- return value > -1 / 0 && value < 1 / 0 ? "" + value : "null";
- } else if (className == stringClass) {
- // Strings are double-quoted and escaped.
- return quote("" + value);
- }
- // Recursively serialize objects and arrays.
- if (typeof value == "object") {
- // Check for cyclic structures. This is a linear search; performance
- // is inversely proportional to the number of unique nested objects.
- for (length = stack.length; length--;) {
- if (stack[length] === value) {
- // Cyclic structures cannot be serialized by `JSON.stringify`.
- throw TypeError();
- }
- }
- // Add the object to the stack of traversed objects.
- stack.push(value);
- results = [];
- // Save the current indentation level and indent one additional level.
- prefix = indentation;
- indentation += whitespace;
- if (className == arrayClass) {
- // Recursively serialize array elements.
- for (index = 0, length = value.length; index < length; index++) {
- element = serialize(index, value, callback, properties, whitespace, indentation, stack);
- results.push(element === undef ? "null" : element);
- }
- result = results.length ? (whitespace ? "[\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "]" : ("[" + results.join(",") + "]")) : "[]";
- } else {
- // Recursively serialize object members. Members are selected from
- // either a user-specified list of property names, or the object
- // itself.
- forEach(properties || value, function (property) {
- var element = serialize(property, value, callback, properties, whitespace, indentation, stack);
- if (element !== undef) {
- // According to ES 5.1 section 15.12.3: "If `gap` {whitespace}
- // is not the empty string, let `member` {quote(property) + ":"}
- // be the concatenation of `member` and the `space` character."
- // The "`space` character" refers to the literal space
- // character, not the `space` {width} argument provided to
- // `JSON.stringify`.
- results.push(quote(property) + ":" + (whitespace ? " " : "") + element);
- }
- });
- result = results.length ? (whitespace ? "{\n" + indentation + results.join(",\n" + indentation) + "\n" + prefix + "}" : ("{" + results.join(",") + "}")) : "{}";
- }
- // Remove the object from the traversed object stack.
- stack.pop();
- return result;
- }
- };
-
- // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.
- exports.stringify = function (source, filter, width) {
- var whitespace, callback, properties, className;
- if (objectTypes[typeof filter] && filter) {
- if ((className = getClass.call(filter)) == functionClass) {
- callback = filter;
- } else if (className == arrayClass) {
- // Convert the property names array into a makeshift set.
- properties = {};
- for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));
- }
- }
- if (width) {
- if ((className = getClass.call(width)) == numberClass) {
- // Convert the `width` to an integer and create a string containing
- // `width` number of space characters.
- if ((width -= width % 1) > 0) {
- for (whitespace = "", width > 10 && (width = 10); whitespace.length < width; whitespace += " ");
- }
- } else if (className == stringClass) {
- whitespace = width.length <= 10 ? width : width.slice(0, 10);
- }
- }
- // Opera <= 7.54u2 discards the values associated with empty string keys
- // (`""`) only if they are used directly within an object member list
- // (e.g., `!("" in { "": 1})`).
- return serialize("", (value = {}, value[""] = source, value), callback, properties, whitespace, "", []);
- };
- }
-
- // Public: Parses a JSON source string.
- if (!has("json-parse")) {
- var fromCharCode = String.fromCharCode;
-
- // Internal: A map of escaped control characters and their unescaped
- // equivalents.
- var Unescapes = {
- 92: "\\",
- 34: '"',
- 47: "/",
- 98: "\b",
- 116: "\t",
- 110: "\n",
- 102: "\f",
- 114: "\r"
- };
-
- // Internal: Stores the parser state.
- var Index, Source;
-
- // Internal: Resets the parser state and throws a `SyntaxError`.
- var abort = function () {
- Index = Source = null;
- throw SyntaxError();
- };
-
- // Internal: Returns the next token, or `"$"` if the parser has reached
- // the end of the source string. A token may be a string, number, `null`
- // literal, or Boolean literal.
- var lex = function () {
- var source = Source, length = source.length, value, begin, position, isSigned, charCode;
- while (Index < length) {
- charCode = source.charCodeAt(Index);
- switch (charCode) {
- case 9: case 10: case 13: case 32:
- // Skip whitespace tokens, including tabs, carriage returns, line
- // feeds, and space characters.
- Index++;
- break;
- case 123: case 125: case 91: case 93: case 58: case 44:
- // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at
- // the current position.
- value = charIndexBuggy ? source.charAt(Index) : source[Index];
- Index++;
- return value;
- case 34:
- // `"` delimits a JSON string; advance to the next character and
- // begin parsing the string. String tokens are prefixed with the
- // sentinel `@` character to distinguish them from punctuators and
- // end-of-string tokens.
- for (value = "@", Index++; Index < length;) {
- charCode = source.charCodeAt(Index);
- if (charCode < 32) {
- // Unescaped ASCII control characters (those with a code unit
- // less than the space character) are not permitted.
- abort();
- } else if (charCode == 92) {
- // A reverse solidus (`\`) marks the beginning of an escaped
- // control character (including `"`, `\`, and `/`) or Unicode
- // escape sequence.
- charCode = source.charCodeAt(++Index);
- switch (charCode) {
- case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:
- // Revive escaped control characters.
- value += Unescapes[charCode];
- Index++;
- break;
- case 117:
- // `\u` marks the beginning of a Unicode escape sequence.
- // Advance to the first character and validate the
- // four-digit code point.
- begin = ++Index;
- for (position = Index + 4; Index < position; Index++) {
- charCode = source.charCodeAt(Index);
- // A valid sequence comprises four hexdigits (case-
- // insensitive) that form a single hexadecimal value.
- if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {
- // Invalid Unicode escape sequence.
- abort();
- }
- }
- // Revive the escaped character.
- value += fromCharCode("0x" + source.slice(begin, Index));
- break;
- default:
- // Invalid escape sequence.
- abort();
- }
- } else {
- if (charCode == 34) {
- // An unescaped double-quote character marks the end of the
- // string.
- break;
- }
- charCode = source.charCodeAt(Index);
- begin = Index;
- // Optimize for the common case where a string is valid.
- while (charCode >= 32 && charCode != 92 && charCode != 34) {
- charCode = source.charCodeAt(++Index);
- }
- // Append the string as-is.
- value += source.slice(begin, Index);
- }
- }
- if (source.charCodeAt(Index) == 34) {
- // Advance to the next character and return the revived string.
- Index++;
- return value;
- }
- // Unterminated string.
- abort();
- default:
- // Parse numbers and literals.
- begin = Index;
- // Advance past the negative sign, if one is specified.
- if (charCode == 45) {
- isSigned = true;
- charCode = source.charCodeAt(++Index);
- }
- // Parse an integer or floating-point value.
- if (charCode >= 48 && charCode <= 57) {
- // Leading zeroes are interpreted as octal literals.
- if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {
- // Illegal octal literal.
- abort();
- }
- isSigned = false;
- // Parse the integer component.
- for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);
- // Floats cannot contain a leading decimal point; however, this
- // case is already accounted for by the parser.
- if (source.charCodeAt(Index) == 46) {
- position = ++Index;
- // Parse the decimal component.
- for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
- if (position == Index) {
- // Illegal trailing decimal.
- abort();
- }
- Index = position;
- }
- // Parse exponents. The `e` denoting the exponent is
- // case-insensitive.
- charCode = source.charCodeAt(Index);
- if (charCode == 101 || charCode == 69) {
- charCode = source.charCodeAt(++Index);
- // Skip past the sign following the exponent, if one is
- // specified.
- if (charCode == 43 || charCode == 45) {
- Index++;
- }
- // Parse the exponential component.
- for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);
- if (position == Index) {
- // Illegal empty exponent.
- abort();
- }
- Index = position;
- }
- // Coerce the parsed value to a JavaScript number.
- return +source.slice(begin, Index);
- }
- // A negative sign may only precede numbers.
- if (isSigned) {
- abort();
- }
- // `true`, `false`, and `null` literals.
- if (source.slice(Index, Index + 4) == "true") {
- Index += 4;
- return true;
- } else if (source.slice(Index, Index + 5) == "false") {
- Index += 5;
- return false;
- } else if (source.slice(Index, Index + 4) == "null") {
- Index += 4;
- return null;
- }
- // Unrecognized token.
- abort();
- }
- }
- // Return the sentinel `$` character if the parser has reached the end
- // of the source string.
- return "$";
- };
-
- // Internal: Parses a JSON `value` token.
- var get = function (value) {
- var results, hasMembers;
- if (value == "$") {
- // Unexpected end of input.
- abort();
- }
- if (typeof value == "string") {
- if ((charIndexBuggy ? value.charAt(0) : value[0]) == "@") {
- // Remove the sentinel `@` character.
- return value.slice(1);
- }
- // Parse object and array literals.
- if (value == "[") {
- // Parses a JSON array, returning a new JavaScript array.
- results = [];
- for (;; hasMembers || (hasMembers = true)) {
- value = lex();
- // A closing square bracket marks the end of the array literal.
- if (value == "]") {
- break;
- }
- // If the array literal contains elements, the current token
- // should be a comma separating the previous element from the
- // next.
- if (hasMembers) {
- if (value == ",") {
- value = lex();
- if (value == "]") {
- // Unexpected trailing `,` in array literal.
- abort();
- }
- } else {
- // A `,` must separate each array element.
- abort();
- }
- }
- // Elisions and leading commas are not permitted.
- if (value == ",") {
- abort();
- }
- results.push(get(value));
- }
- return results;
- } else if (value == "{") {
- // Parses a JSON object, returning a new JavaScript object.
- results = {};
- for (;; hasMembers || (hasMembers = true)) {
- value = lex();
- // A closing curly brace marks the end of the object literal.
- if (value == "}") {
- break;
- }
- // If the object literal contains members, the current token
- // should be a comma separator.
- if (hasMembers) {
- if (value == ",") {
- value = lex();
- if (value == "}") {
- // Unexpected trailing `,` in object literal.
- abort();
- }
- } else {
- // A `,` must separate each object member.
- abort();
- }
- }
- // Leading commas are not permitted, object property names must be
- // double-quoted strings, and a `:` must separate each property
- // name and value.
- if (value == "," || typeof value != "string" || (charIndexBuggy ? value.charAt(0) : value[0]) != "@" || lex() != ":") {
- abort();
- }
- results[value.slice(1)] = get(lex());
- }
- return results;
- }
- // Unexpected token encountered.
- abort();
- }
- return value;
- };
-
- // Internal: Updates a traversed object member.
- var update = function (source, property, callback) {
- var element = walk(source, property, callback);
- if (element === undef) {
- delete source[property];
- } else {
- source[property] = element;
- }
- };
-
- // Internal: Recursively traverses a parsed JSON object, invoking the
- // `callback` function for each value. This is an implementation of the
- // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2.
- var walk = function (source, property, callback) {
- var value = source[property], length;
- if (typeof value == "object" && value) {
- // `forEach` can't be used to traverse an array in Opera <= 8.54
- // because its `Object#hasOwnProperty` implementation returns `false`
- // for array indices (e.g., `![1, 2, 3].hasOwnProperty("0")`).
- if (getClass.call(value) == arrayClass) {
- for (length = value.length; length--;) {
- update(value, length, callback);
- }
- } else {
- forEach(value, function (property) {
- update(value, property, callback);
- });
- }
- }
- return callback.call(source, property, value);
- };
-
- // Public: `JSON.parse`. See ES 5.1 section 15.12.2.
- exports.parse = function (source, callback) {
- var result, value;
- Index = 0;
- Source = "" + source;
- result = get(lex());
- // If a JSON string contains multiple tokens, it is invalid.
- if (lex() != "$") {
- abort();
- }
- // Reset the parser state.
- Index = Source = null;
- return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[""] = result, value), "", callback) : result;
- };
- }
- }
-
- exports["runInContext"] = runInContext;
- return exports;
- }
-
- if (freeExports && !isLoader) {
- // Export for CommonJS environments.
- runInContext(root, freeExports);
- } else {
- // Export for web browsers and JavaScript engines.
- var nativeJSON = root.JSON,
- previousJSON = root["JSON3"],
- isRestored = false;
-
- var JSON3 = runInContext(root, (root["JSON3"] = {
- // Public: Restores the original value of the global `JSON` object and
- // returns a reference to the `JSON3` object.
- "noConflict": function () {
- if (!isRestored) {
- isRestored = true;
- root.JSON = nativeJSON;
- root["JSON3"] = previousJSON;
- nativeJSON = previousJSON = null;
- }
- return JSON3;
- }
- }));
-
- root.JSON = {
- "parse": JSON3.parse,
- "stringify": JSON3.stringify
- };
- }
-
- // Export for asynchronous module loaders.
- if (isLoader) {
- define(function () {
- return JSON3;
- });
- }
-}).call(this);
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],55:[function(require,module,exports){
-/**
- * lodash 3.2.0 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-var baseCopy = require('lodash._basecopy'),
- keys = require('lodash.keys');
-
-/**
- * The base implementation of `_.assign` without support for argument juggling,
- * multiple sources, and `customizer` functions.
- *
- * @private
- * @param {Object} object The destination object.
- * @param {Object} source The source object.
- * @returns {Object} Returns `object`.
- */
-function baseAssign(object, source) {
- return source == null
- ? object
- : baseCopy(source, keys(source), object);
-}
-
-module.exports = baseAssign;
-
-},{"lodash._basecopy":56,"lodash.keys":63}],56:[function(require,module,exports){
-/**
- * lodash 3.0.1 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-
-/**
- * Copies properties of `source` to `object`.
- *
- * @private
- * @param {Object} source The object to copy properties from.
- * @param {Array} props The property names to copy.
- * @param {Object} [object={}] The object to copy properties to.
- * @returns {Object} Returns `object`.
- */
-function baseCopy(source, props, object) {
- object || (object = {});
-
- var index = -1,
- length = props.length;
-
- while (++index < length) {
- var key = props[index];
- object[key] = source[key];
- }
- return object;
-}
-
-module.exports = baseCopy;
-
-},{}],57:[function(require,module,exports){
-/**
- * lodash 3.0.3 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-
-/**
- * The base implementation of `_.create` without support for assigning
- * properties to the created object.
- *
- * @private
- * @param {Object} prototype The object to inherit from.
- * @returns {Object} Returns the new object.
- */
-var baseCreate = (function() {
- function object() {}
- return function(prototype) {
- if (isObject(prototype)) {
- object.prototype = prototype;
- var result = new object;
- object.prototype = undefined;
- }
- return result || {};
- };
-}());
-
-/**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
-function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-module.exports = baseCreate;
-
-},{}],58:[function(require,module,exports){
-/**
- * lodash 3.9.1 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-
-/** `Object#toString` result references. */
-var funcTag = '[object Function]';
-
-/** Used to detect host constructors (Safari > 5). */
-var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
-/**
- * Checks if `value` is object-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- */
-function isObjectLike(value) {
- return !!value && typeof value == 'object';
-}
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to resolve the decompiled source of functions. */
-var fnToString = Function.prototype.toString;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/** Used to detect if a method is native. */
-var reIsNative = RegExp('^' +
- fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
-);
-
-/**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
-function getNative(object, key) {
- var value = object == null ? undefined : object[key];
- return isNative(value) ? value : undefined;
-}
-
-/**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
-function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in older versions of Chrome and Safari which return 'function' for regexes
- // and Safari 8 equivalents which return 'object' for typed array constructors.
- return isObject(value) && objToString.call(value) == funcTag;
-}
-
-/**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
-function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-/**
- * Checks if `value` is a native function.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
-function isNative(value) {
- if (value == null) {
- return false;
- }
- if (isFunction(value)) {
- return reIsNative.test(fnToString.call(value));
- }
- return isObjectLike(value) && reIsHostCtor.test(value);
-}
-
-module.exports = getNative;
-
-},{}],59:[function(require,module,exports){
-/**
- * lodash 3.0.9 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-
-/** Used to detect unsigned integer values. */
-var reIsUint = /^\d+$/;
-
-/**
- * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer)
- * of an array-like value.
- */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/**
- * The base implementation of `_.property` without support for deep paths.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new function.
- */
-function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
-}
-
-/**
- * Gets the "length" property value of `object`.
- *
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {*} Returns the "length" value.
- */
-var getLength = baseProperty('length');
-
-/**
- * Checks if `value` is array-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- */
-function isArrayLike(value) {
- return value != null && isLength(getLength(value));
-}
-
-/**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
-function isIndex(value, length) {
- value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return value > -1 && value % 1 == 0 && value < length;
-}
-
-/**
- * Checks if the provided arguments are from an iteratee call.
- *
- * @private
- * @param {*} value The potential iteratee value argument.
- * @param {*} index The potential iteratee index or key argument.
- * @param {*} object The potential iteratee object argument.
- * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
- */
-function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == 'number'
- ? (isArrayLike(object) && isIndex(index, object.length))
- : (type == 'string' && index in object)) {
- var other = object[index];
- return value === value ? (value === other) : (other !== other);
- }
- return false;
-}
-
-/**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength).
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- */
-function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-}
-
-/**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
-function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-module.exports = isIterateeCall;
-
-},{}],60:[function(require,module,exports){
-/**
- * lodash 3.1.1 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-var baseAssign = require('lodash._baseassign'),
- baseCreate = require('lodash._basecreate'),
- isIterateeCall = require('lodash._isiterateecall');
-
-/**
- * Creates an object that inherits from the given `prototype` object. If a
- * `properties` object is provided its own enumerable properties are assigned
- * to the created object.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} prototype The object to inherit from.
- * @param {Object} [properties] The properties to assign to the object.
- * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
- * @returns {Object} Returns the new object.
- * @example
- *
- * function Shape() {
- * this.x = 0;
- * this.y = 0;
- * }
- *
- * function Circle() {
- * Shape.call(this);
- * }
- *
- * Circle.prototype = _.create(Shape.prototype, {
- * 'constructor': Circle
- * });
- *
- * var circle = new Circle;
- * circle instanceof Circle;
- * // => true
- *
- * circle instanceof Shape;
- * // => true
- */
-function create(prototype, properties, guard) {
- var result = baseCreate(prototype);
- if (guard && isIterateeCall(prototype, properties, guard)) {
- properties = undefined;
- }
- return properties ? baseAssign(result, properties) : result;
-}
-
-module.exports = create;
-
-},{"lodash._baseassign":55,"lodash._basecreate":57,"lodash._isiterateecall":59}],61:[function(require,module,exports){
-/**
- * lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="npm" -o ./`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-
-/** Used as references for various `Number` constants. */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/** `Object#toString` result references. */
-var argsTag = '[object Arguments]',
- funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]';
-
-/** Used for built-in method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objectToString = objectProto.toString;
-
-/** Built-in value references. */
-var propertyIsEnumerable = objectProto.propertyIsEnumerable;
-
-/**
- * Checks if `value` is likely an `arguments` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an `arguments` object,
- * else `false`.
- * @example
- *
- * _.isArguments(function() { return arguments; }());
- * // => true
- *
- * _.isArguments([1, 2, 3]);
- * // => false
- */
-function isArguments(value) {
- // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
- return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
- (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
-}
-
-/**
- * Checks if `value` is array-like. A value is considered array-like if it's
- * not a function and has a `value.length` that's an integer greater than or
- * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- * @example
- *
- * _.isArrayLike([1, 2, 3]);
- * // => true
- *
- * _.isArrayLike(document.body.children);
- * // => true
- *
- * _.isArrayLike('abc');
- * // => true
- *
- * _.isArrayLike(_.noop);
- * // => false
- */
-function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
-}
-
-/**
- * This method is like `_.isArrayLike` except that it also checks if `value`
- * is an object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array-like object,
- * else `false`.
- * @example
- *
- * _.isArrayLikeObject([1, 2, 3]);
- * // => true
- *
- * _.isArrayLikeObject(document.body.children);
- * // => true
- *
- * _.isArrayLikeObject('abc');
- * // => false
- *
- * _.isArrayLikeObject(_.noop);
- * // => false
- */
-function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
-}
-
-/**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
-function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 8-9 which returns 'object' for typed array and other constructors.
- var tag = isObject(value) ? objectToString.call(value) : '';
- return tag == funcTag || tag == genTag;
-}
-
-/**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This method is loosely based on
- * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- * @example
- *
- * _.isLength(3);
- * // => true
- *
- * _.isLength(Number.MIN_VALUE);
- * // => false
- *
- * _.isLength(Infinity);
- * // => false
- *
- * _.isLength('3');
- * // => false
- */
-function isLength(value) {
- return typeof value == 'number' &&
- value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-}
-
-/**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
-function isObject(value) {
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-/**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
-function isObjectLike(value) {
- return !!value && typeof value == 'object';
-}
-
-module.exports = isArguments;
-
-},{}],62:[function(require,module,exports){
-/**
- * lodash 3.0.4 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-
-/** `Object#toString` result references. */
-var arrayTag = '[object Array]',
- funcTag = '[object Function]';
-
-/** Used to detect host constructors (Safari > 5). */
-var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
-/**
- * Checks if `value` is object-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- */
-function isObjectLike(value) {
- return !!value && typeof value == 'object';
-}
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to resolve the decompiled source of functions. */
-var fnToString = Function.prototype.toString;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/**
- * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
- * of values.
- */
-var objToString = objectProto.toString;
-
-/** Used to detect if a method is native. */
-var reIsNative = RegExp('^' +
- fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
-);
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeIsArray = getNative(Array, 'isArray');
-
-/**
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
- * of an array-like value.
- */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
-function getNative(object, key) {
- var value = object == null ? undefined : object[key];
- return isNative(value) ? value : undefined;
-}
-
-/**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- */
-function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-}
-
-/**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(function() { return arguments; }());
- * // => false
- */
-var isArray = nativeIsArray || function(value) {
- return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
-};
-
-/**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
-function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in older versions of Chrome and Safari which return 'function' for regexes
- // and Safari 8 equivalents which return 'object' for typed array constructors.
- return isObject(value) && objToString.call(value) == funcTag;
-}
-
-/**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
-function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-/**
- * Checks if `value` is a native function.
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
- * @example
- *
- * _.isNative(Array.prototype.push);
- * // => true
- *
- * _.isNative(_);
- * // => false
- */
-function isNative(value) {
- if (value == null) {
- return false;
- }
- if (isFunction(value)) {
- return reIsNative.test(fnToString.call(value));
- }
- return isObjectLike(value) && reIsHostCtor.test(value);
-}
-
-module.exports = isArray;
-
-},{}],63:[function(require,module,exports){
-/**
- * lodash 3.1.2 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-var getNative = require('lodash._getnative'),
- isArguments = require('lodash.isarguments'),
- isArray = require('lodash.isarray');
-
-/** Used to detect unsigned integer values. */
-var reIsUint = /^\d+$/;
-
-/** Used for native method references. */
-var objectProto = Object.prototype;
-
-/** Used to check objects for own properties. */
-var hasOwnProperty = objectProto.hasOwnProperty;
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeKeys = getNative(Object, 'keys');
-
-/**
- * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
- * of an array-like value.
- */
-var MAX_SAFE_INTEGER = 9007199254740991;
-
-/**
- * The base implementation of `_.property` without support for deep paths.
- *
- * @private
- * @param {string} key The key of the property to get.
- * @returns {Function} Returns the new function.
- */
-function baseProperty(key) {
- return function(object) {
- return object == null ? undefined : object[key];
- };
-}
-
-/**
- * Gets the "length" property value of `object`.
- *
- * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
- * that affects Safari on at least iOS 8.1-8.3 ARM64.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {*} Returns the "length" value.
- */
-var getLength = baseProperty('length');
-
-/**
- * Checks if `value` is array-like.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
- */
-function isArrayLike(value) {
- return value != null && isLength(getLength(value));
-}
-
-/**
- * Checks if `value` is a valid array-like index.
- *
- * @private
- * @param {*} value The value to check.
- * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
- * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
- */
-function isIndex(value, length) {
- value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return value > -1 && value % 1 == 0 && value < length;
-}
-
-/**
- * Checks if `value` is a valid array-like length.
- *
- * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
- */
-function isLength(value) {
- return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
-}
-
-/**
- * A fallback implementation of `Object.keys` which creates an array of the
- * own enumerable property names of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- */
-function shimKeys(object) {
- var props = keysIn(object),
- propsLength = props.length,
- length = propsLength && object.length;
-
- var allowIndexes = !!length && isLength(length) &&
- (isArray(object) || isArguments(object));
-
- var index = -1,
- result = [];
-
- while (++index < propsLength) {
- var key = props[index];
- if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) {
- result.push(key);
- }
- }
- return result;
-}
-
-/**
- * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
- * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(1);
- * // => false
- */
-function isObject(value) {
- // Avoid a V8 JIT bug in Chrome 19-20.
- // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
-}
-
-/**
- * Creates an array of the own enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects. See the
- * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
- * for more details.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keys(new Foo);
- * // => ['a', 'b'] (iteration order is not guaranteed)
- *
- * _.keys('hi');
- * // => ['0', '1']
- */
-var keys = !nativeKeys ? shimKeys : function(object) {
- var Ctor = object == null ? undefined : object.constructor;
- if ((typeof Ctor == 'function' && Ctor.prototype === object) ||
- (typeof object != 'function' && isArrayLike(object))) {
- return shimKeys(object);
- }
- return isObject(object) ? nativeKeys(object) : [];
-};
-
-/**
- * Creates an array of the own and inherited enumerable property names of `object`.
- *
- * **Note:** Non-object values are coerced to objects.
- *
- * @static
- * @memberOf _
- * @category Object
- * @param {Object} object The object to query.
- * @returns {Array} Returns the array of property names.
- * @example
- *
- * function Foo() {
- * this.a = 1;
- * this.b = 2;
- * }
- *
- * Foo.prototype.c = 3;
- *
- * _.keysIn(new Foo);
- * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
- */
-function keysIn(object) {
- if (object == null) {
- return [];
- }
- if (!isObject(object)) {
- object = Object(object);
- }
- var length = object.length;
- length = (length && isLength(length) &&
- (isArray(object) || isArguments(object)) && length) || 0;
-
- var Ctor = object.constructor,
- index = -1,
- isProto = typeof Ctor == 'function' && Ctor.prototype === object,
- result = Array(length),
- skipIndexes = length > 0;
-
- while (++index < length) {
- result[index] = (index + '');
- }
- for (var key in object) {
- if (!(skipIndexes && isIndex(key, length)) &&
- !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
- result.push(key);
- }
- }
- return result;
-}
-
-module.exports = keys;
-
-},{"lodash._getnative":58,"lodash.isarguments":61,"lodash.isarray":62}],64:[function(require,module,exports){
-(function (process){
-var path = require('path');
-var fs = require('fs');
-var _0777 = parseInt('0777', 8);
-
-module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
-
-function mkdirP (p, opts, f, made) {
- if (typeof opts === 'function') {
- f = opts;
- opts = {};
- }
- else if (!opts || typeof opts !== 'object') {
- opts = { mode: opts };
- }
-
- var mode = opts.mode;
- var xfs = opts.fs || fs;
-
- if (mode === undefined) {
- mode = _0777 & (~process.umask());
- }
- if (!made) made = null;
-
- var cb = f || function () {};
- p = path.resolve(p);
-
- xfs.mkdir(p, mode, function (er) {
- if (!er) {
- made = made || p;
- return cb(null, made);
- }
- switch (er.code) {
- case 'ENOENT':
- mkdirP(path.dirname(p), opts, function (er, made) {
- if (er) cb(er, made);
- else mkdirP(p, opts, cb, made);
- });
- break;
-
- // In the case of any other error, just see if there's a dir
- // there already. If so, then hooray! If not, then something
- // is borked.
- default:
- xfs.stat(p, function (er2, stat) {
- // if the stat fails, then that's super weird.
- // let the original error be the failure reason.
- if (er2 || !stat.isDirectory()) cb(er, made)
- else cb(null, made);
- });
- break;
- }
- });
-}
-
-mkdirP.sync = function sync (p, opts, made) {
- if (!opts || typeof opts !== 'object') {
- opts = { mode: opts };
- }
-
- var mode = opts.mode;
- var xfs = opts.fs || fs;
-
- if (mode === undefined) {
- mode = _0777 & (~process.umask());
- }
- if (!made) made = null;
-
- p = path.resolve(p);
-
- try {
- xfs.mkdirSync(p, mode);
- made = made || p;
- }
- catch (err0) {
- switch (err0.code) {
- case 'ENOENT' :
- made = sync(path.dirname(p), opts, made);
- sync(p, opts, made);
- break;
-
- // In the case of any other error, just see if there's a dir
- // there already. If so, then hooray! If not, then something
- // is borked.
- default:
- var stat;
- try {
- stat = xfs.statSync(p);
- }
- catch (err1) {
- throw err0;
- }
- if (!stat.isDirectory()) throw err0;
- break;
- }
- }
-
- return made;
-};
-
-}).call(this,require('_process'))
-},{"_process":67,"fs":42,"path":42}],65:[function(require,module,exports){
-exports.endianness = function () { return 'LE' };
-
-exports.hostname = function () {
- if (typeof location !== 'undefined') {
- return location.hostname
- }
- else return '';
-};
-
-exports.loadavg = function () { return [] };
-
-exports.uptime = function () { return 0 };
-
-exports.freemem = function () {
- return Number.MAX_VALUE;
-};
-
-exports.totalmem = function () {
- return Number.MAX_VALUE;
-};
-
-exports.cpus = function () { return [] };
-
-exports.type = function () { return 'Browser' };
-
-exports.release = function () {
- if (typeof navigator !== 'undefined') {
- return navigator.appVersion;
- }
- return '';
-};
-
-exports.networkInterfaces
-= exports.getNetworkInterfaces
-= function () { return {} };
-
-exports.arch = function () { return 'javascript' };
-
-exports.platform = function () { return 'browser' };
-
-exports.tmpdir = exports.tmpDir = function () {
- return '/tmp';
-};
-
-exports.EOL = '\n';
-
-},{}],66:[function(require,module,exports){
-(function (process){
-'use strict';
-
-if (!process.version ||
- process.version.indexOf('v0.') === 0 ||
- process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
- module.exports = nextTick;
-} else {
- module.exports = process.nextTick;
-}
-
-function nextTick(fn, arg1, arg2, arg3) {
- if (typeof fn !== 'function') {
- throw new TypeError('"callback" argument must be a function');
- }
- var len = arguments.length;
- var args, i;
- switch (len) {
- case 0:
- case 1:
- return process.nextTick(fn);
- case 2:
- return process.nextTick(function afterTickOne() {
- fn.call(null, arg1);
- });
- case 3:
- return process.nextTick(function afterTickTwo() {
- fn.call(null, arg1, arg2);
- });
- case 4:
- return process.nextTick(function afterTickThree() {
- fn.call(null, arg1, arg2, arg3);
- });
- default:
- args = new Array(len - 1);
- i = 0;
- while (i < args.length) {
- args[i++] = arguments[i];
- }
- return process.nextTick(function afterTick() {
- fn.apply(null, args);
- });
- }
-}
-
-}).call(this,require('_process'))
-},{"_process":67}],67:[function(require,module,exports){
-// shim for using process in browser
-var process = module.exports = {};
-
-// cached from whatever global is present so that test runners that stub it
-// don't break things. But we need to wrap it in a try catch in case it is
-// wrapped in strict mode code which doesn't define any globals. It's inside a
-// function because try/catches deoptimize in certain engines.
-
-var cachedSetTimeout;
-var cachedClearTimeout;
-
-function defaultSetTimout() {
- throw new Error('setTimeout has not been defined');
-}
-function defaultClearTimeout () {
- throw new Error('clearTimeout has not been defined');
-}
-(function () {
- try {
- if (typeof setTimeout === 'function') {
- cachedSetTimeout = setTimeout;
- } else {
- cachedSetTimeout = defaultSetTimout;
- }
- } catch (e) {
- cachedSetTimeout = defaultSetTimout;
- }
- try {
- if (typeof clearTimeout === 'function') {
- cachedClearTimeout = clearTimeout;
- } else {
- cachedClearTimeout = defaultClearTimeout;
- }
- } catch (e) {
- cachedClearTimeout = defaultClearTimeout;
- }
-} ())
-function runTimeout(fun) {
- if (cachedSetTimeout === setTimeout) {
- //normal enviroments in sane situations
- return setTimeout(fun, 0);
- }
- // if setTimeout wasn't available but was latter defined
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
- cachedSetTimeout = setTimeout;
- return setTimeout(fun, 0);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedSetTimeout(fun, 0);
- } catch(e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedSetTimeout.call(null, fun, 0);
- } catch(e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
- return cachedSetTimeout.call(this, fun, 0);
- }
- }
-
-
-}
-function runClearTimeout(marker) {
- if (cachedClearTimeout === clearTimeout) {
- //normal enviroments in sane situations
- return clearTimeout(marker);
- }
- // if clearTimeout wasn't available but was latter defined
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
- cachedClearTimeout = clearTimeout;
- return clearTimeout(marker);
- }
- try {
- // when when somebody has screwed with setTimeout but no I.E. maddness
- return cachedClearTimeout(marker);
- } catch (e){
- try {
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
- return cachedClearTimeout.call(null, marker);
- } catch (e){
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
- return cachedClearTimeout.call(this, marker);
- }
- }
-
-
-
-}
-var queue = [];
-var draining = false;
-var currentQueue;
-var queueIndex = -1;
-
-function cleanUpNextTick() {
- if (!draining || !currentQueue) {
- return;
- }
- draining = false;
- if (currentQueue.length) {
- queue = currentQueue.concat(queue);
- } else {
- queueIndex = -1;
- }
- if (queue.length) {
- drainQueue();
- }
-}
-
-function drainQueue() {
- if (draining) {
- return;
- }
- var timeout = runTimeout(cleanUpNextTick);
- draining = true;
-
- var len = queue.length;
- while(len) {
- currentQueue = queue;
- queue = [];
- while (++queueIndex < len) {
- if (currentQueue) {
- currentQueue[queueIndex].run();
- }
- }
- queueIndex = -1;
- len = queue.length;
- }
- currentQueue = null;
- draining = false;
- runClearTimeout(timeout);
-}
-
-process.nextTick = function (fun) {
- var args = new Array(arguments.length - 1);
- if (arguments.length > 1) {
- for (var i = 1; i < arguments.length; i++) {
- args[i - 1] = arguments[i];
- }
- }
- queue.push(new Item(fun, args));
- if (queue.length === 1 && !draining) {
- runTimeout(drainQueue);
- }
-};
-
-// v8 likes predictible objects
-function Item(fun, array) {
- this.fun = fun;
- this.array = array;
-}
-Item.prototype.run = function () {
- this.fun.apply(null, this.array);
-};
-process.title = 'browser';
-process.browser = true;
-process.env = {};
-process.argv = [];
-process.version = ''; // empty string to avoid regexp issues
-process.versions = {};
-
-function noop() {}
-
-process.on = noop;
-process.addListener = noop;
-process.once = noop;
-process.off = noop;
-process.removeListener = noop;
-process.removeAllListeners = noop;
-process.emit = noop;
-
-process.binding = function (name) {
- throw new Error('process.binding is not supported');
-};
-
-process.cwd = function () { return '/' };
-process.chdir = function (dir) {
- throw new Error('process.chdir is not supported');
-};
-process.umask = function() { return 0; };
-
-},{}],68:[function(require,module,exports){
-module.exports = require("./lib/_stream_duplex.js")
-
-},{"./lib/_stream_duplex.js":69}],69:[function(require,module,exports){
-// a duplex stream is just a stream that is both readable and writable.
-// Since JS doesn't have multiple prototypal inheritance, this class
-// prototypally inherits from Readable, and then parasitically from
-// Writable.
-
-'use strict';
-
-/*<replacement>*/
-
-var objectKeys = Object.keys || function (obj) {
- var keys = [];
- for (var key in obj) {
- keys.push(key);
- }return keys;
-};
-/*</replacement>*/
-
-module.exports = Duplex;
-
-/*<replacement>*/
-var processNextTick = require('process-nextick-args');
-/*</replacement>*/
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-var Readable = require('./_stream_readable');
-var Writable = require('./_stream_writable');
-
-util.inherits(Duplex, Readable);
-
-var keys = objectKeys(Writable.prototype);
-for (var v = 0; v < keys.length; v++) {
- var method = keys[v];
- if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
-}
-
-function Duplex(options) {
- if (!(this instanceof Duplex)) return new Duplex(options);
-
- Readable.call(this, options);
- Writable.call(this, options);
-
- if (options && options.readable === false) this.readable = false;
-
- if (options && options.writable === false) this.writable = false;
-
- this.allowHalfOpen = true;
- if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
-
- this.once('end', onend);
-}
-
-// the no-half-open enforcer
-function onend() {
- // if we allow half-open state, or if the writable side ended,
- // then we're ok.
- if (this.allowHalfOpen || this._writableState.ended) return;
-
- // no more data can be written.
- // But allow more writes to happen in this tick.
- processNextTick(onEndNT, this);
-}
-
-function onEndNT(self) {
- self.end();
-}
-
-function forEach(xs, f) {
- for (var i = 0, l = xs.length; i < l; i++) {
- f(xs[i], i);
- }
-}
-},{"./_stream_readable":71,"./_stream_writable":73,"core-util-is":45,"inherits":51,"process-nextick-args":66}],70:[function(require,module,exports){
-// a passthrough stream.
-// basically just the most minimal sort of Transform stream.
-// Every written chunk gets output as-is.
-
-'use strict';
-
-module.exports = PassThrough;
-
-var Transform = require('./_stream_transform');
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-util.inherits(PassThrough, Transform);
-
-function PassThrough(options) {
- if (!(this instanceof PassThrough)) return new PassThrough(options);
-
- Transform.call(this, options);
-}
-
-PassThrough.prototype._transform = function (chunk, encoding, cb) {
- cb(null, chunk);
-};
-},{"./_stream_transform":72,"core-util-is":45,"inherits":51}],71:[function(require,module,exports){
-(function (process){
-'use strict';
-
-module.exports = Readable;
-
-/*<replacement>*/
-var processNextTick = require('process-nextick-args');
-/*</replacement>*/
-
-/*<replacement>*/
-var isArray = require('isarray');
-/*</replacement>*/
-
-Readable.ReadableState = ReadableState;
-
-/*<replacement>*/
-var EE = require('events').EventEmitter;
-
-var EElistenerCount = function (emitter, type) {
- return emitter.listeners(type).length;
-};
-/*</replacement>*/
-
-/*<replacement>*/
-var Stream;
-(function () {
- try {
- Stream = require('st' + 'ream');
- } catch (_) {} finally {
- if (!Stream) Stream = require('events').EventEmitter;
- }
-})();
-/*</replacement>*/
-
-var Buffer = require('buffer').Buffer;
-/*<replacement>*/
-var bufferShim = require('buffer-shims');
-/*</replacement>*/
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-/*<replacement>*/
-var debugUtil = require('util');
-var debug = void 0;
-if (debugUtil && debugUtil.debuglog) {
- debug = debugUtil.debuglog('stream');
-} else {
- debug = function () {};
-}
-/*</replacement>*/
-
-var BufferList = require('./internal/streams/BufferList');
-var StringDecoder;
-
-util.inherits(Readable, Stream);
-
-function prependListener(emitter, event, fn) {
- if (typeof emitter.prependListener === 'function') {
- return emitter.prependListener(event, fn);
- } else {
- // This is a hack to make sure that our error handler is attached before any
- // userland ones. NEVER DO THIS. This is here only because this code needs
- // to continue to work with older versions of Node.js that do not include
- // the prependListener() method. The goal is to eventually remove this hack.
- if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
- }
-}
-
-var Duplex;
-function ReadableState(options, stream) {
- Duplex = Duplex || require('./_stream_duplex');
-
- options = options || {};
-
- // object stream flag. Used to make read(n) ignore n and to
- // make all the buffer merging and length checks go away
- this.objectMode = !!options.objectMode;
-
- if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
-
- // the point at which it stops calling _read() to fill the buffer
- // Note: 0 is a valid value, means "don't call _read preemptively ever"
- var hwm = options.highWaterMark;
- var defaultHwm = this.objectMode ? 16 : 16 * 1024;
- this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
-
- // cast to ints.
- this.highWaterMark = ~ ~this.highWaterMark;
-
- // A linked list is used to store data chunks instead of an array because the
- // linked list can remove elements from the beginning faster than
- // array.shift()
- this.buffer = new BufferList();
- this.length = 0;
- this.pipes = null;
- this.pipesCount = 0;
- this.flowing = null;
- this.ended = false;
- this.endEmitted = false;
- this.reading = false;
-
- // a flag to be able to tell if the onwrite cb is called immediately,
- // or on a later tick. We set this to true at first, because any
- // actions that shouldn't happen until "later" should generally also
- // not happen before the first write call.
- this.sync = true;
-
- // whenever we return null, then we set a flag to say
- // that we're awaiting a 'readable' event emission.
- this.needReadable = false;
- this.emittedReadable = false;
- this.readableListening = false;
- this.resumeScheduled = false;
-
- // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8';
-
- // when piping, we only care about 'readable' events that happen
- // after read()ing all the bytes and not getting any pushback.
- this.ranOut = false;
-
- // the number of writers that are awaiting a drain event in .pipe()s
- this.awaitDrain = 0;
-
- // if true, a maybeReadMore has been scheduled
- this.readingMore = false;
-
- this.decoder = null;
- this.encoding = null;
- if (options.encoding) {
- if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
- this.decoder = new StringDecoder(options.encoding);
- this.encoding = options.encoding;
- }
-}
-
-var Duplex;
-function Readable(options) {
- Duplex = Duplex || require('./_stream_duplex');
-
- if (!(this instanceof Readable)) return new Readable(options);
-
- this._readableState = new ReadableState(options, this);
-
- // legacy
- this.readable = true;
-
- if (options && typeof options.read === 'function') this._read = options.read;
-
- Stream.call(this);
-}
-
-// Manually shove something into the read() buffer.
-// This returns true if the highWaterMark has not been hit yet,
-// similar to how Writable.write() returns true if you should
-// write() some more.
-Readable.prototype.push = function (chunk, encoding) {
- var state = this._readableState;
-
- if (!state.objectMode && typeof chunk === 'string') {
- encoding = encoding || state.defaultEncoding;
- if (encoding !== state.encoding) {
- chunk = bufferShim.from(chunk, encoding);
- encoding = '';
- }
- }
-
- return readableAddChunk(this, state, chunk, encoding, false);
-};
-
-// Unshift should *always* be something directly out of read()
-Readable.prototype.unshift = function (chunk) {
- var state = this._readableState;
- return readableAddChunk(this, state, chunk, '', true);
-};
-
-Readable.prototype.isPaused = function () {
- return this._readableState.flowing === false;
-};
-
-function readableAddChunk(stream, state, chunk, encoding, addToFront) {
- var er = chunkInvalid(state, chunk);
- if (er) {
- stream.emit('error', er);
- } else if (chunk === null) {
- state.reading = false;
- onEofChunk(stream, state);
- } else if (state.objectMode || chunk && chunk.length > 0) {
- if (state.ended && !addToFront) {
- var e = new Error('stream.push() after EOF');
- stream.emit('error', e);
- } else if (state.endEmitted && addToFront) {
- var _e = new Error('stream.unshift() after end event');
- stream.emit('error', _e);
- } else {
- var skipAdd;
- if (state.decoder && !addToFront && !encoding) {
- chunk = state.decoder.write(chunk);
- skipAdd = !state.objectMode && chunk.length === 0;
- }
-
- if (!addToFront) state.reading = false;
-
- // Don't add to the buffer if we've decoded to an empty string chunk and
- // we're not in object mode
- if (!skipAdd) {
- // if we want the data now, just emit it.
- if (state.flowing && state.length === 0 && !state.sync) {
- stream.emit('data', chunk);
- stream.read(0);
- } else {
- // update the buffer info.
- state.length += state.objectMode ? 1 : chunk.length;
- if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
-
- if (state.needReadable) emitReadable(stream);
- }
- }
-
- maybeReadMore(stream, state);
- }
- } else if (!addToFront) {
- state.reading = false;
- }
-
- return needMoreData(state);
-}
-
-// if it's past the high water mark, we can push in some more.
-// Also, if we have no data yet, we can stand some
-// more bytes. This is to work around cases where hwm=0,
-// such as the repl. Also, if the push() triggered a
-// readable event, and the user called read(largeNumber) such that
-// needReadable was set, then we ought to push more, so that another
-// 'readable' event will be triggered.
-function needMoreData(state) {
- return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
-}
-
-// backwards compatibility.
-Readable.prototype.setEncoding = function (enc) {
- if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
- this._readableState.decoder = new StringDecoder(enc);
- this._readableState.encoding = enc;
- return this;
-};
-
-// Don't raise the hwm > 8MB
-var MAX_HWM = 0x800000;
-function computeNewHighWaterMark(n) {
- if (n >= MAX_HWM) {
- n = MAX_HWM;
- } else {
- // Get the next highest power of 2 to prevent increasing hwm excessively in
- // tiny amounts
- n--;
- n |= n >>> 1;
- n |= n >>> 2;
- n |= n >>> 4;
- n |= n >>> 8;
- n |= n >>> 16;
- n++;
- }
- return n;
-}
-
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function howMuchToRead(n, state) {
- if (n <= 0 || state.length === 0 && state.ended) return 0;
- if (state.objectMode) return 1;
- if (n !== n) {
- // Only flow one buffer at a time
- if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
- }
- // If we're asking for more than the current hwm, then raise the hwm.
- if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
- if (n <= state.length) return n;
- // Don't have enough
- if (!state.ended) {
- state.needReadable = true;
- return 0;
- }
- return state.length;
-}
-
-// you can override either this method, or the async _read(n) below.
-Readable.prototype.read = function (n) {
- debug('read', n);
- n = parseInt(n, 10);
- var state = this._readableState;
- var nOrig = n;
-
- if (n !== 0) state.emittedReadable = false;
-
- // if we're doing read(0) to trigger a readable event, but we
- // already have a bunch of data in the buffer, then just trigger
- // the 'readable' event and move on.
- if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
- debug('read: emitReadable', state.length, state.ended);
- if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
- return null;
- }
-
- n = howMuchToRead(n, state);
-
- // if we've ended, and we're now clear, then finish it up.
- if (n === 0 && state.ended) {
- if (state.length === 0) endReadable(this);
- return null;
- }
-
- // All the actual chunk generation logic needs to be
- // *below* the call to _read. The reason is that in certain
- // synthetic stream cases, such as passthrough streams, _read
- // may be a completely synchronous operation which may change
- // the state of the read buffer, providing enough data when
- // before there was *not* enough.
- //
- // So, the steps are:
- // 1. Figure out what the state of things will be after we do
- // a read from the buffer.
- //
- // 2. If that resulting state will trigger a _read, then call _read.
- // Note that this may be asynchronous, or synchronous. Yes, it is
- // deeply ugly to write APIs this way, but that still doesn't mean
- // that the Readable class should behave improperly, as streams are
- // designed to be sync/async agnostic.
- // Take note if the _read call is sync or async (ie, if the read call
- // has returned yet), so that we know whether or not it's safe to emit
- // 'readable' etc.
- //
- // 3. Actually pull the requested chunks out of the buffer and return.
-
- // if we need a readable event, then we need to do some reading.
- var doRead = state.needReadable;
- debug('need readable', doRead);
-
- // if we currently have less than the highWaterMark, then also read some
- if (state.length === 0 || state.length - n < state.highWaterMark) {
- doRead = true;
- debug('length less than watermark', doRead);
- }
-
- // however, if we've ended, then there's no point, and if we're already
- // reading, then it's unnecessary.
- if (state.ended || state.reading) {
- doRead = false;
- debug('reading or ended', doRead);
- } else if (doRead) {
- debug('do read');
- state.reading = true;
- state.sync = true;
- // if the length is currently zero, then we *need* a readable event.
- if (state.length === 0) state.needReadable = true;
- // call internal read method
- this._read(state.highWaterMark);
- state.sync = false;
- // If _read pushed data synchronously, then `reading` will be false,
- // and we need to re-evaluate how much data we can return to the user.
- if (!state.reading) n = howMuchToRead(nOrig, state);
- }
-
- var ret;
- if (n > 0) ret = fromList(n, state);else ret = null;
-
- if (ret === null) {
- state.needReadable = true;
- n = 0;
- } else {
- state.length -= n;
- }
-
- if (state.length === 0) {
- // If we have nothing in the buffer, then we want to know
- // as soon as we *do* get something into the buffer.
- if (!state.ended) state.needReadable = true;
-
- // If we tried to read() past the EOF, then emit end on the next tick.
- if (nOrig !== n && state.ended) endReadable(this);
- }
-
- if (ret !== null) this.emit('data', ret);
-
- return ret;
-};
-
-function chunkInvalid(state, chunk) {
- var er = null;
- if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
- er = new TypeError('Invalid non-string/buffer chunk');
- }
- return er;
-}
-
-function onEofChunk(stream, state) {
- if (state.ended) return;
- if (state.decoder) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) {
- state.buffer.push(chunk);
- state.length += state.objectMode ? 1 : chunk.length;
- }
- }
- state.ended = true;
-
- // emit 'readable' now to make sure it gets picked up.
- emitReadable(stream);
-}
-
-// Don't emit readable right away in sync mode, because this can trigger
-// another read() call => stack overflow. This way, it might trigger
-// a nextTick recursion warning, but that's not so bad.
-function emitReadable(stream) {
- var state = stream._readableState;
- state.needReadable = false;
- if (!state.emittedReadable) {
- debug('emitReadable', state.flowing);
- state.emittedReadable = true;
- if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
- }
-}
-
-function emitReadable_(stream) {
- debug('emit readable');
- stream.emit('readable');
- flow(stream);
-}
-
-// at this point, the user has presumably seen the 'readable' event,
-// and called read() to consume some data. that may have triggered
-// in turn another _read(n) call, in which case reading = true if
-// it's in progress.
-// However, if we're not ended, or reading, and the length < hwm,
-// then go ahead and try to read some more preemptively.
-function maybeReadMore(stream, state) {
- if (!state.readingMore) {
- state.readingMore = true;
- processNextTick(maybeReadMore_, stream, state);
- }
-}
-
-function maybeReadMore_(stream, state) {
- var len = state.length;
- while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
- debug('maybeReadMore read 0');
- stream.read(0);
- if (len === state.length)
- // didn't get any data, stop spinning.
- break;else len = state.length;
- }
- state.readingMore = false;
-}
-
-// abstract method. to be overridden in specific implementation classes.
-// call cb(er, data) where data is <= n in length.
-// for virtual (non-string, non-buffer) streams, "length" is somewhat
-// arbitrary, and perhaps not very meaningful.
-Readable.prototype._read = function (n) {
- this.emit('error', new Error('not implemented'));
-};
-
-Readable.prototype.pipe = function (dest, pipeOpts) {
- var src = this;
- var state = this._readableState;
-
- switch (state.pipesCount) {
- case 0:
- state.pipes = dest;
- break;
- case 1:
- state.pipes = [state.pipes, dest];
- break;
- default:
- state.pipes.push(dest);
- break;
- }
- state.pipesCount += 1;
- debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
-
- var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
-
- var endFn = doEnd ? onend : cleanup;
- if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
-
- dest.on('unpipe', onunpipe);
- function onunpipe(readable) {
- debug('onunpipe');
- if (readable === src) {
- cleanup();
- }
- }
-
- function onend() {
- debug('onend');
- dest.end();
- }
-
- // when the dest drains, it reduces the awaitDrain counter
- // on the source. This would be more elegant with a .once()
- // handler in flow(), but adding and removing repeatedly is
- // too slow.
- var ondrain = pipeOnDrain(src);
- dest.on('drain', ondrain);
-
- var cleanedUp = false;
- function cleanup() {
- debug('cleanup');
- // cleanup event handlers once the pipe is broken
- dest.removeListener('close', onclose);
- dest.removeListener('finish', onfinish);
- dest.removeListener('drain', ondrain);
- dest.removeListener('error', onerror);
- dest.removeListener('unpipe', onunpipe);
- src.removeListener('end', onend);
- src.removeListener('end', cleanup);
- src.removeListener('data', ondata);
-
- cleanedUp = true;
-
- // if the reader is waiting for a drain event from this
- // specific writer, then it would cause it to never start
- // flowing again.
- // So, if this is awaiting a drain, then we just call it now.
- // If we don't know, then assume that we are waiting for one.
- if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
- }
-
- // If the user pushes more data while we're writing to dest then we'll end up
- // in ondata again. However, we only want to increase awaitDrain once because
- // dest will only emit one 'drain' event for the multiple writes.
- // => Introduce a guard on increasing awaitDrain.
- var increasedAwaitDrain = false;
- src.on('data', ondata);
- function ondata(chunk) {
- debug('ondata');
- increasedAwaitDrain = false;
- var ret = dest.write(chunk);
- if (false === ret && !increasedAwaitDrain) {
- // If the user unpiped during `dest.write()`, it is possible
- // to get stuck in a permanently paused state if that write
- // also returned false.
- // => Check whether `dest` is still a piping destination.
- if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
- debug('false write response, pause', src._readableState.awaitDrain);
- src._readableState.awaitDrain++;
- increasedAwaitDrain = true;
- }
- src.pause();
- }
- }
-
- // if the dest has an error, then stop piping into it.
- // however, don't suppress the throwing behavior for this.
- function onerror(er) {
- debug('onerror', er);
- unpipe();
- dest.removeListener('error', onerror);
- if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
- }
-
- // Make sure our error handler is attached before userland ones.
- prependListener(dest, 'error', onerror);
-
- // Both close and finish should trigger unpipe, but only once.
- function onclose() {
- dest.removeListener('finish', onfinish);
- unpipe();
- }
- dest.once('close', onclose);
- function onfinish() {
- debug('onfinish');
- dest.removeListener('close', onclose);
- unpipe();
- }
- dest.once('finish', onfinish);
-
- function unpipe() {
- debug('unpipe');
- src.unpipe(dest);
- }
-
- // tell the dest that it's being piped to
- dest.emit('pipe', src);
-
- // start the flow if it hasn't been started already.
- if (!state.flowing) {
- debug('pipe resume');
- src.resume();
- }
-
- return dest;
-};
-
-function pipeOnDrain(src) {
- return function () {
- var state = src._readableState;
- debug('pipeOnDrain', state.awaitDrain);
- if (state.awaitDrain) state.awaitDrain--;
- if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
- state.flowing = true;
- flow(src);
- }
- };
-}
-
-Readable.prototype.unpipe = function (dest) {
- var state = this._readableState;
-
- // if we're not piping anywhere, then do nothing.
- if (state.pipesCount === 0) return this;
-
- // just one destination. most common case.
- if (state.pipesCount === 1) {
- // passed in one, but it's not the right one.
- if (dest && dest !== state.pipes) return this;
-
- if (!dest) dest = state.pipes;
-
- // got a match.
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
- if (dest) dest.emit('unpipe', this);
- return this;
- }
-
- // slow case. multiple pipe destinations.
-
- if (!dest) {
- // remove all.
- var dests = state.pipes;
- var len = state.pipesCount;
- state.pipes = null;
- state.pipesCount = 0;
- state.flowing = false;
-
- for (var _i = 0; _i < len; _i++) {
- dests[_i].emit('unpipe', this);
- }return this;
- }
-
- // try to find the right one.
- var i = indexOf(state.pipes, dest);
- if (i === -1) return this;
-
- state.pipes.splice(i, 1);
- state.pipesCount -= 1;
- if (state.pipesCount === 1) state.pipes = state.pipes[0];
-
- dest.emit('unpipe', this);
-
- return this;
-};
-
-// set up data events if they are asked for
-// Ensure readable listeners eventually get something
-Readable.prototype.on = function (ev, fn) {
- var res = Stream.prototype.on.call(this, ev, fn);
-
- if (ev === 'data') {
- // Start flowing on next tick if stream isn't explicitly paused
- if (this._readableState.flowing !== false) this.resume();
- } else if (ev === 'readable') {
- var state = this._readableState;
- if (!state.endEmitted && !state.readableListening) {
- state.readableListening = state.needReadable = true;
- state.emittedReadable = false;
- if (!state.reading) {
- processNextTick(nReadingNextTick, this);
- } else if (state.length) {
- emitReadable(this, state);
- }
- }
- }
-
- return res;
-};
-Readable.prototype.addListener = Readable.prototype.on;
-
-function nReadingNextTick(self) {
- debug('readable nexttick read 0');
- self.read(0);
-}
-
-// pause() and resume() are remnants of the legacy readable stream API
-// If the user uses them, then switch into old mode.
-Readable.prototype.resume = function () {
- var state = this._readableState;
- if (!state.flowing) {
- debug('resume');
- state.flowing = true;
- resume(this, state);
- }
- return this;
-};
-
-function resume(stream, state) {
- if (!state.resumeScheduled) {
- state.resumeScheduled = true;
- processNextTick(resume_, stream, state);
- }
-}
-
-function resume_(stream, state) {
- if (!state.reading) {
- debug('resume read 0');
- stream.read(0);
- }
-
- state.resumeScheduled = false;
- state.awaitDrain = 0;
- stream.emit('resume');
- flow(stream);
- if (state.flowing && !state.reading) stream.read(0);
-}
-
-Readable.prototype.pause = function () {
- debug('call pause flowing=%j', this._readableState.flowing);
- if (false !== this._readableState.flowing) {
- debug('pause');
- this._readableState.flowing = false;
- this.emit('pause');
- }
- return this;
-};
-
-function flow(stream) {
- var state = stream._readableState;
- debug('flow', state.flowing);
- while (state.flowing && stream.read() !== null) {}
-}
-
-// wrap an old-style stream as the async data source.
-// This is *not* part of the readable stream interface.
-// It is an ugly unfortunate mess of history.
-Readable.prototype.wrap = function (stream) {
- var state = this._readableState;
- var paused = false;
-
- var self = this;
- stream.on('end', function () {
- debug('wrapped end');
- if (state.decoder && !state.ended) {
- var chunk = state.decoder.end();
- if (chunk && chunk.length) self.push(chunk);
- }
-
- self.push(null);
- });
-
- stream.on('data', function (chunk) {
- debug('wrapped data');
- if (state.decoder) chunk = state.decoder.write(chunk);
-
- // don't skip over falsy values in objectMode
- if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
-
- var ret = self.push(chunk);
- if (!ret) {
- paused = true;
- stream.pause();
- }
- });
-
- // proxy all the other methods.
- // important when wrapping filters and duplexes.
- for (var i in stream) {
- if (this[i] === undefined && typeof stream[i] === 'function') {
- this[i] = function (method) {
- return function () {
- return stream[method].apply(stream, arguments);
- };
- }(i);
- }
- }
-
- // proxy certain important events.
- var events = ['error', 'close', 'destroy', 'pause', 'resume'];
- forEach(events, function (ev) {
- stream.on(ev, self.emit.bind(self, ev));
- });
-
- // when we try to consume some more bytes, simply unpause the
- // underlying stream.
- self._read = function (n) {
- debug('wrapped _read', n);
- if (paused) {
- paused = false;
- stream.resume();
- }
- };
-
- return self;
-};
-
-// exposed for testing purposes only.
-Readable._fromList = fromList;
-
-// Pluck off n bytes from an array of buffers.
-// Length is the combined lengths of all the buffers in the list.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function fromList(n, state) {
- // nothing buffered
- if (state.length === 0) return null;
-
- var ret;
- if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
- // read it all, truncate the list
- if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
- state.buffer.clear();
- } else {
- // read part of list
- ret = fromListPartial(n, state.buffer, state.decoder);
- }
-
- return ret;
-}
-
-// Extracts only enough buffered data to satisfy the amount requested.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function fromListPartial(n, list, hasStrings) {
- var ret;
- if (n < list.head.data.length) {
- // slice is the same for buffers and strings
- ret = list.head.data.slice(0, n);
- list.head.data = list.head.data.slice(n);
- } else if (n === list.head.data.length) {
- // first chunk is a perfect match
- ret = list.shift();
- } else {
- // result spans more than one buffer
- ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
- }
- return ret;
-}
-
-// Copies a specified amount of characters from the list of buffered data
-// chunks.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function copyFromBufferString(n, list) {
- var p = list.head;
- var c = 1;
- var ret = p.data;
- n -= ret.length;
- while (p = p.next) {
- var str = p.data;
- var nb = n > str.length ? str.length : n;
- if (nb === str.length) ret += str;else ret += str.slice(0, n);
- n -= nb;
- if (n === 0) {
- if (nb === str.length) {
- ++c;
- if (p.next) list.head = p.next;else list.head = list.tail = null;
- } else {
- list.head = p;
- p.data = str.slice(nb);
- }
- break;
- }
- ++c;
- }
- list.length -= c;
- return ret;
-}
-
-// Copies a specified amount of bytes from the list of buffered data chunks.
-// This function is designed to be inlinable, so please take care when making
-// changes to the function body.
-function copyFromBuffer(n, list) {
- var ret = bufferShim.allocUnsafe(n);
- var p = list.head;
- var c = 1;
- p.data.copy(ret);
- n -= p.data.length;
- while (p = p.next) {
- var buf = p.data;
- var nb = n > buf.length ? buf.length : n;
- buf.copy(ret, ret.length - n, 0, nb);
- n -= nb;
- if (n === 0) {
- if (nb === buf.length) {
- ++c;
- if (p.next) list.head = p.next;else list.head = list.tail = null;
- } else {
- list.head = p;
- p.data = buf.slice(nb);
- }
- break;
- }
- ++c;
- }
- list.length -= c;
- return ret;
-}
-
-function endReadable(stream) {
- var state = stream._readableState;
-
- // If we get here before consuming all the bytes, then that is a
- // bug in node. Should never happen.
- if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
-
- if (!state.endEmitted) {
- state.ended = true;
- processNextTick(endReadableNT, state, stream);
- }
-}
-
-function endReadableNT(state, stream) {
- // Check that we didn't get one last unshift.
- if (!state.endEmitted && state.length === 0) {
- state.endEmitted = true;
- stream.readable = false;
- stream.emit('end');
- }
-}
-
-function forEach(xs, f) {
- for (var i = 0, l = xs.length; i < l; i++) {
- f(xs[i], i);
- }
-}
-
-function indexOf(xs, x) {
- for (var i = 0, l = xs.length; i < l; i++) {
- if (xs[i] === x) return i;
- }
- return -1;
-}
-}).call(this,require('_process'))
-},{"./_stream_duplex":69,"./internal/streams/BufferList":74,"_process":67,"buffer":44,"buffer-shims":43,"core-util-is":45,"events":48,"inherits":51,"isarray":53,"process-nextick-args":66,"string_decoder/":80,"util":40}],72:[function(require,module,exports){
-// a transform stream is a readable/writable stream where you do
-// something with the data. Sometimes it's called a "filter",
-// but that's not a great name for it, since that implies a thing where
-// some bits pass through, and others are simply ignored. (That would
-// be a valid example of a transform, of course.)
-//
-// While the output is causally related to the input, it's not a
-// necessarily symmetric or synchronous transformation. For example,
-// a zlib stream might take multiple plain-text writes(), and then
-// emit a single compressed chunk some time in the future.
-//
-// Here's how this works:
-//
-// The Transform stream has all the aspects of the readable and writable
-// stream classes. When you write(chunk), that calls _write(chunk,cb)
-// internally, and returns false if there's a lot of pending writes
-// buffered up. When you call read(), that calls _read(n) until
-// there's enough pending readable data buffered up.
-//
-// In a transform stream, the written data is placed in a buffer. When
-// _read(n) is called, it transforms the queued up data, calling the
-// buffered _write cb's as it consumes chunks. If consuming a single
-// written chunk would result in multiple output chunks, then the first
-// outputted bit calls the readcb, and subsequent chunks just go into
-// the read buffer, and will cause it to emit 'readable' if necessary.
-//
-// This way, back-pressure is actually determined by the reading side,
-// since _read has to be called to start processing a new chunk. However,
-// a pathological inflate type of transform can cause excessive buffering
-// here. For example, imagine a stream where every byte of input is
-// interpreted as an integer from 0-255, and then results in that many
-// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
-// 1kb of data being output. In this case, you could write a very small
-// amount of input, and end up with a very large amount of output. In
-// such a pathological inflating mechanism, there'd be no way to tell
-// the system to stop doing the transform. A single 4MB write could
-// cause the system to run out of memory.
-//
-// However, even in such a pathological case, only a single written chunk
-// would be consumed, and then the rest would wait (un-transformed) until
-// the results of the previous transformed chunk were consumed.
-
-'use strict';
-
-module.exports = Transform;
-
-var Duplex = require('./_stream_duplex');
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-util.inherits(Transform, Duplex);
-
-function TransformState(stream) {
- this.afterTransform = function (er, data) {
- return afterTransform(stream, er, data);
- };
-
- this.needTransform = false;
- this.transforming = false;
- this.writecb = null;
- this.writechunk = null;
- this.writeencoding = null;
-}
-
-function afterTransform(stream, er, data) {
- var ts = stream._transformState;
- ts.transforming = false;
-
- var cb = ts.writecb;
-
- if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));
-
- ts.writechunk = null;
- ts.writecb = null;
-
- if (data !== null && data !== undefined) stream.push(data);
-
- cb(er);
-
- var rs = stream._readableState;
- rs.reading = false;
- if (rs.needReadable || rs.length < rs.highWaterMark) {
- stream._read(rs.highWaterMark);
- }
-}
-
-function Transform(options) {
- if (!(this instanceof Transform)) return new Transform(options);
-
- Duplex.call(this, options);
-
- this._transformState = new TransformState(this);
-
- // when the writable side finishes, then flush out anything remaining.
- var stream = this;
-
- // start out asking for a readable event once data is transformed.
- this._readableState.needReadable = true;
-
- // we have implemented the _read method, and done the other things
- // that Readable wants before the first _read call, so unset the
- // sync guard flag.
- this._readableState.sync = false;
-
- if (options) {
- if (typeof options.transform === 'function') this._transform = options.transform;
-
- if (typeof options.flush === 'function') this._flush = options.flush;
- }
-
- this.once('prefinish', function () {
- if (typeof this._flush === 'function') this._flush(function (er) {
- done(stream, er);
- });else done(stream);
- });
-}
-
-Transform.prototype.push = function (chunk, encoding) {
- this._transformState.needTransform = false;
- return Duplex.prototype.push.call(this, chunk, encoding);
-};
-
-// This is the part where you do stuff!
-// override this function in implementation classes.
-// 'chunk' is an input chunk.
-//
-// Call `push(newChunk)` to pass along transformed output
-// to the readable side. You may call 'push' zero or more times.
-//
-// Call `cb(err)` when you are done with this chunk. If you pass
-// an error, then that'll put the hurt on the whole operation. If you
-// never call cb(), then you'll never get another chunk.
-Transform.prototype._transform = function (chunk, encoding, cb) {
- throw new Error('Not implemented');
-};
-
-Transform.prototype._write = function (chunk, encoding, cb) {
- var ts = this._transformState;
- ts.writecb = cb;
- ts.writechunk = chunk;
- ts.writeencoding = encoding;
- if (!ts.transforming) {
- var rs = this._readableState;
- if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
- }
-};
-
-// Doesn't matter what the args are here.
-// _transform does all the work.
-// That we got here means that the readable side wants more data.
-Transform.prototype._read = function (n) {
- var ts = this._transformState;
-
- if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
- ts.transforming = true;
- this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
- } else {
- // mark that we need a transform, so that any data that comes in
- // will get processed, now that we've asked for it.
- ts.needTransform = true;
- }
-};
-
-function done(stream, er) {
- if (er) return stream.emit('error', er);
-
- // if there's nothing in the write buffer, then that means
- // that nothing more will ever be provided
- var ws = stream._writableState;
- var ts = stream._transformState;
-
- if (ws.length) throw new Error('Calling transform done when ws.length != 0');
-
- if (ts.transforming) throw new Error('Calling transform done when still transforming');
-
- return stream.push(null);
-}
-},{"./_stream_duplex":69,"core-util-is":45,"inherits":51}],73:[function(require,module,exports){
-(function (process){
-// A bit simpler than readable streams.
-// Implement an async ._write(chunk, encoding, cb), and it'll handle all
-// the drain event emission and buffering.
-
-'use strict';
-
-module.exports = Writable;
-
-/*<replacement>*/
-var processNextTick = require('process-nextick-args');
-/*</replacement>*/
-
-/*<replacement>*/
-var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
-/*</replacement>*/
-
-Writable.WritableState = WritableState;
-
-/*<replacement>*/
-var util = require('core-util-is');
-util.inherits = require('inherits');
-/*</replacement>*/
-
-/*<replacement>*/
-var internalUtil = {
- deprecate: require('util-deprecate')
-};
-/*</replacement>*/
-
-/*<replacement>*/
-var Stream;
-(function () {
- try {
- Stream = require('st' + 'ream');
- } catch (_) {} finally {
- if (!Stream) Stream = require('events').EventEmitter;
- }
-})();
-/*</replacement>*/
-
-var Buffer = require('buffer').Buffer;
-/*<replacement>*/
-var bufferShim = require('buffer-shims');
-/*</replacement>*/
-
-util.inherits(Writable, Stream);
-
-function nop() {}
-
-function WriteReq(chunk, encoding, cb) {
- this.chunk = chunk;
- this.encoding = encoding;
- this.callback = cb;
- this.next = null;
-}
-
-var Duplex;
-function WritableState(options, stream) {
- Duplex = Duplex || require('./_stream_duplex');
-
- options = options || {};
-
- // object stream flag to indicate whether or not this stream
- // contains buffers or objects.
- this.objectMode = !!options.objectMode;
-
- if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
-
- // the point at which write() starts returning false
- // Note: 0 is a valid value, means that we always return false if
- // the entire buffer is not flushed immediately on write()
- var hwm = options.highWaterMark;
- var defaultHwm = this.objectMode ? 16 : 16 * 1024;
- this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm;
-
- // cast to ints.
- this.highWaterMark = ~ ~this.highWaterMark;
-
- this.needDrain = false;
- // at the start of calling end()
- this.ending = false;
- // when end() has been called, and returned
- this.ended = false;
- // when 'finish' is emitted
- this.finished = false;
-
- // should we decode strings into buffers before passing to _write?
- // this is here so that some node-core streams can optimize string
- // handling at a lower level.
- var noDecode = options.decodeStrings === false;
- this.decodeStrings = !noDecode;
-
- // Crypto is kind of old and crusty. Historically, its default string
- // encoding is 'binary' so we have to make this configurable.
- // Everything else in the universe uses 'utf8', though.
- this.defaultEncoding = options.defaultEncoding || 'utf8';
-
- // not an actual buffer we keep track of, but a measurement
- // of how much we're waiting to get pushed to some underlying
- // socket or file.
- this.length = 0;
-
- // a flag to see when we're in the middle of a write.
- this.writing = false;
-
- // when true all writes will be buffered until .uncork() call
- this.corked = 0;
-
- // a flag to be able to tell if the onwrite cb is called immediately,
- // or on a later tick. We set this to true at first, because any
- // actions that shouldn't happen until "later" should generally also
- // not happen before the first write call.
- this.sync = true;
-
- // a flag to know if we're processing previously buffered items, which
- // may call the _write() callback in the same tick, so that we don't
- // end up in an overlapped onwrite situation.
- this.bufferProcessing = false;
-
- // the callback that's passed to _write(chunk,cb)
- this.onwrite = function (er) {
- onwrite(stream, er);
- };
-
- // the callback that the user supplies to write(chunk,encoding,cb)
- this.writecb = null;
-
- // the amount that is being written when _write is called.
- this.writelen = 0;
-
- this.bufferedRequest = null;
- this.lastBufferedRequest = null;
-
- // number of pending user-supplied write callbacks
- // this must be 0 before 'finish' can be emitted
- this.pendingcb = 0;
-
- // emit prefinish if the only thing we're waiting for is _write cbs
- // This is relevant for synchronous Transform streams
- this.prefinished = false;
-
- // True if the error was already emitted and should not be thrown again
- this.errorEmitted = false;
-
- // count buffered requests
- this.bufferedRequestCount = 0;
-
- // allocate the first CorkedRequest, there is always
- // one allocated and free to use, and we maintain at most two
- this.corkedRequestsFree = new CorkedRequest(this);
-}
-
-WritableState.prototype.getBuffer = function writableStateGetBuffer() {
- var current = this.bufferedRequest;
- var out = [];
- while (current) {
- out.push(current);
- current = current.next;
- }
- return out;
-};
-
-(function () {
- try {
- Object.defineProperty(WritableState.prototype, 'buffer', {
- get: internalUtil.deprecate(function () {
- return this.getBuffer();
- }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
- });
- } catch (_) {}
-})();
-
-var Duplex;
-function Writable(options) {
- Duplex = Duplex || require('./_stream_duplex');
-
- // Writable ctor is applied to Duplexes, though they're not
- // instanceof Writable, they're instanceof Readable.
- if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options);
-
- this._writableState = new WritableState(options, this);
-
- // legacy.
- this.writable = true;
-
- if (options) {
- if (typeof options.write === 'function') this._write = options.write;
-
- if (typeof options.writev === 'function') this._writev = options.writev;
- }
-
- Stream.call(this);
-}
-
-// Otherwise people can pipe Writable streams, which is just wrong.
-Writable.prototype.pipe = function () {
- this.emit('error', new Error('Cannot pipe, not readable'));
-};
-
-function writeAfterEnd(stream, cb) {
- var er = new Error('write after end');
- // TODO: defer error events consistently everywhere, not just the cb
- stream.emit('error', er);
- processNextTick(cb, er);
-}
-
-// If we get something that is not a buffer, string, null, or undefined,
-// and we're not in objectMode, then that's an error.
-// Otherwise stream chunks are all considered to be of length=1, and the
-// watermarks determine how many objects to keep in the buffer, rather than
-// how many bytes or characters.
-function validChunk(stream, state, chunk, cb) {
- var valid = true;
- var er = false;
- // Always throw error if a null is written
- // if we are not in object mode then throw
- // if it is not a buffer, string, or undefined.
- if (chunk === null) {
- er = new TypeError('May not write null values to stream');
- } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
- er = new TypeError('Invalid non-string/buffer chunk');
- }
- if (er) {
- stream.emit('error', er);
- processNextTick(cb, er);
- valid = false;
- }
- return valid;
-}
-
-Writable.prototype.write = function (chunk, encoding, cb) {
- var state = this._writableState;
- var ret = false;
-
- if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
-
- if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
-
- if (typeof cb !== 'function') cb = nop;
-
- if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) {
- state.pendingcb++;
- ret = writeOrBuffer(this, state, chunk, encoding, cb);
- }
-
- return ret;
-};
-
-Writable.prototype.cork = function () {
- var state = this._writableState;
-
- state.corked++;
-};
-
-Writable.prototype.uncork = function () {
- var state = this._writableState;
-
- if (state.corked) {
- state.corked--;
-
- if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
- }
-};
-
-Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
- // node::ParseEncoding() requires lower case.
- if (typeof encoding === 'string') encoding = encoding.toLowerCase();
- if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
- this._writableState.defaultEncoding = encoding;
- return this;
-};
-
-function decodeChunk(state, chunk, encoding) {
- if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
- chunk = bufferShim.from(chunk, encoding);
- }
- return chunk;
-}
-
-// if we're already writing something, then just put this
-// in the queue, and wait our turn. Otherwise, call _write
-// If we return false, then we need a drain event, so set that flag.
-function writeOrBuffer(stream, state, chunk, encoding, cb) {
- chunk = decodeChunk(state, chunk, encoding);
-
- if (Buffer.isBuffer(chunk)) encoding = 'buffer';
- var len = state.objectMode ? 1 : chunk.length;
-
- state.length += len;
-
- var ret = state.length < state.highWaterMark;
- // we must ensure that previous needDrain will not be reset to false.
- if (!ret) state.needDrain = true;
-
- if (state.writing || state.corked) {
- var last = state.lastBufferedRequest;
- state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
- if (last) {
- last.next = state.lastBufferedRequest;
- } else {
- state.bufferedRequest = state.lastBufferedRequest;
- }
- state.bufferedRequestCount += 1;
- } else {
- doWrite(stream, state, false, len, chunk, encoding, cb);
- }
-
- return ret;
-}
-
-function doWrite(stream, state, writev, len, chunk, encoding, cb) {
- state.writelen = len;
- state.writecb = cb;
- state.writing = true;
- state.sync = true;
- if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
- state.sync = false;
-}
-
-function onwriteError(stream, state, sync, er, cb) {
- --state.pendingcb;
- if (sync) processNextTick(cb, er);else cb(er);
-
- stream._writableState.errorEmitted = true;
- stream.emit('error', er);
-}
-
-function onwriteStateUpdate(state) {
- state.writing = false;
- state.writecb = null;
- state.length -= state.writelen;
- state.writelen = 0;
-}
-
-function onwrite(stream, er) {
- var state = stream._writableState;
- var sync = state.sync;
- var cb = state.writecb;
-
- onwriteStateUpdate(state);
-
- if (er) onwriteError(stream, state, sync, er, cb);else {
- // Check if we're actually ready to finish, but don't emit yet
- var finished = needFinish(state);
-
- if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
- clearBuffer(stream, state);
- }
-
- if (sync) {
- /*<replacement>*/
- asyncWrite(afterWrite, stream, state, finished, cb);
- /*</replacement>*/
- } else {
- afterWrite(stream, state, finished, cb);
- }
- }
-}
-
-function afterWrite(stream, state, finished, cb) {
- if (!finished) onwriteDrain(stream, state);
- state.pendingcb--;
- cb();
- finishMaybe(stream, state);
-}
-
-// Must force callback to be called on nextTick, so that we don't
-// emit 'drain' before the write() consumer gets the 'false' return
-// value, and has a chance to attach a 'drain' listener.
-function onwriteDrain(stream, state) {
- if (state.length === 0 && state.needDrain) {
- state.needDrain = false;
- stream.emit('drain');
- }
-}
-
-// if there's something in the buffer waiting, then process it
-function clearBuffer(stream, state) {
- state.bufferProcessing = true;
- var entry = state.bufferedRequest;
-
- if (stream._writev && entry && entry.next) {
- // Fast case, write everything using _writev()
- var l = state.bufferedRequestCount;
- var buffer = new Array(l);
- var holder = state.corkedRequestsFree;
- holder.entry = entry;
-
- var count = 0;
- while (entry) {
- buffer[count] = entry;
- entry = entry.next;
- count += 1;
- }
-
- doWrite(stream, state, true, state.length, buffer, '', holder.finish);
-
- // doWrite is almost always async, defer these to save a bit of time
- // as the hot path ends with doWrite
- state.pendingcb++;
- state.lastBufferedRequest = null;
- if (holder.next) {
- state.corkedRequestsFree = holder.next;
- holder.next = null;
- } else {
- state.corkedRequestsFree = new CorkedRequest(state);
- }
- } else {
- // Slow case, write chunks one-by-one
- while (entry) {
- var chunk = entry.chunk;
- var encoding = entry.encoding;
- var cb = entry.callback;
- var len = state.objectMode ? 1 : chunk.length;
-
- doWrite(stream, state, false, len, chunk, encoding, cb);
- entry = entry.next;
- // if we didn't call the onwrite immediately, then
- // it means that we need to wait until it does.
- // also, that means that the chunk and cb are currently
- // being processed, so move the buffer counter past them.
- if (state.writing) {
- break;
- }
- }
-
- if (entry === null) state.lastBufferedRequest = null;
- }
-
- state.bufferedRequestCount = 0;
- state.bufferedRequest = entry;
- state.bufferProcessing = false;
-}
-
-Writable.prototype._write = function (chunk, encoding, cb) {
- cb(new Error('not implemented'));
-};
-
-Writable.prototype._writev = null;
-
-Writable.prototype.end = function (chunk, encoding, cb) {
- var state = this._writableState;
-
- if (typeof chunk === 'function') {
- cb = chunk;
- chunk = null;
- encoding = null;
- } else if (typeof encoding === 'function') {
- cb = encoding;
- encoding = null;
- }
-
- if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
-
- // .end() fully uncorks
- if (state.corked) {
- state.corked = 1;
- this.uncork();
- }
-
- // ignore unnecessary end() calls.
- if (!state.ending && !state.finished) endWritable(this, state, cb);
-};
-
-function needFinish(state) {
- return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
-}
-
-function prefinish(stream, state) {
- if (!state.prefinished) {
- state.prefinished = true;
- stream.emit('prefinish');
- }
-}
-
-function finishMaybe(stream, state) {
- var need = needFinish(state);
- if (need) {
- if (state.pendingcb === 0) {
- prefinish(stream, state);
- state.finished = true;
- stream.emit('finish');
- } else {
- prefinish(stream, state);
- }
- }
- return need;
-}
-
-function endWritable(stream, state, cb) {
- state.ending = true;
- finishMaybe(stream, state);
- if (cb) {
- if (state.finished) processNextTick(cb);else stream.once('finish', cb);
- }
- state.ended = true;
- stream.writable = false;
-}
-
-// It seems a linked list but it is not
-// there will be only 2 of these for each stream
-function CorkedRequest(state) {
- var _this = this;
-
- this.next = null;
- this.entry = null;
-
- this.finish = function (err) {
- var entry = _this.entry;
- _this.entry = null;
- while (entry) {
- var cb = entry.callback;
- state.pendingcb--;
- cb(err);
- entry = entry.next;
- }
- if (state.corkedRequestsFree) {
- state.corkedRequestsFree.next = _this;
- } else {
- state.corkedRequestsFree = _this;
- }
- };
-}
-}).call(this,require('_process'))
-},{"./_stream_duplex":69,"_process":67,"buffer":44,"buffer-shims":43,"core-util-is":45,"events":48,"inherits":51,"process-nextick-args":66,"util-deprecate":81}],74:[function(require,module,exports){
-'use strict';
-
-var Buffer = require('buffer').Buffer;
-/*<replacement>*/
-var bufferShim = require('buffer-shims');
-/*</replacement>*/
-
-module.exports = BufferList;
-
-function BufferList() {
- this.head = null;
- this.tail = null;
- this.length = 0;
-}
-
-BufferList.prototype.push = function (v) {
- var entry = { data: v, next: null };
- if (this.length > 0) this.tail.next = entry;else this.head = entry;
- this.tail = entry;
- ++this.length;
-};
-
-BufferList.prototype.unshift = function (v) {
- var entry = { data: v, next: this.head };
- if (this.length === 0) this.tail = entry;
- this.head = entry;
- ++this.length;
-};
-
-BufferList.prototype.shift = function () {
- if (this.length === 0) return;
- var ret = this.head.data;
- if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
- --this.length;
- return ret;
-};
-
-BufferList.prototype.clear = function () {
- this.head = this.tail = null;
- this.length = 0;
-};
-
-BufferList.prototype.join = function (s) {
- if (this.length === 0) return '';
- var p = this.head;
- var ret = '' + p.data;
- while (p = p.next) {
- ret += s + p.data;
- }return ret;
-};
-
-BufferList.prototype.concat = function (n) {
- if (this.length === 0) return bufferShim.alloc(0);
- if (this.length === 1) return this.head.data;
- var ret = bufferShim.allocUnsafe(n >>> 0);
- var p = this.head;
- var i = 0;
- while (p) {
- p.data.copy(ret, i);
- i += p.data.length;
- p = p.next;
- }
- return ret;
-};
-},{"buffer":44,"buffer-shims":43}],75:[function(require,module,exports){
-module.exports = require("./lib/_stream_passthrough.js")
-
-},{"./lib/_stream_passthrough.js":70}],76:[function(require,module,exports){
-(function (process){
-var Stream = (function (){
- try {
- return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify
- } catch(_){}
-}());
-exports = module.exports = require('./lib/_stream_readable.js');
-exports.Stream = Stream || exports;
-exports.Readable = exports;
-exports.Writable = require('./lib/_stream_writable.js');
-exports.Duplex = require('./lib/_stream_duplex.js');
-exports.Transform = require('./lib/_stream_transform.js');
-exports.PassThrough = require('./lib/_stream_passthrough.js');
-
-if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) {
- module.exports = Stream;
-}
-
-}).call(this,require('_process'))
-},{"./lib/_stream_duplex.js":69,"./lib/_stream_passthrough.js":70,"./lib/_stream_readable.js":71,"./lib/_stream_transform.js":72,"./lib/_stream_writable.js":73,"_process":67}],77:[function(require,module,exports){
-module.exports = require("./lib/_stream_transform.js")
-
-},{"./lib/_stream_transform.js":72}],78:[function(require,module,exports){
-module.exports = require("./lib/_stream_writable.js")
-
-},{"./lib/_stream_writable.js":73}],79:[function(require,module,exports){
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// 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.
-
-module.exports = Stream;
-
-var EE = require('events').EventEmitter;
-var inherits = require('inherits');
-
-inherits(Stream, EE);
-Stream.Readable = require('readable-stream/readable.js');
-Stream.Writable = require('readable-stream/writable.js');
-Stream.Duplex = require('readable-stream/duplex.js');
-Stream.Transform = require('readable-stream/transform.js');
-Stream.PassThrough = require('readable-stream/passthrough.js');
-
-// Backwards-compat with node 0.4.x
-Stream.Stream = Stream;
-
-
-
-// old-style streams. Note that the pipe method (the only relevant
-// part of this class) is overridden in the Readable class.
-
-function Stream() {
- EE.call(this);
-}
-
-Stream.prototype.pipe = function(dest, options) {
- var source = this;
-
- function ondata(chunk) {
- if (dest.writable) {
- if (false === dest.write(chunk) && source.pause) {
- source.pause();
- }
- }
- }
-
- source.on('data', ondata);
-
- function ondrain() {
- if (source.readable && source.resume) {
- source.resume();
- }
- }
-
- dest.on('drain', ondrain);
-
- // If the 'end' option is not supplied, dest.end() will be called when
- // source gets the 'end' or 'close' events. Only dest.end() once.
- if (!dest._isStdio && (!options || options.end !== false)) {
- source.on('end', onend);
- source.on('close', onclose);
- }
-
- var didOnEnd = false;
- function onend() {
- if (didOnEnd) return;
- didOnEnd = true;
-
- dest.end();
- }
-
-
- function onclose() {
- if (didOnEnd) return;
- didOnEnd = true;
-
- if (typeof dest.destroy === 'function') dest.destroy();
- }
-
- // don't leave dangling pipes when there are errors.
- function onerror(er) {
- cleanup();
- if (EE.listenerCount(this, 'error') === 0) {
- throw er; // Unhandled stream error in pipe.
- }
- }
-
- source.on('error', onerror);
- dest.on('error', onerror);
-
- // remove all the event listeners that were added.
- function cleanup() {
- source.removeListener('data', ondata);
- dest.removeListener('drain', ondrain);
-
- source.removeListener('end', onend);
- source.removeListener('close', onclose);
-
- source.removeListener('error', onerror);
- dest.removeListener('error', onerror);
-
- source.removeListener('end', cleanup);
- source.removeListener('close', cleanup);
-
- dest.removeListener('close', cleanup);
- }
-
- source.on('end', cleanup);
- source.on('close', cleanup);
-
- dest.on('close', cleanup);
-
- dest.emit('pipe', source);
-
- // Allow for unix-like usage: A.pipe(B).pipe(C)
- return dest;
-};
-
-},{"events":48,"inherits":51,"readable-stream/duplex.js":68,"readable-stream/passthrough.js":75,"readable-stream/readable.js":76,"readable-stream/transform.js":77,"readable-stream/writable.js":78}],80:[function(require,module,exports){
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// 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.
-
-var Buffer = require('buffer').Buffer;
-
-var isBufferEncoding = Buffer.isEncoding
- || function(encoding) {
- switch (encoding && encoding.toLowerCase()) {
- case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true;
- default: return false;
- }
- }
-
-
-function assertEncoding(encoding) {
- if (encoding && !isBufferEncoding(encoding)) {
- throw new Error('Unknown encoding: ' + encoding);
- }
-}
-
-// StringDecoder provides an interface for efficiently splitting a series of
-// buffers into a series of JS strings without breaking apart multi-byte
-// characters. CESU-8 is handled as part of the UTF-8 encoding.
-//
-// @TODO Handling all encodings inside a single object makes it very difficult
-// to reason about this code, so it should be split up in the future.
-// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
-// points as used by CESU-8.
-var StringDecoder = exports.StringDecoder = function(encoding) {
- this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
- assertEncoding(encoding);
- switch (this.encoding) {
- case 'utf8':
- // CESU-8 represents each of Surrogate Pair by 3-bytes
- this.surrogateSize = 3;
- break;
- case 'ucs2':
- case 'utf16le':
- // UTF-16 represents each of Surrogate Pair by 2-bytes
- this.surrogateSize = 2;
- this.detectIncompleteChar = utf16DetectIncompleteChar;
- break;
- case 'base64':
- // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
- this.surrogateSize = 3;
- this.detectIncompleteChar = base64DetectIncompleteChar;
- break;
- default:
- this.write = passThroughWrite;
- return;
- }
-
- // Enough space to store all bytes of a single character. UTF-8 needs 4
- // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
- this.charBuffer = new Buffer(6);
- // Number of bytes received for the current incomplete multi-byte character.
- this.charReceived = 0;
- // Number of bytes expected for the current incomplete multi-byte character.
- this.charLength = 0;
-};
-
-
-// write decodes the given buffer and returns it as JS string that is
-// guaranteed to not contain any partial multi-byte characters. Any partial
-// character found at the end of the buffer is buffered up, and will be
-// returned when calling write again with the remaining bytes.
-//
-// Note: Converting a Buffer containing an orphan surrogate to a String
-// currently works, but converting a String to a Buffer (via `new Buffer`, or
-// Buffer#write) will replace incomplete surrogates with the unicode
-// replacement character. See https://codereview.chromium.org/121173009/ .
-StringDecoder.prototype.write = function(buffer) {
- var charStr = '';
- // if our last write ended with an incomplete multibyte character
- while (this.charLength) {
- // determine how many remaining bytes this buffer has to offer for this char
- var available = (buffer.length >= this.charLength - this.charReceived) ?
- this.charLength - this.charReceived :
- buffer.length;
-
- // add the new bytes to the char buffer
- buffer.copy(this.charBuffer, this.charReceived, 0, available);
- this.charReceived += available;
-
- if (this.charReceived < this.charLength) {
- // still not enough chars in this buffer? wait for more ...
- return '';
- }
-
- // remove bytes belonging to the current character from the buffer
- buffer = buffer.slice(available, buffer.length);
-
- // get the character that was split
- charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding);
-
- // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
- var charCode = charStr.charCodeAt(charStr.length - 1);
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
- this.charLength += this.surrogateSize;
- charStr = '';
- continue;
- }
- this.charReceived = this.charLength = 0;
-
- // if there are no more bytes in this buffer, just emit our char
- if (buffer.length === 0) {
- return charStr;
- }
- break;
- }
-
- // determine and set charLength / charReceived
- this.detectIncompleteChar(buffer);
-
- var end = buffer.length;
- if (this.charLength) {
- // buffer the incomplete character bytes we got
- buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
- end -= this.charReceived;
- }
-
- charStr += buffer.toString(this.encoding, 0, end);
-
- var end = charStr.length - 1;
- var charCode = charStr.charCodeAt(end);
- // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
- if (charCode >= 0xD800 && charCode <= 0xDBFF) {
- var size = this.surrogateSize;
- this.charLength += size;
- this.charReceived += size;
- this.charBuffer.copy(this.charBuffer, size, 0, size);
- buffer.copy(this.charBuffer, 0, 0, size);
- return charStr.substring(0, end);
- }
-
- // or just emit the charStr
- return charStr;
-};
-
-// detectIncompleteChar determines if there is an incomplete UTF-8 character at
-// the end of the given buffer. If so, it sets this.charLength to the byte
-// length that character, and sets this.charReceived to the number of bytes
-// that are available for this character.
-StringDecoder.prototype.detectIncompleteChar = function(buffer) {
- // determine how many bytes we have to check at the end of this buffer
- var i = (buffer.length >= 3) ? 3 : buffer.length;
-
- // Figure out if one of the last i bytes of our buffer announces an
- // incomplete char.
- for (; i > 0; i--) {
- var c = buffer[buffer.length - i];
-
- // See http://en.wikipedia.org/wiki/UTF-8#Description
-
- // 110XXXXX
- if (i == 1 && c >> 5 == 0x06) {
- this.charLength = 2;
- break;
- }
-
- // 1110XXXX
- if (i <= 2 && c >> 4 == 0x0E) {
- this.charLength = 3;
- break;
- }
-
- // 11110XXX
- if (i <= 3 && c >> 3 == 0x1E) {
- this.charLength = 4;
- break;
- }
- }
- this.charReceived = i;
-};
-
-StringDecoder.prototype.end = function(buffer) {
- var res = '';
- if (buffer && buffer.length)
- res = this.write(buffer);
-
- if (this.charReceived) {
- var cr = this.charReceived;
- var buf = this.charBuffer;
- var enc = this.encoding;
- res += buf.slice(0, cr).toString(enc);
- }
-
- return res;
-};
-
-function passThroughWrite(buffer) {
- return buffer.toString(this.encoding);
-}
-
-function utf16DetectIncompleteChar(buffer) {
- this.charReceived = buffer.length % 2;
- this.charLength = this.charReceived ? 2 : 0;
-}
-
-function base64DetectIncompleteChar(buffer) {
- this.charReceived = buffer.length % 3;
- this.charLength = this.charReceived ? 3 : 0;
-}
-
-},{"buffer":44}],81:[function(require,module,exports){
-(function (global){
-
-/**
- * Module exports.
- */
-
-module.exports = deprecate;
-
-/**
- * Mark that a method should not be used.
- * Returns a modified function which warns once by default.
- *
- * If `localStorage.noDeprecation = true` is set, then it is a no-op.
- *
- * If `localStorage.throwDeprecation = true` is set, then deprecated functions
- * will throw an Error when invoked.
- *
- * If `localStorage.traceDeprecation = true` is set, then deprecated functions
- * will invoke `console.trace()` instead of `console.error()`.
- *
- * @param {Function} fn - the function to deprecate
- * @param {String} msg - the string to print to the console when `fn` is invoked
- * @returns {Function} a new "deprecated" version of `fn`
- * @api public
- */
-
-function deprecate (fn, msg) {
- if (config('noDeprecation')) {
- return fn;
- }
-
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (config('throwDeprecation')) {
- throw new Error(msg);
- } else if (config('traceDeprecation')) {
- console.trace(msg);
- } else {
- console.warn(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
-
- return deprecated;
-}
-
-/**
- * Checks `localStorage` for boolean values for the given `name`.
- *
- * @param {String} name
- * @returns {Boolean}
- * @api private
- */
-
-function config (name) {
- // accessing global.localStorage can trigger a DOMException in sandboxed iframes
- try {
- if (!global.localStorage) return false;
- } catch (_) {
- return false;
- }
- var val = global.localStorage[name];
- if (null == val) return false;
- return String(val).toLowerCase() === 'true';
-}
-
-}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{}],82:[function(require,module,exports){
-arguments[4][51][0].apply(exports,arguments)
-},{"dup":51}],83:[function(require,module,exports){
-module.exports = function isBuffer(arg) {
- return arg && typeof arg === 'object'
- && typeof arg.copy === 'function'
- && typeof arg.fill === 'function'
- && typeof arg.readUInt8 === 'function';
-}
-},{}],84:[function(require,module,exports){
-(function (process,global){
-// Copyright Joyent, Inc. and other Node contributors.
-//
-// 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.
-
-var formatRegExp = /%[sdj%]/g;
-exports.format = function(f) {
- if (!isString(f)) {
- var objects = [];
- for (var i = 0; i < arguments.length; i++) {
- objects.push(inspect(arguments[i]));
- }
- return objects.join(' ');
- }
-
- var i = 1;
- var args = arguments;
- var len = args.length;
- var str = String(f).replace(formatRegExp, function(x) {
- if (x === '%%') return '%';
- if (i >= len) return x;
- switch (x) {
- case '%s': return String(args[i++]);
- case '%d': return Number(args[i++]);
- case '%j':
- try {
- return JSON.stringify(args[i++]);
- } catch (_) {
- return '[Circular]';
- }
- default:
- return x;
- }
- });
- for (var x = args[i]; i < len; x = args[++i]) {
- if (isNull(x) || !isObject(x)) {
- str += ' ' + x;
- } else {
- str += ' ' + inspect(x);
- }
- }
- return str;
-};
-
-
-// Mark that a method should not be used.
-// Returns a modified function which warns once by default.
-// If --no-deprecation is set, then it is a no-op.
-exports.deprecate = function(fn, msg) {
- // Allow for deprecating things in the process of starting up.
- if (isUndefined(global.process)) {
- return function() {
- return exports.deprecate(fn, msg).apply(this, arguments);
- };
- }
-
- if (process.noDeprecation === true) {
- return fn;
- }
-
- var warned = false;
- function deprecated() {
- if (!warned) {
- if (process.throwDeprecation) {
- throw new Error(msg);
- } else if (process.traceDeprecation) {
- console.trace(msg);
- } else {
- console.error(msg);
- }
- warned = true;
- }
- return fn.apply(this, arguments);
- }
-
- return deprecated;
-};
-
-
-var debugs = {};
-var debugEnviron;
-exports.debuglog = function(set) {
- if (isUndefined(debugEnviron))
- debugEnviron = process.env.NODE_DEBUG || '';
- set = set.toUpperCase();
- if (!debugs[set]) {
- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
- var pid = process.pid;
- debugs[set] = function() {
- var msg = exports.format.apply(exports, arguments);
- console.error('%s %d: %s', set, pid, msg);
- };
- } else {
- debugs[set] = function() {};
- }
- }
- return debugs[set];
-};
-
-
-/**
- * Echos the value of a value. Trys to print the value out
- * in the best way possible given the different types.
- *
- * @param {Object} obj The object to print out.
- * @param {Object} opts Optional options object that alters the output.
- */
-/* legacy: obj, showHidden, depth, colors*/
-function inspect(obj, opts) {
- // default options
- var ctx = {
- seen: [],
- stylize: stylizeNoColor
- };
- // legacy...
- if (arguments.length >= 3) ctx.depth = arguments[2];
- if (arguments.length >= 4) ctx.colors = arguments[3];
- if (isBoolean(opts)) {
- // legacy...
- ctx.showHidden = opts;
- } else if (opts) {
- // got an "options" object
- exports._extend(ctx, opts);
- }
- // set default options
- if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
- if (isUndefined(ctx.depth)) ctx.depth = 2;
- if (isUndefined(ctx.colors)) ctx.colors = false;
- if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
- if (ctx.colors) ctx.stylize = stylizeWithColor;
- return formatValue(ctx, obj, ctx.depth);
-}
-exports.inspect = inspect;
-
-
-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
-inspect.colors = {
- 'bold' : [1, 22],
- 'italic' : [3, 23],
- 'underline' : [4, 24],
- 'inverse' : [7, 27],
- 'white' : [37, 39],
- 'grey' : [90, 39],
- 'black' : [30, 39],
- 'blue' : [34, 39],
- 'cyan' : [36, 39],
- 'green' : [32, 39],
- 'magenta' : [35, 39],
- 'red' : [31, 39],
- 'yellow' : [33, 39]
-};
-
-// Don't use 'blue' not visible on cmd.exe
-inspect.styles = {
- 'special': 'cyan',
- 'number': 'yellow',
- 'boolean': 'yellow',
- 'undefined': 'grey',
- 'null': 'bold',
- 'string': 'green',
- 'date': 'magenta',
- // "name": intentionally not styling
- 'regexp': 'red'
-};
-
-
-function stylizeWithColor(str, styleType) {
- var style = inspect.styles[styleType];
-
- if (style) {
- return '\u001b[' + inspect.colors[style][0] + 'm' + str +
- '\u001b[' + inspect.colors[style][1] + 'm';
- } else {
- return str;
- }
-}
-
-
-function stylizeNoColor(str, styleType) {
- return str;
-}
-
-
-function arrayToHash(array) {
- var hash = {};
-
- array.forEach(function(val, idx) {
- hash[val] = true;
- });
-
- return hash;
-}
-
-
-function formatValue(ctx, value, recurseTimes) {
- // Provide a hook for user-specified inspect functions.
- // Check that value is an object with an inspect function on it
- if (ctx.customInspect &&
- value &&
- isFunction(value.inspect) &&
- // Filter out the util module, it's inspect function is special
- value.inspect !== exports.inspect &&
- // Also filter out any prototype objects using the circular check.
- !(value.constructor && value.constructor.prototype === value)) {
- var ret = value.inspect(recurseTimes, ctx);
- if (!isString(ret)) {
- ret = formatValue(ctx, ret, recurseTimes);
- }
- return ret;
- }
-
- // Primitive types cannot have properties
- var primitive = formatPrimitive(ctx, value);
- if (primitive) {
- return primitive;
- }
-
- // Look up the keys of the object.
- var keys = Object.keys(value);
- var visibleKeys = arrayToHash(keys);
-
- if (ctx.showHidden) {
- keys = Object.getOwnPropertyNames(value);
- }
-
- // IE doesn't make error fields non-enumerable
- // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
- if (isError(value)
- && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
- return formatError(value);
- }
-
- // Some type of object without properties can be shortcutted.
- if (keys.length === 0) {
- if (isFunction(value)) {
- var name = value.name ? ': ' + value.name : '';
- return ctx.stylize('[Function' + name + ']', 'special');
- }
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- }
- if (isDate(value)) {
- return ctx.stylize(Date.prototype.toString.call(value), 'date');
- }
- if (isError(value)) {
- return formatError(value);
- }
- }
-
- var base = '', array = false, braces = ['{', '}'];
-
- // Make Array say that they are Array
- if (isArray(value)) {
- array = true;
- braces = ['[', ']'];
- }
-
- // Make functions say that they are functions
- if (isFunction(value)) {
- var n = value.name ? ': ' + value.name : '';
- base = ' [Function' + n + ']';
- }
-
- // Make RegExps say that they are RegExps
- if (isRegExp(value)) {
- base = ' ' + RegExp.prototype.toString.call(value);
- }
-
- // Make dates with properties first say the date
- if (isDate(value)) {
- base = ' ' + Date.prototype.toUTCString.call(value);
- }
-
- // Make error with message first say the error
- if (isError(value)) {
- base = ' ' + formatError(value);
- }
-
- if (keys.length === 0 && (!array || value.length == 0)) {
- return braces[0] + base + braces[1];
- }
-
- if (recurseTimes < 0) {
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- } else {
- return ctx.stylize('[Object]', 'special');
- }
- }
-
- ctx.seen.push(value);
-
- var output;
- if (array) {
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
- } else {
- output = keys.map(function(key) {
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
- });
- }
-
- ctx.seen.pop();
-
- return reduceToSingleString(output, base, braces);
-}
-
-
-function formatPrimitive(ctx, value) {
- if (isUndefined(value))
- return ctx.stylize('undefined', 'undefined');
- if (isString(value)) {
- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
- .replace(/'/g, "\\'")
- .replace(/\\"/g, '"') + '\'';
- return ctx.stylize(simple, 'string');
- }
- if (isNumber(value))
- return ctx.stylize('' + value, 'number');
- if (isBoolean(value))
- return ctx.stylize('' + value, 'boolean');
- // For some reason typeof null is "object", so special case here.
- if (isNull(value))
- return ctx.stylize('null', 'null');
-}
-
-
-function formatError(value) {
- return '[' + Error.prototype.toString.call(value) + ']';
-}
-
-
-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
- var output = [];
- for (var i = 0, l = value.length; i < l; ++i) {
- if (hasOwnProperty(value, String(i))) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- String(i), true));
- } else {
- output.push('');
- }
- }
- keys.forEach(function(key) {
- if (!key.match(/^\d+$/)) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- key, true));
- }
- });
- return output;
-}
-
-
-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- var name, str, desc;
- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
- if (desc.get) {
- if (desc.set) {
- str = ctx.stylize('[Getter/Setter]', 'special');
- } else {
- str = ctx.stylize('[Getter]', 'special');
- }
- } else {
- if (desc.set) {
- str = ctx.stylize('[Setter]', 'special');
- }
- }
- if (!hasOwnProperty(visibleKeys, key)) {
- name = '[' + key + ']';
- }
- if (!str) {
- if (ctx.seen.indexOf(desc.value) < 0) {
- if (isNull(recurseTimes)) {
- str = formatValue(ctx, desc.value, null);
- } else {
- str = formatValue(ctx, desc.value, recurseTimes - 1);
- }
- if (str.indexOf('\n') > -1) {
- if (array) {
- str = str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n').substr(2);
- } else {
- str = '\n' + str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n');
- }
- }
- } else {
- str = ctx.stylize('[Circular]', 'special');
- }
- }
- if (isUndefined(name)) {
- if (array && key.match(/^\d+$/)) {
- return str;
- }
- name = JSON.stringify('' + key);
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
- name = name.substr(1, name.length - 2);
- name = ctx.stylize(name, 'name');
- } else {
- name = name.replace(/'/g, "\\'")
- .replace(/\\"/g, '"')
- .replace(/(^"|"$)/g, "'");
- name = ctx.stylize(name, 'string');
- }
- }
-
- return name + ': ' + str;
-}
-
-
-function reduceToSingleString(output, base, braces) {
- var numLinesEst = 0;
- var length = output.reduce(function(prev, cur) {
- numLinesEst++;
- if (cur.indexOf('\n') >= 0) numLinesEst++;
- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
- }, 0);
-
- if (length > 60) {
- return braces[0] +
- (base === '' ? '' : base + '\n ') +
- ' ' +
- output.join(',\n ') +
- ' ' +
- braces[1];
- }
-
- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
-}
-
-
-// NOTE: These type checking functions intentionally don't use `instanceof`
-// because it is fragile and can be easily faked with `Object.create()`.
-function isArray(ar) {
- return Array.isArray(ar);
-}
-exports.isArray = isArray;
-
-function isBoolean(arg) {
- return typeof arg === 'boolean';
-}
-exports.isBoolean = isBoolean;
-
-function isNull(arg) {
- return arg === null;
-}
-exports.isNull = isNull;
-
-function isNullOrUndefined(arg) {
- return arg == null;
-}
-exports.isNullOrUndefined = isNullOrUndefined;
-
-function isNumber(arg) {
- return typeof arg === 'number';
-}
-exports.isNumber = isNumber;
-
-function isString(arg) {
- return typeof arg === 'string';
-}
-exports.isString = isString;
-
-function isSymbol(arg) {
- return typeof arg === 'symbol';
-}
-exports.isSymbol = isSymbol;
-
-function isUndefined(arg) {
- return arg === void 0;
-}
-exports.isUndefined = isUndefined;
-
-function isRegExp(re) {
- return isObject(re) && objectToString(re) === '[object RegExp]';
-}
-exports.isRegExp = isRegExp;
-
-function isObject(arg) {
- return typeof arg === 'object' && arg !== null;
-}
-exports.isObject = isObject;
-
-function isDate(d) {
- return isObject(d) && objectToString(d) === '[object Date]';
-}
-exports.isDate = isDate;
-
-function isError(e) {
- return isObject(e) &&
- (objectToString(e) === '[object Error]' || e instanceof Error);
-}
-exports.isError = isError;
-
-function isFunction(arg) {
- return typeof arg === 'function';
-}
-exports.isFunction = isFunction;
-
-function isPrimitive(arg) {
- return arg === null ||
- typeof arg === 'boolean' ||
- typeof arg === 'number' ||
- typeof arg === 'string' ||
- typeof arg === 'symbol' || // ES6 symbol
- typeof arg === 'undefined';
-}
-exports.isPrimitive = isPrimitive;
-
-exports.isBuffer = require('./support/isBuffer');
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
-
-
-function pad(n) {
- return n < 10 ? '0' + n.toString(10) : n.toString(10);
-}
-
-
-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
- 'Oct', 'Nov', 'Dec'];
-
-// 26 Feb 16:19:34
-function timestamp() {
- var d = new Date();
- var time = [pad(d.getHours()),
- pad(d.getMinutes()),
- pad(d.getSeconds())].join(':');
- return [d.getDate(), months[d.getMonth()], time].join(' ');
-}
-
-
-// log is just a thin wrapper to console.log that prepends a timestamp
-exports.log = function() {
- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
-};
-
-
-/**
- * Inherit the prototype methods from one constructor into another.
- *
- * The Function.prototype.inherits from lang.js rewritten as a standalone
- * function (not on Function.prototype). NOTE: If this file is to be loaded
- * during bootstrapping this function needs to be rewritten using some native
- * functions as prototype setup using normal JavaScript does not work as
- * expected during bootstrapping (see mirror.js in r114903).
- *
- * @param {function} ctor Constructor function which needs to inherit the
- * prototype.
- * @param {function} superCtor Constructor function to inherit prototype from.
- */
-exports.inherits = require('inherits');
-
-exports._extend = function(origin, add) {
- // Don't do anything if add isn't an object
- if (!add || !isObject(add)) return origin;
-
- var keys = Object.keys(add);
- var i = keys.length;
- while (i--) {
- origin[keys[i]] = add[keys[i]];
- }
- return origin;
-};
-
-function hasOwnProperty(obj, prop) {
- return Object.prototype.hasOwnProperty.call(obj, prop);
-}
-
-}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
-},{"./support/isBuffer":83,"_process":67,"inherits":82}]},{},[1]);
diff --git a/tests/lib/mocha-3.1.2/package.json b/tests/lib/mocha-3.1.2/package.json
deleted file mode 100644
index 475f92513f..0000000000
--- a/tests/lib/mocha-3.1.2/package.json
+++ /dev/null
@@ -1,364 +0,0 @@
-{
- "name": "mocha",
- "version": "3.1.2",
- "description": "simple, flexible, fun test framework",
- "keywords": [
- "mocha",
- "test",
- "bdd",
- "tdd",
- "tap"
- ],
- "author": "TJ Holowaychuk <tj@vision-media.ca>",
- "contributors": [
- "aaroncrows (https://github.com/aaroncrows)",
- "Aaron Hamid <aaron@incsw.com> (https://github.com/ahamid)",
- "Aaron Heckmann <aaron.heckmann+github@gmail.com> (https://github.com/aheckmann)",
- "Adam Crabtree (CrabDude's alias) (https://github.com/CrabBot)",
- "Adam Gruber (https://github.com/adamgruber)",
- "Adrian Ludwig (https://github.com/adrian-ludwig)",
- "Ainthe Kitchen <a.in.the.k@gmail.com> (https://github.com/ainthek)",
- "ajaykodali (https://github.com/ajaykodali)",
- "Alex Early (https://github.com/aearly)",
- "Alex Pham <thedark1337@thedark1337.com> (https://github.com/thedark1337)",
- "amsul (https://github.com/amsul)",
- "Andreas Brekken <andreas@brekken.com> (https://github.com/abrkn)",
- "Andreas Lind <andreas@one.com> (https://github.com/papandreou)",
- "Andrew Miller <vnikitin@live.com> (https://github.com/vnikiti)",
- "Andrew Nesbitt <andrewnez@gmail.com> (https://github.com/andrew)",
- "Andrey Popp <8mayday@gmail.com> (https://github.com/andreypopp)",
- "Andrii Shumada <eagleeyes91@gmail.com> (https://github.com/eagleeye)",
- "Anis Safine (https://github.com/anis)",
- "Arian Stolwijk <stolwijk.arian@gmail.com> (https://github.com/arian)",
- "Ariel Mashraki <ariel@mashraki.co.il> (https://github.com/a8m)",
- "Arnaud Brousseau (https://github.com/ArnaudBrousseau)",
- "Atsuya Takagi <atsuya.takagi@gmail.com> (https://github.com/atsuya)",
- "Attila Domokos (https://github.com/adomokos)",
- "Austin Birch (https://github.com/austinbirch)",
- "Avi Vahl (https://github.com/AviVahl)",
- "Ben Bradley (https://github.com/ben-bradley)",
- "beneidel (https://github.com/beneidel)",
- "Benjie Gillam (https://github.com/benjie)",
- "Ben Noordhuis <info@bnoordhuis.nl> (https://github.com/bnoordhuis)",
- "Benoit Larroque (https://github.com/zetaben)",
- "Benoît Zugmeyer (https://github.com/BenoitZugmeyer)",
- "Ben Vinegar (https://github.com/benvinegar)",
- "Berker Peksag <berker.peksag@gmail.com> (https://github.com/berkerpeksag)",
- "Bjørge Næss (https://github.com/bjoerge)",
- "Brendan Nee <brendan@blinktag.com> (https://github.com/brendannee)",
- "Brian Beck <exogen@gmail.com> (https://github.com/exogen)",
- "Brian C <brian.m.carlson@gmail.com> (https://github.com/brianc)",
- "Brian Lalor <blalor@bravo5.org> (https://github.com/blalor)",
- "Brian Moore (https://github.com/bionicbrian)",
- "Bryan Donovan (https://github.com/BryanDonovan)",
- "Buck Doyle (https://github.com/backspace)",
- "C. Scott Ananian <cscott@cscott.net> (https://github.com/cscott)",
- "Casey Foster (https://github.com/caseywebdev)",
- "Charles Lowell <cowboyd@frontside.io> (https://github.com/cowboyd)",
- "Chris Buckley <chris@cmbuckley.co.uk> (https://github.com/cmbuckley)",
- "Christopher Hiller <boneskull@boneskull.com> (https://github.com/boneskull)",
- "Chris Wren <chriswrendev@gmail.com> (https://github.com/ChrisWren)",
- "Clemens Stolle (https://github.com/klaemo)",
- "Connor Dunn (https://github.com/Connorhd)",
- "Corey Butler (https://github.com/coreybutler)",
- "Cory Thomas (https://github.com/dump247)",
- "cybertk (https://github.com/cybertk)",
- "Daniel Ericsson (https://github.com/monowerker)",
- "Daniel St. Jules <danielst.jules@gmail.com> (https://github.com/danielstjules)",
- "Daniel Stockman <daniel.stockman@gmail.com> (https://github.com/evocateur)",
- "Dave McKenna <davemckenna01@gmail.com> (https://github.com/davemckenna01)",
- "David da Silva <yo@dasilvacont.in> (https://github.com/dasilvacontin)",
- "David Henderson (https://github.com/dhendo)",
- "Denis Bardadym <bardadymchik@gmail.com> (https://github.com/btd)",
- "Devin Weaver <suki@tritarget.org> (https://github.com/sukima)",
- "Diogo Monteiro <diogo.gmt@gmail.com> (https://github.com/diogogmt)",
- "Dmitry Shirokov <deadrunk@gmail.com> (https://github.com/runk)",
- "Domenic Denicola <d@domenic.me> (https://github.com/domenic)",
- "Dominic Barnes <dominic@dbarnes.info> (https://github.com/dominicbarnes)",
- "domq (https://github.com/domq)",
- "Douglas Wilson <doug@somethingdoug.com> (https://github.com/dougwilson)",
- "Duncan Beevers <duncan@dweebd.com> (https://github.com/duncanbeevers)",
- "Duncan Wong (https://github.com/badunk)",
- "eiji.ienaga (https://github.com/haru01)",
- "Fabio Crisci <piuccio@gmail.com> (https://github.com/piuccio)",
- "Fede Ramirez <i@2fd.me> (https://github.com/2fd)",
- "Fedor Indutny <fedor@indutny.com> (https://github.com/indutny)",
- "fengmk2 <m@fengmk2.com> (https://github.com/fengmk2)",
- "Florian Margaine <florian@margaine.com> (https://github.com/ralt)",
- "Forbes Lindesay (https://github.com/ForbesLindesay)",
- "Frederico Silva (https://github.com/fredericosilva)",
- "Fredrik Enestad <fredrik.enestad@soundtrackyourbrand.com> (https://github.com/fredr)",
- "Fredrik Lindin (https://github.com/Cowboy-coder)",
- "Gabriel Silk (https://github.com/gsilk)",
- "Gareth Aye <gareth.aye@gmail.com> (https://github.com/gaye)",
- "Gavin Mogan <gavin@gavinmogan.com> (https://github.com/halkeye)",
- "gigadude (https://github.com/gigadude)",
- "Giovanni Bassi (https://github.com/giggio)",
- "Glen Huang <curvedmark@gmail.com> (https://github.com/curvedmark)",
- "Glen Mailer <glen@stainlessed.co.uk> (https://github.com/glenjamin)",
- "Greg Perkins <gregperkins@alum.mit.edu> (https://github.com/gregrperkins)",
- "Guillermo Rauch <rauchg@gmail.com> (https://github.com/rauchg)",
- "Guy Arye (https://github.com/aryeguy)",
- "Gyandeep Singh <gyandeeps@gmail.com> (https://github.com/gyandeeps)",
- "Harish <hyeluri@gmail.com> (https://github.com/hyeluri)",
- "Harry Brundage <harry.brundage@gmail.com> (https://github.com/airhorns)",
- "Ian Remmel <design@ianwremmel.com> (https://github.com/ianwremmel)",
- "Ian Storm Taylor (https://github.com/ianstormtaylor)",
- "Ian Young <ian@iangreenleaf.com> (https://github.com/iangreenleaf)",
- "Ivan (https://github.com/ivanstoyanov)",
- "Jaakko Salonen (https://github.com/jsalonen)",
- "Jacob Wejendorp <jacob@wejendorp.dk> (https://github.com/wejendorp)",
- "Jake Craige (https://github.com/jakecraige)",
- "Jake Marsh (https://github.com/jakemmarsh)",
- "Jake Mc <jake.mc@icloud.com> (https://github.com/startswithaj)",
- "Jake Verbaten <raynos2@gmail.com> (https://github.com/Raynos)",
- "Jakub Nešetřil <jakub@apiary.io> (https://github.com/zzen)",
- "James Bowes (https://github.com/jbowes)",
- "James Carr <james.r.carr@gmail.com> (https://github.com/jamescarr)",
- "James G. Kim <jgkim@jayg.org> (https://github.com/jgkim)",
- "James Lal <james@lightsofapollo.com> (https://github.com/lightsofapollo)",
- "James Nylen <jnylen@gmail.com> (https://github.com/nylen)",
- "Jason (https://github.com/jlai)",
- "Jason Barry <jay@jcbarry.com> (https://github.com/JCBarry)",
- "Javier Aranda <javier.aranda.varo@gmail.com> (https://github.com/javierav)",
- "jcreamer898 (https://github.com/jcreamer898)",
- "Jean Ponchon (https://github.com/nopnop)",
- "Jeff Kunkle (https://github.com/kunklejr)",
- "Jeff Schilling <jeff@manicwave.com> (https://github.com/jschilli)",
- "JeongHoon Byun (aka Outsider) <outsideris@gmail.com> (https://github.com/outsideris)",
- "Jeremy Martin (https://github.com/jmar777)",
- "jimenglish81 (https://github.com/jimenglish81)",
- "Jimmy Cuadra (https://github.com/jimmycuadra)",
- "jldailey (https://github.com/jldailey)",
- "jleyba (https://github.com/jleyba)",
- "Joey Cozza <joeycozza@gmail.com> (https://github.com/joeycozza)",
- "Johnathon Sanders (https://github.com/outdooricon)",
- "John Doty <jrhdoty@gmail.com> (https://github.com/jrhdoty)",
- "John Firebaugh <john.firebaugh@gmail.com> (https://github.com/jfirebaugh)",
- "John Reeves (https://github.com/jonnyreeves)",
- "Jo Liss <joliss42@gmail.com> (https://github.com/joliss)",
- "Jonas Dohse (https://github.com/dohse)",
- "Jonathan Kim <hello@jkimbo.co.uk> (https://github.com/jkimbo)",
- "Jonathan Park <jonathan.daniel.park@gmail.com> (https://github.com/park9140)",
- "jongleberry <me@jongleberry.com> (https://github.com/jonathanong)",
- "Jordan Sexton <jordan@jordansexton.com> (https://github.com/jordansexton)",
- "Joseph Spencer (https://github.com/jsdevel)",
- "Josh Lory (https://github.com/joshlory)",
- "Joshua Appelman <joshua@jbna.nl> (https://github.com/jbnicolai)",
- "Joshua Krall <joshuakrall@pobox.com> (https://github.com/jkrall)",
- "João Moreno (https://github.com/joaomoreno)",
- "João Paulo Bochi <jpbochi@gmail.com> (https://github.com/jpbochi)",
- "jugglinmike (https://github.com/jugglinmike)",
- "Julien Wajsberg (https://github.com/julienw)",
- "Jussi Virtanen <contact@jvirtanen.org> (https://github.com/jvirtanen)",
- "Justin DuJardin (https://github.com/justindujardin)",
- "Juzer Ali <juzerali@live.com> (https://github.com/juzerali)",
- "Jérémie Astori (https://github.com/astorije)",
- "Katie Gengler (https://github.com/kategengler)",
- "Kazuhito Hokamura (https://github.com/hokaccha)",
- "Keith Cirkel (https://github.com/keithamus)",
- "Kent C. Dodds <kent+github@doddsfamily.us> (https://github.com/kentcdodds)",
- "Kevin Burke <kev@inburke.com> (https://github.com/kevinburke)",
- "Kevin Conway <kevinjacobconway@gmail.com> (https://github.com/kevinconway)",
- "Kevin Kirsche <Kev.Kirsche@gmail.com> (https://github.com/kkirsche)",
- "Kirill Korolyov <kirill.korolyov@gmail.com> (https://github.com/Dremora)",
- "Koen Punt <mail@koen.pt> (https://github.com/koenpunt)",
- "Konstantin Käfer <mail@kkaefer.com> (https://github.com/kkaefer)",
- "Kris Rasmussen (https://github.com/krisr)",
- "Kyle Mitchell <kyle@kemitchell.com> (https://github.com/kemitchell)",
- "lakmeer (https://github.com/lakmeer)",
- "Liam Newman <bitwiseman@gmail.com> (https://github.com/bitwiseman)",
- "Linus Unnebäck <linus@folkdatorn.se> (https://github.com/LinusU)",
- "Long Ho <holevietlong@gmail.com> (https://github.com/longlho)",
- "László Bácsi <lackac@lackac.hu> (https://github.com/lackac)",
- "Maciej Małecki <me@mmalecki.com> (https://github.com/mmalecki)",
- "Mal Graty (https://github.com/mal)",
- "Marcello Bastéa-Forte <marcello@cellosoft.com> (https://github.com/marcello3d)",
- "Marc Kuo <marc@routific.com> (https://github.com/mck-)",
- "Mark Banner (https://github.com/Standard8)",
- "Matija Marohnić <matija.marohnic@gmail.com> (https://github.com/silvenon)",
- "Matthew Shanley <matthewshanley@littlesecretsrecords.com> (https://github.com/arkadyan)",
- "mattias-lw (https://github.com/mattias-lw)",
- "Matt Robenolt <m@robenolt.com> (https://github.com/mattrobenolt)",
- "Matt Smith <matt@twobitfool.com> (https://github.com/twobitfool)",
- "Max Goodman <c@chromako.de> (https://github.com/chromakode)",
- "Maximilian Antoni <mail@maxantoni.de> (https://github.com/mantoni)",
- "Merrick Christensen <merrick.christensen@gmail.com> (https://github.com/iammerrick)",
- "michael-adsk (https://github.com/michael-adsk)",
- "Michael Demmer (https://github.com/demmer)",
- "Michael Jackson <mjijackson@gmail.com> (https://github.com/mjackson)",
- "Michael Schoonmaker <michael.r.schoonmaker@gmail.com> (https://github.com/Schoonology)",
- "Michal Charemza (https://github.com/michalc)",
- "Mike Olson (https://github.com/mwolson)",
- "Mislav Marohnić <mislav.marohnic@gmail.com> (https://github.com/mislav)",
- "mrShturman (https://github.com/mrShturman)",
- "Nathan Alderson <nathan@nathanalderson.com> (https://github.com/nathanalderson)",
- "Nathan Black <nathan@nathanblack.org> (https://github.com/nathanboktae)",
- "Nathan Bowser <nbowser@gmail.com> (https://github.com/nathanbowser)",
- "Nathan Houle <nathan+github@nathanhoule.com> (https://github.com/ndhoule)",
- "Nathan Rajlich <nathan@tootallnate.net> (https://github.com/TooTallNate)",
- "Nick Fitzgerald (https://github.com/fitzgen)",
- "noirlab (https://github.com/noirlab)",
- "Noshir Patel <nosh@blackpiano.com> (https://github.com/noshir-patel)",
- "OlegTsyba <oleg.tsyba.ua@gmail.com> (https://github.com/OlegTsyba)",
- "omar (https://github.com/omardelarosa)",
- "Panu Horsmalahti <panu.horsmalahti@iki.fi> (https://github.com/panuhorsmalahti)",
- "Parker Moore <email@byparker.com> (https://github.com/parkr)",
- "Paul Armstrong (https://github.com/paularmstrong)",
- "Paul Miller <paul+gh@paulmillr.com> (https://github.com/paulmillr)",
- "Pavel Zubkou (https://github.com/irnc)",
- "Pete Hawkins (https://github.com/phawk)",
- "Phil Sung <philbert@gmail.com> (https://github.com/psung)",
- "Prayag Verma <prayag.verma@gmail.com> (https://github.com/pra85)",
- "qiu zuhui <qiuzuhui@gmail.com> (https://github.com/qiuzuhui)",
- "Quang Van <quang@boldapps.io> (https://github.com/quangv)",
- "Rauno (https://github.com/Rauno56)",
- "Refael Ackermann <me@refack.com> (https://github.com/refack)",
- "Richard Dingwall <rdingwall@gmail.com> (https://github.com/rdingwall)",
- "Richard Knop (https://github.com/RichardKnop)",
- "Rico Sta. Cruz <hi@ricostacruz.com> (https://github.com/rstacruz)",
- "Robert Rossmann (https://github.com/Alaneor)",
- "Rob Wu <rob@robwu.nl> (https://github.com/Rob--W)",
- "Romain (https://github.com/rprieto)",
- "Roman Neuhauser <rneuhauser@sigpipe.cz> (https://github.com/roman-neuhauser)",
- "Roman Shtylman (https://github.com/defunctzombie)",
- "Russ Bradberry <devdazed@me.com> (https://github.com/devdazed)",
- "Russell Munson (https://github.com/rmunson)",
- "Ryan <ryan.shaw@min.vc> (https://github.com/ryan-shaw)",
- "Ryan Hubbard (https://github.com/ryedog)",
- "Ryunosuke Sato <tricknotes.rs@gmail.com> (https://github.com/tricknotes)",
- "ryym (https://github.com/ryym)",
- "Salehen Shovon Rahman <sal@linux.com> (https://github.com/shovon)",
- "Salvador de la Puente González <salva@unoyunodiez.com> (https://github.com/delapuente)",
- "Sam Mussell (https://github.com/smussell)",
- "Samuel Goldszmidt <samuel.goldszmidt@gmail.com> (https://github.com/ouhouhsami)",
- "Sasha Koss <kossnocorp@gmail.com> (https://github.com/kossnocorp)",
- "Scott Santucci <ScottFreeCode@gmail.com> (https://github.com/ScottFreeCode)",
- "Sean Lang <slang800@gmail.com> (https://github.com/slang800)",
- "seb vincent <seb.vincent@gmail.com> (https://github.com/sebv)",
- "Seiya Konno <nulltask@gmail.com> (https://github.com/nulltask)",
- "Sergey Simonchik (https://github.com/segrey)",
- "Sergio Santoro (https://github.com/taueres)",
- "Shahar Soel (https://github.com/bd82)",
- "Shaine Hatch (https://github.com/shaine)",
- "Shiwei Wang (https://github.com/wsw0108)",
- "Simon Gaeremynck (https://github.com/simong)",
- "Simon Goumaz (https://github.com/sgoumaz)",
- "Sindre Sorhus <sindresorhus@gmail.com> (https://github.com/sindresorhus)",
- "slientcloud <rjmuqiang@gmail.com> (https://github.com/silentcloud)",
- "Sorin Iclanzan (https://github.com/iclanzan)",
- "Standa Opichal <opichals@gmail.com> (https://github.com/opichals)",
- "Stephen Mathieson <me@stephenmathieson.com> (https://github.com/stephenmathieson)",
- "Steve Mason (https://github.com/spmason)",
- "Stewart Taylor <stewart@taylore.net> (https://github.com/Stewart-Taylor)",
- "Sune Simonsen <sune@we-knowhow.dk> (https://github.com/sunesimonsen)",
- "Sylvain Faucherand (https://github.com/slyg)",
- "Takuya Nishigori <nishigori.tak@gmail.com> (https://github.com/nishigori)",
- "Taylor Gautier (https://github.com/tsgautier)",
- "Teddy Zeenny (https://github.com/teddyzeenny)",
- "Thomas Grainger <https//@graingert.co.uk> (https://github.com/graingert)",
- "Tim Ehat (https://github.com/timehat)",
- "Timothy Gu <timothygu99@gmail.com> (https://github.com/TimothyGu)",
- "Timo Tijhof <krinklemail@gmail.com> (https://github.com/Krinkle)",
- "Tingan Ho <tingan87@gmail.com> (https://github.com/tinganho)",
- "TJ Holowaychuk <tj@vision-media.ca> (https://github.com/tj)",
- "Tobias Bieniek <tobias.bieniek@gmail.com> (https://github.com/Turbo87)",
- "Toby Ho <airportyh@gmail.com> (https://github.com/airportyh)",
- "Todd Agulnick (https://github.com/tawdle)",
- "Tom Hughes (https://github.com/tomhughes)",
- "Tommy Montgomery (https://github.com/tmont)",
- "traleig1 (https://github.com/traleig1)",
- "Travis Jeffery <tj@travisjeffery.com> (https://github.com/travisjeffery)",
- "Tyson Tate <tyson@tysontate.com> (https://github.com/tysontate)",
- "Valentin Agachi (https://github.com/avaly)",
- "Victor Costan <victor@costan.us> (https://github.com/pwnall)",
- "Vladimir Chernis (https://github.com/vlazzle)",
- "Vlad Magdalin <vlad@webflow.com> (https://github.com/callmevlad)",
- "Will Langstroth (https://github.com/wlangstroth)",
- "Wil Moore III <wil.moore@wilmoore.com> (https://github.com/wilmoore)",
- "Xavier Antoviaque <xavier@opencraft.com> (https://github.com/antoviaque)",
- "Xavier Damman <xdamman@gmail.com> (https://github.com/xdamman)",
- "Yanis Wang <yanis.wang@gmail.com> (https://github.com/yaniswang)",
- "yuitest <developer.yuitest+github@cjhat.net> (https://github.com/yuitest)",
- "Zhiye Li <github@zhiye.li> (https://github.com/zhiyelee)",
- "Zhouxuan Yang <fool2fish@gmail.com> (https://github.com/fool2fish)",
- "Zsolt Takács <firstname at lastname dot cc> (https://github.com/oker1)"
- ],
- "license": "MIT",
- "repository": {
- "type": "git",
- "url": "https://github.com/mochajs/mocha.git"
- },
- "bin": {
- "mocha": "./bin/mocha",
- "_mocha": "./bin/_mocha"
- },
- "engines": {
- "node": ">= 0.10.x",
- "npm": ">= 1.4.x"
- },
- "scripts": {
- "test": "make test"
- },
- "dependencies": {
- "browser-stdout": "1.3.0",
- "commander": "2.9.0",
- "debug": "2.2.0",
- "diff": "1.4.0",
- "escape-string-regexp": "1.0.5",
- "glob": "7.0.5",
- "growl": "1.9.2",
- "json3": "3.3.2",
- "lodash.create": "3.1.1",
- "mkdirp": "0.5.1",
- "supports-color": "3.1.2"
- },
- "devDependencies": {
- "assert": "^1.4.1",
- "browserify": "^13.0.0",
- "coffee-script": "^1.10.0",
- "eslint": "^2.13.1",
- "eslint-config-semistandard": "^6.0.2",
- "eslint-config-standard": "^5.0.0",
- "eslint-plugin-promise": "^2.0.1",
- "eslint-plugin-standard": "1.3.2",
- "expect.js": "^0.3.1",
- "karma": "^1.1.0",
- "karma-browserify": "^5.0.5",
- "karma-chrome-launcher": "^2.0.0",
- "karma-expect": "^1.1.2",
- "karma-no-mocha": "^2.0.0",
- "karma-phantomjs-launcher": "^0.2.3",
- "karma-sauce-launcher": "^1.0.0",
- "karma-spec-reporter": "0.0.26",
- "os-name": "^2.0.1",
- "phantomjs": "1.9.8",
- "rimraf": "^2.5.2",
- "should": "^9.0.2",
- "through2": "^2.0.1",
- "watchify": "^3.7.0"
- },
- "files": [
- "bin",
- "images",
- "lib",
- "index.js",
- "mocha.css",
- "mocha.js",
- "browser-entry.js",
- "LICENSE",
- "bower.json"
- ],
- "browser": {
- "debug": "./lib/browser/debug.js",
- "events": "./lib/browser/events.js",
- "tty": "./lib/browser/tty.js",
- "./index.js": "./browser-entry.js",
- "fs": false,
- "glob": false,
- "path": false,
- "supports-color": false
- },
- "homepage": "https://mochajs.org",
- "logo": "https://cldup.com/S9uQ-cOLYz.svg"
-}
diff --git a/tests/lib/mocha-3.1.2/scripts/dedefine.js b/tests/lib/mocha-3.1.2/scripts/dedefine.js
deleted file mode 100644
index 3e297586c9..0000000000
--- a/tests/lib/mocha-3.1.2/scripts/dedefine.js
+++ /dev/null
@@ -1,26 +0,0 @@
-'use strict';
-
-/**
- * This is a transform stream we're using to strip AMD calls from
- * dependencies in our Browserify bundle.
- */
-
-var through = require('through2');
-var defineRx = /typeof define === ['"]function['"] && define\.amd/g;
-
-function createStream () {
- return through.obj(function (chunk, enc, next) {
- this.push(String(chunk)
- .replace(defineRx, 'false'));
- next();
- });
-}
-
-module.exports = function (b) {
- function wrap () {
- b.pipeline.get('wrap').push(createStream());
- }
-
- b.on('reset', wrap);
- wrap();
-};
diff --git a/tests/lib/mocha-3.1.2/scripts/travis-after-script.sh b/tests/lib/mocha-3.1.2/scripts/travis-after-script.sh
deleted file mode 100644
index e93c98f796..0000000000
--- a/tests/lib/mocha-3.1.2/scripts/travis-after-script.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env bash
-# syncs Karma test bundles to S3 if $S3 is set
-
-if [ ${S3} ]
-then
- mkdir -p .karma/${TRAVIS_JOB_NUMBER}
- cp ./mocha.js ".karma/${TRAVIS_JOB_NUMBER}/mocha.js"
- aws s3 sync ".karma/${TRAVIS_JOB_NUMBER}" "s3://mochajs/karma-bundles/${TRAVIS_JOB_NUMBER}"
-fi
diff --git a/tests/lib/mocha-3.1.2/scripts/travis-before-install.sh b/tests/lib/mocha-3.1.2/scripts/travis-before-install.sh
deleted file mode 100644
index 9913070ae9..0000000000
--- a/tests/lib/mocha-3.1.2/scripts/travis-before-install.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env bash
-
-npm install --production
-# this avoids our mocha.opts (and thus devDependencies) in a roundabout way
-./bin/mocha --opts /dev/null --reporter spec test/sanity/sanity.spec.js
diff --git a/tests/lib/mocha-3.1.2/scripts/travis-before-script.sh b/tests/lib/mocha-3.1.2/scripts/travis-before-script.sh
deleted file mode 100644
index e5c6b25414..0000000000
--- a/tests/lib/mocha-3.1.2/scripts/travis-before-script.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env bash
-# installs awscli from pip if $S3 is set
-
-if [ ${S3} ]
-then
- sudo pip install awscli
-fi
diff --git a/tests/lib/mocha-3.1.2/test/.eslintrc.yaml b/tests/lib/mocha-3.1.2/test/.eslintrc.yaml
deleted file mode 100644
index 1830a0b6f4..0000000000
--- a/tests/lib/mocha-3.1.2/test/.eslintrc.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-env:
- mocha: true
-globals:
- expect: false
- assert: false
- # https://github.com/sindresorhus/globals/pull/102
- run: false
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/context.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/context.spec.js
deleted file mode 100644
index cbcdedb49d..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/context.spec.js
+++ /dev/null
@@ -1,73 +0,0 @@
-'use strict';
-
-describe('Context', function () {
- beforeEach(function () {
- this.calls = ['before'];
- });
-
- describe('nested', function () {
- beforeEach(function () {
- this.calls.push('before two');
- });
-
- it('should work', function () {
- expect(this.calls).to.eql(['before', 'before two']);
- this.calls.push('test');
- });
-
- after(function () {
- expect(this.calls).to.eql(['before', 'before two', 'test']);
- this.calls.push('after two');
- });
- });
-
- after(function () {
- expect(this.calls).to.eql(['before', 'before two', 'test', 'after two']);
- });
-});
-
-describe('Context Siblings', function () {
- beforeEach(function () {
- this.calls = ['before'];
- });
-
- describe('sequestered sibling', function () {
- beforeEach(function () {
- this.calls.push('before two');
- this.hiddenFromSibling = 'This should be hidden';
- });
-
- it('should work', function () {
- expect(this.hiddenFromSibling).to.eql('This should be hidden');
- });
- });
-
- describe('sibling verifiction', function () {
- beforeEach(function () {
- this.calls.push('before sibling');
- });
-
- it('should not have value set within a sibling describe', function () {
- expect('This should be hidden').not.to.eql(this.hiddenFromSibling);
- this.visibleFromTestSibling = 'Visible from test sibling';
- });
-
- it('should allow test siblings to modify shared context', function () {
- expect('Visible from test sibling').to.eql(this.visibleFromTestSibling);
- });
-
- it('should have reset this.calls before describe', function () {
- expect(this.calls).to.eql(['before', 'before sibling']);
- });
- });
-
- after(function () {
- expect(this.calls).to.eql(['before', 'before sibling']);
- });
-});
-
-describe('timeout()', function () {
- it('should return the timeout', function () {
- expect(this.timeout()).to.equal(200);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/duration.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/duration.spec.js
deleted file mode 100644
index 0194d4408c..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/duration.spec.js
+++ /dev/null
@@ -1,27 +0,0 @@
-'use strict';
-
-describe('durations', function () {
- describe('when slow', function () {
- it('should highlight in red', function (done) {
- setTimeout(function () {
- done();
- }, 100);
- });
- });
-
- describe('when reasonable', function () {
- it('should highlight in yellow', function (done) {
- setTimeout(function () {
- done();
- }, 50);
- });
- });
-
- describe('when fast', function () {
- it('should highlight in green', function (done) {
- setTimeout(function () {
- done();
- }, 10);
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/fs.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/fs.spec.js
deleted file mode 100644
index 9d0357c382..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/fs.spec.js
+++ /dev/null
@@ -1,22 +0,0 @@
-'use strict';
-
-var fs = require('fs');
-var path = require('path');
-var os = require('os');
-var tmpFile = path.join.bind(path, os.tmpdir());
-
-describe('fs.readFile()', function () {
- describe('when the file exists', function () {
- it('should succeed', function (done) {
- fs.writeFile(tmpFile('mocha'), 'wahoo', done);
- });
- });
-
- describe('when the file does not exist', function () {
- it('should fail', function (done) {
- // uncomment
- // fs.readFile(tmpFile('does-not-exist'), done);
- done();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/glob/glob.sh b/tests/lib/mocha-3.1.2/test/acceptance/glob/glob.sh
deleted file mode 100644
index 823ba07fb9..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/glob/glob.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-REL_SCRIPT_DIR="`dirname \"$0\"`"
-SCRIPT_DIR="`( cd \"$REL_SCRIPT_DIR\" && pwd )`"
-
-cd $SCRIPT_DIR || {
- echo Could not cd to $SCRIPT_DIR from `pwd`
- exit 1
-}
-
-../../../bin/mocha -R json-stream ./*.js > /tmp/mocha-glob.txt || {
- echo Globbing ./*.js in `pwd` failed.
- exit 1
-}
-
-cat /tmp/mocha-glob.txt | grep -q -F '["end",{"suites":1,"tests":1,"passes":1,"pending":0,"failures":0,' || {
- echo Globbing ./*.js in `pwd` should match glob.js with one test inside.
- exit 1
-}
-
-../../../bin/mocha -R json-stream ./*-none.js 2> /tmp/mocha-glob.txt && {
- echo Globbing './*-none.js' in `pwd` failed.
- exit 1
-}
-
-cat /tmp/mocha-glob.txt | grep -q -F 'Could not find any test files matching pattern' || {
- echo Globbing './*-none.js' in `pwd` should match no files and run no tests.
- exit 1
-}
-
-../../../bin/mocha -R json-stream ./*.js ./*-none.js >& /tmp/mocha-glob.txt || {
- echo Globbing ./*.js ./*-none.js in `pwd` failed.
- exit 1
-}
-
-cat /tmp/mocha-glob.txt | grep -q -F '["end",{"suites":1,"tests":1,"passes":1,"pending":0,"failures":0,' &&
-cat /tmp/mocha-glob.txt | grep -q -F 'Could not find any test files matching pattern' || {
- echo Globbing ./*.js ./*-none.js in `pwd` should match glob.js with one test inside and display one warning for the non-existing file.
- exit 1
-}
-
-# Globbing in windows command-shell differs completely from unix-style globbing.
-# In bash, the shell expands globs and passes the result to executables.
-# In windows, the shell passes globs unexpanded, executables do expansion if they support it.
-# Adding single-quotes around the glob below makes bash pass glob unexpanded,
-# allowing us to test windows-style globbing in bash.
-../../../bin/mocha -R json-stream './*.js' > /tmp/mocha-glob.txt || {
- echo Globbing './*.js' in `pwd` failed.
- exit 1
-}
-
-cat /tmp/mocha-glob.txt | grep -q -F '["end",{"suites":1,"tests":1,"passes":1,"pending":0,"failures":0,' || {
- echo Globbing './*.js' in `pwd` should match glob.js with one test inside.
- exit 1
-}
-
-../../../bin/mocha -R json-stream './*-none.js' 2> /tmp/mocha-glob.txt && {
- echo Globbing './*-none.js' in `pwd` failed.
- exit 1
-}
-
-cat /tmp/mocha-glob.txt | grep -q -F 'Could not find any test files matching pattern' || {
- echo Globbing './*-none.js' in `pwd` should match no files and run no tests.
- exit 1
-}
-
-echo Glob-test passed.
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/glob/glob.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/glob/glob.spec.js
deleted file mode 100644
index eca3733898..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/glob/glob.spec.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-describe('globbing test', function () {
- it('should find this test', function () {
- // see glob.sh for details
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/globals.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/globals.spec.js
deleted file mode 100644
index b87df9fd99..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/globals.spec.js
+++ /dev/null
@@ -1,43 +0,0 @@
-'use strict';
-
-describe('global leaks', function () {
- before(function () {
- // uncomment to test
- // foo = 'hey';
- // bar = 'hey';
- });
-
- beforeEach(function () {
- // uncomment to test
- // foo = 'bar'
- });
-
- it('should cause tests to fail', function () {
- // uncomment to test
- // foo = 'bar';
- // bar = 'baz';
- // baz = 'raz';
- });
-
- it('should pass when accepted', function () {
- global.okGlobalA = 1;
- global.okGlobalB = 1;
- global.okGlobalC = 1;
- });
-
- it('should pass with wildcard', function () {
- global.callback123 = 'foo';
- global.callback345 = 'bar';
- });
-
- it('should pass when prefixed "mocha-"', function () {
- // Opera and IE do this for HTML element IDs anyway
- // but to sure we can assert this in any browser, simulate it.
- global['mocha-example'] = { nodeType: 1 };
- });
-
- afterEach(function () {
- // uncomment to test
- // foo = 'bar'
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/http.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/http.spec.js
deleted file mode 100644
index b8bc2f7e26..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/http.spec.js
+++ /dev/null
@@ -1,18 +0,0 @@
-'use strict';
-
-var http = require('http');
-
-var server = http.createServer(function (req, res) {
- res.end('Hello World\n');
-});
-
-server.listen(8888);
-
-describe('http', function () {
- it('should provide an example', function (done) {
- http.get({ path: '/', port: 8888 }, function (res) {
- expect(res).to.have.property('statusCode', 200);
- done();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/interfaces/bdd.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/interfaces/bdd.spec.js
deleted file mode 100644
index f6e24d88a8..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/interfaces/bdd.spec.js
+++ /dev/null
@@ -1,34 +0,0 @@
-'use strict';
-
-describe('integer primitives', function () {
- describe('arithmetic', function () {
- it('should add', function () {
- expect(1 + 1).to.equal(2);
- expect(2 + 2).to.equal(4);
- });
-
- it('should subtract', function () {
- expect(1 - 1).to.equal(0);
- expect(2 - 1).to.equal(1);
- });
- });
-});
-
-describe('integer primitives', function () {
- describe('arithmetic is not', function () {
- it('should add', function () {
- expect(1 + 1).not.to.equal(3);
- expect(2 + 2).not.to.equal(5);
- });
- });
-});
-
-context('test suite', function () {
- beforeEach(function () {
- this.number = 5;
- });
-
- specify('share a property', function () {
- expect(this.number).to.equal(5);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/interfaces/exports.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/interfaces/exports.spec.js
deleted file mode 100644
index f53c6a4ca0..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/interfaces/exports.spec.js
+++ /dev/null
@@ -1,48 +0,0 @@
-'use strict';
-
-var calls = [];
-
-exports.Array = {
- before: function () {
- calls.push('before');
- },
-
- after: function () {
- calls.push('after');
- expect(calls)
- .to
- .eql([
- 'before',
- 'before each',
- 'one',
- 'after each',
- 'before each',
- 'two',
- 'after each',
- 'after'
- ]);
- },
-
- '#indexOf()': {
- beforeEach: function () {
- calls.push('before each');
- },
-
- afterEach: function () {
- calls.push('after each');
- },
-
- 'should return -1 when the value is not present': function () {
- calls.push('one');
- expect([1, 2, 3].indexOf(5)).to.equal(-1);
- expect([1, 2, 3].indexOf(0)).to.equal(-1);
- },
-
- 'should return the correct index when the value is present': function () {
- calls.push('two');
- expect([1, 2, 3].indexOf(1)).to.equal(0);
- expect([1, 2, 3].indexOf(2)).to.equal(1);
- expect([1, 2, 3].indexOf(3)).to.equal(2);
- }
- }
-};
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/interfaces/qunit.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/interfaces/qunit.spec.js
deleted file mode 100644
index 0d15272f0b..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/interfaces/qunit.spec.js
+++ /dev/null
@@ -1,25 +0,0 @@
-'use strict';
-
-function ok (expr, msg) {
- if (!expr) throw new Error(msg);
-}
-
-suite('integer primitives');
-
-test('should add', function () {
- var number = 2 + 2;
- ok(number === 4);
-});
-
-test('should decrement', function () {
- var number = 3;
- ok(--number === 2);
- ok(--number === 1);
- ok(--number === 0);
-});
-
-suite('String');
-
-test('#length', function () {
- ok('foo'.length === 3);
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/interfaces/tdd.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/interfaces/tdd.spec.js
deleted file mode 100644
index c2db518d70..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/interfaces/tdd.spec.js
+++ /dev/null
@@ -1,42 +0,0 @@
-'use strict';
-
-suite('integer primitives', function () {
- suite('arithmetic', function () {
- var initialValue = 41;
-
- suiteSetup(function (done) {
- expect(initialValue).to.eql(41);
- initialValue += 1;
- done();
- });
-
- test('should add', function () {
- expect(initialValue).to.eql(42);
- expect(1 + 1).to.equal(2);
- expect(2 + 2).to.equal(4);
- });
-
- test('should subtract', function () {
- expect(initialValue).to.eql(42);
- expect(1 - 1).to.equal(0);
- expect(2 - 1).to.equal(1);
- });
-
- test.skip('should skip this test', function () {
- var zero = 0;
- expect(zero).to.equal(1, 'this test should have been skipped');
- });
-
- suite.skip('should skip this suite', function () {
- test('should skip this test', function () {
- var zero = 0;
- expect(zero).to.equal(1, 'this test should have been skipped');
- });
- });
-
- suiteTeardown(function (done) {
- expect(initialValue).to.eql(42);
- done();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/lookup-files.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/lookup-files.spec.js
deleted file mode 100644
index faf31b1375..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/lookup-files.spec.js
+++ /dev/null
@@ -1,90 +0,0 @@
-'use strict';
-
-var utils = require('../../lib/utils');
-var fs = require('fs');
-var path = require('path');
-var os = require('os');
-var mkdirp = require('mkdirp');
-var rimraf = require('rimraf');
-
-describe('lookupFiles', function () {
- var tmpDir = path.join(os.tmpDir(), 'mocha-lookup-files');
- var existsSync = fs.existsSync;
- var tmpFile = path.join.bind(path, tmpDir);
- var symlinkSupported = false;
-
- (function testSymlinkSupport () {
- makeTempDir();
-
- fs.writeFileSync(tmpFile('mocha-utils.js'), 'yippy skippy ying yang yow');
- try {
- fs.symlinkSync(tmpFile('mocha-utils.js'), tmpFile('mocha-utils-link.js'));
- symlinkSupported = true;
- } catch (ignored) {
- // ignored
- } finally {
- removeTempDir();
- }
- }());
-
- beforeEach(function () {
- makeTempDir();
-
- fs.writeFileSync(tmpFile('mocha-utils.js'), 'yippy skippy ying yang yow');
- if (symlinkSupported) {
- fs.symlinkSync(tmpFile('mocha-utils.js'), tmpFile('mocha-utils-link.js'));
- }
- });
-
- (symlinkSupported ? it : it.skip)('should not choke on symlinks', function () {
- expect(utils.lookupFiles(tmpDir, ['js'], false))
- .to
- .contain(tmpFile('mocha-utils-link.js'))
- .and
- .contain(tmpFile('mocha-utils.js'))
- .and
- .have
- .length(2);
- expect(existsSync(tmpFile('mocha-utils-link.js')))
- .to
- .be(true);
- fs.renameSync(tmpFile('mocha-utils.js'), tmpFile('bob'));
- expect(existsSync(tmpFile('mocha-utils-link.js')))
- .to
- .be(false);
- expect(utils.lookupFiles(tmpDir, ['js'], false))
- .to
- .eql([]);
- });
-
- it('should accept a glob "path" value', function () {
- var res = utils.lookupFiles(tmpFile('mocha-utils*'), ['js'], false)
- .map(path.normalize.bind(path));
-
- var expectedLength = 0;
- var ex = expect(res)
- .to
- .contain(tmpFile('mocha-utils.js'));
- expectedLength++;
-
- if (symlinkSupported) {
- ex = ex.and
- .contain(tmpFile('mocha-utils-link.js'));
- expectedLength++;
- }
-
- ex.and
- .have
- .length(expectedLength);
- });
-
- afterEach(removeTempDir);
-
- function makeTempDir () {
- mkdirp.sync(tmpDir);
- }
-
- function removeTempDir () {
- rimraf.sync(tmpDir);
- }
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/misc/exit.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/misc/exit.spec.js
deleted file mode 100644
index 916752f9b1..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/misc/exit.spec.js
+++ /dev/null
@@ -1,20 +0,0 @@
-'use strict';
-
-describe('exit', function () {
- // note --bail works nicely in that it still allows an 'early exit' in an error scenario
- it('should not exit even in error scenario if called with --no-exit', function (done) {
- done(new Error('failure'));
- });
-
- it('should take a long time to exit if called with --no-exit', function (done) {
- done();
- setTimeout(function () {
- console.log('all done');
- }, 2500);
- });
-
- it('should kill all processes when SIGINT received', function () {
- // uncomment to test
- // while (true) {}
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/misc/many.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/misc/many.spec.js
deleted file mode 100644
index d4e4a1e806..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/misc/many.spec.js
+++ /dev/null
@@ -1,28 +0,0 @@
-'use strict';
-
-// Useful for testing SIGINT handler
-// use env.big_number to tune iterations so that you have time to ctrl+c
-
-describe('a load of tests', function () {
- it('should fail the first test', function () {
- throw new Error('this should appear in the summary');
- });
-
- var iterations = (process.env.big_number || 1e7);
- function work () {
- var a = 0;
- for (var i = 0; i < iterations; ++i) {
- a += i;
- }
- }
-
- function addTest () {
- it('should pass test ' + i, function () {
- work();
- });
- }
-
- for (var i = 0; i < 500; ++i) {
- addTest();
- }
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/misc/nontty.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/misc/nontty.spec.js
deleted file mode 100644
index ea57b9733f..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/misc/nontty.spec.js
+++ /dev/null
@@ -1,11 +0,0 @@
-'use strict';
-
-describe('tests for non-tty', function () {
- it('should pass', function () {
-
- });
-
- it('should fail', function () {
- throw new Error('oh noes');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/bdd-require.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/misc/only/bdd-require.spec.js
deleted file mode 100644
index 14710c4cd2..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/bdd-require.spec.js
+++ /dev/null
@@ -1,20 +0,0 @@
-'use strict';
-
-/* jshint node: true */
-
-var mocha = require('../../../../lib/mocha');
-
-var beforeEach = mocha.beforeEach;
-var it = mocha.it;
-var describe = mocha.describe;
-
-describe('it.only via require("mocha")', function () {
- beforeEach(function () {
- this.didRunBeforeEach = true;
- });
- describe('nested within a describe/context', function () {
- it.only('should run all enclosing beforeEach hooks', function () {
- require('assert').equal(this.didRunBeforeEach, true);
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/bdd.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/misc/only/bdd.spec.js
deleted file mode 100644
index 639ab30e1b..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/bdd.spec.js
+++ /dev/null
@@ -1,127 +0,0 @@
-'use strict';
-
-describe('should only run .only test in this bdd suite', function () {
- it('should not run this test', function () {
- (0).should.equal(1, 'this test should have been skipped');
- });
- it.only('should run this test', function () {
- (0).should.equal(0, 'this .only test should run');
- });
- it('should run this test, not (includes the title of the .only test)', function () {
- (0).should.equal(1, 'this test should have been skipped');
- });
-});
-
-describe('should not run this suite', function () {
- it('should not run this test', function () {
- (true).should.equal(false);
- });
-
- it('should not run this test', function () {
- (true).should.equal(false);
- });
-
- it('should not run this test', function () {
- (true).should.equal(false);
- });
-});
-
-describe.only('should run all tests in this bdd suite', function () {
- it('should run this test #1', function () {
- (true).should.equal(true);
- });
-
- it('should run this test #2', function () {
- (1).should.equal(1);
- });
-
- it('should run this test #3', function () {
- ('foo').should.equal('foo');
- });
-});
-
-describe('should run only suites that marked as `only`', function () {
- describe.only('should run all this tdd suite', function () {
- it('should run this test #1', function () {
- (true).should.equal(true);
- });
-
- it('should run this test #2', function () {
- (true).should.equal(true);
- });
- });
-
- describe('should not run this suite', function () {
- it('should run this test', function () {
- (true).should.equal(false);
- });
- });
-});
-
-// Nested situation
-describe('should not run parent tests', function () {
- it('should not run this test', function () {
- (true).should.equal(false);
- });
- describe('and not the child tests too', function () {
- it('should not run this test', function () {
- (true).should.equal(false);
- });
- describe.only('but run all the tests in this suite', function () {
- it('should run this test #1', function () {
- (true).should.equal(true);
- });
- it('should run this test #2', function () {
- (true).should.equal(true);
- });
- });
- });
-});
-
-// mark test as `only` override the suite behavior
-describe.only('should run only tests that marked as `only`', function () {
- it('should not run this test #1', function () {
- (false).should.equal(true);
- });
-
- it.only('should run this test #2', function () {
- (true).should.equal(true);
- });
-
- it('should not run this test #3', function () {
- (false).should.equal(true);
- });
-
- it.only('should run this test #4', function () {
- (true).should.equal(true);
- });
-});
-
-describe.only('Should run only test cases that mark as only', function () {
- it.only('should runt his test', function () {
- (true).should.equal(true);
- });
-
- it('should not run this test', function () {
- (false).should.equal(true);
- });
-
- describe('should not run this suite', function () {
- it('should not run this test', function () {
- (false).should.equal(true);
- });
- });
-});
-
-// Root Suite
-it.only('#Root-Suite, should run this test-case #1', function () {
- (true).should.equal(true);
-});
-
-it.only('#Root-Suite, should run this test-case #2', function () {
- (true).should.equal(true);
-});
-
-it('#Root-Suite, should not run this test', function () {
- (false).should.equal(true);
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/bdd.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/bdd.spec.js
deleted file mode 100644
index 1fc3d14384..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/bdd.spec.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-// Root-only test cases
-it.only('#Root-Suite, should run this bdd test-case #1', function () {
- (true).should.equal(true);
-});
-
-it('#Root-Suite, should not run this bdd test-case #2', function () {
- (false).should.equal(true);
-});
-
-it('#Root-Suite, should not run this bdd test-case #3', function () {
- (false).should.equal(true);
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/qunit.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/qunit.spec.js
deleted file mode 100644
index 69bbd3467a..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/qunit.spec.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-// Root-only test cases
-test.only('#Root-Suite, should run this qunit test-case #1', function () {
- (true).should.equal(true);
-});
-
-test('#Root-Suite, should not run this qunit test-case #2', function () {
- (false).should.equal(true);
-});
-
-test('#Root-Suite, should not run this qunit test-case #3', function () {
- (false).should.equal(true);
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/tdd.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/tdd.spec.js
deleted file mode 100644
index 03fdea768f..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/global/tdd.spec.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-// Root-only test cases
-test.only('#Root-Suite, should run this tdd test-case #1', function () {
- (true).should.equal(true);
-});
-
-test('#Root-Suite, should not run this tdd test-case #2', function () {
- (false).should.equal(true);
-});
-
-test('#Root-Suite, should not run this tdd test-case #3', function () {
- (false).should.equal(true);
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/qunit.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/misc/only/qunit.spec.js
deleted file mode 100644
index 77bdfcc64f..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/qunit.spec.js
+++ /dev/null
@@ -1,75 +0,0 @@
-'use strict';
-
-// Root Suite
-test.only('#Root-Suite, should run this test-case #1', function () {
- (true).should.equal(true);
-});
-
-test.only('#Root-Suite, should run this test-case #2', function () {
- (true).should.equal(true);
-});
-
-test('#Root-Suite, should not run this test', function () {
- (false).should.equal(true);
-});
-
-suite('should only run .only test in this qunit suite');
-
-test('should not run this test', function () {
- (0).should.equal(1, 'this test should have been skipped');
-});
-test.only('should run this test', function () {
- (0).should.equal(0, 'this .only test should run');
-});
-test('should run this test, not (includes the title of the .only test)', function () {
- (0).should.equal(1, 'this test should have been skipped');
-});
-
-// Mark suite
-suite.only('should run all tests in this suite');
-
-test('should run this test #1', function () {
- (true).should.equal(true);
-});
-
-test('should run this test #2', function () {
- (true).should.equal(true);
-});
-
-test('should run this test #3', function () {
- (true).should.equal(true);
-});
-
-// Unmark this suite
-suite('should not run any of this suite\'s tests');
-
-test('should not run this test', function () {
- (false).should.equal(true);
-});
-
-test('should not run this test', function () {
- (false).should.equal(true);
-});
-
-test('should not run this test', function () {
- (false).should.equal(true);
-});
-
-// Mark test as `only` override the suite behavior
-suite.only('should run only tests that marked as `only`');
-
-test('should not run this test #1', function () {
- (false).should.equal(true);
-});
-
-test.only('should not run this test #2', function () {
- (true).should.equal(true);
-});
-
-test('should not run this test #3', function () {
- (false).should.equal(true);
-});
-
-test.only('should not run this test #4', function () {
- (true).should.equal(true);
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/tdd.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/misc/only/tdd.spec.js
deleted file mode 100644
index da5f45b198..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/misc/only/tdd.spec.js
+++ /dev/null
@@ -1,127 +0,0 @@
-'use strict';
-
-suite('should only run .only test in this tdd suite', function () {
- test('should not run this test', function () {
- (0).should.equal(1, 'this test should have been skipped');
- });
- test.only('should run this test', function () {
- (0).should.equal(0, 'this .only test should run');
- });
- test('should run this test, not (includes the title of the .only test)', function () {
- (0).should.equal(1, 'this test should have been skipped');
- });
-});
-
-suite('should not run this suite', function () {
- test('should not run this test', function () {
- (true).should.equal(false);
- });
-
- test('should not run this test', function () {
- (true).should.equal(false);
- });
-
- test('should not run this test', function () {
- (true).should.equal(false);
- });
-});
-
-suite.only('should run all tests in this tdd suite', function () {
- test('should run this test #1', function () {
- (true).should.equal(true);
- });
-
- test('should run this test #2', function () {
- (1).should.equal(1);
- });
-
- test('should run this test #3', function () {
- ('foo').should.equal('foo');
- });
-});
-
-suite('should run only suites that marked as `only`', function () {
- suite.only('should run all this tdd suite', function () {
- test('should run this test #1', function () {
- (true).should.equal(true);
- });
-
- test('should run this test #2', function () {
- (true).should.equal(true);
- });
- });
-
- suite('should not run this suite', function () {
- test('should not run this test', function () {
- (true).should.equal(false);
- });
- });
-});
-
-// Nested situation
-suite('should not run parent tests', function () {
- test('should not run this test', function () {
- (true).should.equal(false);
- });
- suite('and not the child tests too', function () {
- test('should not run this test', function () {
- (true).should.equal(false);
- });
- suite.only('but run all the tests in this suite', function () {
- test('should run this test #1', function () {
- (true).should.equal(true);
- });
- test('should run this test #2', function () {
- (true).should.equal(true);
- });
- });
- });
-});
-
-// mark test as `only` override the suite behavior
-suite.only('should run only tests that marked as `only`', function () {
- test('should not run this test #1', function () {
- (false).should.equal(true);
- });
-
- test.only('should run this test #2', function () {
- (true).should.equal(true);
- });
-
- test('should not run this test #3', function () {
- (false).should.equal(true);
- });
-
- test.only('should run this test #4', function () {
- (true).should.equal(true);
- });
-});
-
-suite.only('Should run only test cases that mark as only', function () {
- test.only('should runt his test', function () {
- (true).should.equal(true);
- });
-
- test('should not run this test', function () {
- (false).should.equal(true);
- });
-
- suite('should not run this suite', function () {
- test('should not run this test', function () {
- (false).should.equal(true);
- });
- });
-});
-
-// Root Suite
-test.only('#Root-Suite, should run this test-case #1', function () {
- (true).should.equal(true);
-});
-
-test.only('#Root-Suite, should run this test-case #2', function () {
- (true).should.equal(true);
-});
-
-test('#Root-Suite, should not run this test', function () {
- (false).should.equal(true);
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/overspecified-async.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/overspecified-async.spec.js
deleted file mode 100644
index 0f9b6c9ff5..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/overspecified-async.spec.js
+++ /dev/null
@@ -1,10 +0,0 @@
-'use strict';
-
-describe('overspecified asynchronous resolution method', function () {
- it('should fail when multiple methods are used', function (done) {
- setTimeout(done, 0);
-
- // uncomment
- // return { then: function() {} };
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/require/a.js b/tests/lib/mocha-3.1.2/test/acceptance/require/a.js
deleted file mode 100644
index 949b8af2f0..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/require/a.js
+++ /dev/null
@@ -1,4 +0,0 @@
-'use strict';
-
-global.required = (global.required || []);
-global.required.push('a.js');
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/require/b.coffee b/tests/lib/mocha-3.1.2/test/acceptance/require/b.coffee
deleted file mode 100644
index 045cc7591b..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/require/b.coffee
+++ /dev/null
@@ -1,2 +0,0 @@
-global.required ?= []
-global.required.push 'b.coffee'
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/require/c.js b/tests/lib/mocha-3.1.2/test/acceptance/require/c.js
deleted file mode 100644
index 4d68dc4549..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/require/c.js
+++ /dev/null
@@ -1,4 +0,0 @@
-'use strict';
-
-global.required = (global.required || []);
-global.required.push('c.js');
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/require/d.coffee b/tests/lib/mocha-3.1.2/test/acceptance/require/d.coffee
deleted file mode 100644
index d5ebbf60ed..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/require/d.coffee
+++ /dev/null
@@ -1,2 +0,0 @@
-global.required ?= []
-global.required.push 'd.coffee'
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/require/require.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/require/require.spec.js
deleted file mode 100644
index f959a859a8..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/require/require.spec.js
+++ /dev/null
@@ -1,11 +0,0 @@
-'use strict';
-
-describe('require test', function () {
- it('should require args in order', function () {
- var req = global.required;
- expect(req.indexOf('a.js')).to.equal(0);
- expect(req.indexOf('b.coffee')).to.equal(1);
- expect(req.indexOf('c.js')).to.equal(2);
- expect(req.indexOf('d.coffee')).to.equal(3);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/required-tokens.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/required-tokens.spec.js
deleted file mode 100644
index 2b44dee59b..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/required-tokens.spec.js
+++ /dev/null
@@ -1,12 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var describe = require('../..').describe;
-var it = require('../..').it;
-
-describe('using imported describe', function () {
- it('using imported it', function (done) {
- assert.ok(true);
- done();
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/root.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/root.spec.js
deleted file mode 100644
index abd8d4192e..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/root.spec.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-
-var calls = [];
-
-before(function () {
- calls.push('before');
-});
-
-describe('root', function () {
- it('should be a valid suite', function () {
- expect(calls).to.eql(['before']);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/test.coffee b/tests/lib/mocha-3.1.2/test/acceptance/test.coffee
deleted file mode 100644
index b8e309f515..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/test.coffee
+++ /dev/null
@@ -1,6 +0,0 @@
-
-obj = foo: 'bar'
-
-describe 'coffeescript', ->
- it 'should work', ->
- expect(obj).to.eql foo: 'bar'
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/test.foo b/tests/lib/mocha-3.1.2/test/acceptance/test.foo
deleted file mode 100644
index d00491fd7e..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/test.foo
+++ /dev/null
@@ -1 +0,0 @@
-1
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/throw.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/throw.spec.js
deleted file mode 100644
index 68e8cd2c1d..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/throw.spec.js
+++ /dev/null
@@ -1,108 +0,0 @@
-'use strict';
-
-/* eslint no-throw-literal: off */
-
-var Suite = require('../../lib/suite');
-var Test = require('../../lib/test');
-var Runner = require('../../lib/runner');
-
-describe('a test that throws', function () {
- var suite, runner;
-
- beforeEach(function () {
- suite = new Suite('Suite', 'root');
- runner = new Runner(suite);
- });
-
- describe('undefined', function () {
- it('should not pass if throwing sync and test is sync', function (done) {
- var test = new Test('im sync and throw undefined sync', function () {
- throw undefined;
- });
- suite.addTest(test);
- runner = new Runner(suite);
- runner.on('end', function () {
- expect(runner.failures).to.equal(1);
- expect(test.state).to.equal('failed');
- done();
- });
- runner.run();
- });
-
- it('should not pass if throwing sync and test is async', function (done) {
- var test = new Test('im async and throw undefined sync', function (done2) {
- throw undefined;
- });
- suite.addTest(test);
- runner = new Runner(suite);
- runner.on('end', function () {
- expect(runner.failures).to.equal(1);
- expect(test.state).to.equal('failed');
- done();
- });
- runner.run();
- });
-
- it('should not pass if throwing async and test is async', function (done) {
- var test = new Test('im async and throw undefined async', function (done2) {
- process.nexTick(function () {
- throw undefined;
- });
- });
- suite.addTest(test);
- runner = new Runner(suite);
- runner.on('end', function () {
- expect(runner.failures).to.equal(1);
- expect(test.state).to.equal('failed');
- done();
- });
- runner.run();
- });
- });
-
- describe('null', function () {
- it('should not pass if throwing sync and test is sync', function (done) {
- var test = new Test('im sync and throw null sync', function () {
- throw null;
- });
- suite.addTest(test);
- runner = new Runner(suite);
- runner.on('end', function () {
- expect(runner.failures).to.equal(1);
- expect(test.state).to.equal('failed');
- done();
- });
- runner.run();
- });
-
- it('should not pass if throwing sync and test is async', function (done) {
- var test = new Test('im async and throw null sync', function (done2) {
- throw null;
- });
- suite.addTest(test);
- runner = new Runner(suite);
- runner.on('end', function () {
- expect(runner.failures).to.equal(1);
- expect(test.state).to.equal('failed');
- done();
- });
- runner.run();
- });
-
- it('should not pass if throwing async and test is async', function (done) {
- var test = new Test('im async and throw null async', function (done2) {
- process.nexTick(function () {
- throw null;
- });
- });
- suite.addTest(test);
- runner = new Runner(suite);
- runner.on('end', function () {
- expect(runner.failures).to.equal(1);
- expect(test.state).to.equal('failed');
- done();
- });
- runner.run();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/timeout.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/timeout.spec.js
deleted file mode 100644
index b3fc632a0d..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/timeout.spec.js
+++ /dev/null
@@ -1,79 +0,0 @@
-'use strict';
-
-describe('timeouts', function () {
- beforeEach(function (done) {
- // uncomment
- // setTimeout(done, 3000);
- done();
- });
-
- it('should error on timeout', function (done) {
- // uncomment
- // setTimeout(done, 3000);
- done();
- });
-
- it('should allow overriding per-test', function (done) {
- this.timeout(1000);
- setTimeout(function () {
- done();
- }, 300);
- });
-
- describe('disabling', function () {
- it('should allow overriding per-test', function (done) {
- this.enableTimeouts(false);
- this.timeout(1);
- setTimeout(done, 2);
- });
-
- it('should work with timeout(0)', function (done) {
- this.timeout(0);
- setTimeout(done, 1);
- });
-
- describe('using beforeEach', function () {
- beforeEach(function () {
- this.timeout(0);
- });
-
- it('should work with timeout(0)', function (done) {
- setTimeout(done, 1);
- });
- });
-
- describe('using before', function () {
- before(function () {
- this.timeout(0);
- });
-
- it('should work with timeout(0)', function (done) {
- setTimeout(done, 1);
- });
- });
-
- describe('using enableTimeouts(false)', function () {
- this.timeout(4);
-
- it('should suppress timeout(4)', function (done) {
- // The test is in the before() call.
- this.enableTimeouts(false);
- setTimeout(done, 50);
- });
- });
-
- describe('suite-level', function () {
- this.timeout(0);
-
- it('should work with timeout(0)', function (done) {
- setTimeout(done, 1);
- });
-
- describe('nested suite', function () {
- it('should work with timeout(0)', function (done) {
- setTimeout(done, 1);
- });
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/acceptance/utils.spec.js b/tests/lib/mocha-3.1.2/test/acceptance/utils.spec.js
deleted file mode 100644
index 545bdfd265..0000000000
--- a/tests/lib/mocha-3.1.2/test/acceptance/utils.spec.js
+++ /dev/null
@@ -1,418 +0,0 @@
-'use strict';
-
-var utils = require('../../lib/utils');
-var toISOString = require('../../lib/to-iso-string');
-var JSON = require('json3');
-
-describe('lib/utils', function () {
- describe('clean', function () {
- it('should format a single line test function', function () {
- var fn = [
- 'function () {',
- ' var a = 1;',
- '}'
- ].join('\n');
- expect(utils.clean(fn)).to.equal('var a = 1;');
- });
-
- it('should format a multi line test indented with spaces', function () {
- // and no new lines after curly braces, shouldn't matter
- var fn = [
- 'function(){ var a = 1;',
- // this one has more spaces
- ' var b = 2;',
- ' var c = 3; }'
- ].join('\n');
- expect(utils.clean(fn)).to.equal('var a = 1;\n var b = 2;\nvar c = 3;');
- });
-
- it('should format a multi line test indented with tabs', function () {
- var fn = [
- 'function (arg1, arg2) {',
- '\tif (true) {',
- '\t\tvar a = 1;',
- '\t}',
- '}'
- ].join('\n');
- expect(utils.clean(fn)).to.equal('if (true) {\n\tvar a = 1;\n}');
- });
-
- it('should format functions saved in windows style - spaces', function () {
- var fn = [
- 'function (one) {',
- ' do {',
- ' "nothing";',
- ' } while (false);',
- ' }'
- ].join('\r\n');
- expect(utils.clean(fn)).to.equal('do {\n "nothing";\n} while (false);');
- });
-
- it('should format functions saved in windows style - tabs', function () {
- var fn = [
- 'function ( ) {',
- '\tif (false) {',
- '\t\tvar json = {',
- '\t\t\tone : 1',
- '\t\t};',
- '\t}',
- '}'
- ].join('\r\n');
- expect(utils.clean(fn)).to.equal('if (false) {\n\tvar json = {\n\t\tone : 1\n\t};\n}');
- });
-
- it('should format es6 arrow functions', function () {
- var fn = [
- '() => {',
- ' var a = 1;',
- '}'
- ].join('\n');
- expect(utils.clean(fn)).to.equal('var a = 1;');
- });
-
- it('should format es6 arrow functions with implicit return', function () {
- var fn = '() => foo()';
- expect(utils.clean(fn)).to.equal('foo()');
- });
- });
-
- describe('stringify', function () {
- var stringify = utils.stringify;
-
- it('should return an object representation of a string created with a String constructor', function () {
- /* eslint no-new-wrappers: off */
- expect(stringify(new String('foo'))).to.equal('{\n "0": "f"\n "1": "o"\n "2": "o"\n}');
- });
-
- it('should return Buffer with .toJSON representation', function () {
- expect(stringify(new Buffer([0x01]))).to.equal('[\n 1\n]');
- expect(stringify(new Buffer([0x01, 0x02]))).to.equal('[\n 1\n 2\n]');
-
- expect(stringify(new Buffer('ABCD'))).to.equal('[\n 65\n 66\n 67\n 68\n]');
- });
-
- it('should return Date object with .toISOString() + string prefix', function () {
- expect(stringify(new Date(0))).to.equal('[Date: ' + shimToISOString(new Date(0)) + ']');
-
- var date = new Date(); // now
- expect(stringify(date)).to.equal('[Date: ' + shimToISOString(date) + ']');
-
- function shimToISOString (date) {
- if (date.toISOString) {
- return date.toISOString();
- } else {
- return toISOString(date);
- }
- }
- });
-
- it('should return invalid Date object with .toString() + string prefix', function () {
- expect(stringify(new Date(''))).to.equal('[Date: ' + new Date('').toString() + ']');
- });
-
- describe('#Number', function () {
- it('should show the handle -0 situations', function () {
- expect(stringify(-0)).to.eql('-0');
- expect(stringify(0)).to.eql('0');
- expect(stringify('-0')).to.eql('"-0"');
- });
-
- it('should work well with `NaN` and `Infinity`', function () {
- expect(stringify(NaN)).to.equal('NaN');
- expect(stringify(Infinity)).to.equal('Infinity');
- expect(stringify(-Infinity)).to.equal('-Infinity');
- });
-
- it('floats and ints', function () {
- expect(stringify(1)).to.equal('1');
- expect(stringify(1.2)).to.equal('1.2');
- expect(stringify(1e9)).to.equal('1000000000');
- });
- });
-
- describe('canonicalize example', function () {
- it('should represent the actual full result', function () {
- var expected = {
- str: 'string',
- int: 90,
- float: 9.99,
- boolean: false,
- nil: null,
- undef: undefined,
- regex: /^[a-z|A-Z]/,
- date: new Date(0),
- func: function () {},
- infi: Infinity,
- nan: NaN,
- zero: -0,
- buffer: new Buffer([0x01, 0x02]),
- array: [1, 2, 3],
- empArr: [],
- matrix: [[1],
- [
- 2,
- 3,
- 4
- ]
- ],
- object: { a: 1, b: 2 },
- canObj: { a: { b: 1, c: 2 }, b: {} },
- empObj: {}
- };
- expected.circular = expected; // Make `Circular` situation
- var actual = [
- '{',
- ' "array": [',
- ' 1',
- ' 2',
- ' 3',
- ' ]',
- ' "boolean": false',
- ' "buffer": [Buffer: [',
- ' 1',
- ' 2',
- ' ]]',
- ' "canObj": {',
- ' "a": {',
- ' "b": 1',
- ' "c": 2',
- ' }',
- ' "b": {}',
- ' }',
- ' "circular": [Circular]',
- ' "date": [Date: 1970-01-01T00:00:00.000Z]',
- ' "empArr": []',
- ' "empObj": {}',
- ' "float": 9.99',
- ' "func": [Function]',
- ' "infi": Infinity',
- ' "int": 90',
- ' "matrix": [',
- ' [',
- ' 1',
- ' ]',
- ' [',
- ' 2',
- ' 3',
- ' 4',
- ' ]',
- ' ]',
- ' "nan": NaN',
- ' "nil": [null]',
- ' "object": {',
- ' "a": 1',
- ' "b": 2',
- ' }',
- ' "regex": /^[a-z|A-Z]/',
- ' "str": "string"',
- ' "undef": [undefined]',
- ' "zero": -0',
- '}'
- ].join('\n');
- expect(stringify(expected)).to.equal(actual);
- });
- });
-
- it('should canonicalize the object', function () {
- var travis = { name: 'travis', age: 24 };
- var travis2 = { age: 24, name: 'travis' };
-
- expect(stringify(travis)).to.equal(stringify(travis2));
- });
-
- it('should handle circular structures in objects', function () {
- var travis = { name: 'travis' };
- travis.whoami = travis;
-
- expect(stringify(travis)).to.equal('{\n "name": "travis"\n "whoami": [Circular]\n}');
- });
-
- it('should handle circular structures in arrays', function () {
- var travis = ['travis'];
- travis.push(travis);
-
- expect(stringify(travis)).to.equal('[\n "travis"\n [Circular]\n]');
- });
-
- it('should handle circular structures in functions', function () {
- var travis = function () {};
- travis.fn = travis;
-
- expect(stringify(travis)).to.equal('{\n "fn": [Circular]\n}');
- });
-
- it('should handle various non-undefined, non-null, non-object, non-array, non-date, and non-function values', function () {
- var regexp = new RegExp('(?:)');
- var regExpObj = {regexp: regexp};
- var regexpString = '/(?:)/';
-
- expect(stringify(regExpObj)).to.equal('{\n "regexp": ' + regexpString + '\n}');
- expect(stringify(regexp)).to.equal(regexpString);
-
- var number = 1;
- var numberObj = {number: number};
- var numberString = '1';
-
- expect(stringify(numberObj)).to.equal('{\n "number": ' + number + '\n}');
- expect(stringify(number)).to.equal(numberString);
-
- var boolean = false;
- var booleanObj = {boolean: boolean};
- var booleanString = 'false';
-
- expect(stringify(booleanObj)).to.equal('{\n "boolean": ' + boolean + '\n}');
- expect(stringify(boolean)).to.equal(booleanString);
-
- var string = 'sneepy';
- var stringObj = {string: string};
-
- expect(stringify(stringObj)).to.equal('{\n "string": "' + string + '"\n}');
- expect(stringify(string)).to.equal(JSON.stringify(string));
-
- var nullValue = null;
- var nullObj = {'null': null};
- var nullString = '[null]';
-
- expect(stringify(nullObj)).to.equal('{\n "null": [null]\n}');
- expect(stringify(nullValue)).to.equal(nullString);
- });
-
- it('should handle arrays', function () {
- var array = ['dave', 'dave', 'dave', 'dave'];
- var arrayObj = {array: array};
- var arrayString = ' "dave"\n "dave"\n "dave"\n "dave"';
-
- expect(stringify(arrayObj)).to.equal('{\n "array": [\n' + arrayString + '\n ]\n}');
- expect(stringify(array)).to.equal('[' + arrayString.replace(/\s+/g, '\n ') + '\n]');
- });
-
- it('should handle functions', function () {
- var fn = function () {};
- var fnObj = {fn: fn};
- var fnString = '[Function]';
-
- expect(stringify(fnObj)).to.equal('{\n "fn": ' + fnString + '\n}');
- expect(stringify(fn)).to.equal('[Function]');
- });
-
- it('should handle empty objects', function () {
- expect(stringify({})).to.equal('{}');
- expect(stringify({foo: {}})).to.equal('{\n "foo": {}\n}');
- });
-
- it('should handle empty arrays', function () {
- expect(stringify([])).to.equal('[]');
- expect(stringify({foo: []})).to.equal('{\n "foo": []\n}');
- });
-
- it('should handle non-empty arrays', function () {
- expect(stringify(['a', 'b', 'c'])).to.equal('[\n "a"\n "b"\n "c"\n]');
- });
-
- it('should handle empty functions (with no properties)', function () {
- expect(stringify(function () {})).to.equal('[Function]');
- expect(stringify({foo: function () {}})).to.equal('{\n "foo": [Function]\n}');
- expect(stringify({foo: function () {}, bar: 'baz'})).to.equal('{\n "bar": "baz"\n "foo": [Function]\n}');
- });
-
- it('should handle functions w/ properties', function () {
- var fn = function () {};
- fn.bar = 'baz';
- expect(stringify(fn)).to.equal('{\n "bar": "baz"\n}');
- expect(stringify({foo: fn})).to.equal('{\n "foo": {\n "bar": "baz"\n }\n}');
- });
-
- it('should handle undefined values', function () {
- expect(stringify({foo: undefined})).to.equal('{\n "foo": [undefined]\n}');
- expect(stringify({foo: 'bar', baz: undefined})).to.equal('{\n "baz": [undefined]\n "foo": "bar"\n}');
- expect(stringify()).to.equal('[undefined]');
- });
-
- it('should recurse', function () {
- expect(stringify({foo: {bar: {baz: {quux: {herp: 'derp'}}}}})).to.equal('{\n "foo": {\n "bar": {\n "baz": {\n "quux": {\n "herp": "derp"\n }\n }\n }\n }\n}');
- });
-
- it('might get confusing', function () {
- expect(stringify(null)).to.equal('[null]');
- });
-
- it('should not freak out if it sees a primitive twice', function () {
- expect(stringify({foo: null, bar: null})).to.equal('{\n "bar": [null]\n "foo": [null]\n}');
- expect(stringify({foo: 1, bar: 1})).to.equal('{\n "bar": 1\n "foo": 1\n}');
- });
-
- it('should stringify dates', function () {
- var date = new Date(0);
- expect(stringify(date)).to.equal('[Date: 1970-01-01T00:00:00.000Z]');
- expect(stringify({date: date})).to.equal('{\n "date": [Date: 1970-01-01T00:00:00.000Z]\n}');
- });
-
- it('should handle object without an Object prototype', function () {
- var a;
- if (Object.create) {
- a = Object.create(null);
- } else {
- a = {};
- }
- a.foo = 1;
-
- expect(stringify(a)).to.equal('{\n "foo": 1\n}');
- });
-
- // In old version node.js, Symbol is not available by default.
- if (typeof global.Symbol === 'function') {
- it('should handle Symbol', function () {
- var symbol = Symbol('value');
- expect(stringify(symbol)).to.equal('Symbol(value)');
- expect(stringify({symbol: symbol})).to.equal('{\n "symbol": Symbol(value)\n}');
- });
- }
-
- it('should handle length properties that cannot be coerced to a number', function () {
- expect(stringify({length: {nonBuiltinProperty: 0}})).to.equal('{\n "length": {\n "nonBuiltinProperty": 0\n }\n}');
- expect(stringify({length: 'a string where length should be'})).to.equal('{\n "length": "a string where length should be"\n}');
- });
- });
-
- describe('type', function () {
- /* eslint no-extend-native: off */
-
- var type = utils.type;
- var toString = Object.prototype.toString;
-
- beforeEach(function () {
- // some JS engines such as PhantomJS 1.x exhibit this behavior
- Object.prototype.toString = function () {
- if (this === global) {
- return '[object DOMWindow]';
- }
- return toString.call(this);
- };
- });
-
- it('should recognize various types', function () {
- expect(type({})).to.equal('object');
- expect(type([])).to.equal('array');
- expect(type(1)).to.equal('number');
- expect(type(Infinity)).to.equal('number');
- expect(type(null)).to.equal('null');
- expect(type(undefined)).to.equal('undefined');
- expect(type(new Date())).to.equal('date');
- expect(type(/foo/)).to.equal('regexp');
- expect(type('type')).to.equal('string');
- expect(type(global)).to.equal('domwindow');
- expect(type(true)).to.equal('boolean');
- });
-
- describe('when toString on null or undefined stringifies window', function () {
- it('should recognize null and undefined', function () {
- expect(type(null)).to.equal('null');
- expect(type(undefined)).to.equal('undefined');
- });
- });
-
- afterEach(function () {
- Object.prototype.toString = toString;
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/browser-fixtures/bdd.fixture.js b/tests/lib/mocha-3.1.2/test/browser-fixtures/bdd.fixture.js
deleted file mode 100644
index d19993676a..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser-fixtures/bdd.fixture.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-
-/* eslint-env browser */
-
-window.mocha.timeout(200)
- .ui('bdd');
diff --git a/tests/lib/mocha-3.1.2/test/browser-fixtures/exports.fixture.js b/tests/lib/mocha-3.1.2/test/browser-fixtures/exports.fixture.js
deleted file mode 100644
index 97b8b97cbe..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser-fixtures/exports.fixture.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-
-/* eslint-env browser */
-
-window.mocha.timeout(200)
- .ui('exports');
diff --git a/tests/lib/mocha-3.1.2/test/browser-fixtures/qunit.fixture.js b/tests/lib/mocha-3.1.2/test/browser-fixtures/qunit.fixture.js
deleted file mode 100644
index a3fd887940..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser-fixtures/qunit.fixture.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-
-/* eslint-env browser */
-
-window.mocha.timeout(200)
- .ui('qunit');
diff --git a/tests/lib/mocha-3.1.2/test/browser-fixtures/tdd.fixture.js b/tests/lib/mocha-3.1.2/test/browser-fixtures/tdd.fixture.js
deleted file mode 100644
index 0c36f0c54b..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser-fixtures/tdd.fixture.js
+++ /dev/null
@@ -1,6 +0,0 @@
-'use strict';
-
-/* eslint-env browser */
-
-window.mocha.timeout(200)
- .ui('tdd');
diff --git a/tests/lib/mocha-3.1.2/test/browser/array.spec.js b/tests/lib/mocha-3.1.2/test/browser/array.spec.js
deleted file mode 100644
index edf66ac458..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/array.spec.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict';
-
-describe('Array', function () {
- describe('#push()', function () {
- it('should append a value', function () {
- var arr = [];
- arr.push('foo');
- arr.push('bar');
- arr.push('baz');
- assert(arr[0] === 'foo'); // to test indentation
- assert(arr[1] === 'bar');
- assert(arr[2] === 'baz');
- });
-
- it('should return the length', function () {
- var arr = [];
- assert(arr.push('foo') === 1);
- assert(arr.push('bar') === 2);
- assert(arr.push('baz') === 3);
- });
- });
-});
-
-describe('Array', function () {
- describe('#pop()', function () {
- it('should remove and return the last value', function () {
- var arr = [1, 2, 3];
- assert(arr.pop() === 3);
- assert(arr.pop() === 2);
- assert(arr.pop() === -1);
- });
-
- it('should adjust .length', function () {
- var arr = [1, 2, 3];
- arr.pop();
- assert(arr.length === 2);
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/browser/grep.html b/tests/lib/mocha-3.1.2/test/browser/grep.html
deleted file mode 100644
index 0ba47c8533..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/grep.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<html>
- <head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>mocha.setup('bdd')</script>
- <script>
- function assert(expr, msg) {
- if (!expr) throw new Error(msg || 'failed');
- }
- </script>
- <script src="grep.js"></script>
- </head>
- <body>
- <div id="mocha"></div>
- <script>
- (function(window) {
- var location = window.location;
- mocha.checkLeaks();
- var runner = mocha.run();
- setTimeout(run, 1000);
-
- function run() {
- var regex = [
- '.*', // All
- 'm{2}', // 'mm...m'
- '\\d', // Contains number
- '^\\d{2}(?=\\s\\d$)', // Start with 2 numbers and end with one
- '^@.*(?=\\(\\)$)', // Run @Array and @Function suite, but only function
- '^@(?!.*\\)$)', // Run @Array and @Function suite, but only properties
- '^co', // Start with 'co'
- 'first$', // Ends with 'first'
- '^co.*(?=second$)', // Starts with 'co', ends with 'second'
- '^Date:\\s01\/0(?:[1-4])\/2015$', // Run all tests between '01/[01-04]/2015'
- encodeURIComponent('^#'), // Run encoded => start with '#'
- encodeURIComponent('^[^a-z|0-9]+$') // Run encoded => only uppercase suites(include `it` fns), e.g: CONSTANTS
- ]
- , qs = location.search.replace('?grep=', '')
- , re = ~qs.indexOf('%') ? qs : decodeURIComponent(qs)
- , grep = regex[regex.indexOf(re) + 1];
-
- return grep
- ? location.search = 'grep=' + grep
- : false;
- }
- })(window);
- </script>
- </body>
-</html>
diff --git a/tests/lib/mocha-3.1.2/test/browser/grep.spec.js b/tests/lib/mocha-3.1.2/test/browser/grep.spec.js
deleted file mode 100644
index 6c5a83aeb5..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/grep.spec.js
+++ /dev/null
@@ -1,110 +0,0 @@
-'use strict';
-
-// numbers
-describe('21', function () {
- it('1', function () {
- assert(true);
- });
- it('2', function () {
- assert(true);
- });
-});
-// symbols
-describe('@Array', function () {
- it('.pop()', function () {
- assert(true);
- });
- it('.push()', function () {
- assert(true);
- });
- it('.length', function () {
- assert(true);
- });
-});
-
-describe('@Function', function () {
- it('.call()', function () {
- assert(true);
- });
- it('.apply()', function () {
- assert(true);
- });
- it('.length', function () {
- assert(true);
- });
- it('.name', function () {
- assert(true);
- });
- it('.prototype', function () {
- assert(true);
- });
-});
-
-// url with hashtags
-describe('#Services', function () {
- describe('#http', function () {
- it('.createClient()', function () {
- assert(true);
- });
- it('.Server()', function () {
- assert(true);
- });
- });
- describe('#crypto', function () {
- it('.randomBytes()', function () {
- assert(true);
- });
- it('.Hmac()', function () {
- assert(true);
- });
- });
-});
-
-// Uppercase
-describe('CONSTANTS', function () {
- it('.STATUS_CODES', function () {
- assert(true);
- });
-});
-
-// Dates
-describe('Date:', function () {
- it('01/02/2015', function () {
- assert(true);
- });
- it('01/03/2015', function () {
- assert(true);
- });
- it('01/06/2015', function () {
- assert(true);
- });
-});
-
-// etc..
-describe('booking/summary', function () {
- it('should be run last', function () {
- assert(true);
- });
-});
-
-describe('component/booking/summary', function () {
- it('should be run second', function () {
- assert(true);
- });
-});
-
-describe('component/booking/intro', function () {
- it('should be run first', function () {
- assert(true);
- });
-});
-
-describe('contains numbers', function () {
- it('should run if the number 92 matching', function () {
- assert(true);
- });
-
- it('should run if the number 8 matching', function () {
- assert(true);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/browser/index.html b/tests/lib/mocha-3.1.2/test/browser/index.html
deleted file mode 100644
index 9200b977e5..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/index.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<html>
- <head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>mocha.setup('bdd')</script>
- <script>
- function assert(expr, msg) {
- if (!expr) throw new Error(msg || 'failed');
- }
- </script>
- <script src="array.js"></script>
- <script src="../acceptance/duration.js"></script>
- <script src="../acceptance/timeout.js"></script>
- <script src="multiple-done.js"></script>
- <script>
- onload = function(){
- mocha.checkLeaks();
- mocha.globals(['foo']);
- var runner = mocha.run();
-
- // runner.on('test end', function(test){
- // console.log(test.fullTitle());
- // });
- };
- </script>
- </head>
- <body>
- <div id="mocha"></div>
- </body>
-</html>
diff --git a/tests/lib/mocha-3.1.2/test/browser/large.html b/tests/lib/mocha-3.1.2/test/browser/large.html
deleted file mode 100644
index 1804b3a000..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/large.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
- <head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>mocha.setup('bdd')</script>
- <script>
- function assert(expr, msg) {
- if (!expr) throw new Error(msg || 'failed');
- }
- </script>
- <script src="large.js"></script>
- <script>
- onload = function(){
- mocha.run();
- };
- </script>
- </head>
- <body>
- <div id="mocha"></div>
- </body>
-</html>
diff --git a/tests/lib/mocha-3.1.2/test/browser/large.spec.js b/tests/lib/mocha-3.1.2/test/browser/large.spec.js
deleted file mode 100644
index 7dfa62f2a2..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/large.spec.js
+++ /dev/null
@@ -1,49 +0,0 @@
-'use strict';
-
-var n = 30;
-while (n--) {
- describe('Array ' + n, function () {
- var arr;
-
- beforeEach(function () {
- arr = [1, 2, 3];
- });
-
- describe('#indexOf()', function () {
- it('should return -1 when the value is not present', function () {
- assert(arr.indexOf(5) === -1);
- });
-
- it('should return the correct index when the value is present', function (done) {
- assert(arr.indexOf(1) === 0);
- assert(arr.indexOf(2) === 1);
- done();
- });
- });
- });
-}
-
-describe('something', function () {
- it('should provide a useful error', function (done) {
- setTimeout(function () {
- throw new Error('boom');
- }, 1);
- });
-
- it('should provide an even better error on phantomjs', function (done) {
- setTimeout(function () {
- var AssertionError = function (message, actual, expected) {
- this.message = message;
- this.actual = actual;
- this.expected = expected;
- this.showDiff = true;
- };
- AssertionError.prototype = Object.create(Error.prototype);
- AssertionError.prototype.name = 'AssertionError';
- AssertionError.prototype.constructor = AssertionError;
-
- mocha.throwError(new AssertionError('kabooom', 'text with a typo', 'text without a typo'));
- done();
- }, 1);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/browser/multiple-done.spec.js b/tests/lib/mocha-3.1.2/test/browser/multiple-done.spec.js
deleted file mode 100644
index ddb536735e..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/multiple-done.spec.js
+++ /dev/null
@@ -1,18 +0,0 @@
-'use strict';
-
-describe('Multiple Done calls', function () {
- it('should report an error if done was called more than once', function (done) {
- done();
- done();
- });
-
- it('should report an error if an exception happened async after done was called', function (done) {
- done();
- setTimeout(done, 50);
- });
-
- it('should report an error if an exception happened after done was called', function (done) {
- done();
- throw new Error('thrown error');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/browser/opts.html b/tests/lib/mocha-3.1.2/test/browser/opts.html
deleted file mode 100644
index ec49a418fc..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/opts.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<html>
- <head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>
- mocha.setup({
- ui: 'bdd',
- globals: ['okGlobalA', 'okGlobalB', 'okGlobalC', 'callback*']
- }).timeout(1500)
- </script>
- <script>
- function assert(expr, msg) {
- if (!expr) throw new Error(msg || 'failed');
- }
- </script>
- <script src="opts.js"></script>
- <script src="../acceptance/globals.js"></script>
- <script>
- onload = function(){
- var runner = mocha.run();
- };
- </script>
- </head>
- <body>
- <div id="mocha"></div>
- </body>
-</html>
diff --git a/tests/lib/mocha-3.1.2/test/browser/opts.spec.js b/tests/lib/mocha-3.1.2/test/browser/opts.spec.js
deleted file mode 100644
index 7b93f22615..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/opts.spec.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-describe('Options', function () {
- it('should set timeout value', function () {
- assert(this.test._timeout === 1500);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/browser/stack-trace.html b/tests/lib/mocha-3.1.2/test/browser/stack-trace.html
deleted file mode 100644
index 0f267dab98..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/stack-trace.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
-<head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>mocha.setup('bdd')</script>
- <script>
- function assert(expr, err) {
- if (!expr) throw err;
- }
- </script>
- <script src="stack-trace.js"></script>
- <script>
- onload = function() {
- mocha.run();
- };
- </script>
-</head>
-<body>
-<div id="mocha"></div>
-</body>
-</html>
diff --git a/tests/lib/mocha-3.1.2/test/browser/stack-trace.spec.js b/tests/lib/mocha-3.1.2/test/browser/stack-trace.spec.js
deleted file mode 100644
index a4801bf32f..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/stack-trace.spec.js
+++ /dev/null
@@ -1,22 +0,0 @@
-'use strict';
-describe('Stack trace', function () {
- it('should prettify the stack-trace', function () {
- var err = new Error();
- // We do this fake stack-trace because we under development,
- // and our root isn't `node_modules`, `bower` or `components`
- err.stack = [
- 'Error: failed',
- 'at assert (stack-trace.html:11:30)',
- 'at Context.<anonymous> (stack-trace.js:5:5)',
- 'at callFn (http://localhost:63342/node_modules/mocha.js:4546:21)',
- 'at Test.require.register.Runnable.run (http://localhost:63342/node_modules/mocha.js:4539:7)',
- 'at Runner.require.register.Runner.runTest (http://localhost:63342/node_modules/mocha.js:4958:10)',
- 'at http://localhost:63342/bower_components/mocha.js:5041:12',
- 'at next (http://localhost:63342/bower_components/mocha.js:4883:14)',
- 'at http://localhost:63342/bower_components/mocha.js:4893:7',
- 'at next (http://localhost:63342/bower_components/mocha.js:4828:23)',
- 'at http://localhost:63342/bower_components/mocha.js:4860:5'
- ].join('\n');
- assert(false, err);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/browser/ui.html b/tests/lib/mocha-3.1.2/test/browser/ui.html
deleted file mode 100644
index 071c7798a0..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/ui.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<html>
- <head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>mocha.setup('bdd')</script>
- <script>
- function assert(expr, msg) {
- if (!expr) throw new Error(msg || 'failed');
- }
- </script>
- <script src="ui.js"></script>
- </head>
- <body>
- <div id="mocha"></div>
- <script>
- (function(window) {
- var location = window.location;
- mocha.checkLeaks();
- var runner = mocha.run();
- var count = 0;
- setTimeout(run, 1000);
-
- function run() {
- var regex = [
- '', // All
- '%5C%24%5C.jQuery', // $.jQuery
- '%5C%24%5C.jQuery%20%5C.on%5C(%5C)', // $.jQuery .on()
- ]
- , qs = location.search.replace('?grep=', '')
- , re = ~qs.indexOf('%') ? qs : decodeURIComponent(qs)
- , grep = regex[regex.indexOf(re) + 1]
- , anchors = document.getElementsByTagName('a');
-
- // Locate first 'a' element w/ matching grep param; click it
- for (var i = 0; i < anchors.length; i++) {
- if (anchors[i].href && anchors[i].href.indexOf(grep) > -1)
- return void anchors[i].click();
- }
- }
- })(window);
- </script>
- </body>
-</html>
diff --git a/tests/lib/mocha-3.1.2/test/browser/ui.spec.js b/tests/lib/mocha-3.1.2/test/browser/ui.spec.js
deleted file mode 100644
index 159cab6d95..0000000000
--- a/tests/lib/mocha-3.1.2/test/browser/ui.spec.js
+++ /dev/null
@@ -1,33 +0,0 @@
-'use strict';
-
-// test titles containing regex-conflicting characters
-
-// leading $
-describe('$.jQuery', function () {
- // parens
- describe('.on()', function () {
- it('should set an event', function () {
- assert(true);
- });
- });
-
- describe('.off()', function () {
- it('should remove an event', function () {
-
- });
- });
-});
-
-// another generic describe block to verify it is absent
-// when greeping on $.jQuery
-describe('@Array', function () {
- it('.pop()', function () {
- assert(true);
- });
- it('.push()', function () {
- assert(true);
- });
- it('.length', function () {
- assert(true);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/color.spec.js b/tests/lib/mocha-3.1.2/test/color.spec.js
deleted file mode 100644
index bffd30e6eb..0000000000
--- a/tests/lib/mocha-3.1.2/test/color.spec.js
+++ /dev/null
@@ -1,20 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var childProcess = require('child_process');
-var path = require('path');
-
-describe('Mocha', function () {
- this.timeout(2000);
-
- it('should not output colors to pipe', function (cb) {
- var command = [path.join('bin', 'mocha'), '--grep', 'missing-test'];
- childProcess.execFile(process.execPath, command, function (err, stdout, stderr) {
- if (err) return cb(err);
-
- assert(stdout.indexOf('[90m') === -1);
-
- cb(null);
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/compiler/foo.js b/tests/lib/mocha-3.1.2/test/compiler/foo.js
deleted file mode 100644
index 753d08e740..0000000000
--- a/tests/lib/mocha-3.1.2/test/compiler/foo.js
+++ /dev/null
@@ -1,10 +0,0 @@
-'use strict';
-
-var fs = require('fs');
-require.extensions['.foo'] = function (module, filename) {
- var content;
- content = fs.readFileSync(filename, 'utf8');
- var test = 'describe("custom compiler",function(){ it("should work",function() { ' +
- content + '.should.eql(1); }); });';
- return module._compile(test, filename);
-};
diff --git a/tests/lib/mocha-3.1.2/test/grep.spec.js b/tests/lib/mocha-3.1.2/test/grep.spec.js
deleted file mode 100644
index dd21cf0090..0000000000
--- a/tests/lib/mocha-3.1.2/test/grep.spec.js
+++ /dev/null
@@ -1,67 +0,0 @@
-'use strict';
-
-var Mocha = require('../');
-
-describe('Mocha', function () {
- describe('"grep" option', function () {
- it('should add a RegExp to the mocha.options object', function () {
- var mocha = new Mocha({ grep: /foo.*/ });
- mocha.options.grep.toString().should.equal('/foo.*/');
- });
-
- it('should convert string to a RegExp', function () {
- var mocha = new Mocha({ grep: 'foo.*' });
- mocha.options.grep.toString().should.equal('/foo.*/');
- });
- });
-
- describe('"fgrep" option', function () {
- it('should escape and convert string to a RegExp', function () {
- var mocha = new Mocha({ fgrep: 'foo.*' });
- mocha.options.grep.toString().should.equal('/foo\\.\\*/');
- });
- });
-
- describe('.grep()', function () {
- // Test helper
- function testGrep (mocha) {
- return function testGrep (grep, expected) {
- mocha.grep(grep);
- mocha.options.grep.toString().should.equal(expected);
- };
- }
-
- it('should add a RegExp to the mocha.options object', function () {
- var test = testGrep(new Mocha());
- test(/foo/, '/foo/');
- });
-
- it('should convert grep string to a RegExp', function () {
- var test = testGrep(new Mocha());
- test('foo', '/foo/');
- test('^foo.*bar$', '/^foo.*bar$/');
- test('^@.*(?=\\(\\)$)', '/^@.*(?=\\(\\)$)/');
- });
-
- it('should covert grep regex-like string to a RegExp', function () {
- var test = testGrep(new Mocha());
- test('/foo/', '/foo/');
- // Keep the flags
- test('/baz/i', '/baz/i');
- test('/bar/g', '/bar/g');
- test('/^foo(.*)bar/g', '/^foo(.*)bar/g');
- });
-
- it('should return it\'s parent Mocha object for chainability', function () {
- var mocha = new Mocha();
- mocha.grep().should.equal(mocha);
- });
- });
-
- describe('"invert" option', function () {
- it('should add a Boolean to the mocha.options object', function () {
- var mocha = new Mocha({ invert: true });
- mocha.options.invert.should.be.ok;
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/hook-async.spec.js b/tests/lib/mocha-3.1.2/test/hook-async.spec.js
deleted file mode 100644
index a03821e32c..0000000000
--- a/tests/lib/mocha-3.1.2/test/hook-async.spec.js
+++ /dev/null
@@ -1,135 +0,0 @@
-'use strict';
-
-describe('async', function () {
- var calls = [];
-
- before(function () {
- calls.push('root before all');
- });
-
- after(function () {
- calls.push('root after all');
- calls.should.eql([
- 'root before all',
- 'before all',
- 'parent before',
- 'before',
- 'before test one',
- 'one',
- 'after',
- 'after test one passed',
- 'parent after',
- 'parent before',
- 'before',
- 'before test two',
- 'two',
- 'after',
- 'after test two passed',
- 'parent after',
- 'parent before',
- 'before',
- 'before test three',
- 'three',
- 'after',
- 'after test three passed',
- 'parent after',
- 'after all',
- 'root after all'
- ]);
- });
-
- beforeEach(function () {
- calls.push('parent before');
- });
-
- afterEach(function () {
- calls.push('parent after');
- });
-
- describe('hooks', function () {
- before(function () {
- calls.push('before all');
- });
-
- after(function () {
- calls.push('after all');
- });
-
- beforeEach(function (done) {
- var ctx = this;
- process.nextTick(function () {
- calls.push('before');
- if (ctx.currentTest) {
- calls.push('before test ' + ctx.currentTest.title);
- }
- done();
- });
- });
-
- it('one', function (done) {
- calls.should.eql([
- 'root before all',
- 'before all',
- 'parent before',
- 'before',
- 'before test one'
- ]);
- calls.push('one');
- process.nextTick(done);
- });
-
- it('two', function () {
- calls.should.eql([
- 'root before all',
- 'before all',
- 'parent before',
- 'before',
- 'before test one',
- 'one',
- 'after',
- 'after test one passed',
- 'parent after',
- 'parent before',
- 'before',
- 'before test two'
- ]);
- calls.push('two');
- });
-
- it('three', function () {
- calls.should.eql([
- 'root before all',
- 'before all',
- 'parent before',
- 'before',
- 'before test one',
- 'one',
- 'after',
- 'after test one passed',
- 'parent after',
- 'parent before',
- 'before',
- 'before test two',
- 'two',
- 'after',
- 'after test two passed',
- 'parent after',
- 'parent before',
- 'before',
- 'before test three'
- ]);
- calls.push('three');
- });
-
- afterEach(function (done) {
- var ctx = this;
- process.nextTick(function () {
- calls.push('after');
- if (ctx.currentTest) {
- calls.push('after test ' + ctx.currentTest.title + ' ' + ctx.currentTest.state);
- }
- done();
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/hook-sync-nested.spec.js b/tests/lib/mocha-3.1.2/test/hook-sync-nested.spec.js
deleted file mode 100644
index 3f1929f547..0000000000
--- a/tests/lib/mocha-3.1.2/test/hook-sync-nested.spec.js
+++ /dev/null
@@ -1,104 +0,0 @@
-'use strict';
-
-describe('serial', function () {
- describe('nested', function () {
- var calls = [];
-
- beforeEach(function () {
- calls.push('parent before');
- if (this.currentTest) {
- calls.push('parent before test ' + this.currentTest.title);
- }
- });
-
- afterEach(function () {
- calls.push('parent after');
- if (this.currentTest) {
- calls.push('parent after test ' + this.currentTest.title + ' ' + this.currentTest.state);
- }
- });
-
- it('foo', function () {
- calls.should.eql([
- 'parent before',
- 'parent before test foo'
- ]);
- calls.push('foo');
- });
-
- it('bar', function () {
- calls.should.eql([
- 'parent before',
- 'parent before test foo',
- 'foo',
- 'parent after',
- 'parent after test foo passed',
- 'parent before',
- 'parent before test bar'
- ]);
- });
-
- describe('hooks', function () {
- beforeEach(function () {
- calls.push('before');
- if (this.currentTest) {
- calls.push('before test ' + this.currentTest.title);
- }
- });
-
- it('one', function () {
- calls.should.eql([
- 'parent before',
- 'parent before test foo',
- 'foo',
- 'parent after',
- 'parent after test foo passed',
- 'parent before',
- 'parent before test bar',
- 'parent after',
- 'parent after test bar passed',
- 'parent before',
- 'parent before test one',
- 'before',
- 'before test one'
- ]);
- calls.push('one');
- });
-
- it('two', function () {
- calls.should.eql([
- 'parent before',
- 'parent before test foo',
- 'foo',
- 'parent after',
- 'parent after test foo passed',
- 'parent before',
- 'parent before test bar',
- 'parent after',
- 'parent after test bar passed',
- 'parent before',
- 'parent before test one',
- 'before',
- 'before test one',
- 'one',
- 'after',
- 'after test one passed',
- 'parent after',
- 'parent after test one passed',
- 'parent before',
- 'parent before test two',
- 'before',
- 'before test two'
- ]);
- calls.push('two');
- });
-
- afterEach(function () {
- calls.push('after');
- if (this.currentTest) {
- calls.push('after test ' + this.currentTest.title + ' ' + this.currentTest.state);
- }
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/hook-sync.spec.js b/tests/lib/mocha-3.1.2/test/hook-sync.spec.js
deleted file mode 100644
index b1138a6db8..0000000000
--- a/tests/lib/mocha-3.1.2/test/hook-sync.spec.js
+++ /dev/null
@@ -1,103 +0,0 @@
-'use strict';
-
-describe('serial', function () {
- var calls = [];
-
- beforeEach(function () {
- calls.push('parent before');
- });
-
- afterEach(function () {
- calls.push('parent after');
- });
-
- describe('hooks', function () {
- beforeEach(function () {
- calls.push('before');
- if (this.currentTest) {
- calls.push('before test ' + this.currentTest.title);
- }
- });
-
- it('one', function () {
- calls.should.eql([
- 'parent before',
- 'before',
- 'before test one'
- ]);
- calls.push('one');
- });
-
- it('two', function () {
- calls.should.eql([
- 'parent before',
- 'before',
- 'before test one',
- 'one',
- 'after',
- 'after test one passed',
- 'parent after',
- 'parent before',
- 'before',
- 'before test two'
- ]);
- calls.push('two');
- });
-
- it('three', function () {
- calls.should.eql([
- 'parent before',
- 'before',
- 'before test one',
- 'one',
- 'after',
- 'after test one passed',
- 'parent after',
- 'parent before',
- 'before',
- 'before test two',
- 'two',
- 'after',
- 'after test two passed',
- 'parent after',
- 'parent before',
- 'before',
- 'before test three'
- ]);
- calls.push('three');
- });
-
- afterEach(function () {
- calls.push('after');
- if (this.currentTest) {
- calls.push('after test ' + this.currentTest.title + ' ' + this.currentTest.state);
- }
- });
-
- after(function () {
- calls.should.eql([
- 'parent before',
- 'before',
- 'before test one',
- 'one',
- 'after',
- 'after test one passed',
- 'parent after',
- 'parent before',
- 'before',
- 'before test two',
- 'two',
- 'after',
- 'after test two passed',
- 'parent after',
- 'parent before',
- 'before',
- 'before test three',
- 'three',
- 'after',
- 'after test three passed',
- 'parent after'
- ]);
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/hook-timeout.spec.js b/tests/lib/mocha-3.1.2/test/hook-timeout.spec.js
deleted file mode 100644
index c16c3011fb..0000000000
--- a/tests/lib/mocha-3.1.2/test/hook-timeout.spec.js
+++ /dev/null
@@ -1,10 +0,0 @@
-'use strict';
-
-before(function (done) {
- this.timeout(100);
- setTimeout(done, 50);
-});
-
-it('should work', function (done) {
- done();
-});
diff --git a/tests/lib/mocha-3.1.2/test/http-meta-2.spec.js b/tests/lib/mocha-3.1.2/test/http-meta-2.spec.js
deleted file mode 100644
index 4530969041..0000000000
--- a/tests/lib/mocha-3.1.2/test/http-meta-2.spec.js
+++ /dev/null
@@ -1,92 +0,0 @@
-'use strict';
-
-var http = require('http');
-
-var PORT = 8899;
-
-var server = http.createServer(function (req, res) {
- var accept = req.headers.accept || '';
- var json = ~accept.indexOf('json');
-
- switch (req.url) {
- case '/':
- res.end('hello');
- break;
- case '/users':
- if (json) {
- res.end('["tobi","loki","jane"]');
- } else {
- res.end('tobi, loki, jane');
- }
- break;
- }
-});
-
-function get (url) {
- var fields;
- var expected;
- var header = {};
-
- function request (done) {
- http.get({ path: url, port: PORT, headers: header }, function (res) {
- var buf = '';
- res.should.have.property('statusCode', 200);
- res.setEncoding('utf8');
- res.on('data', function (chunk) { buf += chunk; });
- res.on('end', function () {
- buf.should.equal(expected);
- done();
- });
- });
- }
-
- return {
- set: function (field, val) {
- header[field] = val;
- return this;
- },
-
- should: {
- respond: function (body) {
- fields = Object.keys(header).map(function (field) {
- return field + ': ' + header[field];
- }).join(', ');
-
- expected = body;
- describe('GET ' + url, function () {
- this.timeout(500);
- if (fields) {
- describe('when given ' + fields, function () {
- it('should respond with "' + body + '"', request);
- });
- } else {
- it('should respond with "' + body + '"', request);
- }
- });
- }
- }
- };
-}
-
-describe('http server', function () {
- before(function (done) {
- server.listen(PORT, done);
- });
-
- after(function () {
- server.close();
- });
-
- get('/')
- .should
- .respond('hello');
-
- get('/users')
- .should
- .respond('tobi, loki, jane');
-
- get('/users')
- .set('Accept', 'application/json')
- .should
- .respond('["tobi","loki","jane"]');
-});
diff --git a/tests/lib/mocha-3.1.2/test/http-meta.spec.js b/tests/lib/mocha-3.1.2/test/http-meta.spec.js
deleted file mode 100644
index c92dbd2307..0000000000
--- a/tests/lib/mocha-3.1.2/test/http-meta.spec.js
+++ /dev/null
@@ -1,65 +0,0 @@
-'use strict';
-
-var http = require('http');
-
-var PORT = 8889;
-
-var server = http.createServer(function (req, res) {
- var accept = req.headers.accept || '';
- var json = ~accept.indexOf('json');
-
- switch (req.url) {
- case '/':
- res.end('hello');
- break;
- case '/users':
- if (json) {
- res.end('["tobi","loki","jane"]');
- } else {
- res.end('tobi, loki, jane');
- }
- break;
- }
-});
-
-function get (url, body, header) {
- return function (done) {
- http.get({
- path: url,
- port: PORT,
- headers: header || {}
- }, function (res) {
- var buf = '';
- res.should.have.property('statusCode', 200);
- res.setEncoding('utf8');
- res.on('data', function (chunk) { buf += chunk; });
- res.on('end', function () {
- buf.should.equal(body);
- done();
- });
- });
- };
-}
-
-describe('http requests', function () {
- before(function (done) {
- server.listen(PORT, done);
- });
-
- after(function () {
- server.close();
- });
-
- describe('GET /', function () {
- it('should respond with hello',
- get('/', 'hello'));
- });
-
- describe('GET /users', function () {
- it('should respond with users',
- get('/users', 'tobi, loki, jane'));
-
- it('should respond with users',
- get('/users', '["tobi","loki","jane"]', { Accept: 'application/json' }));
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/diffs.spec.js b/tests/lib/mocha-3.1.2/test/integration/diffs.spec.js
deleted file mode 100644
index 7d620e7489..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/diffs.spec.js
+++ /dev/null
@@ -1,46 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var helpers = require('./helpers');
-var run = helpers.runMocha;
-var fs = require('fs');
-var getDiffs = helpers.getDiffs;
-
-function getExpectedOutput () {
- var output = fs.readFileSync('test/integration/fixtures/diffs/output', 'UTF8');
-
- // Diffs are delimited in file by "// DIFF"
- return output.split(/\s*\/\/ DIFF/).slice(1).map(function (diff) {
- return diff.split('\n').filter(Boolean).join('\n');
- });
-}
-
-describe('diffs', function () {
- var diffs, expected;
-
- before(function (done) {
- run('diffs/diffs.fixture.js', ['-C'], function (err, res) {
- expected = getExpectedOutput();
- diffs = getDiffs(res.output);
- done(err);
- });
- });
-
- [
- 'should display a diff for small strings',
- 'should display a diff of canonicalized objects',
- 'should display a diff for medium strings',
- 'should display a diff for entire object dumps',
- 'should display a diff for multi-line strings',
- 'should display a diff for entire object dumps',
- 'should display a full-comparison with escaped special characters',
- 'should display a word diff for large strings',
- 'should work with objects',
- 'should show value diffs and not be affected by commas',
- 'should display diff by data and not like an objects'
- ].forEach(function (title, i) {
- it(title, function () {
- assert.equal(diffs[i], expected[i]);
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/cascade.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/cascade.fixture.js
deleted file mode 100644
index 259c81af2d..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/cascade.fixture.js
+++ /dev/null
@@ -1,59 +0,0 @@
-'use strict';
-
-describe('one', function () {
- before(function () {
- console.log('before one');
- });
-
- after(function () {
- console.log('after one');
- });
-
- beforeEach(function () {
- console.log(' before each one');
- });
-
- afterEach(function () {
- console.log(' after each one');
- });
-
- describe('two', function () {
- before(function () {
- console.log(' before two');
- });
-
- after(function () {
- console.log(' after two');
- });
-
- beforeEach(function () {
- console.log(' before each two');
- });
-
- afterEach(function () {
- console.log(' after each two');
- });
-
- describe('three', function () {
- before(function () {
- console.log(' before three');
- });
-
- after(function () {
- console.log(' after three');
- });
-
- beforeEach(function () {
- console.log(' before each three');
- });
-
- afterEach(function () {
- console.log(' after each three');
- });
-
- it('should three', function () {
- console.log(' TEST three');
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.css.in b/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.css.in
deleted file mode 100644
index 09a3ca5363..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.css.in
+++ /dev/null
@@ -1,9 +0,0 @@
-body {
- font: "Helvetica Neue", Helvetica, arial, sans-serif;
- background: black;
- color: white;
-}
-
-a {
- color: blue
-}
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.css.out b/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.css.out
deleted file mode 100644
index 53b3ec906e..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.css.out
+++ /dev/null
@@ -1,13 +0,0 @@
-body {
- font: "Helvetica Neue", Helvetica, arial, sans-serif;
- background: black;
- color: #fff;
-}
-
-a {
- color: blue;
-}
-
-foo {
- bar: 'baz';
-}
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.fixture.js
deleted file mode 100644
index 50ea00bee0..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/diffs.fixture.js
+++ /dev/null
@@ -1,113 +0,0 @@
-'use strict';
-
-var fs = require('fs');
-var cssin = fs.readFileSync('test/integration/fixtures/diffs/diffs.css.in', 'ascii');
-var cssout = fs.readFileSync('test/integration/fixtures/diffs/diffs.css.out', 'ascii');
-
-describe('diffs', function () {
- var actual, expected;
-
- it('should display a diff for small strings', function () {
- actual = 'foo rar baz';
- expected = 'foo bar baz';
- actual.should.equal(expected);
- });
-
- it('should display a diff of canonicalized objects', function () {
- actual = { name: 'travis j', age: 23 };
- expected = { age: 23, name: 'travis' };
- actual.should.equal(expected);
- });
-
- it('should display a diff for medium strings', function () {
- actual = 'foo bar baz\nfoo rar baz\nfoo bar raz';
- expected = 'foo bar baz\nfoo bar baz\nfoo bar baz';
- actual.should.equal(expected);
- });
-
- it('should display a diff for entire object dumps', function () {
- actual = {
- name: 'joel',
- age: 30,
- address: {
- city: 'new york',
- country: 'usa'
- }
- };
- expected = {
- name: 'joe',
- age: 30,
- address: {
- city: 'new york',
- country: 'us'
- }
- };
- actual.should.equal(expected);
- });
-
- it('should display a diff for multi-line strings', function () {
- actual = 'one two three\nfour zzzz six\nseven eight nine';
- expected = 'one two three\nfour five six\nseven eight nine';
- actual.should.equal(expected);
- });
-
- it('should display a diff for entire object dumps', function () {
- actual = {
- name: 'joel',
- age: 30,
- address: {
- city: 'new york',
- country: 'usa'
- }
- };
- expected = {
- name: 'joe',
- age: 30,
- address: {
- city: 'new york',
- country: 'us'
- }
- };
- actual.should.equal(expected);
- });
-
- it('should display a full-comparison with escaped special characters', function () {
- actual = 'one\ttab\ntwo\t\t\ttabs';
- expected = 'one\ttab\ntwo\t\ttabs';
- actual.should.equal(expected);
- });
-
- it('should display a word diff for large strings', function () {
- cssin.should.equal(cssout);
- });
-
- it('should work with objects', function () {
- actual = {
- name: 'tobi',
- species: 'ferret',
- color: 'white',
- age: 2
- };
-
- expected = {
- name: 'loki',
- species: 'ferret',
- color: 'brown',
- age: 2
- };
-
- actual.should.eql(expected);
- });
-
- it('should show value diffs and not be affected by commas', function () {
- actual = { a: 123 };
- expected = { a: 123, b: 456 };
- actual.should.equal(expected);
- });
-
- it('should display diff by data and not like an objects', function () {
- actual = new Buffer([0x01]);
- expected = new Buffer([0x02]);
- actual.should.equal(expected);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/output b/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/output
deleted file mode 100644
index bf56a96397..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/diffs/output
+++ /dev/null
@@ -1,91 +0,0 @@
-// DIFF
- -foo rar baz
- +foo bar baz
-
-// DIFF
- {
- "age": 23
- - "name": "travis j"
- + "name": "travis"
- }
-
-// DIFF
- foo bar baz
- -foo rar baz
- -foo bar raz
- +foo bar baz
- +foo bar baz
-
-// DIFF
- {
- "address": {
- "city": "new york"
- - "country": "usa"
- + "country": "us"
- }
- "age": 30
- - "name": "joel"
- + "name": "joe"
- }
-
-// DIFF
- one two three
- -four zzzz six
- +four five six
- seven eight nine
-
-// DIFF
- {
- "address": {
- "city": "new york"
- - "country": "usa"
- + "country": "us"
- }
- "age": 30
- - "name": "joel"
- + "name": "joe"
- }
-
-// DIFF
- one tab
- -two tabs
- +two tabs
-
-// DIFF
- body {
- font: "Helvetica Neue", Helvetica, arial, sans-serif;
- background: black;
- - color: white;
- + color: #fff;
- }
-
- a {
- - color: blue
- + color: blue;
- }
- +
- +foo {
- + bar: 'baz';
- +}
-
-// DIFF
- {
- "age": 2
- - "color": "white"
- - "name": "tobi"
- + "color": "brown"
- + "name": "loki"
- "species": "ferret"
- }
-
-// DIFF
- {
- "a": 123
- + "b": 456
- }
-
-// DIFF
- [
- - 1
- + 2
- ]
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-async-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-async-error.fixture.js
deleted file mode 100644
index f3dfe7e1ae..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-async-error.fixture.js
+++ /dev/null
@@ -1,21 +0,0 @@
-'use strict';
-
-describe('spec 1', function () {
- after(function (done) {
- console.log('after');
- process.nextTick(function () {
- throw new Error('after hook error');
- });
- });
- it('should be called because error is in after hook', function () {
- console.log('test 1');
- });
- it('should be called because error is in after hook', function () {
- console.log('test 2');
- });
-});
-describe('spec 2', function () {
- it('should be called, because hook error was in a sibling suite', function () {
- console.log('test 3');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-error.fixture.js
deleted file mode 100644
index 7fc258f46d..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/after-hook-error.fixture.js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-
-describe('spec 1', function () {
- after(function () {
- console.log('after');
- throw new Error('after hook error');
- });
- it('should be called because error is in after hook', function () {
- console.log('test 1');
- });
- it('should be called because error is in after hook', function () {
- console.log('test 2');
- });
-});
-describe('spec 2', function () {
- it('should be called, because hook error was in a sibling suite', function () {
- console.log('test 3');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-async-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-async-error.fixture.js
deleted file mode 100644
index 442ad9321f..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-async-error.fixture.js
+++ /dev/null
@@ -1,21 +0,0 @@
-'use strict';
-
-describe('spec 1', function () {
- afterEach(function (done) {
- console.log('after');
- process.nextTick(function () {
- throw new Error('after each hook error');
- });
- });
- it('should be called because error is in after each hook', function () {
- console.log('test 1');
- });
- it('should not be called', function () {
- console.log('test 2');
- });
-});
-describe('spec 2', function () {
- it('should be called, because hook error was in a sibling suite', function () {
- console.log('test 3');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-error.fixture.js
deleted file mode 100644
index 5fb9a36c8d..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/afterEach-hook-error.fixture.js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-
-describe('spec 1', function () {
- afterEach(function () {
- console.log('after');
- throw new Error('after each hook error');
- });
- it('should be called because error is in after each hook', function () {
- console.log('test 1');
- });
- it('should not be called', function () {
- console.log('test 2');
- });
-});
-describe('spec 2', function () {
- it('should be called, because hook error was in a sibling suite', function () {
- console.log('test 3');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error-tip.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error-tip.fixture.js
deleted file mode 100644
index 04801c1946..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error-tip.fixture.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-
-describe('spec 1', function () {
- it('should not blame me', function () { });
-});
-describe('spec 2', function () {
- before(function (done) {
- process.nextTick(function () {
- throw new Error('before hook error');
- });
- });
- it('skipped');
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error.fixture.js
deleted file mode 100644
index 2530eec783..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-async-error.fixture.js
+++ /dev/null
@@ -1,21 +0,0 @@
-'use strict';
-
-describe('spec 1', function () {
- before(function (done) {
- console.log('before');
- process.nextTick(function () {
- throw new Error('before hook error');
- });
- });
- it('should not be called because of error in before hook', function () {
- console.log('test 1');
- });
- it('should not be called because of error in before hook', function () {
- console.log('test 2');
- });
-});
-describe('spec 2', function () {
- it('should be called, because hook error was in a sibling suite', function () {
- console.log('test 3');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error-tip.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error-tip.fixture.js
deleted file mode 100644
index 64df731573..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error-tip.fixture.js
+++ /dev/null
@@ -1,11 +0,0 @@
-'use strict';
-
-describe('spec 1', function () {
- it('should not blame me', function () { });
-});
-describe('spec 2', function () {
- before(function () {
- throw new Error('before hook error');
- });
- it('skipped');
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error.fixture.js
deleted file mode 100644
index 547e54a243..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/before-hook-error.fixture.js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-
-describe('spec 1', function () {
- before(function () {
- console.log('before');
- throw new Error('before hook error');
- });
- it('should not be called because of error in before hook', function () {
- console.log('test 1');
- });
- it('should not be called because of error in before hook', function () {
- console.log('test 2');
- });
-});
-describe('spec 2', function () {
- it('should be called, because hook error was in a sibling suite', function () {
- console.log('test 3');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-async-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-async-error.fixture.js
deleted file mode 100644
index 6ce27784a6..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-async-error.fixture.js
+++ /dev/null
@@ -1,21 +0,0 @@
-'use strict';
-
-describe('spec 1', function () {
- beforeEach(function (done) {
- console.log('before');
- process.nextTick(function () {
- throw new Error('before each hook error');
- });
- });
- it('should not be called because of error in before each hook', function () {
- console.log('test 1');
- });
- it('should not be called because of error in before each hook', function () {
- console.log('test 2');
- });
-});
-describe('spec 2', function () {
- it('should be called, because hook error was in a sibling suite', function () {
- console.log('test 3');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-error.fixture.js
deleted file mode 100644
index 4c0ab2f237..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/beforeEach-hook-error.fixture.js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-
-describe('spec 1', function () {
- beforeEach(function () {
- console.log('before');
- throw new Error('before each hook error');
- });
- it('should not be called because of error in before each hook', function () {
- console.log('test 1');
- });
- it('should not be called because of error in before each hook', function () {
- console.log('test 2');
- });
-});
-describe('spec 2', function () {
- it('should be called, because hook error was in a sibling suite', function () {
- console.log('test 3');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-async-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-async-error.fixture.js
deleted file mode 100644
index 858bbb3c5e..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-async-error.fixture.js
+++ /dev/null
@@ -1,141 +0,0 @@
-'use strict';
-
-before(function () {
- console.log('root before');
-});
-beforeEach(function () {
- console.log('root before each');
-});
-describe('1', function () {
- beforeEach(function () {
- console.log('1 before each');
- });
-
- describe('1-1', function () {
- before(function () {
- console.log('1-1 before');
- });
- beforeEach(function (done) {
- console.log('1-1 before each');
- process.nextTick(function () {
- throw new Error('1-1 before each hook failed');
- });
- });
- it('1-1 test 1', function () {
- console.log('1-1 test 1');
- });
- it('1-1 test 2', function () {
- console.log('1-1 test 2');
- });
- afterEach(function () {
- console.log('1-1 after each');
- });
- after(function (done) {
- console.log('1-1 after');
- process.nextTick(function () {
- throw new Error('1-1 after hook failed');
- });
- });
- });
-
- describe('1-2', function () {
- before(function () {
- console.log('1-2 before');
- });
- beforeEach(function () {
- console.log('1-2 before each');
- });
- it('1-2 test 1', function () {
- console.log('1-2 test 1');
- });
- it('1-2 test 2', function () {
- console.log('1-2 test 2');
- });
- afterEach(function (done) {
- console.log('1-2 after each');
- process.nextTick(function () {
- throw new Error('1-2 after each hook failed');
- });
- });
- after(function () {
- console.log('1-2 after');
- });
- });
-
- afterEach(function () {
- console.log('1 after each');
- });
-
- after(function () {
- console.log('1 after');
- });
-});
-
-describe('2', function () {
- beforeEach(function (done) {
- console.log('2 before each');
- process.nextTick(function () {
- throw new Error('2 before each hook failed');
- });
- });
-
- describe('2-1', function () {
- before(function () {
- console.log('2-1 before');
- });
- beforeEach(function () {
- console.log('2-1 before each');
- });
- it('2-1 test 1', function () {
- console.log('2-1 test 1');
- });
- it('2-1 test 2', function () {
- console.log('2-1 test 2');
- });
- afterEach(function () {
- console.log('2-1 after each');
- });
- after(function () {
- console.log('2-1 after');
- });
- });
-
- describe('2-2', function () {
- before(function () {
- console.log('2-2 before');
- });
- beforeEach(function () {
- console.log('2-2 before each');
- });
- it('2-2 test 1', function () {
- console.log('2-2 test 1');
- });
- it('2-2 test 2', function () {
- console.log('2-2 test 2');
- });
- afterEach(function () {
- console.log('2-2 after each');
- });
- after(function () {
- console.log('2-2 after');
- });
- });
-
- afterEach(function (done) {
- console.log('2 after each');
- process.nextTick(function () {
- throw new Error('2 after each hook failed');
- });
- });
-
- after(function () {
- console.log('2 after');
- });
-});
-
-after(function () {
- console.log('root after');
-});
-afterEach(function () {
- console.log('root after each');
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-error.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-error.fixture.js
deleted file mode 100644
index 085978ef79..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/hooks/multiple-hook-error.fixture.js
+++ /dev/null
@@ -1,131 +0,0 @@
-'use strict';
-
-before(function () {
- console.log('root before');
-});
-beforeEach(function () {
- console.log('root before each');
-});
-describe('1', function () {
- beforeEach(function () {
- console.log('1 before each');
- });
-
- describe('1-1', function () {
- before(function () {
- console.log('1-1 before');
- });
- beforeEach(function () {
- console.log('1-1 before each');
- throw new Error('1-1 before each hook failed');
- });
- it('1-1 test 1', function () {
- console.log('1-1 test 1');
- });
- it('1-1 test 2', function () {
- console.log('1-1 test 2');
- });
- afterEach(function () {
- console.log('1-1 after each');
- });
- after(function () {
- console.log('1-1 after');
- throw new Error('1-1 after hook failed');
- });
- });
-
- describe('1-2', function () {
- before(function () {
- console.log('1-2 before');
- });
- beforeEach(function () {
- console.log('1-2 before each');
- });
- it('1-2 test 1', function () {
- console.log('1-2 test 1');
- });
- it('1-2 test 2', function () {
- console.log('1-2 test 2');
- });
- afterEach(function () {
- console.log('1-2 after each');
- throw new Error('1-2 after each hook failed');
- });
- after(function () {
- console.log('1-2 after');
- });
- });
-
- afterEach(function () {
- console.log('1 after each');
- });
-
- after(function () {
- console.log('1 after');
- });
-});
-
-describe('2', function () {
- beforeEach(function () {
- console.log('2 before each');
- throw new Error('2 before each hook failed');
- });
-
- describe('2-1', function () {
- before(function () {
- console.log('2-1 before');
- });
- beforeEach(function () {
- console.log('2-1 before each');
- });
- it('2-1 test 1', function () {
- console.log('2-1 test 1');
- });
- it('2-1 test 2', function () {
- console.log('2-1 test 2');
- });
- afterEach(function () {
- console.log('2-1 after each');
- });
- after(function () {
- console.log('2-1 after');
- });
- });
-
- describe('2-2', function () {
- before(function () {
- console.log('2-2 before');
- });
- beforeEach(function () {
- console.log('2-2 before each');
- });
- it('2-2 test 1', function () {
- console.log('2-2 test 1');
- });
- it('2-2 test 2', function () {
- console.log('2-2 test 2');
- });
- afterEach(function () {
- console.log('2-2 after each');
- });
- after(function () {
- console.log('2-2 after');
- });
- });
-
- afterEach(function () {
- console.log('2 after each');
- throw new Error('2 after each hook failed');
- });
-
- after(function () {
- console.log('2 after');
- });
-});
-
-after(function () {
- console.log('root after');
-});
-afterEach(function () {
- console.log('root after each');
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-before.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-before.fixture.js
deleted file mode 100644
index 1e1bc71a16..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-before.fixture.js
+++ /dev/null
@@ -1,12 +0,0 @@
-'use strict';
-
-describe('suite', function () {
- before(function (done) {
- setTimeout(done, 10);
- setTimeout(done, 30);
- });
-
- it('test1', function (done) {
- setTimeout(done, 50);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-beforeEach.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-beforeEach.fixture.js
deleted file mode 100644
index 32de2bf442..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-beforeEach.fixture.js
+++ /dev/null
@@ -1,16 +0,0 @@
-'use strict';
-
-describe('suite', function () {
- beforeEach(function (done) {
- setTimeout(done, 10);
- setTimeout(done, 20);
- });
-
- it('test1', function (done) {
- setTimeout(done, 50);
- });
-
- it('test2', function (done) {
- setTimeout(done, 50);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-specs.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-specs.fixture.js
deleted file mode 100644
index a8ae6d1ac4..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done-specs.fixture.js
+++ /dev/null
@@ -1,12 +0,0 @@
-'use strict';
-
-describe('suite', function () {
- it('test1', function (done) {
- done();
- setTimeout(done, 10);
- });
-
- it('test2', function (done) {
- setTimeout(done, 20);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done.fixture.js
deleted file mode 100644
index f1b471c678..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/multiple-done.fixture.js
+++ /dev/null
@@ -1,20 +0,0 @@
-'use strict';
-
-// The suite below should result in an additional error, but does
-// not. Uncomment once this bug is resolved.
-
-// describe('suite', function() {
-// beforeEach(function(done) {
-// done();
-// done();
-// });
-
-// it('test', function() {});
-// });
-
-it('should fail in a test-case', function (done) {
- process.nextTick(function () {
- done();
- done();
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/async-only-async.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/async-only-async.fixture.js
deleted file mode 100644
index d5ba2b37a0..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/async-only-async.fixture.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-it('should pass', function (done) {
- done();
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/async-only-sync.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/async-only-sync.fixture.js
deleted file mode 100644
index 512fd0e4db..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/async-only-sync.fixture.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict';
-
-it('throws an error', function () {});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/bail.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/bail.fixture.js
deleted file mode 100644
index 5095e63158..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/bail.fixture.js
+++ /dev/null
@@ -1,23 +0,0 @@
-'use strict';
-
-describe('suite1', function () {
- it('should display this spec', function () {});
-
- it('should only display this error', function (done) {
- throw new Error('this should be displayed');
- });
-
- it('should not display this error', function (done) {
- throw new Error('this should not be displayed');
- });
-});
-
-describe('suite2', function () {
- before(function (done) {
- throw new Error('this hook should not be displayed');
- });
-
- it('should not display this error', function (done) {
- throw new Error('this should not be displayed');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/delay-fail.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/delay-fail.fixture.js
deleted file mode 100644
index 644cbc0281..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/delay-fail.fixture.js
+++ /dev/null
@@ -1,8 +0,0 @@
-'use strict';
-
-setTimeout(function () {
- throw new Error('oops');
- /* eslint no-unreachable: off */
- it('test', function () {});
- run();
-}, 100);
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/delay.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/delay.fixture.js
deleted file mode 100644
index b2d49217db..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/delay.fixture.js
+++ /dev/null
@@ -1,16 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var delay = 500;
-
-setTimeout(function () {
- describe('delayed execution', function () {
- it('should have no effect if attempted twice in the same suite', function () {
- assert(true);
- run();
- assert(true);
- });
- });
-
- run();
-}, delay);
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/grep.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/grep.fixture.js
deleted file mode 100644
index 0939d084ec..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/grep.fixture.js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-
-describe('grep', function () {
- describe('Match', function () {
- it('should run', function () {});
- it('should also run', function () {});
- });
-
- describe('match', function () {
- it('should run', function () {});
- it('should also run', function () {});
- });
-
- describe('fail', function () {
- it('should not be ran', function () {
- throw new Error('Spec should not run');
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/bdd.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/bdd.fixture.js
deleted file mode 100644
index 39323f3567..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/bdd.fixture.js
+++ /dev/null
@@ -1,72 +0,0 @@
-'use strict';
-
-describe.only('should run this suite', function () {
- it('should run this test', function () {});
-
- it('should run this test', function () {});
-
- it('should run this test', function () {});
-});
-
-describe('should not run this suite', function () {
- it('should not run this test', function () {
- (true).should.equal(false);
- });
-
- it('should not run this test', function () {
- (true).should.equal(false);
- });
-
- it('should not run this test', function () {
- (true).should.equal(false);
- });
-});
-
-describe.only('should run this suite too', function () {
- describe('should run this nested suite', function () {
- it('should run this test', function () {});
-
- it('should run this test', function () {});
-
- it('should run this test', function () {});
- });
-});
-
-describe.only('should run this suite, even', function () {
- describe('should run this nested suite, even', function () {
- describe('should run this doubly-nested suite!', function () {
- it('should run this test', function () {});
-
- it('should run this test', function () {});
-
- it('should run this test', function () {});
- });
- });
-});
-
-describe('should run this suite with an exclusive test', function () {
- it.only('should run this test', function () {});
-
- describe('should not run this nested suite', function () {
- describe.only('should not run this doubly-nested suite', function () {
- it('should not run this test', function () {});
-
- it('should not run this test', function () {});
-
- it('should not run this test', function () {});
- });
- });
-});
-
-describe('should run this suite with an exclusive test (reverse order)', function () {
- describe('should not run this nested suite', function () {
- describe.only('should not run this doubly-nested suite', function () {
- it('should not run this test', function () {});
-
- it('should not run this test', function () {});
-
- it('should not run this test', function () {});
- });
- });
- it.only('should run this test', function () {});
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/qunit.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/qunit.fixture.js
deleted file mode 100644
index 8bc598030d..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/qunit.fixture.js
+++ /dev/null
@@ -1,27 +0,0 @@
-'use strict';
-
-suite.only('should run all tests in this suite');
-
-test('should run this test #1', function () {});
-
-test('should run this test #2', function () {});
-
-test('should run this test #3', function () {});
-
-test('should run this test #4', function () {});
-
-test('should run this test #5', function () {});
-
-suite('should not run any of this suite\'s tests');
-
-test('should not run this test', function () {
- (false).should.equal(true);
-});
-
-test('should not run this test', function () {
- (false).should.equal(true);
-});
-
-test('should not run this test', function () {
- (false).should.equal(true);
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/tdd.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/tdd.fixture.js
deleted file mode 100644
index 987ee6bfba..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/only/tdd.fixture.js
+++ /dev/null
@@ -1,37 +0,0 @@
-'use strict';
-
-suite.only('should run all tests in this tdd suite', function () {
- test('should run this test #1', function () {});
-
- test('should run this test #2', function () {});
-
- test('should run this test #3', function () {});
-
- test('should run this test #4', function () {});
-});
-
-suite('should not run this suite', function () {
- test('should not run this test', function () {
- (true).should.equal(false);
- });
-
- test('should not run this test', function () {
- (true).should.equal(false);
- });
-
- test('should not run this test', function () {
- (true).should.equal(false);
- });
-});
-
-suite.only('should run this suite too', function () {
- suite('should run this nested suite', function () {
- test('should run this test', function () {});
-
- test('should run this test', function () {});
-
- test('should run this test', function () {});
-
- test('should run this test', function () {});
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/retries.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/retries.fixture.js
deleted file mode 100644
index 8d2b0a40b6..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/retries.fixture.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-describe('retries', function () {
- it('should fail', function () {
- throw new Error('retry failure');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/sort-alpha.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/sort-alpha.fixture.js
deleted file mode 100644
index dd74303163..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/sort-alpha.fixture.js
+++ /dev/null
@@ -1,9 +0,0 @@
-'use strict';
-
-describe('alpha', function () {
- it('should be executed first', function () {
- if (global.beta) {
- throw new Error('alpha was not executed first');
- }
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/sort-beta.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/options/sort-beta.fixture.js
deleted file mode 100644
index 56da4a6523..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/options/sort-beta.fixture.js
+++ /dev/null
@@ -1,7 +0,0 @@
-'use strict';
-
-describe('beta', function () {
- it('should be executed second', function () {
- global.beta = 1;
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/passing.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/passing.fixture.js
deleted file mode 100644
index baf142026d..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/passing.fixture.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-
-describe('suite', function () {
- it('test1', function () {
- assert(true);
- });
-
- it('test2', function () {
- assert(true);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-before.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-before.fixture.js
deleted file mode 100644
index efeaa93899..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-before.fixture.js
+++ /dev/null
@@ -1,18 +0,0 @@
-'use strict';
-
-describe('skip in before', function () {
- before(function (done) {
- var self = this;
- setTimeout(function () {
- self.skip();
- }, 50);
- });
-
- it('should never run this test', function () {
- throw new Error('never thrown');
- });
-
- it('should never run this test', function () {
- throw new Error('never thrown');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-beforeEach.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-beforeEach.fixture.js
deleted file mode 100644
index d6225564ba..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-beforeEach.fixture.js
+++ /dev/null
@@ -1,18 +0,0 @@
-'use strict';
-
-describe('skip in beforeEach', function () {
- beforeEach(function (done) {
- var self = this;
- setTimeout(function () {
- self.skip();
- }, 50);
- });
-
- it('should never run this test', function () {
- throw new Error('never thrown');
- });
-
- it('should never run this test', function () {
- throw new Error('never thrown');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-spec.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-spec.fixture.js
deleted file mode 100644
index 44707b026c..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-async-spec.fixture.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-describe('skip in test', function () {
- it('should skip async', function (done) {
- var self = this;
- setTimeout(function () {
- self.skip();
- }, 50);
- });
-
- it('should run other tests in the suite', function () {
- // Do nothing
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-before.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-before.fixture.js
deleted file mode 100644
index 5e3b208efa..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-before.fixture.js
+++ /dev/null
@@ -1,15 +0,0 @@
-'use strict';
-
-describe('skip in before', function () {
- before(function () {
- this.skip();
- });
-
- it('should never run this test', function () {
- throw new Error('never thrown');
- });
-
- it('should never run this test', function () {
- throw new Error('never thrown');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-beforeEach.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-beforeEach.fixture.js
deleted file mode 100644
index 0bd155ba55..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-beforeEach.fixture.js
+++ /dev/null
@@ -1,15 +0,0 @@
-'use strict';
-
-describe('skip in beforeEach', function () {
- beforeEach(function () {
- this.skip();
- });
-
- it('should never run this test', function () {
- throw new Error('never thrown');
- });
-
- it('should never run this test', function () {
- throw new Error('never thrown');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-spec.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-spec.fixture.js
deleted file mode 100644
index 1d22f0b77d..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/skip-sync-spec.fixture.js
+++ /dev/null
@@ -1,12 +0,0 @@
-'use strict';
-
-describe('skip in test', function () {
- it('should skip immediately', function () {
- this.skip();
- throw new Error('never thrown');
- });
-
- it('should run other tests in the suite', function () {
- // Do nothing
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/spec.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/spec.fixture.js
deleted file mode 100644
index d750fcad1a..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/pending/spec.fixture.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-describe('suite', function () {
- it('pending spec');
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/1794/issue-1794.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/1794/issue-1794.fixture.js
deleted file mode 100644
index 8867369546..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/1794/issue-1794.fixture.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict';
-
-test('pass', function () {
- // pass
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/1794/simple-ui.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/1794/simple-ui.js
deleted file mode 100644
index 5cfde0465f..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/1794/simple-ui.js
+++ /dev/null
@@ -1,28 +0,0 @@
-'use strict';
-
-var path = '../../../../../lib/';
-var Mocha = require(path + 'mocha');
-var Test = require(path + 'test');
-
-/**
- * A simple UI that only exposes a single function: test
- */
-module.exports = Mocha.interfaces['simple-ui'] = function (suite) {
- suite.on('pre-require', function (context, file, mocha) {
- var common = require(path + 'interfaces/common')([suite], context);
-
- context.run = mocha.options.delay && common.runWithSuite(suite);
-
- /**
- * Describes a specification or test-case with the given `title`
- * and callback `fn` acting as a thunk.
- */
- context.test = function (title, fn) {
- var test = new Test(title, fn);
- test.file = file;
- suite.addTest(test);
-
- return test;
- };
- });
-};
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1327.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1327.fixture.js
deleted file mode 100644
index e788278d6d..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1327.fixture.js
+++ /dev/null
@@ -1,17 +0,0 @@
-'use strict';
-
-it('test 1', function () {
- console.log('testbody1');
- process.nextTick(function () {
- throw new Error('Too bad');
- });
-});
-
-it('test 2', function () {
- console.log('testbody2');
-});
-
-it('test 3', function () {
- console.log('testbody3');
- throw new Error('OUCH');
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1417.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1417.js
deleted file mode 100644
index 13ce053784..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1417.js
+++ /dev/null
@@ -1,22 +0,0 @@
-'use strict';
-
-/**
- * This file should generate only one failure per spec for the thrown error.
- * It should not report misleading 'multiple calls to done()'.
- */
-
-it('fails exactly once when a global error is thrown synchronously and done errors', function (done) {
- setTimeout(function () {
- done(new Error('test error'));
- }, 1); // Not 0 - it will 'succeed', but won't test the breaking condition
-
- throw new Error('sync error');
-});
-
-it('fails exactly once when a global error is thrown synchronously and done completes', function (done) {
- setTimeout(function () {
- done();
- }, 1); // Not 0 - it will 'succeed', but won't test the breaking condition
-
- throw new Error('sync error');
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1991.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1991.fixture.js
deleted file mode 100644
index 024f02519f..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-1991.fixture.js
+++ /dev/null
@@ -1,49 +0,0 @@
-'use strict';
-
-/* eslint no-unused-vars: off */
-
-function MemoryLeak () {
- this.myArr = [];
- for (var i = 0; i < 1000000; i++) {
- this.myArr.push(i);
- }
-}
-
-var numOfTests = 300;
-for (var i = 0; i < numOfTests; i += 1) {
- /*
- * This Test suite will crash V8 due to:
- * 'FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory'
- * if all the deferred functions references have not been cleared
- */
- describe('Memory Leak Suite #' + i, function () {
- // The <closureVar> variable will be accessed by the test below.
- // As long as those test's functions are
- // referenced in memory, the closure variable may not be garbage collected
- // as it is still referenced.
- // * In a chrome heap snapshot it will appear under "system / Context" (a scope)
- var closureVar;
-
- before(function () {
- var x = closureVar ? 1 : 2;
- });
-
- after(function () {
- var x = closureVar[0];
- });
-
- beforeEach(function () {
- var x = closureVar ? 1 : 2;
- });
-
- afterEach(function () {
- var x = closureVar[0];
- });
-
- it('access a variable via a closure', function () {
- // slow performance on older node.js versions
- this.timeout(1000);
- closureVar = new MemoryLeak();
- });
- });
-}
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2315.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2315.js
deleted file mode 100644
index fe18841d1c..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2315.js
+++ /dev/null
@@ -1,11 +0,0 @@
-'use strict';
-
-describe('issue-2315: cannot read property currentRetry of undefined', function () {
- before(function () {
- process.nextTick(function () {
- throw new Error();
- });
- });
-
- it('something', function () {});
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2406.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2406.fixture.js
deleted file mode 100644
index b3770014dd..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2406.fixture.js
+++ /dev/null
@@ -1,17 +0,0 @@
-'use strict';
-
-describe('outer describe', function () {
- it('should not run this test', function () {});
- describe('this suite should not run', function () {
- it('should not run this test', function () {});
- });
- describe.only('this .only suite should run', function () {
- describe('this suite should run', function () {
- it('should run this test in a nested suite', function () {});
- });
- it('should run this test', function () {});
- });
- describe('this suite should not run', function () {
- it('should not run this test', function () {});
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2417.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2417.fixture.js
deleted file mode 100644
index 58f49cf846..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/regression/issue-2417.fixture.js
+++ /dev/null
@@ -1,9 +0,0 @@
-'use strict';
-
-describe('outer describe', function () {
- describe.only('outer describe.only', function () {
- it.only('inner it.only', function () {
- // should run and exit without error
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/async.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/async.fixture.js
deleted file mode 100644
index 56d067fc05..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/async.fixture.js
+++ /dev/null
@@ -1,30 +0,0 @@
-'use strict';
-
-describe('retries', function () {
- var times = 0;
- before(function () {
- console.log('before');
- });
-
- after(function () {
- console.log('after');
- });
-
- beforeEach(function () {
- console.log('before each', times);
- });
-
- afterEach(function () {
- console.log('after each', times);
- });
-
- it('should allow override and run appropriate hooks', function (done) {
- this.timeout(200);
- this.retries(2);
- console.log('TEST', times);
- if (++times < 3) {
- return setTimeout(done, 300);
- }
- setTimeout(done, 50);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/early-pass.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/early-pass.fixture.js
deleted file mode 100644
index ddad40399e..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/early-pass.fixture.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-
-describe('retries', function () {
- this.retries(1);
- var times = 0;
-
- it('should pass after 1 retry', function () {
- times++;
- if (times !== 2) {
- throw new Error('retry error ' + times);
- }
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/hooks.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/hooks.fixture.js
deleted file mode 100644
index b4fc081aaa..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/hooks.fixture.js
+++ /dev/null
@@ -1,27 +0,0 @@
-'use strict';
-
-describe('retries', function () {
- var times = 0;
- before(function () {
- console.log('before');
- });
-
- after(function () {
- console.log('after');
- });
-
- beforeEach(function () {
- console.log('before each', times);
- });
-
- afterEach(function () {
- console.log('after each', times);
- });
-
- it('should allow override and run appropriate hooks', function () {
- this.retries(4);
- console.log('TEST', times);
- times++;
- throw new Error('retry error');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/nested.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/nested.fixture.js
deleted file mode 100644
index 877d519d7f..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/retries/nested.fixture.js
+++ /dev/null
@@ -1,11 +0,0 @@
-'use strict';
-
-describe('retries', function () {
- this.retries(3);
- describe('nested', function () {
- it('should fail after only 1 retry', function () {
- this.retries(1);
- throw new Error('retry error');
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-no-callback.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-no-callback.fixture.js
deleted file mode 100644
index 80d046438f..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-no-callback.fixture.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict';
-
-describe('a suite without a callback');
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-skipped-callback.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-skipped-callback.fixture.js
deleted file mode 100644
index 6def25de7f..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-skipped-callback.fixture.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict';
-
-xdescribe('a pending suite with a callback', function () {});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-skipped-no-callback.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-skipped-no-callback.fixture.js
deleted file mode 100644
index e9381159bf..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/suite/suite-skipped-no-callback.fixture.js
+++ /dev/null
@@ -1,3 +0,0 @@
-'use strict';
-
-xdescribe('a pending suite without a callback');
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/timeout.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/timeout.fixture.js
deleted file mode 100644
index d237436811..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/timeout.fixture.js
+++ /dev/null
@@ -1,19 +0,0 @@
-'use strict';
-
-describe('timeout', function () {
- this.timeout(1);
-
- it('should be honored with sync suites', function () {
- sleep(2);
- });
-
- it('should be honored with async suites', function (done) {
- sleep(2);
- done();
- });
-
- function sleep (ms) {
- var start = Date.now();
- while (start + ms > Date.now());
- }
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/uncaught-hook.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/uncaught-hook.fixture.js
deleted file mode 100644
index 54f30c56e9..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/uncaught-hook.fixture.js
+++ /dev/null
@@ -1,15 +0,0 @@
-'use strict';
-
-describe('uncaught', function () {
- beforeEach(function (done) {
- process.nextTick(function () {
- throw new Error('oh noes');
- });
- });
-
- it('test', function (done) {
- process.nextTick(function () {
- throw new Error("I'm uncaught!");
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/fixtures/uncaught.fixture.js b/tests/lib/mocha-3.1.2/test/integration/fixtures/uncaught.fixture.js
deleted file mode 100644
index 6a2ded880c..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/fixtures/uncaught.fixture.js
+++ /dev/null
@@ -1,22 +0,0 @@
-'use strict';
-
-/**
- * This file should only generate one failure per spec despite the fact that
- * Mocha is capable of detecting two distinct exceptions during test execution.
- */
-
-it('fails exactly once when a global error is thrown first', function (done) {
- setTimeout(function () {
- throw new Error('global error');
- }, 0);
-});
-
-it('fails exactly once when a global error is thrown second', function (done) {
- setTimeout(function () {
- done(new Error('test error'));
- }, 0);
-
- setTimeout(function () {
- throw new Error('global error');
- }, 0);
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/helpers.js b/tests/lib/mocha-3.1.2/test/integration/helpers.js
deleted file mode 100644
index 7f6a608a6f..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/helpers.js
+++ /dev/null
@@ -1,193 +0,0 @@
-'use strict';
-
-var spawn = require('child_process').spawn;
-var path = require('path');
-var fs = require('fs');
-var baseReporter = require('../../lib/reporters/base');
-
-module.exports = {
- /**
- * Invokes the mocha binary for the given fixture with color output disabled.
- * Accepts an array of additional command line args to pass. The callback is
- * invoked with a summary of the run, in addition to its output. The summary
- * includes the number of passing, pending, and failing tests, as well as the
- * exit code. Useful for testing different reporters.
- *
- * Example response:
- * {
- * pending: 0,
- * passing: 0,
- * failing: 1,
- * code: 1,
- * output: '...'
- * }
- *
- * @param {string} fixturePath
- * @param {array} args
- * @param {function} fn
- */
- runMocha: function (fixturePath, args, fn) {
- var path;
-
- path = resolveFixturePath(fixturePath);
- args = args || [];
-
- invokeMocha(args.concat(['-C', path]), function (err, res) {
- if (err) return fn(err);
-
- fn(null, getSummary(res));
- });
- },
-
- /**
- * Invokes the mocha binary on the code of the body of the function.
- * Accepts an array of additional command line args to pass. The callback is
- * invoked with a summary of the run, in addition to its output. The summary
- * includes the number of passing, pending, and failing tests, as well as the
- * exit code. Useful for testing different reporters.
- *
- * Example response:
- * {
- * pending: 0,
- * passing: 0,
- * failing: 1,
- * code: 1,
- * output: '...'
- * }
- *
- * @param {function} fixture
- * @param {array} args
- * @param {function} fn
- */
- runMochaFunction: function (fixture, args, fn) {
- var path = resolveFixturePath(fixture.name + '.js' || 'tempfile.js');
- args = args || [];
-
- var fixtureContent = 'var fn = ' + fixture.toString() + '; fn()';
- fs.writeFileSync(path, fixtureContent, 'utf8');
-
- function cleanup () {
- fs.unlink(path);
- fn.apply(this, arguments);
- }
-
- invokeMocha(args.concat(['-C', path]), function (err, res) {
- if (err) {
- return cleanup(err);
- }
-
- cleanup(null, getSummary(res));
- });
- },
-
- /**
- * Invokes the mocha binary for the given fixture using the JSON reporter,
- * returning the parsed output, as well as exit code.
- *
- * @param {string} fixturePath
- * @param {array} args
- * @param {function} fn
- */
- runMochaJSON: function (fixturePath, args, fn) {
- var path;
-
- path = resolveFixturePath(fixturePath);
- args = args || [];
-
- invokeMocha(args.concat(['--reporter', 'json', path]), function (err, res) {
- if (err) return fn(err);
-
- try {
- var result = JSON.parse(res.output);
- result.code = res.code;
- } catch (err) {
- return fn(err);
- }
-
- fn(null, result);
- });
- },
-
- /**
- * Returns an array of diffs corresponding to exceptions thrown from specs,
- * given the plaintext output (-C) of a mocha run.
- *
- * @param {string} output
- * returns {string[]}
- */
- getDiffs: function (output) {
- var diffs, i, inDiff, inStackTrace;
-
- diffs = [];
- output.split('\n').forEach(function (line) {
- if (line.match(/^\s{2}\d+\)/)) {
- // New spec, e.g. "1) spec title"
- diffs.push([]);
- i = diffs.length - 1;
- inStackTrace = false;
- inDiff = false;
- } else if (!diffs.length || inStackTrace) {
- // Haven't encountered a spec yet
- // or we're in the middle of a stack trace
- return;
- } else if (line.indexOf('+ expected - actual') !== -1) {
- inDiff = true;
- } else if (line.match(/at Context/)) {
- // At the start of a stack trace
- inStackTrace = true;
- inDiff = false;
- } else if (inDiff) {
- diffs[i].push(line);
- }
- });
-
- // Ignore empty lines before/after diff
- return diffs.map(function (diff) {
- return diff.slice(1, -3).join('\n');
- });
- },
-
- /**
- * regular expression used for splitting lines based on new line / dot symbol.
- */
- splitRegExp: new RegExp('[\\n' + baseReporter.symbols.dot + ']+')
-};
-
-function invokeMocha (args, fn) {
- var output, mocha, listener;
-
- output = '';
- args = [path.join('bin', 'mocha')].concat(args);
- mocha = spawn(process.execPath, args);
-
- listener = function (data) {
- output += data;
- };
-
- mocha.stdout.on('data', listener);
- mocha.stderr.on('data', listener);
- mocha.on('error', fn);
-
- mocha.on('close', function (code) {
- fn(null, {
- output: output.split('\n').join('\n'),
- code: code
- });
- });
-}
-
-function resolveFixturePath (fixture) {
- return path.join('./test/integration/fixtures', fixture);
-}
-
-function getSummary (res) {
- return ['passing', 'pending', 'failing'].reduce(function (summary, type) {
- var pattern, match;
-
- pattern = new RegExp(' (\\d+) ' + type + '\\s');
- match = pattern.exec(res.output);
- summary[type] = (match) ? parseInt(match, 10) : 0;
-
- return summary;
- }, res);
-}
diff --git a/tests/lib/mocha-3.1.2/test/integration/hook-err.spec.js b/tests/lib/mocha-3.1.2/test/integration/hook-err.spec.js
deleted file mode 100644
index fbdd7e8e38..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/hook-err.spec.js
+++ /dev/null
@@ -1,217 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var runMocha = require('./helpers').runMocha;
-var splitRegExp = require('./helpers').splitRegExp;
-var bang = require('../../lib/reporters/base').symbols.bang;
-
-describe('hook error handling', function () {
- var lines;
-
- describe('before hook error', function () {
- before(run('hooks/before-hook-error.fixture.js'));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- ['before', bang + 'test 3']
- );
- });
- });
-
- describe('before hook error tip', function () {
- before(run('hooks/before-hook-error-tip.fixture.js', onlyErrorTitle));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- ['1) spec 2 "before all" hook:']
- );
- });
- });
-
- describe('before each hook error', function () {
- before(run('hooks/beforeEach-hook-error.fixture.js'));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- ['before', bang + 'test 3']
- );
- });
- });
-
- describe('after hook error', function () {
- before(run('hooks/after-hook-error.fixture.js'));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- ['test 1', 'test 2', 'after', bang + 'test 3']
- );
- });
- });
-
- describe('after each hook error', function () {
- before(run('hooks/afterEach-hook-error.fixture.js'));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- ['test 1', 'after', bang + 'test 3']
- );
- });
- });
-
- describe('multiple hook errors', function () {
- before(run('hooks/multiple-hook-error.fixture.js'));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- [
- 'root before',
- '1-1 before',
- 'root before each',
- '1 before each',
- '1-1 before each',
- bang + '1-1 after each',
- '1 after each',
- 'root after each',
- '1-1 after',
- bang + '1-2 before',
- 'root before each',
- '1 before each',
- '1-2 before each',
- '1-2 test 1',
- '1-2 after each',
- bang + '1 after each',
- 'root after each',
- '1-2 after',
- '1 after',
- '2-1 before',
- 'root before each',
- '2 before each',
- bang + '2 after each',
- bang + 'root after each',
- '2-1 after',
- '2 after',
- 'root after'
- ]
- );
- });
- });
-
- describe('async - before hook error', function () {
- before(run('hooks/before-hook-async-error.fixture.js'));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- ['before', bang + 'test 3']
- );
- });
- });
-
- describe('async - before hook error tip', function () {
- before(run('hooks/before-hook-async-error-tip.fixture.js', onlyErrorTitle));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- ['1) spec 2 "before all" hook:']
- );
- });
- });
-
- describe('async - before each hook error', function () {
- before(run('hooks/beforeEach-hook-async-error.fixture.js'));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- ['before', bang + 'test 3']
- );
- });
- });
-
- describe('async - after hook error', function () {
- before(run('hooks/after-hook-async-error.fixture.js'));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- ['test 1', 'test 2', 'after', bang + 'test 3']
- );
- });
- });
-
- describe('async - after each hook error', function () {
- before(run('hooks/afterEach-hook-async-error.fixture.js'));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- ['test 1', 'after', bang + 'test 3']
- );
- });
- });
-
- describe('async - multiple hook errors', function () {
- before(run('hooks/multiple-hook-async-error.fixture.js'));
- it('should verify results', function () {
- assert.deepEqual(
- lines,
- [
- 'root before',
- '1-1 before',
- 'root before each',
- '1 before each',
- '1-1 before each',
- bang + '1-1 after each',
- '1 after each',
- 'root after each',
- '1-1 after',
- bang + '1-2 before',
- 'root before each',
- '1 before each',
- '1-2 before each',
- '1-2 test 1',
- '1-2 after each',
- bang + '1 after each',
- 'root after each',
- '1-2 after',
- '1 after',
- '2-1 before',
- 'root before each',
- '2 before each',
- bang + '2 after each',
- bang + 'root after each',
- '2-1 after',
- '2 after',
- 'root after'
- ]
- );
- });
- });
-
- function run (fnPath, outputFilter) {
- return function (done) {
- runMocha(fnPath, [], function (err, res) {
- assert.ifError(err);
-
- lines = res.output
- .split(splitRegExp)
- .map(function (line) {
- return line.trim();
- })
- .filter(outputFilter || onlyConsoleOutput());
-
- done();
- });
- };
- }
-});
-
-function onlyConsoleOutput () {
- var foundSummary = false;
- return function (line) {
- if (!foundSummary) {
- foundSummary = !!(/\(\d+ms\)/).exec(line);
- }
- return !foundSummary && line.length > 0;
- };
-}
-
-function onlyErrorTitle (line) {
- return !!(/^1\)/).exec(line);
-}
diff --git a/tests/lib/mocha-3.1.2/test/integration/hooks.spec.js b/tests/lib/mocha-3.1.2/test/integration/hooks.spec.js
deleted file mode 100644
index 0d31cbfdf4..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/hooks.spec.js
+++ /dev/null
@@ -1,45 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var run = require('./helpers').runMocha;
-var splitRegExp = require('./helpers').splitRegExp;
-var args = [];
-
-describe('hooks', function () {
- it('are ran in correct order', function (done) {
- run('cascade.fixture.js', args, function (err, res) {
- var lines, expected;
-
- assert(!err);
-
- lines = res.output.split(splitRegExp).map(function (line) {
- return line.trim();
- }).filter(function (line) {
- return line.length;
- }).slice(0, -1);
-
- expected = [
- 'before one',
- 'before two',
- 'before three',
- 'before each one',
- 'before each two',
- 'before each three',
- 'TEST three',
- 'after each three',
- 'after each two',
- 'after each one',
- 'after three',
- 'after two',
- 'after one'
- ];
-
- expected.forEach(function (line, i) {
- assert.equal(lines[i], line);
- });
-
- assert.equal(res.code, 0);
- done();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/multiple-done.spec.js b/tests/lib/mocha-3.1.2/test/integration/multiple-done.spec.js
deleted file mode 100644
index 76a6483115..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/multiple-done.spec.js
+++ /dev/null
@@ -1,98 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var run = require('./helpers').runMochaJSON;
-var args = [];
-
-describe('multiple calls to done()', function () {
- var res;
- describe('from a spec', function () {
- before(function (done) {
- run('multiple-done.fixture.js', args, function (err, result) {
- res = result;
- done(err);
- });
- });
-
- it('results in failures', function () {
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 1);
- assert.equal(res.stats.failures, 1);
- assert.equal(res.code, 1);
- });
-
- it('throws a descriptive error', function () {
- assert.equal(res.failures[0].err.message,
- 'done() called multiple times');
- });
- });
-
- describe('with multiple specs', function () {
- before(function (done) {
- run('multiple-done-specs.fixture.js', args, function (err, result) {
- res = result;
- done(err);
- });
- });
-
- it('results in a failure', function () {
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 2);
- assert.equal(res.stats.failures, 1);
- assert.equal(res.code, 1);
- });
-
- it('correctly attributes the error', function () {
- assert.equal(res.failures[0].fullTitle, 'suite test1');
- assert.equal(res.failures[0].err.message,
- 'done() called multiple times');
- });
- });
-
- describe('from a before hook', function () {
- before(function (done) {
- run('multiple-done-before.fixture.js', args, function (err, result) {
- res = result;
- done(err);
- });
- });
-
- it('results in a failure', function () {
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 1);
- assert.equal(res.stats.failures, 1);
- assert.equal(res.code, 1);
- });
-
- it('correctly attributes the error', function () {
- assert.equal(res.failures[0].fullTitle, 'suite "before all" hook');
- assert.equal(res.failures[0].err.message,
- 'done() called multiple times');
- });
- });
-
- describe('from a beforeEach hook', function () {
- before(function (done) {
- run('multiple-done-beforeEach.fixture.js', args, function (err, result) {
- res = result;
- done(err);
- });
- });
-
- it('results in a failure', function () {
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 2);
- assert.equal(res.stats.failures, 2);
- assert.equal(res.code, 2);
- });
-
- it('correctly attributes the errors', function () {
- assert.equal(res.failures.length, 2);
- res.failures.forEach(function (failure) {
- assert.equal(failure.fullTitle, 'suite "before each" hook');
- assert.equal(failure.err.message,
- 'done() called multiple times');
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/only.spec.js b/tests/lib/mocha-3.1.2/test/integration/only.spec.js
deleted file mode 100644
index b37a4b263e..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/only.spec.js
+++ /dev/null
@@ -1,45 +0,0 @@
-'use strict';
-
-var run = require('./helpers').runMochaJSON;
-var assert = require('assert');
-
-describe('.only()', function () {
- describe('bdd', function () {
- it('should run only tests that marked as `only`', function (done) {
- run('options/only/bdd.fixture.js', ['--ui', 'bdd'], function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 11);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
- });
-
- describe('tdd', function () {
- it('should run only tests that marked as `only`', function (done) {
- run('options/only/tdd.fixture.js', ['--ui', 'tdd'], function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 8);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
- });
-
- describe('qunit', function () {
- it('should run only tests that marked as `only`', function (done) {
- run('options/only/qunit.fixture.js', ['--ui', 'qunit'], function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 5);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/options.spec.js b/tests/lib/mocha-3.1.2/test/integration/options.spec.js
deleted file mode 100644
index 7c7a3cc75e..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/options.spec.js
+++ /dev/null
@@ -1,183 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var run = require('./helpers').runMochaJSON;
-var args = [];
-
-describe('options', function () {
- describe('--async-only', function () {
- before(function () {
- args = ['--async-only'];
- });
-
- it('should fail synchronous specs', function (done) {
- run('options/async-only-sync.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 1);
-
- assert.equal(res.failures[0].title, 'throws an error');
- assert.equal(res.code, 1);
- done();
- });
- });
-
- it('should allow asynchronous specs', function (done) {
- run('options/async-only-async.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 1);
- assert.equal(res.stats.failures, 0);
-
- assert.equal(res.passes[0].title, 'should pass');
- assert.equal(res.code, 0);
- done();
- });
- });
- });
-
- describe('--bail', function () {
- before(function () {
- args = ['--bail'];
- });
-
- it('should stop after the first error', function (done) {
- run('options/bail.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 1);
- assert.equal(res.stats.failures, 1);
-
- assert.equal(res.passes[0].title, 'should display this spec');
- assert.equal(res.failures[0].title, 'should only display this error');
- assert.equal(res.code, 1);
- done();
- });
- });
- });
-
- describe('--sort', function () {
- before(function () {
- args = ['--sort'];
- });
-
- it('should sort tests in alphabetical order', function (done) {
- run('options/sort*', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 2);
- assert.equal(res.stats.failures, 0);
-
- assert.equal(res.passes[0].fullTitle,
- 'alpha should be executed first');
- assert.equal(res.code, 0);
- done();
- });
- });
- });
-
- describe('--delay', function () {
- before(function () {
- args = ['--delay'];
- });
-
- it('should run the generated test suite', function (done) {
- run('options/delay.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 1);
- assert.equal(res.stats.failures, 0);
-
- assert.equal(res.passes[0].title,
- 'should have no effect if attempted twice in the same suite');
- assert.equal(res.code, 0);
- done();
- });
- });
-
- it('should throw an error if the test suite failed to run', function (done) {
- run('options/delay-fail.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 1);
-
- assert.equal(res.failures[0].title,
- 'Uncaught error outside test suite');
- assert.equal(res.code, 1);
- done();
- });
- });
- });
-
- describe('--grep', function () {
- it('runs specs matching a string', function (done) {
- args = ['--grep', 'match'];
- run('options/grep.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 2);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
-
- describe('runs specs matching a RegExp', function () {
- it('with RegExp like strings(pattern follow by flag)', function (done) {
- args = ['--grep', '/match/i'];
- run('options/grep.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 4);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
-
- it('string as pattern', function (done) {
- args = ['--grep', '.*'];
- run('options/grep.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 4);
- assert.equal(res.stats.failures, 1);
- assert.equal(res.code, 1);
- done();
- });
- });
- });
-
- describe('with --invert', function () {
- it('runs specs that do not match the pattern', function (done) {
- args = ['--grep', 'fail', '--invert'];
- run('options/grep.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 4);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
- });
- });
-
- describe('--retries', function () {
- it('retries after a certain threshold', function (done) {
- args = ['--retries', '3'];
- run('options/retries.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.tests, 1);
- assert.equal(res.tests[0].currentRetry, 3);
- assert.equal(res.stats.failures, 1);
- assert.equal(res.code, 1);
- done();
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/pending.spec.js b/tests/lib/mocha-3.1.2/test/integration/pending.spec.js
deleted file mode 100644
index 19ae30ad3a..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/pending.spec.js
+++ /dev/null
@@ -1,102 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var run = require('./helpers').runMochaJSON;
-var args = [];
-
-describe('pending', function () {
- describe('pending specs', function () {
- it('should be created by omitting a function', function (done) {
- run('pending/spec.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 1);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
- });
-
- describe('synchronous skip()', function () {
- describe('in spec', function () {
- it('should immediately skip the spec and run all others', function (done) {
- run('pending/skip-sync-spec.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 1);
- assert.equal(res.stats.passes, 1);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
- });
-
- describe('in before', function () {
- it('should skip all suite specs', function (done) {
- run('pending/skip-sync-before.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 2);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
- });
-
- describe('in beforeEach', function () {
- it('should skip all suite specs', function (done) {
- run('pending/skip-sync-beforeEach.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 2);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
- });
- });
-
- describe('asynchronous skip()', function () {
- describe('in spec', function () {
- it('should immediately skip the spec and run all others', function (done) {
- run('pending/skip-async-spec.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 1);
- assert.equal(res.stats.passes, 1);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
- });
-
- describe('in before', function () {
- it('should skip all suite specs', function (done) {
- run('pending/skip-async-before.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 2);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
- });
-
- describe('in beforeEach', function () {
- it('should skip all suite specs', function (done) {
- run('pending/skip-sync-beforeEach.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 2);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/regression.spec.js b/tests/lib/mocha-3.1.2/test/integration/regression.spec.js
deleted file mode 100644
index ffd17aa979..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/regression.spec.js
+++ /dev/null
@@ -1,119 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var fs = require('fs');
-var path = require('path');
-var run = require('./helpers').runMocha;
-var runJSON = require('./helpers').runMochaJSON;
-
-describe('regressions', function () {
- it('issue-1327: should run all 3 specs exactly once', function (done) {
- var args = [];
- run('regression/issue-1327.fixture.js', args, function (err, res) {
- var occurences = function (str) {
- var pattern = new RegExp(str, 'g');
- return (res.output.match(pattern) || []).length;
- };
-
- assert(!err);
- assert.equal(occurences('testbody1'), 1);
- assert.equal(occurences('testbody2'), 1);
- assert.equal(occurences('testbody3'), 1);
-
- assert.equal(res.code, 1);
- done();
- });
- });
-
- it('should not duplicate mocha.opts args in process.argv', function () {
- var processArgv = process.argv.join('');
- var mochaOpts = fs.readFileSync(path.join(__dirname, '..', 'mocha.opts'), 'utf-8').split(/[\s]+/).join('');
- assert.notEqual(processArgv.indexOf(mochaOpts), -1, 'process.argv missing mocha.opts');
- assert.equal(processArgv.indexOf(mochaOpts), processArgv.lastIndexOf(mochaOpts), 'process.argv contains duplicated mocha.opts');
- });
-
- it('issue-1794: Can\'t --require custom UI and use it', function (done) {
- var simpleUiPath = path.join(__dirname, 'fixtures', 'regression', '1794', 'simple-ui.js');
- var args = ['--require', simpleUiPath, '--ui', 'simple-ui'];
- run('regression/1794/issue-1794.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.code, 0, 'Custom UI should be loaded');
- done();
- });
- });
-
- it('issue-1991: Declarations do not get cleaned up unless you set them to `null` - Memory Leak', function (done) {
- // on a modern MBP takes ±5 seconds on node 4.0, but on older laptops with node 0.12 ±40 seconds.
- // Could easily take longer on even weaker machines (Travis-CI containers for example).
- this.timeout(120000);
- run('regression/issue-1991.fixture.js', [], function (err, res) {
- assert(!err);
- assert.equal(/process out of memory/.test(res.output), false, 'fixture\'s process out of memory!');
- assert.equal(res.code, 0, 'Runnable fn (it/before[Each]/after[Each]) references should be deleted to avoid memory leaks');
- done();
- });
- });
-
- describe('issue-2286: after doesn\'t execute if test was skipped in beforeEach', function () {
- var afterWasRun = false;
- describe('suite with skipped test for meta test', function () {
- beforeEach(function () { this.skip(); });
- after(function () { afterWasRun = true; });
- it('should be pending', function () {});
- });
- after('meta test', function () {
- afterWasRun.should.be.ok();
- });
- });
-
- it('issue-2315: cannot read property currentRetry of undefined', function (done) {
- runJSON('regression/issue-2315.js', [], function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 1);
- assert.equal(res.code, 1);
- done();
- });
- });
-
- it('issue-2406: should run nested describe.only suites', function (done) {
- this.timeout(2000);
- runJSON('regression/issue-2406.fixture.js', [], function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 2);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- done();
- });
- });
-
- it('issue-2417: should not recurse infinitely with .only suites nested within each other', function () {
- runJSON('regression/issue-2417.fixture.js', [], function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 1);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.code, 0);
- });
- });
-
- it('issue-1417 uncaught exceptions from async specs', function (done) {
- runJSON('regression/issue-1417.js', [], function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 2);
-
- assert.equal(res.failures[0].title,
- 'fails exactly once when a global error is thrown synchronously and done errors');
- assert.equal(res.failures[0].err.message, 'sync error');
- assert.equal(res.failures[1].title,
- 'fails exactly once when a global error is thrown synchronously and done completes');
- assert.equal(res.failures[1].err.message, 'sync error');
- assert.equal(res.code, 2);
- done();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/reporters.spec.js b/tests/lib/mocha-3.1.2/test/integration/reporters.spec.js
deleted file mode 100644
index 5cfee57037..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/reporters.spec.js
+++ /dev/null
@@ -1,63 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var os = require('os');
-var fs = require('fs');
-var crypto = require('crypto');
-var path = require('path');
-var run = require('./helpers').runMocha;
-
-describe('reporters', function () {
- describe('markdown', function () {
- var res;
-
- before(function (done) {
- run('passing.fixture.js', ['--reporter', 'markdown'], function (err, result) {
- res = result;
- done(err);
- });
- });
-
- it('does not exceed maximum callstack (issue: 1875)', function () {
- assert(res.output.indexOf('RangeError') === -1, 'Threw RangeError');
- });
-
- it('contains spec src', function () {
- var src = [
- '```js',
- 'assert(true);',
- '```'
- ].join('\n');
-
- assert(res.output.indexOf(src) !== -1, 'No assert found');
- });
- });
-
- describe('xunit', function () {
- it('prints test cases with --reporter-options output (issue: 1864)', function (done) {
- var randomStr = crypto.randomBytes(8).toString('hex');
- var tmpDir = os.tmpDir().replace(new RegExp(path.sep + '$'), '');
- var tmpFile = tmpDir + path.sep + 'test-issue-1864-' + randomStr + '.xml';
-
- var args = ['--reporter=xunit', '--reporter-options', 'output=' + tmpFile];
- var expectedOutput = [
- '<testcase classname="suite" name="test1" time="',
- '<testcase classname="suite" name="test2" time="',
- '</testsuite>'
- ];
-
- run('passing.fixture.js', args, function (err, result) {
- if (err) return done(err);
-
- var xml = fs.readFileSync(tmpFile, 'utf8');
- fs.unlinkSync(tmpFile);
-
- expectedOutput.forEach(function (line) {
- assert(xml.indexOf(line) !== -1, 'XML did not contain ' + line);
- });
-
- done(err);
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/retries.spec.js b/tests/lib/mocha-3.1.2/test/integration/retries.spec.js
deleted file mode 100644
index 28ed702c5f..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/retries.spec.js
+++ /dev/null
@@ -1,108 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var helpers = require('./helpers');
-var args = [];
-var bang = require('../../lib/reporters/base').symbols.bang;
-
-describe('retries', function () {
- it('are ran in correct order', function (done) {
- helpers.runMocha('retries/hooks.fixture.js', args, function (err, res) {
- var lines, expected;
-
- assert(!err);
-
- lines = res.output.split(helpers.splitRegExp).map(function (line) {
- return line.trim();
- }).filter(function (line) {
- return line.length;
- }).slice(0, -1);
-
- expected = [
- 'before',
- 'before each 0',
- 'TEST 0',
- 'after each 1',
- 'before each 1',
- 'TEST 1',
- 'after each 2',
- 'before each 2',
- 'TEST 2',
- 'after each 3',
- 'before each 3',
- 'TEST 3',
- 'after each 4',
- 'before each 4',
- 'TEST 4',
- bang + 'after each 5',
- 'after'
- ];
-
- expected.forEach(function (line, i) {
- assert.equal(lines[i], line);
- });
-
- assert.equal(res.code, 1);
- done();
- });
- });
-
- it('should exit early if test passes', function (done) {
- helpers.runMochaJSON('retries/early-pass.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.passes, 1);
- assert.equal(res.stats.failures, 0);
- assert.equal(res.tests[0].currentRetry, 1);
- assert.equal(res.stats.tests, 1);
- assert.equal(res.code, 0);
- done();
- });
- });
-
- it('should let test override', function (done) {
- helpers.runMochaJSON('retries/nested.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 1);
- assert.equal(res.stats.tests, 1);
- assert.equal(res.tests[0].currentRetry, 1);
- assert.equal(res.code, 1);
- done();
- });
- });
-
- it('should not hang w/ async test', function (done) {
- helpers.runMocha('retries/async.fixture.js', args, function (err, res) {
- var lines, expected;
-
- assert(!err);
-
- lines = res.output.split(helpers.splitRegExp).map(function (line) {
- return line.trim();
- }).filter(function (line) {
- return line.length;
- }).slice(0, -1);
-
- expected = [
- 'before',
- 'before each 0',
- 'TEST 0',
- 'after each 1',
- 'before each 1',
- 'TEST 1',
- 'after each 2',
- 'before each 2',
- 'TEST 2',
- 'after each 3',
- 'after'
- ];
-
- expected.forEach(function (line, i) {
- assert.equal(lines[i], line);
- });
-
- assert.equal(res.code, 0);
- done();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/suite.spec.js b/tests/lib/mocha-3.1.2/test/integration/suite.spec.js
deleted file mode 100644
index 171a929ed1..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/suite.spec.js
+++ /dev/null
@@ -1,43 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var run = require('./helpers').runMocha;
-var args = [];
-
-describe('suite w/no callback', function () {
- this.timeout(1000);
- it('should throw a helpful error message when a callback for suite is not supplied', function (done) {
- run('suite/suite-no-callback.fixture.js', args, function (err, res) {
- assert(!err);
- var result = res.output.match(/no callback was supplied/) || [];
- assert.equal(result.length, 1);
- done();
- });
- });
-});
-
-describe('skipped suite w/no callback', function () {
- this.timeout(1000);
- it('should not throw an error when a callback for skipped suite is not supplied', function (done) {
- run('suite/suite-skipped-no-callback.fixture.js', args, function (err, res) {
- assert(!err);
- var pattern = new RegExp('Error', 'g');
- var result = res.output.match(pattern) || [];
- assert.equal(result.length, 0);
- done();
- });
- });
-});
-
-describe('skipped suite w/ callback', function () {
- this.timeout(1000);
- it('should not throw an error when a callback for skipped suite is supplied', function (done) {
- run('suite/suite-skipped-callback.fixture.js', args, function (err, res) {
- assert(!err);
- var pattern = new RegExp('Error', 'g');
- var result = res.output.match(pattern) || [];
- assert.equal(result.length, 0);
- done();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/timeout.spec.js b/tests/lib/mocha-3.1.2/test/integration/timeout.spec.js
deleted file mode 100644
index 4e0f989e86..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/timeout.spec.js
+++ /dev/null
@@ -1,18 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var run = require('./helpers').runMochaJSON;
-var args = [];
-
-describe('this.timeout()', function () {
- it('is respected by sync and async suites', function (done) {
- run('timeout.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 2);
- assert.equal(res.code, 2);
- done();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/integration/uncaught.spec.js b/tests/lib/mocha-3.1.2/test/integration/uncaught.spec.js
deleted file mode 100644
index 92e39c195e..0000000000
--- a/tests/lib/mocha-3.1.2/test/integration/uncaught.spec.js
+++ /dev/null
@@ -1,37 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-var run = require('./helpers').runMochaJSON;
-var args = [];
-
-describe('uncaught exceptions', function () {
- it('handles uncaught exceptions from hooks', function (done) {
- run('uncaught-hook.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 1);
-
- assert.equal(res.failures[0].fullTitle,
- 'uncaught "before each" hook');
- assert.equal(res.code, 1);
- done();
- });
- });
-
- it('handles uncaught exceptions from async specs', function (done) {
- run('uncaught.fixture.js', args, function (err, res) {
- assert(!err);
- assert.equal(res.stats.pending, 0);
- assert.equal(res.stats.passes, 0);
- assert.equal(res.stats.failures, 2);
-
- assert.equal(res.failures[0].title,
- 'fails exactly once when a global error is thrown first');
- assert.equal(res.failures[1].title,
- 'fails exactly once when a global error is thrown second');
- assert.equal(res.code, 2);
- done();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/jsapi/index.js b/tests/lib/mocha-3.1.2/test/jsapi/index.js
deleted file mode 100644
index 42133578e0..0000000000
--- a/tests/lib/mocha-3.1.2/test/jsapi/index.js
+++ /dev/null
@@ -1,30 +0,0 @@
-'use strict';
-
-var Mocha = require('../../');
-
-var mocha = new Mocha({
- ui: 'bdd',
- globals: ['okGlobalA', 'okGlobalB', 'okGlobalC', 'callback*'],
- // ignoreLeaks: true,
- growl: true
-});
-
-// mocha.reporter('spec');
-require('should');
-
-mocha.addFile('test/suite.spec.js');
-mocha.addFile('test/runner.spec.js');
-mocha.addFile('test/runnable.spec.js');
-mocha.addFile('test/hook-sync.spec.js');
-mocha.addFile('test/hook-sync-nested.spec.js');
-mocha.addFile('test/hook-async.spec.js');
-mocha.addFile('test/acceptance/duration.spec.js');
-mocha.addFile('test/acceptance/fs.spec.js');
-mocha.addFile('test/acceptance/globals.spec.js');
-mocha.addFile('test/acceptance/timeout.spec.js');
-
-mocha.run(function () {
- console.log('done');
-}).on('pass', function (test) {
- // console.log('... %s', test.title);
-});
diff --git a/tests/lib/mocha-3.1.2/test/mocha.opts b/tests/lib/mocha-3.1.2/test/mocha.opts
deleted file mode 100644
index 36146eb65e..0000000000
--- a/tests/lib/mocha-3.1.2/test/mocha.opts
+++ /dev/null
@@ -1,8 +0,0 @@
---require should
---require ./test/setup
---reporter dot
---ui bdd
---globals okGlobalA,okGlobalB
---globals okGlobalC
---globals callback*
---timeout 200
diff --git a/tests/lib/mocha-3.1.2/test/mocha.spec.js b/tests/lib/mocha-3.1.2/test/mocha.spec.js
deleted file mode 100644
index 618742cdbd..0000000000
--- a/tests/lib/mocha-3.1.2/test/mocha.spec.js
+++ /dev/null
@@ -1,35 +0,0 @@
-'use strict';
-
-var Mocha = require('../');
-var Test = Mocha.Test;
-
-describe('Mocha', function () {
- var blankOpts = { reporter: function () {} }; // no output
-
- describe('.run(fn)', function () {
- it('should not raise errors if callback was not provided', function () {
- var mocha = new Mocha(blankOpts);
- mocha.run();
- });
-
- it('should execute the callback when complete', function (done) {
- var mocha = new Mocha(blankOpts);
- mocha.run(function () {
- done();
- });
- });
-
- it('should execute the callback with the number of failures ' +
- 'as parameter', function (done) {
- var mocha = new Mocha(blankOpts);
- var failingTest = new Test('failing test', function () {
- throw new Error('such fail');
- });
- mocha.suite.addTest(failingTest);
- mocha.run(function (failures) {
- failures.should.equal(1);
- done();
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/ms.spec.js b/tests/lib/mocha-3.1.2/test/ms.spec.js
deleted file mode 100644
index 26f5c30209..0000000000
--- a/tests/lib/mocha-3.1.2/test/ms.spec.js
+++ /dev/null
@@ -1,82 +0,0 @@
-'use strict';
-var ms = require('../lib/ms');
-
-describe('.ms()', function () {
- // Helpers
- var time = {
- minutes: function (n) { return n * 60 * 1000; },
- hours: function (n) { return n * this.minutes(60); },
- days: function (n) { return n * this.hours(24); },
- years: function (n) { return n * this.days(365.25); }
- };
- describe('get a value that less than 1 second', function () {
- it('should return milliseconds representation', function () {
- ms(200).should.equal('200ms');
- ms(30).should.equal('30ms');
- ms(2000).should.not.equal('2000ms');
- });
- });
-
- describe('seconds representation', function () {
- it('should return short format', function () {
- ms(2000).should.equal('2s');
- });
-
- it('should return long format', function () {
- ms(2000, { long: true }).should.equal('2 seconds');
- ms(1000, { long: true }).should.equal('1 second');
- ms(1010, { long: true }).should.equal('1 second');
- });
- });
-
- describe('minutess representation', function () {
- it('should return short format', function () {
- ms(time.minutes(1)).should.equal('1m');
- });
-
- it('should return long format', function () {
- ms(time.minutes(1), { long: true }).should.equal('1 minute');
- ms(time.minutes(3), { long: true }).should.equal('3 minutes');
- });
- });
-
- describe('hours representation', function () {
- it('should return short format', function () {
- ms(time.hours(1)).should.equal('1h');
- });
-
- it('should return long format', function () {
- ms(time.hours(1), { long: true }).should.equal('1 hour');
- ms(time.hours(3), { long: true }).should.equal('3 hours');
- });
- });
-
- describe('days representation', function () {
- it('should return short format', function () {
- ms(time.days(1)).should.equal('1d');
- });
-
- it('should return long format', function () {
- ms(time.days(1), { long: true }).should.equal('1 day');
- ms(time.days(3), { long: true }).should.equal('3 days');
- });
- });
-
- describe('Getting string value', function () {
- it('should return the milliseconds representation(Number)', function () {
- ms('1 second').should.equal(1000);
-
- ms('1 minute').should.equal(time.minutes(1));
- ms('6 minutes').should.equal(time.minutes(6));
-
- ms('1 hour').should.equal(time.hours(1));
- ms('5 hours').should.equal(time.hours(5));
-
- ms('1 day').should.equal(time.days(1));
- ms('3 days').should.equal(time.days(3));
-
- ms('1 year').should.equal(time.years(1));
- ms('2 years').should.equal(time.years(2));
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/reporters/base.spec.js b/tests/lib/mocha-3.1.2/test/reporters/base.spec.js
deleted file mode 100644
index 6282d882ff..0000000000
--- a/tests/lib/mocha-3.1.2/test/reporters/base.spec.js
+++ /dev/null
@@ -1,213 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-
-var Base = require('../../lib/reporters/base');
-var Assert = require('assert').AssertionError;
-
-function makeTest (err) {
- return {
- err: err,
- fullTitle: function () {
- return 'test title';
- }
- };
-}
-
-describe('Base reporter', function () {
- var stdout;
- var stdoutWrite;
- var useColors;
-
- beforeEach(function () {
- stdout = [];
- stdoutWrite = process.stdout.write;
- process.stdout.write = function (string) {
- stdout.push(string);
- };
- useColors = Base.useColors;
- Base.useColors = false;
- });
-
- afterEach(function () {
- process.stdout.write = stdoutWrite;
- Base.useColors = useColors;
- });
-
- describe('showDiff', function () {
- it('should show diffs by default', function () {
- var err = new Assert({ actual: 'foo', expected: 'bar' });
- var errOut;
-
- var test = makeTest(err);
-
- Base.list([test]);
-
- errOut = stdout.join('\n');
- errOut.should.match(/\- actual/);
- errOut.should.match(/\+ expected/);
- });
-
- it('should show diffs if property set to `true`', function () {
- var err = new Assert({ actual: 'foo', expected: 'bar' });
- var errOut;
-
- err.showDiff = true;
- var test = makeTest(err);
-
- Base.list([test]);
-
- errOut = stdout.join('\n');
- errOut.should.match(/\- actual/);
- errOut.should.match(/\+ expected/);
- });
-
- it('should not show diffs when showDiff property set to `false`', function () {
- var err = new Assert({ actual: 'foo', expected: 'bar' });
- var errOut;
-
- err.showDiff = false;
- var test = makeTest(err);
-
- Base.list([test]);
-
- errOut = stdout.join('\n');
- errOut.should.not.match(/\- actual/);
- errOut.should.not.match(/\+ expected/);
- });
-
- it('should not show diffs when expected is not defined', function () {
- var err = new Error('ouch');
- var errOut;
-
- var test = makeTest(err);
-
- Base.list([test]);
-
- errOut = stdout.join('\n');
- errOut.should.not.match(/\- actual/);
- errOut.should.not.match(/\+ expected/);
- });
- });
-
- describe('Getting two strings', function () {
- // Fix regression V1.2.1(see: issue #1241)
- it('should show strings diff as is', function () {
- var err = new Error('test');
- var errOut;
-
- err.actual = 'foo\nbar';
- err.expected = 'foo\nbaz';
- err.showDiff = true;
- var test = makeTest(err);
-
- Base.list([test]);
-
- errOut = stdout.join('\n');
-
- errOut.should.not.match(/"foo\\nbar"/);
- errOut.should.match(/foo/).and.match(/bar/);
- errOut.should.match(/test/);
- errOut.should.match(/actual/);
- errOut.should.match(/expected/);
- });
- });
-
- it('should stringify objects', function () {
- var err = new Error('test');
- var errOut;
-
- err.actual = {key: 'a1'};
- err.expected = {key: 'e1'};
- err.showDiff = true;
- var test = makeTest(err);
-
- Base.list([test]);
-
- errOut = stdout.join('\n');
- errOut.should.match(/"key"/);
- errOut.should.match(/test/);
- errOut.should.match(/\- actual/);
- errOut.should.match(/\+ expected/);
- });
-
- it('should stringify Object.create(null)', function () {
- var err = new Error('test');
- var errOut;
-
- err.actual = Object.create(null);
- err.actual.hasOwnProperty = 1;
- err.expected = Object.create(null);
- err.expected.hasOwnProperty = 2;
- err.showDiff = true;
- var test = makeTest(err);
-
- Base.list([test]);
-
- errOut = stdout.join('\n');
- errOut.should.match(/"hasOwnProperty"/);
- errOut.should.match(/test/);
- errOut.should.match(/\- actual/);
- errOut.should.match(/\+ expected/);
- });
-
- it('should handle error messages that are not strings', function () {
- var errOut;
-
- try {
- assert(false, true);
- } catch (err) {
- err.actual = false;
- err.expected = true;
- err.showDiff = true;
- var test = makeTest(err);
-
- Base.list([test]);
-
- errOut = stdout.join('\n');
- errOut.should.match(/\+true/);
- errOut.should.match(/\-false/);
- errOut.should.match(/\- actual/);
- errOut.should.match(/\+ expected/);
- }
- });
-
- it('should remove message from stack', function () {
- var err = {
- message: 'Error',
- stack: 'Error\nfoo\nbar',
- showDiff: false
- };
- var test = makeTest(err);
-
- Base.list([test]);
-
- var errOut = stdout.join('\n').trim();
- errOut.should.equal('1) test title:\n Error\n foo\n bar');
- });
-
- it('should use the inspect() property if `message` is not set', function () {
- var err = {
- showDiff: false,
- inspect: function () { return 'an error happened'; }
- };
- var test = makeTest(err);
- Base.list([test]);
- var errOut = stdout.join('\n').trim();
- errOut.should.equal('1) test title:\n an error happened');
- });
-
- it('should not modify stack if it does not contain message', function () {
- var err = {
- message: 'Error',
- stack: 'foo\nbar',
- showDiff: false
- };
- var test = makeTest(err);
-
- Base.list([test]);
-
- var errOut = stdout.join('\n').trim();
- errOut.should.equal('1) test title:\n Error\n foo\n bar');
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/reporters/json.spec.js b/tests/lib/mocha-3.1.2/test/reporters/json.spec.js
deleted file mode 100644
index 74151fdc8b..0000000000
--- a/tests/lib/mocha-3.1.2/test/reporters/json.spec.js
+++ /dev/null
@@ -1,63 +0,0 @@
-'use strict';
-
-var Mocha = require('../../');
-var Suite = Mocha.Suite;
-var Runner = Mocha.Runner;
-var Test = Mocha.Test;
-
-describe('json reporter', function () {
- var suite, runner;
-
- beforeEach(function () {
- var mocha = new Mocha({
- reporter: 'json'
- });
- suite = new Suite('JSON suite', 'root');
- runner = new Runner(suite);
- /* eslint no-unused-vars: off */
- var mochaReporter = new mocha._reporter(runner);
- });
-
- it('should have 1 test failure', function (done) {
- var testTitle = 'json test 1';
- var error = { message: 'oh shit' };
-
- suite.addTest(new Test(testTitle, function (done) {
- done(new Error(error.message));
- }));
-
- runner.run(function (failureCount) {
- failureCount.should.be.exactly(1);
- runner.should.have.property('testResults');
- runner.testResults.should.have.property('failures');
- runner.testResults.failures.should.be.an.instanceOf(Array);
- runner.testResults.failures.should.have.a.lengthOf(1);
-
- var failure = runner.testResults.failures[0];
- failure.should.have.property('title', testTitle);
- failure.err.message.should.equal(error.message);
- failure.should.have.properties('err');
-
- done();
- });
- });
-
- it('should have 1 test pending', function (done) {
- var testTitle = 'json test 1';
-
- suite.addTest(new Test(testTitle));
-
- runner.run(function (failureCount) {
- failureCount.should.be.exactly(0);
- runner.should.have.property('testResults');
- runner.testResults.should.have.property('pending');
- runner.testResults.pending.should.be.an.instanceOf(Array);
- runner.testResults.pending.should.have.a.lengthOf(1);
-
- var pending = runner.testResults.pending[0];
- pending.should.have.property('title', testTitle);
-
- done();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/reporters/nyan.spec.js b/tests/lib/mocha-3.1.2/test/reporters/nyan.spec.js
deleted file mode 100644
index 07c455efd3..0000000000
--- a/tests/lib/mocha-3.1.2/test/reporters/nyan.spec.js
+++ /dev/null
@@ -1,31 +0,0 @@
-'use strict';
-
-var reporters = require('../../').reporters;
-var NyanCat = reporters.Nyan;
-
-describe('nyan face', function () {
- it('nyan face:(x .x) when "failures" at least one', function () {
- var nyanCat = new NyanCat({on: function () {}});
- nyanCat.stats = { passes: 2, pending: 1, failures: 1 };
- nyanCat.face().should.equal('( x .x)');
- });
-
- it('expected nyan face:(x .x) when "pending" at least one and no failing', function () {
- var nyanCat = new NyanCat({on: function () {}});
- nyanCat.stats = { passes: 2, pending: 1, failures: 0 };
- nyanCat.face().should.equal('( o .o)');
- });
-
- it('expected nyan face:(^ .^) when "passing" only', function () {
- var nyanCat = new NyanCat({on: function () {}});
- nyanCat.stats = { passes: 1, pending: 0, failures: 0 };
- nyanCat.face().should.equal('( ^ .^)');
- });
-
- it('nyan face:(- .-) when otherwise', function (done) {
- var nyanCat = new NyanCat({on: function () {}});
- nyanCat.stats = { passes: 0, pending: 0, failures: 0 };
- nyanCat.face().should.equal('( - .-)');
- done();
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/runnable.spec.js b/tests/lib/mocha-3.1.2/test/runnable.spec.js
deleted file mode 100644
index 67cfcca38a..0000000000
--- a/tests/lib/mocha-3.1.2/test/runnable.spec.js
+++ /dev/null
@@ -1,466 +0,0 @@
-'use strict';
-
-var mocha = require('../');
-var utils = mocha.utils;
-var Runnable = mocha.Runnable;
-
-describe('Runnable(title, fn)', function () {
- // For every test we poison the global time-related methods.
- // runnable.js etc. should keep its own local copy, in order to fix GH-237.
- // NB: we can't poison global.Date because the normal implementation of
- // global.setTimeout uses it [1] so if the runnable.js keeps a copy of
- // global.setTimeout (like it's supposed to), that will blow up.
- // [1]: https://github.com/joyent/node/blob/7fc835afe362ebd30a0dbec81d3360bd24525222/lib/timers.js#L74
- var setTimeout = global.setTimeout;
- var setInterval = global.setInterval;
- var clearTimeout = global.clearTimeout;
- var clearInterval = global.clearInterval;
-
- function poisonPill () {
- throw new Error("Don't use global time-related stuff.");
- }
-
- beforeEach(function () {
- global.setTimeout =
- global.setInterval =
- global.clearTimeout =
- global.clearInterval = poisonPill;
- });
-
- afterEach(function () {
- global.setTimeout = setTimeout;
- global.setInterval = setInterval;
- global.clearTimeout = clearTimeout;
- global.clearInterval = clearInterval;
- });
-
- describe('#timeout(ms)', function () {
- it('should set the timeout', function () {
- var run = new Runnable();
- run.timeout(1000);
- run.timeout().should.equal(1000);
- });
- });
-
- describe('#timeout(ms) when ms>2^31', function () {
- it('should set disabled', function () {
- var run = new Runnable();
- run.timeout(1e10);
- run.enableTimeouts().should.be.false;
- });
- });
-
- describe('#enableTimeouts(enabled)', function () {
- it('should set enabled', function () {
- var run = new Runnable();
- run.enableTimeouts(false);
- run.enableTimeouts().should.equal(false);
- });
- });
-
- describe('#slow(ms)', function () {
- var run;
-
- beforeEach(function () {
- run = new Runnable();
- });
-
- it('should set the slow threshold', function () {
- run.slow(100);
- run.slow().should.equal(100);
- });
-
- it('should not set the slow threshold if the parameter is not passed', function () {
- run.slow();
- run.slow().should.equal(75);
- });
-
- it('should not set the slow threshold if the parameter is undefined', function () {
- run.slow(undefined);
- run.slow().should.equal(75);
- });
- });
-
- describe('.title', function () {
- it('should be present', function () {
- new Runnable('foo').title.should.equal('foo');
- });
- });
-
- describe('when arity >= 1', function () {
- it('should be .async', function () {
- var run = new Runnable('foo', function (done) {});
- run.async.should.equal(1);
- run.sync.should.be.false();
- });
- });
-
- describe('when arity == 0', function () {
- it('should be .sync', function () {
- var run = new Runnable('foo', function () {});
- run.async.should.be.equal(0);
- run.sync.should.be.true();
- });
- });
-
- describe('#globals', function () {
- it('should allow for whitelisting globals', function (done) {
- var test = new Runnable('foo', function () {});
- test.async.should.be.equal(0);
- test.sync.should.be.true();
- test.globals(['foobar']);
- test.run(done);
- });
- });
-
- describe('#retries(n)', function () {
- it('should set the number of retries', function () {
- var run = new Runnable();
- run.retries(1);
- run.retries().should.equal(1);
- });
- });
-
- describe('.run(fn)', function () {
- describe('when .pending', function () {
- it('should not invoke the callback', function (done) {
- var test = new Runnable('foo', function () {
- throw new Error('should not be called');
- });
-
- test.pending = true;
- test.run(done);
- });
- });
-
- describe('when sync', function () {
- describe('without error', function () {
- it('should invoke the callback', function (done) {
- var calls = 0;
- var test = new Runnable('foo', function () {
- ++calls;
- });
-
- test.run(function (err) {
- calls.should.equal(1);
- test.duration.should.be.type('number');
- done(err);
- });
- });
- });
-
- describe('when an exception is thrown', function () {
- it('should invoke the callback', function (done) {
- var calls = 0;
- var test = new Runnable('foo', function () {
- ++calls;
- throw new Error('fail');
- });
-
- test.run(function (err) {
- calls.should.equal(1);
- err.message.should.equal('fail');
- done();
- });
- });
- });
-
- describe('when an exception is thrown and is allowed to remain uncaught', function () {
- it('throws an error when it is allowed', function (done) {
- var test = new Runnable('foo', function () {
- throw new Error('fail');
- });
- test.allowUncaught = true;
- function fail () {
- test.run(function () {});
- }
- fail.should.throw('fail');
- done();
- });
- });
- });
-
- describe('when timeouts are disabled', function () {
- it('should not error with timeout', function (done) {
- var test = new Runnable('foo', function (done) {
- setTimeout(process.nextTick.bind(undefined, done), 2);
- });
- test.timeout(1);
- test.enableTimeouts(false);
- test.run(done);
- });
- });
-
- describe('when async', function () {
- describe('without error', function () {
- it('should invoke the callback', function (done) {
- var test = new Runnable('foo', function (done) {
- process.nextTick(done);
- });
-
- test.run(done);
- });
- });
-
- describe('when the callback is invoked several times', function () {
- describe('without an error', function () {
- it('should emit a single "error" event', function (done) {
- var calls = 0;
- var errCalls = 0;
-
- var test = new Runnable('foo', function (done) {
- process.nextTick(done);
- process.nextTick(done);
- process.nextTick(done);
- process.nextTick(done);
- });
-
- test.on('error', function (err) {
- ++errCalls;
- err.message.should.equal('done() called multiple times');
- calls.should.equal(1);
- errCalls.should.equal(1);
- done();
- });
-
- test.run(function () {
- ++calls;
- });
- });
- });
-
- describe('with an error', function () {
- it('should emit a single "error" event', function (done) {
- var calls = 0;
- var errCalls = 0;
-
- var test = new Runnable('foo', function (done) {
- done(new Error('fail'));
- process.nextTick(done);
- done(new Error('fail'));
- process.nextTick(done);
- process.nextTick(done);
- });
-
- test.on('error', function (err) {
- ++errCalls;
- err.message.should.equal('fail');
- calls.should.equal(1);
- errCalls.should.equal(1);
- done();
- });
-
- test.run(function () {
- ++calls;
- });
- });
- });
- });
-
- describe('when an exception is thrown', function () {
- it('should invoke the callback', function (done) {
- var test = new Runnable('foo', function (done) {
- throw new Error('fail');
- });
-
- test.run(function (err) {
- err.message.should.equal('fail');
- done();
- });
- });
-
- it('should not throw its own exception if passed a non-object', function (done) {
- var test = new Runnable('foo', function (done) {
- /* eslint no-throw-literal: off */
- throw null;
- });
-
- test.run(function (err) {
- err.message.should.equal(utils.undefinedError().message);
- done();
- });
- });
- });
-
- describe('when an exception is thrown and is allowed to remain uncaught', function () {
- it('throws an error when it is allowed', function (done) {
- var test = new Runnable('foo', function (done) {
- throw new Error('fail');
- });
- test.allowUncaught = true;
- function fail () {
- test.run(function () {});
- }
- fail.should.throw('fail');
- done();
- });
- });
-
- describe('when an error is passed', function () {
- it('should invoke the callback', function (done) {
- var test = new Runnable('foo', function (done) {
- done(new Error('fail'));
- });
-
- test.run(function (err) {
- err.message.should.equal('fail');
- done();
- });
- });
- });
-
- describe('when done() is invoked with a non-Error object', function () {
- it('should invoke the callback', function (done) {
- var test = new Runnable('foo', function (done) {
- done({ error: 'Test error' });
- });
-
- test.run(function (err) {
- err.message.should.equal('done() invoked with non-Error: {"error":"Test error"}');
- done();
- });
- });
- });
-
- describe('when done() is invoked with a string', function () {
- it('should invoke the callback', function (done) {
- var test = new Runnable('foo', function (done) {
- done('Test error');
- });
-
- test.run(function (err) {
- err.message.should.equal('done() invoked with non-Error: Test error');
- done();
- });
- });
- });
-
- it('should allow updating the timeout', function (done) {
- var callCount = 0;
- var increment = function () {
- callCount++;
- };
- var test = new Runnable('foo', function (done) {
- setTimeout(increment, 1);
- setTimeout(increment, 100);
- });
- test.timeout(10);
- test.run(function (err) {
- err.should.be.ok();
- callCount.should.equal(1);
- done();
- });
- });
-
- it('should allow a timeout of 0');
- });
-
- describe('when fn returns a promise', function () {
- describe('when the promise is fulfilled with no value', function () {
- var fulfilledPromise = {
- then: function (fulfilled, rejected) {
- process.nextTick(fulfilled);
- }
- };
-
- it('should invoke the callback', function (done) {
- var test = new Runnable('foo', function () {
- return fulfilledPromise;
- });
-
- test.run(done);
- });
- });
-
- describe('when the promise is fulfilled with a value', function () {
- var fulfilledPromise = {
- then: function (fulfilled, rejected) {
- process.nextTick(function () {
- fulfilled({});
- });
- }
- };
-
- it('should invoke the callback', function (done) {
- var test = new Runnable('foo', function () {
- return fulfilledPromise;
- });
-
- test.run(done);
- });
- });
-
- describe('when the promise is rejected', function () {
- var expectedErr = new Error('fail');
- var rejectedPromise = {
- then: function (fulfilled, rejected) {
- process.nextTick(function () {
- rejected(expectedErr);
- });
- }
- };
-
- it('should invoke the callback', function (done) {
- var test = new Runnable('foo', function () {
- return rejectedPromise;
- });
-
- test.run(function (err) {
- err.should.equal(expectedErr);
- done();
- });
- });
- });
-
- describe('when the promise is rejected without a reason', function () {
- var expectedErr = new Error('Promise rejected with no or falsy reason');
- var rejectedPromise = {
- then: function (fulfilled, rejected) {
- process.nextTick(function () {
- rejected();
- });
- }
- };
-
- it('should invoke the callback', function (done) {
- var test = new Runnable('foo', function () {
- return rejectedPromise;
- });
-
- test.run(function (err) {
- err.should.eql(expectedErr);
- done();
- });
- });
- });
-
- describe('when the promise takes too long to settle', function () {
- var foreverPendingPromise = {
- then: function () { }
- };
-
- it('should give the timeout error', function (done) {
- var test = new Runnable('foo', function () {
- return foreverPendingPromise;
- });
-
- test.timeout(10);
- test.run(function (err) {
- err.should.be.ok();
- done();
- });
- });
- });
- });
-
- describe('when fn returns a non-promise', function () {
- it('should invoke the callback', function (done) {
- var test = new Runnable('foo', function () {
- return { then: 'i ran my tests' };
- });
-
- test.run(done);
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/runner.spec.js b/tests/lib/mocha-3.1.2/test/runner.spec.js
deleted file mode 100644
index 7c69846ec8..0000000000
--- a/tests/lib/mocha-3.1.2/test/runner.spec.js
+++ /dev/null
@@ -1,436 +0,0 @@
-'use strict';
-
-var mocha = require('../');
-var Suite = mocha.Suite;
-var Runner = mocha.Runner;
-var Test = mocha.Test;
-var Hook = mocha.Hook;
-var path = require('path');
-var noop = mocha.utils.noop;
-
-describe('Runner', function () {
- var suite;
- var runner;
-
- beforeEach(function () {
- suite = new Suite('Suite', 'root');
- runner = new Runner(suite);
- });
-
- describe('.grep()', function () {
- it('should update the runner.total with number of matched tests', function () {
- suite.addTest(new Test('im a test about lions', noop));
- suite.addTest(new Test('im another test about lions', noop));
- suite.addTest(new Test('im a test about bears', noop));
- var newRunner = new Runner(suite);
- newRunner.grep(/lions/);
- newRunner.total.should.equal(2);
- });
-
- it('should update the runner.total with number of matched tests when inverted', function () {
- suite.addTest(new Test('im a test about lions', noop));
- suite.addTest(new Test('im another test about lions', noop));
- suite.addTest(new Test('im a test about bears', noop));
- var newRunner = new Runner(suite);
- newRunner.grep(/lions/, true);
- newRunner.total.should.equal(1);
- });
- });
-
- describe('.grepTotal()', function () {
- it('should return the total number of matched tests', function () {
- suite.addTest(new Test('im a test about lions', noop));
- suite.addTest(new Test('im another test about lions', noop));
- suite.addTest(new Test('im a test about bears', noop));
- runner.grep(/lions/);
- runner.grepTotal(suite).should.equal(2);
- });
-
- it('should return the total number of matched tests when inverted', function () {
- suite.addTest(new Test('im a test about lions', noop));
- suite.addTest(new Test('im another test about lions', noop));
- suite.addTest(new Test('im a test about bears', noop));
- runner.grep(/lions/, true);
- runner.grepTotal(suite).should.equal(1);
- });
- });
-
- describe('.globalProps()', function () {
- it('should include common non enumerable globals', function () {
- var props = runner.globalProps();
- props.should.containEql('setTimeout');
- props.should.containEql('clearTimeout');
- props.should.containEql('setInterval');
- props.should.containEql('clearInterval');
- props.should.containEql('Date');
- props.should.containEql('XMLHttpRequest');
- });
- });
-
- describe('.globals()', function () {
- it('should default to the known globals', function () {
- runner.globals().length.should.be.above(16);
- });
-
- it('should white-list globals', function () {
- runner.globals(['foo', 'bar']);
- runner.globals().should.containEql('foo');
- runner.globals().should.containEql('bar');
- });
- });
-
- describe('.checkGlobals(test)', function () {
- it('should allow variables that match a wildcard', function (done) {
- runner.globals(['foo*', 'giz*']);
- global.foo = 'baz';
- global.gizmo = 'quux';
- runner.checkGlobals();
- delete global.foo;
- delete global.gizmo;
- done();
- });
-
- it('should emit "fail" when a new global is introduced', function (done) {
- var test = new Test('im a test', noop);
- runner.checkGlobals();
- global.foo = 'bar';
- runner.on('fail', function (_test, err) {
- _test.should.equal(test);
- err.message.should.equal('global leak detected: foo');
- delete global.foo;
- done();
- });
- runner.checkGlobals(test);
- });
-
- it('should emit "fail" when a single new disallowed global is introduced after a single extra global is allowed', function (done) {
- var doneCalled = false;
- runner.globals('good');
- global.bad = 1;
- runner.on('fail', function () {
- delete global.bad;
- done();
- doneCalled = true;
- });
- runner.checkGlobals(new Test('yet another test', noop));
- if (!doneCalled) {
- done(Error('Expected test failure did not occur.'));
- }
- });
-
- it('should not fail when a new common global is introduced', function () {
- // verify that the prop isn't enumerable
- delete global.XMLHttpRequest;
- global.propertyIsEnumerable('XMLHttpRequest').should.not.be.ok();
-
- // create a new runner and keep a reference to the test.
- var test = new Test('im a test about bears', noop);
- suite.addTest(test);
- var newRunner = new Runner(suite);
-
- // make the prop enumerable again.
- global.XMLHttpRequest = function () {};
- global.propertyIsEnumerable('XMLHttpRequest').should.be.ok();
-
- // verify the test hasn't failed.
- newRunner.checkGlobals(test);
- test.should.not.have.key('state');
-
- // clean up our global space.
- delete global.XMLHttpRequest;
- });
-
- it('should pluralize the error message when several are introduced', function (done) {
- var test = new Test('im a test', noop);
- runner.checkGlobals();
- global.foo = 'bar';
- global.bar = 'baz';
- runner.on('fail', function (_test, err) {
- _test.should.equal(test);
- err.message.should.equal('global leaks detected: foo, bar');
- delete global.foo;
- delete global.bar;
- done();
- });
- runner.checkGlobals(test);
- });
-
- it('should respect per test whitelisted globals', function () {
- var test = new Test('im a test about lions', noop);
- test.globals(['foo']);
-
- suite.addTest(test);
- var runner = new Runner(suite);
-
- global.foo = 'bar';
-
- // verify the test hasn't failed.
- runner.checkGlobals(test);
- test.should.not.have.key('state');
-
- delete global.foo;
- });
-
- it('should respect per test whitelisted globals but still detect other leaks', function (done) {
- var test = new Test('im a test about lions', noop);
- test.globals(['foo']);
-
- suite.addTest(test);
-
- global.foo = 'bar';
- global.bar = 'baz';
- runner.on('fail', function (test, err) {
- test.title.should.equal('im a test about lions');
- err.message.should.equal('global leak detected: bar');
- delete global.foo;
- done();
- });
- runner.checkGlobals(test);
- });
-
- it('should emit "fail" when a global beginning with d is introduced', function (done) {
- global.derp = 'bar';
- runner.on('fail', function () {
- delete global.derp;
- done();
- });
- runner.checkGlobals(new Test('herp', function () {}));
- });
- });
-
- describe('.hook(name, fn)', function () {
- it('should execute hooks after failed test if suite bail is true', function (done) {
- runner.fail(new Test('failed test', noop));
- suite.bail(true);
- suite.afterEach(function () {
- suite.afterAll(function () {
- done();
- });
- });
- runner.hook('afterEach', function () {});
- runner.hook('afterAll', function () {});
- });
- });
-
- describe('.fail(test, err)', function () {
- it('should increment .failures', function () {
- runner.failures.should.equal(0);
- runner.fail(new Test('one', noop), {});
- runner.failures.should.equal(1);
- runner.fail(new Test('two', noop), {});
- runner.failures.should.equal(2);
- });
-
- it('should set test.state to "failed"', function () {
- var test = new Test('some test', noop);
- runner.fail(test, 'some error');
- test.state.should.equal('failed');
- });
-
- it('should emit "fail"', function (done) {
- var test = new Test('some other test', noop);
- var err = {};
- runner.on('fail', function (test, err) {
- test.should.equal(test);
- err.should.equal(err);
- done();
- });
- runner.fail(test, err);
- });
-
- it('should emit a helpful message when failed with a string', function (done) {
- var test = new Test('helpful test', noop);
- var err = 'string';
- runner.on('fail', function (test, err) {
- err.message.should.equal('the string "string" was thrown, throw an Error :)');
- done();
- });
- runner.fail(test, err);
- });
-
- it('should emit a the error when failed with an Error instance', function (done) {
- var test = new Test('a test', noop);
- var err = new Error('an error message');
- runner.on('fail', function (test, err) {
- err.message.should.equal('an error message');
- done();
- });
- runner.fail(test, err);
- });
-
- it('should emit the error when failed with an Error-like object', function (done) {
- var test = new Test('a test', noop);
- var err = { message: 'an error message' };
- runner.on('fail', function (test, err) {
- err.message.should.equal('an error message');
- done();
- });
- runner.fail(test, err);
- });
-
- it('should emit a helpful message when failed with an Object', function (done) {
- var test = new Test('a test', noop);
- var err = { x: 1 };
- runner.on('fail', function (test, err) {
- err.message.should.equal('the object {\n "x": 1\n} was thrown, throw an Error :)');
- done();
- });
- runner.fail(test, err);
- });
-
- it('should emit a helpful message when failed with an Array', function (done) {
- var test = new Test('a test', noop);
- var err = [
- 1,
- 2
- ];
- runner.on('fail', function (test, err) {
- err.message.should.equal('the array [\n 1\n 2\n] was thrown, throw an Error :)');
- done();
- });
- runner.fail(test, err);
- });
-
- it('should recover if the error stack is not writable', function (done) {
- var err = new Error('not evil');
- Object.defineProperty(err, 'stack', {
- value: err.stack
- });
- var test = new Test('a test', noop);
-
- runner.on('fail', function (test, err) {
- err.message.should.equal('not evil');
- done();
- });
-
- runner.fail(test, err);
- });
- });
-
- describe('.failHook(hook, err)', function () {
- it('should increment .failures', function () {
- runner.failures.should.equal(0);
- runner.failHook(new Test('fail hook 1', noop), {});
- runner.failures.should.equal(1);
- runner.failHook(new Test('fail hook 2', noop), {});
- runner.failures.should.equal(2);
- });
-
- it('should augment hook title with current test title', function () {
- var hook = new Hook('"before each" hook');
- hook.ctx = { currentTest: new Test('should behave', noop) };
-
- runner.failHook(hook, {});
- hook.title.should.equal('"before each" hook for "should behave"');
-
- hook.ctx.currentTest = new Test('should obey', noop);
- runner.failHook(hook, {});
- hook.title.should.equal('"before each" hook for "should obey"');
- });
-
- it('should emit "fail"', function (done) {
- var hook = new Hook();
- var err = {};
- runner.on('fail', function (hook, err) {
- hook.should.equal(hook);
- err.should.equal(err);
- done();
- });
- runner.failHook(hook, err);
- });
-
- it('should emit "end" if suite bail is true', function (done) {
- var hook = new Hook();
- var err = {};
- suite.bail(true);
- runner.on('end', done);
- runner.failHook(hook, err);
- });
-
- it('should not emit "end" if suite bail is not true', function (done) {
- var hook = new Hook();
- var err = {};
- suite.bail(false);
- runner.on('end', function () {
- throw new Error('"end" was emit, but the bail is false');
- });
- runner.failHook(hook, err);
- done();
- });
- });
-
- describe('allowUncaught', function () {
- it('should allow unhandled errors to propagate through', function (done) {
- var newRunner = new Runner(suite);
- newRunner.allowUncaught = true;
- newRunner.test = new Test('failing test', function () {
- throw new Error('allow unhandled errors');
- });
- function fail () {
- newRunner.runTest();
- }
- fail.should.throw('allow unhandled errors');
- done();
- });
- });
-
- describe('stackTrace', function () {
- var stack = [
- 'AssertionError: foo bar',
- 'at EventEmitter.<anonymous> (/usr/local/dev/test.js:16:12)',
- 'at Context.<anonymous> (/usr/local/dev/test.js:19:5)',
- 'Test.Runnable.run (/usr/local/lib/node_modules/mocha/lib/runnable.js:244:7)',
- 'Runner.runTest (/usr/local/lib/node_modules/mocha/lib/runner.js:374:10)',
- '/usr/local/lib/node_modules/mocha/lib/runner.js:452:12',
- 'next (/usr/local/lib/node_modules/mocha/lib/runner.js:299:14)',
- '/usr/local/lib/node_modules/mocha/lib/runner.js:309:7',
- 'next (/usr/local/lib/node_modules/mocha/lib/runner.js:248:23)',
- 'Immediate._onImmediate (/usr/local/lib/node_modules/mocha/lib/runner.js:276:5)',
- 'at processImmediate [as _immediateCallback] (timers.js:321:17)'
- ];
-
- describe('shortStackTrace', function () {
- beforeEach(function () {
- if (path.sep !== '/') {
- this.skip();
- }
- });
-
- it('should prettify the stack-trace', function (done) {
- var hook = new Hook();
- var err = new Error();
- // Fake stack-trace
- err.stack = stack.join('\n');
-
- runner.on('fail', function (hook, err) {
- err.stack.should.equal(stack.slice(0, 3).join('\n'));
- done();
- });
- runner.failHook(hook, err);
- });
- });
-
- describe('longStackTrace', function () {
- beforeEach(function () {
- if (path.sep !== '/') {
- this.skip();
- }
- });
-
- it('should display the full stack-trace', function (done) {
- var hook = new Hook();
- var err = new Error();
- // Fake stack-trace
- err.stack = stack.join('\n');
- // Add --stack-trace option
- runner.fullStackTrace = true;
-
- runner.on('fail', function (hook, err) {
- err.stack.should.equal(stack.join('\n'));
- done();
- });
- runner.failHook(hook, err);
- });
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/sanity/sanity.spec.js b/tests/lib/mocha-3.1.2/test/sanity/sanity.spec.js
deleted file mode 100644
index b918f1c4f9..0000000000
--- a/tests/lib/mocha-3.1.2/test/sanity/sanity.spec.js
+++ /dev/null
@@ -1,9 +0,0 @@
-'use strict';
-
-var assert = require('assert');
-
-describe('a production installation of Mocha', function () {
- it('should be able to execute a test', function () {
- assert.ok(true);
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/setup.js b/tests/lib/mocha-3.1.2/test/setup.js
deleted file mode 100644
index 0ffe34c7e5..0000000000
--- a/tests/lib/mocha-3.1.2/test/setup.js
+++ /dev/null
@@ -1,4 +0,0 @@
-'use strict';
-
-global.expect = require('expect.js');
-global.assert = require('assert');
diff --git a/tests/lib/mocha-3.1.2/test/suite.spec.js b/tests/lib/mocha-3.1.2/test/suite.spec.js
deleted file mode 100644
index 4cb62dd290..0000000000
--- a/tests/lib/mocha-3.1.2/test/suite.spec.js
+++ /dev/null
@@ -1,440 +0,0 @@
-'use strict';
-
-var mocha = require('../');
-var Suite = mocha.Suite;
-var Test = mocha.Test;
-
-describe('Suite', function () {
- describe('.clone()', function () {
- beforeEach(function () {
- this.suite = new Suite('To be cloned');
- this.suite._timeout = 3043;
- this.suite._slow = 101;
- this.suite._bail = true;
- this.suite.suites.push(1);
- this.suite.tests.push('hello');
- this.suite._beforeEach.push(2);
- this.suite._beforeAll.push(3);
- this.suite._afterEach.push(4);
- this.suite._afterAll.push(5);
- });
-
- it('should copy the title', function () {
- this.suite.clone().title.should.equal('To be cloned');
- });
-
- it('should copy the timeout value', function () {
- this.suite.clone().timeout().should.equal(3043);
- });
-
- it('should copy the slow value', function () {
- this.suite.clone().slow().should.equal(101);
- });
-
- it('should copy the bail value', function () {
- this.suite.clone().bail().should.be.true();
- });
-
- it('should not copy the values from the suites array', function () {
- this.suite.clone().suites.should.be.empty();
- });
-
- it('should not copy the values from the tests array', function () {
- this.suite.clone().tests.should.be.empty();
- });
-
- it('should not copy the values from the _beforeEach array', function () {
- this.suite.clone()._beforeEach.should.be.empty();
- });
-
- it('should not copy the values from the _beforeAll array', function () {
- this.suite.clone()._beforeAll.should.be.empty();
- });
-
- it('should not copy the values from the _afterEach array', function () {
- this.suite.clone()._afterEach.should.be.empty();
- });
-
- it('should not copy the values from the _afterAll array', function () {
- this.suite.clone()._afterAll.should.be.empty();
- });
- });
-
- describe('.timeout()', function () {
- beforeEach(function () {
- this.suite = new Suite('A Suite');
- });
-
- describe('when no argument is passed', function () {
- it('should return the timeout value', function () {
- this.suite.timeout().should.equal(2000);
- });
- });
-
- describe('when argument is passed', function () {
- it('should return the Suite object', function () {
- var newSuite = this.suite.timeout(5000);
- newSuite.timeout().should.equal(5000);
- });
- });
- });
-
- describe('.slow()', function () {
- beforeEach(function () {
- this.suite = new Suite('A Suite');
- });
-
- describe('when given a string', function () {
- it('should parse it', function () {
- this.suite.slow('5 seconds');
- this.suite.slow().should.equal(5000);
- });
- });
-
- describe('when no argument is passed', function () {
- it('should return the slow value', function () {
- this.suite.slow().should.equal(75);
- });
- });
-
- describe('when argument is passed', function () {
- it('should return the Suite object', function () {
- var newSuite = this.suite.slow(5000);
- newSuite.slow().should.equal(5000);
- });
- });
- });
-
- describe('.bail()', function () {
- beforeEach(function () {
- this.suite = new Suite('A Suite');
- this.suite._bail = true;
- });
-
- describe('when no argument is passed', function () {
- it('should return the bail value', function () {
- this.suite.bail().should.be.true();
- });
- });
-
- describe('when argument is passed', function () {
- it('should return the Suite object', function () {
- var newSuite = this.suite.bail(false);
- newSuite.bail().should.be.false();
- });
- });
- });
-
- describe('.beforeAll()', function () {
- beforeEach(function () {
- this.suite = new Suite('A Suite');
- });
-
- describe('wraps the passed in function in a Hook', function () {
- it('adds it to _beforeAll', function () {
- var fn = function () {};
- this.suite.beforeAll(fn);
-
- this.suite._beforeAll.should.have.length(1);
- var beforeAllItem = this.suite._beforeAll[0];
- beforeAllItem.title.should.match(/^"before all" hook/);
- beforeAllItem.fn.should.equal(fn);
- });
-
- it('appends title to hook', function () {
- var fn = function () {};
- this.suite.beforeAll('test', fn);
-
- this.suite._beforeAll.should.have.length(1);
- var beforeAllItem = this.suite._beforeAll[0];
- beforeAllItem.title.should.equal('"before all" hook: test');
- beforeAllItem.fn.should.equal(fn);
-
- function namedFn () {}
- this.suite.beforeAll(namedFn);
- this.suite._beforeAll.should.have.length(2);
- beforeAllItem = this.suite._beforeAll[1];
- beforeAllItem.title.should.equal('"before all" hook: namedFn');
- beforeAllItem.fn.should.equal(namedFn);
- });
- });
- });
-
- describe('.afterAll()', function () {
- beforeEach(function () {
- this.suite = new Suite('A Suite');
- });
-
- describe('wraps the passed in function in a Hook', function () {
- it('adds it to _afterAll', function () {
- var fn = function () {};
- this.suite.afterAll(fn);
-
- this.suite._afterAll.should.have.length(1);
- var afterAllItem = this.suite._afterAll[0];
- afterAllItem.title.should.match(/^"after all" hook/);
- afterAllItem.fn.should.equal(fn);
- });
- it('appends title to hook', function () {
- var fn = function () {};
- this.suite.afterAll('test', fn);
-
- this.suite._afterAll.should.have.length(1);
- var beforeAllItem = this.suite._afterAll[0];
- beforeAllItem.title.should.equal('"after all" hook: test');
- beforeAllItem.fn.should.equal(fn);
-
- function namedFn () {}
- this.suite.afterAll(namedFn);
- this.suite._afterAll.should.have.length(2);
- beforeAllItem = this.suite._afterAll[1];
- beforeAllItem.title.should.equal('"after all" hook: namedFn');
- beforeAllItem.fn.should.equal(namedFn);
- });
- });
- });
-
- describe('.beforeEach()', function () {
- beforeEach(function () {
- this.suite = new Suite('A Suite');
- });
-
- describe('wraps the passed in function in a Hook', function () {
- it('adds it to _beforeEach', function () {
- var fn = function () {};
- this.suite.beforeEach(fn);
-
- this.suite._beforeEach.should.have.length(1);
- var beforeEachItem = this.suite._beforeEach[0];
- beforeEachItem.title.should.match(/^"before each" hook/);
- beforeEachItem.fn.should.equal(fn);
- });
-
- it('appends title to hook', function () {
- var fn = function () {};
- this.suite.beforeEach('test', fn);
-
- this.suite._beforeEach.should.have.length(1);
- var beforeAllItem = this.suite._beforeEach[0];
- beforeAllItem.title.should.equal('"before each" hook: test');
- beforeAllItem.fn.should.equal(fn);
-
- function namedFn () {}
- this.suite.beforeEach(namedFn);
- this.suite._beforeEach.should.have.length(2);
- beforeAllItem = this.suite._beforeEach[1];
- beforeAllItem.title.should.equal('"before each" hook: namedFn');
- beforeAllItem.fn.should.equal(namedFn);
- });
- });
- });
-
- describe('.afterEach()', function () {
- beforeEach(function () {
- this.suite = new Suite('A Suite');
- });
-
- describe('wraps the passed in function in a Hook', function () {
- it('adds it to _afterEach', function () {
- var fn = function () {};
- this.suite.afterEach(fn);
-
- this.suite._afterEach.should.have.length(1);
- var afterEachItem = this.suite._afterEach[0];
- afterEachItem.title.should.match(/^"after each" hook/);
- afterEachItem.fn.should.equal(fn);
- });
-
- it('appends title to hook', function () {
- var fn = function () {};
- this.suite.afterEach('test', fn);
-
- this.suite._afterEach.should.have.length(1);
- var beforeAllItem = this.suite._afterEach[0];
- beforeAllItem.title.should.equal('"after each" hook: test');
- beforeAllItem.fn.should.equal(fn);
-
- function namedFn () {}
- this.suite.afterEach(namedFn);
- this.suite._afterEach.should.have.length(2);
- beforeAllItem = this.suite._afterEach[1];
- beforeAllItem.title.should.equal('"after each" hook: namedFn');
- beforeAllItem.fn.should.equal(namedFn);
- });
- });
- });
-
- describe('.addSuite()', function () {
- beforeEach(function () {
- this.first = new Suite('First suite');
- this.first.timeout(4002);
- this.first.slow(200);
- this.second = new Suite('Second suite');
- this.first.addSuite(this.second);
- });
-
- it('sets the parent on the added Suite', function () {
- this.second.parent.should.equal(this.first);
- });
-
- it('copies the timeout value', function () {
- this.second.timeout().should.equal(4002);
- });
-
- it('copies the slow value', function () {
- this.second.slow().should.equal(200);
- });
-
- it('adds the suite to the suites collection', function () {
- this.first.suites.should.have.length(1);
- this.first.suites[0].should.equal(this.second);
- });
-
- it('treats suite as pending if its parent is pending', function () {
- this.first.pending = true;
- this.second.isPending.should.be.true;
- });
- });
-
- // describe('.addTest()', function(){
- // beforeEach(function(){
- // this.suite = new Suite('A Suite', new Context);
- // this.suite.timeout(4002);
- // this.test = new Test('test');
- // this.suite.addTest(this.test);
- // });
- //
- // it('sets the parent on the added test', function(){
- // this.test.parent.should.equal(this.suite);
- // });
- //
- // it('copies the timeout value', function(){
- // this.test.timeout().should.equal(4002);
- // });
- //
- // it('adds the test to the tests collection', function(){
- // this.suite.tests.should.have.length(1);
- // this.suite.tests[0].should.equal(this.test);
- // });
- // });
-
- describe('.fullTitle()', function () {
- beforeEach(function () {
- this.suite = new Suite('A Suite');
- });
-
- describe('when there is no parent', function () {
- it('returns the suite title', function () {
- this.suite.fullTitle().should.equal('A Suite');
- });
- });
-
- describe('when there is a parent', function () {
- it('returns the combination of parent\'s and suite\'s title', function () {
- var parentSuite = new Suite('I am a parent');
- parentSuite.addSuite(this.suite);
- this.suite.fullTitle().should.equal('I am a parent A Suite');
- });
- });
- });
-
- describe('.total()', function () {
- beforeEach(function () {
- this.suite = new Suite('A Suite');
- });
-
- describe('when there are no nested suites or tests', function () {
- it('should return 0', function () {
- this.suite.total().should.equal(0);
- });
- });
-
- describe('when there are several tests in the suite', function () {
- it('should return the number', function () {
- this.suite.addTest(new Test('a child test'));
- this.suite.addTest(new Test('another child test'));
- this.suite.total().should.equal(2);
- });
- });
- });
-
- describe('.eachTest(fn)', function () {
- beforeEach(function () {
- this.suite = new Suite('A Suite');
- });
-
- describe('when there are no nested suites or tests', function () {
- it('should return 0', function () {
- var n = 0;
- function fn () { n++; }
- this.suite.eachTest(fn);
- n.should.equal(0);
- });
- });
-
- describe('when there are several tests in the suite', function () {
- it('should return the number', function () {
- this.suite.addTest(new Test('a child test'));
- this.suite.addTest(new Test('another child test'));
-
- var n = 0;
- function fn () { n++; }
- this.suite.eachTest(fn);
- n.should.equal(2);
- });
- });
-
- describe('when there are several levels of nested suites', function () {
- it('should return the number', function () {
- this.suite.addTest(new Test('a child test'));
- var suite = new Suite('a child suite');
- suite.addTest(new Test('a test in a child suite'));
- this.suite.addSuite(suite);
-
- var n = 0;
- function fn () { n++; }
- this.suite.eachTest(fn);
- n.should.equal(2);
- });
- });
- });
-
- describe('initialization', function () {
- /* eslint no-new: off */
- it('should throw an error if the title isn\'t a string', function () {
- (function () {
- new Suite(undefined, 'root');
- }).should.throw();
-
- (function () {
- new Suite(function () {}, 'root');
- }).should.throw();
- });
-
- it('should not throw if the title is a string', function () {
- (function () {
- new Suite('Bdd suite', 'root');
- }).should.not.throw();
- });
- });
-});
-
-describe('Test', function () {
- describe('initialization', function () {
- it('should throw an error if the title isn\'t a string', function () {
- (function () {
- new Test(function () {});
- }).should.throw();
-
- (function () {
- new Test(undefined, function () {});
- }).should.throw();
- });
-
- it('should not throw if the title is a string', function () {
- (function () {
- new Test('test-case', function () {});
- }).should.not.throw();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/test.spec.js b/tests/lib/mocha-3.1.2/test/test.spec.js
deleted file mode 100644
index 73c09b3b06..0000000000
--- a/tests/lib/mocha-3.1.2/test/test.spec.js
+++ /dev/null
@@ -1,77 +0,0 @@
-'use strict';
-
-var mocha = require('../');
-var should = require('should');
-var Test = mocha.Test;
-
-describe('Test', function () {
- describe('.clone()', function () {
- beforeEach(function () {
- this._test = new Test('To be cloned', function () {});
- this._test._timeout = 3043;
- this._test._slow = 101;
- this._test._enableTimeouts = true;
- this._test._retries = 3;
- this._test._currentRetry = 1;
- this._test._allowedGlobals = ['foo'];
- this._test.parent = 'foo';
- this._test.file = 'bar';
- });
-
- it('should copy the title', function () {
- this._test.clone().title.should.equal('To be cloned');
- });
-
- it('should copy the timeout value', function () {
- this._test.clone().timeout().should.equal(3043);
- });
-
- it('should copy the slow value', function () {
- this._test.clone().slow().should.equal(101);
- });
-
- it('should copy the enableTimeouts value', function () {
- this._test.clone().enableTimeouts().should.be.true();
- });
-
- it('should copy the retries value', function () {
- this._test.clone().retries().should.equal(3);
- });
-
- it('should copy the currentRetry value', function () {
- this._test.clone().currentRetry().should.equal(1);
- });
-
- it('should copy the globals value', function () {
- this._test.clone().globals().should.not.be.empty();
- });
-
- it('should copy the parent value', function () {
- this._test.clone().parent.should.equal('foo');
- });
-
- it('should copy the file value', function () {
- this._test.clone().file.should.equal('bar');
- });
- });
-
- describe('.isPending()', function () {
- beforeEach(function () {
- this._test = new Test('Is it skipped', function () {});
- });
-
- it('should not be pending by default', function () {
- should(this._test.isPending()).not.be.ok();
- });
-
- it('should be pending when marked as such', function () {
- this._test.pending = true;
- should(this._test.isPending()).be.ok();
- });
-
- it('should be pending when its parent is pending', function () {
- this._test.parent = { isPending: function () { return true; } };
- should(this._test.isPending()).be.ok();
- });
- });
-});
diff --git a/tests/lib/mocha-3.1.2/test/utils.spec.js b/tests/lib/mocha-3.1.2/test/utils.spec.js
deleted file mode 100644
index ccfd861a78..0000000000
--- a/tests/lib/mocha-3.1.2/test/utils.spec.js
+++ /dev/null
@@ -1,263 +0,0 @@
-'use strict';
-
-var mocha = require('..');
-var utils = mocha.utils;
-var path = require('path');
-var JSON = require('json3');
-
-describe('utils', function () {
- describe('.clean()', function () {
- var clean = utils.clean;
- it('should remove the wrapping function declaration', function () {
- clean('function (one, two, three) {\n//code\n}').should.equal('//code');
- });
-
- it('should handle newlines in the function declaration', function () {
- clean('function (one, two, three)\n {\n//code\n}').should.equal('//code');
- });
-
- it('should remove space character indentation from the function body', function () {
- clean(' //line1\n //line2').should.equal('//line1\n //line2');
- });
-
- it('should remove tab character indentation from the function body', function () {
- clean('\t//line1\n\t\t//line2').should.equal('//line1\n\t//line2');
- });
-
- it('should handle functions with tabs in their declarations', function () {
- clean('function\t(\t)\t{\n//code\n}').should.equal('//code');
- });
-
- it('should handle named functions without space after name', function () {
- clean('function withName() {\n//code\n}').should.equal('//code');
- });
-
- it('should handle named functions with space after name', function () {
- clean('function withName () {\n//code\n}').should.equal('//code');
- });
-
- it('should handle functions with no space between the end and the closing brace', function () {
- clean('function() {/*code*/}').should.equal('/*code*/');
- });
-
- it('should handle functions with parentheses in the same line', function () {
- clean('function() { if (true) { /* code */ } }').should.equal('if (true) { /* code */ }');
- });
-
- it('should handle empty functions', function () {
- clean('function() {}').should.equal('');
- });
- });
-
- describe('.isBuffer()', function () {
- var isBuffer = utils.isBuffer;
- it('should test if object is a Buffer', function () {
- isBuffer(new Buffer([0x01])).should.equal(true);
- isBuffer({}).should.equal(false);
- });
- });
-
- describe('.map()', function () {
- var map = utils.map;
- it('should behave same as Array.prototype.map', function () {
- var arr = [1, 2, 3];
- map(arr, JSON.stringify).should.eql(arr.map(JSON.stringify));
- });
-
- it('should call the callback with 3 arguments[currentValue, index, array]', function () {
- var index = 0;
- map([1, 2, 3], function (e, i, arr) {
- e.should.equal(arr[index]);
- i.should.equal(index++);
- });
- });
-
- it('should apply with the given scope', function () {
- var scope = {};
- map(['a', 'b', 'c'], function () {
- this.should.equal(scope);
- }, scope);
- });
- });
-
- describe('.parseQuery()', function () {
- var parseQuery = utils.parseQuery;
- it('should get queryString and return key-value object', function () {
- parseQuery('?foo=1&bar=2&baz=3').should.eql({
- foo: '1',
- bar: '2',
- baz: '3'
- });
-
- parseQuery('?r1=^@(?!.*\\)$)&r2=m{2}&r3=^co.*').should.eql({
- r1: '^@(?!.*\\)$)',
- r2: 'm{2}',
- r3: '^co.*'
- });
- });
- });
-
- describe('.stackTraceFilter()', function () {
- describe('on node', function () {
- var filter = utils.stackTraceFilter();
-
- describe('on POSIX OS', function () {
- before(function () {
- if (path.sep !== '/') {
- this.skip();
- }
- });
-
- it('should get a stack-trace as a string and prettify it', function () {
- var stack = [
- 'AssertionError: foo bar',
- 'at EventEmitter.<anonymous> (/usr/local/dev/test.js:16:12)',
- 'at Context.<anonymous> (/usr/local/dev/test.js:19:5)',
- 'Test.Runnable.run (/usr/local/lib/node_modules/mocha/lib/runnable.js:244:7)',
- 'Runner.runTest (/usr/local/lib/node_modules/mocha/lib/runner.js:374:10)',
- '/usr/local/lib/node_modules/mocha/lib/runner.js:452:12',
- 'next (/usr/local/lib/node_modules/mocha/lib/runner.js:299:14)',
- '/usr/local/lib/node_modules/mocha/lib/runner.js:309:7',
- 'next (/usr/local/lib/node_modules/mocha/lib/runner.js:248:23)',
- 'Immediate._onImmediate (/usr/local/lib/node_modules/mocha/lib/runner.js:276:5)',
- 'at processImmediate [as _immediateCallback] (timers.js:321:17)'
- ];
- filter(stack.join('\n'))
- .should
- .equal(stack.slice(0, 3)
- .join('\n'));
-
- stack = [
- 'AssertionError: bar baz',
- 'at /usr/local/dev/some-test-file.js:25:8',
- 'at tryCatcher (/usr/local/dev/own/tmp/node_modules/bluebird/js/main/util.js:24:31)',
- 'at Promise._resolveFromResolver (/usr/local/dev/own/tmp/node_modules/bluebird/js/main/promise.js:439:31)',
- 'at new Promise (/usr/local/dev/own/tmp/node_modules/bluebird/js/main/promise.js:53:37)',
- 'at yourFunction (/usr/local/dev/own/tmp/test1.js:24:13)',
- 'at Context.<anonymous> (/usr/local/dev/some-test-file:30:4)',
- 'Test.Runnable.run (/usr/local/lib/node_modules/mocha/lib/runnable.js:218:15)',
- 'next (/usr/local/lib/node_modules/mocha/lib/runner.js:248:23)',
- 'Immediate._onImmediate (/usr/local/lib/node_modules/mocha/lib/runner.js:276:5)',
- 'at processImmediate [as _immediateCallback] (timers.js:321:17)'
- ];
-
- filter(stack.join('\n'))
- .should
- .equal(stack.slice(0, 7)
- .join('\n'));
- });
-
- it('does not ignore other bower_components and components',
- function () {
- var stack = [
- 'Error: failed',
- 'at assert (index.html:11:26)',
- 'at Context.<anonymous> (test.js:17:18)',
- 'at bower_components/should/should.js:4827:7',
- 'at next (file:///.../bower_components/should/should.js:4766:23)',
- 'at components/should/5.0.0/should.js:4827:7',
- 'at next (file:///.../components/should/5.0.0/should.js:4766:23)',
- 'at file:///.../bower_components/mocha/mocha.js:4794:5',
- 'at timeslice (.../components/mocha/mocha.js:6218:27)',
- 'at Test.require.register.Runnable.run (file:///.../components/mochajs/mocha/2.1.0/mocha.js:4463:15)',
- 'at Runner.require.register.Runner.runTest (file:///.../components/mochajs/mocha/2.1.0/mocha.js:4892:10)',
- 'at file:///.../components/mochajs/mocha/2.1.0/mocha.js:4970:12',
- 'at next (file:///.../components/mochajs/mocha/2.1.0/mocha.js:4817:14)'
- ];
- filter(stack.join('\n'))
- .should
- .equal(stack.slice(0, 7)
- .join('\n'));
- });
-
- it('should replace absolute with relative paths', function () {
- var stack = [
- 'Error: ' + process.cwd() + '/bla.js has a problem',
- 'at foo (' + process.cwd() + '/foo/index.js:13:226)',
- 'at bar (/usr/local/dev/own/tmp/node_modules/bluebird/js/main/promise.js:11:26)'
- ];
-
- var expected = [
- 'Error: ' + process.cwd() + '/bla.js has a problem',
- 'at foo (foo/index.js:13:226)',
- 'at bar (/usr/local/dev/own/tmp/node_modules/bluebird/js/main/promise.js:11:26)'
- ];
-
- filter(stack.join('\n'))
- .should
- .equal(expected.join('\n'));
- });
- });
-
- describe('on Windows', function () {
- before(function () {
- if (path.sep === '/') {
- this.skip();
- }
- });
-
- it('should work on Windows', function () {
- var stack = [
- 'Error: failed',
- 'at Context.<anonymous> (C:\\Users\\ishida\\src\\test\\test\\mytest.js:5:9)',
- 'at callFn (C:\\Users\\ishida\\src\\test\\node_modules\\mocha\\lib\\runnable.js:326:21)',
- 'at Test.Runnable.run (C:\\Users\\ishida\\src\\test\\node_modules\\mocha\\lib\\runnable.js:319:7)',
- 'at Runner.runTest (C:\\Users\\ishida\\src\\test\\node_modules\\mocha\\lib\\runner.js:422:10)',
- 'at C:\\Users\\ishida\\src\\test\\node_modules\\mocha\\lib\\runner.js:528:12',
- 'at next (C:\\Users\\ishida\\src\\test\\node_modules\\mocha\\lib\\runner.js:342:14)',
- 'at C:\\Users\\ishida\\src\\test\\node_modules\\mocha\\lib\\runner.js:352:7',
- 'at next (C:\\Users\\ishida\\src\\test\\node_modules\\mocha\\lib\\runner.js:284:14)',
- 'at Immediate._onImmediate (C:\\Users\\ishida\\src\\test\\node_modules\\mocha\\lib\\runner.js:320:5)'
- ];
- filter(stack.join('\n'))
- .should
- .equal(stack.slice(0, 2)
- .join('\n'));
- });
- });
- });
-
- describe('on browser', function () {
- var filter;
- before(function () {
- global.document = true;
- global.location = { href: 'localhost:3000/foo/bar/index.html' };
- filter = utils.stackTraceFilter();
- });
- it('does not strip out other bower_components', function () {
- var stack = [
- 'Error: failed',
- 'at assert (index.html:11:26)',
- 'at Context.<anonymous> (test.js:17:18)',
- 'at bower_components/should/should.js:4827:7',
- 'at next (bower_components/should/should.js:4766:23)',
- 'at components/should/5.0.0/should.js:4827:7',
- 'at next (components/should/5.0.0/should.js:4766:23)',
- 'at Runner.require.register.Runner.runTest (node_modules/mocha.js:4892:10)',
- 'at localhost:3000/foo/bar/node_modules/mocha.js:4970:12',
- 'at next (node_modules/mocha.js:4817:14)'
- ];
- filter(stack.join('\n')).should.equal(stack.slice(0, 7).join('\n'));
- });
-
- after(function () {
- delete global.document;
- delete global.location;
- });
- });
- });
-
- describe('.isPromise', function () {
- it('should return true if the value is Promise-ish', function () {
- utils.isPromise({then: function () {}}).should.be.true;
- });
-
- it('should return false if the value is not an object', function () {
- utils.isPromise(1).should.be.false;
- });
-
- it('should return false if the value is an object w/o a "then" function', function () {
- utils.isPromise({}).should.be.false;
- });
- });
-});