From 6adabd53c2036525703a8ea95e155e9dc5a27c3c Mon Sep 17 00:00:00 2001 From: Tom Macwright Date: Mon, 1 May 2017 14:54:15 -0400 Subject: [PATCH 1/2] build: Use Flow syntax without comments. We're switching to Flow annotations - not Flow comments. This gives documentation.js the ability to self-document without JSDoc types and improves our compatibility with tools like prettier. Fixes #729. Fixes #709 --- .babelrc | 6 + .eslintignore | 6 +- .eslintrc | 3 +- .flowconfig | 3 +- .gitignore | 3 +- {test => __tests__}/.eslintrc | 3 + __tests__/__snapshots__/bin-readme.js.snap | 59 + __tests__/__snapshots__/bin.js.snap | 2022 ++++++++++++ __tests__/__snapshots__/test.js.snap | 1176 +++++++ __tests__/bin-readme.js | 125 + __tests__/bin-watch-serve.js | 161 + __tests__/bin.js | 407 +++ {test => __tests__}/config_fixture/config | 0 .../config_fixture/config.json | 0 .../config_fixture/config.yaml | 0 {test => __tests__}/config_fixture/config.yml | 0 .../config_fixture/config_comments.json | 0 .../config_fixture/config_file.yml | 0 .../config_fixture/config_links.yml | 0 .../fixture/_external-deps-included.json | 0 .../fixture/_multi-file-input.json | 0 .../fixture/auto_lang_hljs/config.yml | 0 .../auto_lang_hljs/multilanguage.input.js | 0 .../auto_lang_hljs/multilanguage.output.md | 0 {test => __tests__}/fixture/bad/syntax.input | 0 .../fixture/bad/syntax.output.json | 0 .../fixture/boolean-literal-type.input.js | 0 {test => __tests__}/fixture/class.input.js | 0 {test => __tests__}/fixture/config-bad.yml | 0 .../fixture/config-malformed.json | 0 {test => __tests__}/fixture/config.json | 0 .../fixture/custom_theme/index.js | 0 .../fixture/default-export-function.input.js | 0 .../document-exported-bad/exports-z.js | 0 .../fixture/document-exported-bad/x.js | 0 ...nt-exported-export-default-object.input.js | 0 ...ent-exported-export-default-value.input.js | 0 .../fixture/document-exported.input.js | 0 .../fixture/document-exported/x.js | 0 .../fixture/document-exported/y.js | 0 .../fixture/document-exported/z.js | 0 .../fixture/es6-class.input.js | 0 .../fixture/es6-default2.input.js | 0 {test => __tests__}/fixture/es6-ext.es6 | 0 .../fixture/es6-import.input.js | 0 {test => __tests__}/fixture/es6.input.js | 0 {test => __tests__}/fixture/es6.output-toc.md | 0 {test => __tests__}/fixture/event.input.js | 0 .../fixture/example-caption.input.js | 0 {test => __tests__}/fixture/extension.jsx | 0 .../fixture/extension/extension-required.jsx | 0 .../fixture/extension/index.otherextension | 0 {test => __tests__}/fixture/external.input.js | 1 - {test => __tests__}/fixture/factory.input.js | 0 .../fixture/flow-unnamed-params.input.js | 4 +- .../fixture/html/documentation.yml | 0 .../fixture/html/nested.config-output.html | 0 .../fixture/html/nested.input.js | 2 - .../fixture/html/nested.output.files | 0 .../fixture/html/nested.output.json | 0 .../fixture/infer-private.input.js | 0 .../fixture/inheritance.input.js | 0 .../fixture/inline-link.input.js | 0 .../fixture/interface.input.js | 0 {test => __tests__}/fixture/internal.input.js | 0 {test => __tests__}/fixture/lends.input.js | 0 .../fixture/lint/lint.input.js | 0 {test => __tests__}/fixture/lint/lint.output | 0 .../fixture/literal_types.input.js | 0 .../fixture/memberedclass.input.js | 0 .../fixture/merge-infered-type.input.js | 0 {test => __tests__}/fixture/meta.input.js | 0 .../fixture/multisignature.input.js | 0 .../fixture/nearby_params.input.js | 0 .../fixture/nest_params.input.js | 0 .../fixture/newline-in-description.input.js | 0 {test => __tests__}/fixture/no-name.input.js | 0 .../fixture/node_modules/external/index.js | 0 .../fixture/node_modules/external/lib/main.js | 2 - .../external/node_modules/external2/index.js | 0 .../node_modules/external/package.json | 0 .../fixture/node_modules/external2/index.js | 0 .../optional-record-field-type.input.js | 0 {test => __tests__}/fixture/params.input.js | 0 .../fixture/polyglot/blend.cpp | 0 .../fixture/polyglot/blend.json | 0 .../fixture/react-jsx.input.js | 0 .../fixture/readme/README.input.md | 0 .../fixture/readme/README.output.md | 0 {test => __tests__}/fixture/readme/index.js | 0 .../require-json-no-extension.input.js | 0 .../fixture/require-json.input.js | 0 {test => __tests__}/fixture/require-json.json | 0 .../fixture/simple-hashbang.input.js | 0 .../fixture/simple-private.input.js | 0 .../fixture/simple-singlestar.input.js | 0 .../fixture/simple-triplestar.input.js | 0 .../fixture/simple-two.input.js | 0 {test => __tests__}/fixture/simple.config.yml | 0 {test => __tests__}/fixture/simple.input.js | 0 {test => __tests__}/fixture/snowflake.md | 0 .../fixture/sort-order-alpha.input.js | 0 {test => __tests__}/fixture/sorting/input.js | 0 .../fixture/sorting/output-bad.txt | 0 .../fixture/sorting/output.json | 0 .../fixture/string-literal-key.input.js | 0 .../fixture/system-import.input.js | 0 .../fixture/this-class.input.js | 0 .../fixture/type_application.input.js | 0 .../var-function-param-return.input.js | 0 {test => __tests__}/format_type.js | 42 +- __tests__/lib/__snapshots__/server.js.snap | 7 + __tests__/lib/__snapshots__/sort.js.snap | 109 + {test => __tests__}/lib/filter_access.js | 111 +- __tests__/lib/flow_doctrine.js | 305 ++ __tests__/lib/git/find_git.js | 16 + __tests__/lib/git/url_prefix.js | 32 + __tests__/lib/github.js | 86 + {test => __tests__}/lib/hierarchy.js | 78 +- .../lib/infer/__snapshots__/params.js.snap | 223 ++ __tests__/lib/infer/access.js | 46 + {test => __tests__}/lib/infer/finders.js | 63 +- {test => __tests__}/lib/infer/kind.js | 136 +- {test => __tests__}/lib/infer/membership.js | 606 ++-- {test => __tests__}/lib/infer/name.js | 202 +- __tests__/lib/infer/params.js | 166 + {test => __tests__}/lib/infer/type.js | 37 +- __tests__/lib/input/shallow.js | 46 + __tests__/lib/lint.js | 74 + {test => __tests__}/lib/merge_config.js | 27 +- {test => __tests__}/lib/nest.js | 47 +- __tests__/lib/output/util/formatters.js | 56 + __tests__/lib/parse.js | 1142 +++++++ __tests__/lib/parsers/javascript.js | 86 + __tests__/lib/parsers/polyglot.js | 81 + __tests__/lib/server.js | 59 + {test => __tests__}/lib/sort.js | 142 +- __tests__/lib/walk.js | 74 + __tests__/linker.js | 44 + {test => __tests__}/misc/package.json | 0 __tests__/test.js | 221 ++ .../git/mock_repo.js => __tests__/utils.js | 41 +- bin/documentation.js | 5 +- circle.yml | 5 +- declarations/comment.js | 77 +- default_theme/test/format_markdown.js | 119 - default_theme/test/format_parameters.js | 15 - default_theme/test/index.js | 30 - lib/commands/serve.js | 100 - package.json | 34 +- {lib => src}/commands/build.js | 18 +- {lib => src}/commands/index.js | 1 - {lib => src}/commands/lint.js | 10 +- {lib => src}/commands/readme.js | 13 +- src/commands/serve.js | 101 + {lib => src}/commands/shared_options.js | 5 +- .../default_theme}/README.md | 0 .../default_theme}/assets/anchor.js | 13 +- .../default_theme}/assets/bass-addons.css | 0 .../default_theme}/assets/bass.css | 0 .../assets/fonts/EOT/SourceCodePro-Bold.eot | Bin .../fonts/EOT/SourceCodePro-Regular.eot | Bin .../default_theme}/assets/fonts/LICENSE.txt | 0 .../assets/fonts/OTF/SourceCodePro-Bold.otf | Bin .../fonts/OTF/SourceCodePro-Regular.otf | Bin .../assets/fonts/TTF/SourceCodePro-Bold.ttf | Bin .../fonts/TTF/SourceCodePro-Regular.ttf | Bin .../WOFF/OTF/SourceCodePro-Bold.otf.woff | Bin .../WOFF/OTF/SourceCodePro-Regular.otf.woff | Bin .../WOFF/TTF/SourceCodePro-Bold.ttf.woff | Bin .../WOFF/TTF/SourceCodePro-Regular.ttf.woff | Bin .../WOFF2/OTF/SourceCodePro-Bold.otf.woff2 | Bin .../WOFF2/OTF/SourceCodePro-Regular.otf.woff2 | Bin .../WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 | Bin .../WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 | Bin .../assets/fonts/source-code-pro.css | 0 .../default_theme}/assets/github.css | 0 .../default_theme}/assets/site.js | 0 .../default_theme}/assets/style.css | 0 {default_theme => src/default_theme}/index._ | 0 {default_theme => src/default_theme}/index.js | 8 +- {default_theme => src/default_theme}/note._ | 0 .../default_theme}/section._ | 0 .../default_theme}/section_list._ | 0 {lib => src}/extractors/comments.js | 17 +- {lib => src}/extractors/exported.js | 19 +- {lib => src}/filter_access.js | 14 +- {lib => src}/flow_doctrine.js | 6 +- {lib => src}/garbage_collect.js | 3 +- {lib => src}/git/find_git.js | 3 +- {lib => src}/git/url_prefix.js | 20 +- {lib => src}/github.js | 7 +- {lib => src}/hierarchy.js | 35 +- {lib => src}/index.js | 20 +- {lib => src}/infer/access.js | 5 +- {lib => src}/infer/augments.js | 7 +- {lib => src}/infer/finders.js | 3 +- {lib => src}/infer/kind.js | 3 +- {lib => src}/infer/membership.js | 20 +- {lib => src}/infer/name.js | 6 +- {lib => src}/infer/params.js | 31 +- {lib => src}/infer/properties.js | 5 +- {lib => src}/infer/return.js | 3 +- {lib => src}/infer/type.js | 3 +- {lib => src}/inline_tokenizer.js | 1 - {lib => src}/input/dependency.js | 19 +- {lib => src}/input/shallow.js | 7 +- {lib => src}/is_jsdoc_comment.js | 9 +- {lib => src}/lint.js | 16 +- {lib => src}/merge_config.js | 15 +- {lib => src}/module_filters.js | 12 +- {lib => src}/nest.js | 12 +- {lib => src}/output/highlighter.js | 6 +- {lib => src}/output/html.js | 5 +- {lib => src}/output/json.js | 5 +- {lib => src}/output/markdown.js | 6 +- {lib => src}/output/markdown_ast.js | 141 +- {lib => src}/output/util/format_type.js | 3 +- {lib => src}/output/util/formatters.js | 23 +- {lib => src}/output/util/linker_stack.js | 15 +- {lib => src}/output/util/reroute_links.js | 10 +- {lib => src}/parse.js | 15 +- {lib => src}/parse_markdown.js | 3 +- {lib => src}/parsers/README.md | 0 {lib => src}/parsers/javascript.js | 17 +- {lib => src}/parsers/parse_to_ast.js | 5 +- {lib => src}/parsers/polyglot.js | 7 +- {lib => src}/serve/error_page.js | 6 +- {lib => src}/serve/server.js | 59 +- {lib => src}/smart_glob.js | 10 +- {lib => src}/sort.js | 44 +- {lib => src}/walk.js | 9 +- test/bin-readme.js | 166 - test/bin-watch-serve.js | 139 - test/bin.js | 593 ---- test/fixture/boolean-literal-type.output.json | 89 - test/fixture/boolean-literal-type.output.md | 14 - .../boolean-literal-type.output.md.json | 134 - test/fixture/class.config.output.md | 30 - test/fixture/class.output.json | 613 ---- test/fixture/class.output.md | 31 - test/fixture/class.output.md.json | 448 --- .../default-export-function.output.json | 214 -- .../fixture/default-export-function.output.md | 14 - .../default-export-function.output.md.json | 99 - ...exported-export-default-object.output.json | 108 - ...t-exported-export-default-object.output.md | 10 - ...orted-export-default-object.output.md.json | 29 - ...-exported-export-default-value.output.json | 51 - ...nt-exported-export-default-value.output.md | 7 - ...ported-export-default-value.output.md.json | 19 - test/fixture/document-exported.output.json | 1808 ----------- test/fixture/document-exported.output.md | 140 - test/fixture/document-exported.output.md.json | 827 ----- test/fixture/es6-class.output.json | 480 --- test/fixture/es6-class.output.md | 35 - test/fixture/es6-class.output.md.json | 370 --- test/fixture/es6-default2.output.json | 66 - test/fixture/es6-default2.output.md | 11 - test/fixture/es6-default2.output.md.json | 56 - test/fixture/es6-import.output.json | 452 --- test/fixture/es6-import.output.md | 27 - test/fixture/es6-import.output.md.json | 309 -- test/fixture/es6.output.json | 2892 ----------------- test/fixture/es6.output.md | 171 - test/fixture/es6.output.md.json | 2339 ------------- test/fixture/event.output.json | 262 -- test/fixture/event.output.md | 14 - test/fixture/event.output.md.json | 208 -- test/fixture/example-caption.output.json | 236 -- test/fixture/example-caption.output.md | 19 - test/fixture/example-caption.output.md.json | 189 -- test/fixture/external.output.json | 138 - test/fixture/external.output.md | 9 - test/fixture/external.output.md.json | 88 - test/fixture/factory.output.json | 362 --- test/fixture/factory.output.md | 27 - test/fixture/factory.output.md.json | 247 -- test/fixture/flow-unnamed-params.output.json | 510 --- test/fixture/flow-unnamed-params.output.md | 32 - .../flow-unnamed-params.output.md.json | 431 --- test/fixture/infer-params.output.json | 345 -- test/fixture/infer-params.output.md | 43 - test/fixture/infer-params.output.md.json | 737 ----- test/fixture/infer-private.output.json | 214 -- test/fixture/infer-private.output.md | 14 - test/fixture/infer-private.output.md.json | 99 - test/fixture/inheritance.output.json | 181 -- test/fixture/inheritance.output.md | 16 - test/fixture/inheritance.output.md.json | 100 - test/fixture/inline-link.output.json | 669 ---- test/fixture/inline-link.output.md | 31 - test/fixture/inline-link.output.md.json | 582 ---- test/fixture/interface.output.json | 132 - test/fixture/interface.output.md | 16 - test/fixture/interface.output.md.json | 163 - test/fixture/internal.output.json | 138 - test/fixture/internal.output.md | 9 - test/fixture/internal.output.md.json | 88 - test/fixture/lends.output.json | 630 ---- test/fixture/lends.output.md | 33 - test/fixture/lends.output.md.json | 466 --- test/fixture/literal_types.output.json | 210 -- test/fixture/literal_types.output.md | 18 - test/fixture/literal_types.output.md.json | 217 -- test/fixture/memberedclass.output.json | 553 ---- test/fixture/memberedclass.output.md | 27 - test/fixture/memberedclass.output.md.json | 360 -- test/fixture/merge-infered-type.output.json | 274 -- test/fixture/merge-infered-type.output.md | 15 - .../fixture/merge-infered-type.output.md.json | 240 -- test/fixture/meta.output.json | 454 --- test/fixture/meta.output.md | 23 - test/fixture/meta.output.md.json | 470 --- test/fixture/multisignature.output.json | 422 --- test/fixture/multisignature.output.md | 26 - test/fixture/multisignature.output.md.json | 352 -- test/fixture/nearby_params.output.json | 529 --- test/fixture/nearby_params.output.md | 18 - test/fixture/nearby_params.output.md.json | 502 --- test/fixture/nest_params.output.json | 836 ----- test/fixture/nest_params.output.md | 32 - test/fixture/nest_params.output.md.json | 890 ----- .../newline-in-description.output.json | 180 - test/fixture/newline-in-description.output.md | 13 - .../newline-in-description.output.md.json | 148 - test/fixture/no-name.output.json | 122 - test/fixture/no-name.output.md | 11 - test/fixture/no-name.output.md.json | 107 - .../optional-record-field-type.output.json | 99 - .../optional-record-field-type.output.md | 14 - .../optional-record-field-type.output.md.json | 169 - test/fixture/params.output.json | 2845 ---------------- test/fixture/params.output.md | 139 - test/fixture/params.output.md.json | 2535 --------------- test/fixture/react-jsx.output.json | 104 - test/fixture/react-jsx.output.md | 9 - test/fixture/react-jsx.output.md.json | 54 - .../require-json-no-extension.output.json | 1 - .../require-json-no-extension.output.md | 3 - .../require-json-no-extension.output.md.json | 9 - test/fixture/require-json.output.json | 1 - test/fixture/require-json.output.md | 3 - test/fixture/require-json.output.md.json | 9 - test/fixture/simple-hashbang.output.json | 174 - test/fixture/simple-hashbang.output.md | 11 - test/fixture/simple-hashbang.output.md.json | 118 - test/fixture/simple-private.output.json | 1 - test/fixture/simple-private.output.md | 3 - test/fixture/simple-private.output.md.json | 9 - test/fixture/simple-singlestar.output.json | 1 - test/fixture/simple-singlestar.output.md | 3 - test/fixture/simple-singlestar.output.md.json | 9 - test/fixture/simple-triplestar.output.json | 1 - test/fixture/simple-triplestar.output.md | 3 - test/fixture/simple-triplestar.output.md.json | 9 - test/fixture/simple-two.output.json | 255 -- test/fixture/simple-two.output.md | 22 - test/fixture/simple-two.output.md.json | 220 -- test/fixture/simple.output.github.json | 175 - test/fixture/simple.output.github.md | 9 - test/fixture/simple.output.json | 174 - test/fixture/simple.output.md | 11 - test/fixture/simple.output.md.json | 118 - test/fixture/sort-order-alpha.output.json | 672 ---- test/fixture/sort-order-alpha.output.md | 40 - test/fixture/sort-order-alpha.output.md.json | 129 - test/fixture/string-literal-key.output.json | 169 - test/fixture/string-literal-key.output.md | 12 - .../fixture/string-literal-key.output.md.json | 64 - test/fixture/system-import.output.json | 174 - test/fixture/system-import.output.md | 11 - test/fixture/system-import.output.md.json | 118 - test/fixture/this-class.output.json | 411 --- test/fixture/this-class.output.md | 35 - test/fixture/this-class.output.md.json | 240 -- test/fixture/type_application.output.json | 202 -- test/fixture/type_application.output.md | 13 - test/fixture/type_application.output.md.json | 161 - .../var-function-param-return.output.json | 71 - .../var-function-param-return.output.md | 13 - .../var-function-param-return.output.md.json | 101 - test/lib/flow_doctrine.js | 430 --- test/lib/git/find_git.js | 23 - test/lib/git/url_prefix.js | 43 - test/lib/github.js | 101 - test/lib/infer/access.js | 67 - test/lib/infer/params.js | 379 --- test/lib/input/shallow.js | 59 - test/lib/lint.js | 87 - test/lib/output/util/formatters.js | 65 - test/lib/parse.js | 1452 --------- test/lib/parsers/javascript.js | 101 - test/lib/parsers/polyglot.js | 89 - test/lib/server.js | 104 - test/lib/walk.js | 90 - test/linker.js | 54 - test/normalize.js | 18 - test/test.js | 337 -- test/utils.js | 17 - yarn.lock | 1014 +++--- 401 files changed, 8617 insertions(+), 42839 deletions(-) create mode 100644 .babelrc rename {test => __tests__}/.eslintrc (68%) create mode 100644 __tests__/__snapshots__/bin-readme.js.snap create mode 100644 __tests__/__snapshots__/bin.js.snap create mode 100644 __tests__/__snapshots__/test.js.snap create mode 100644 __tests__/bin-readme.js create mode 100644 __tests__/bin-watch-serve.js create mode 100644 __tests__/bin.js rename {test => __tests__}/config_fixture/config (100%) rename {test => __tests__}/config_fixture/config.json (100%) rename {test => __tests__}/config_fixture/config.yaml (100%) rename {test => __tests__}/config_fixture/config.yml (100%) rename {test => __tests__}/config_fixture/config_comments.json (100%) rename {test => __tests__}/config_fixture/config_file.yml (100%) rename {test => __tests__}/config_fixture/config_links.yml (100%) rename {test => __tests__}/fixture/_external-deps-included.json (100%) rename {test => __tests__}/fixture/_multi-file-input.json (100%) rename {test => __tests__}/fixture/auto_lang_hljs/config.yml (100%) rename {test => __tests__}/fixture/auto_lang_hljs/multilanguage.input.js (100%) rename {test => __tests__}/fixture/auto_lang_hljs/multilanguage.output.md (100%) rename {test => __tests__}/fixture/bad/syntax.input (100%) rename {test => __tests__}/fixture/bad/syntax.output.json (100%) rename {test => __tests__}/fixture/boolean-literal-type.input.js (100%) rename {test => __tests__}/fixture/class.input.js (100%) rename {test => __tests__}/fixture/config-bad.yml (100%) rename {test => __tests__}/fixture/config-malformed.json (100%) rename {test => __tests__}/fixture/config.json (100%) rename {test => __tests__}/fixture/custom_theme/index.js (100%) rename {test => __tests__}/fixture/default-export-function.input.js (100%) rename {test => __tests__}/fixture/document-exported-bad/exports-z.js (100%) rename {test => __tests__}/fixture/document-exported-bad/x.js (100%) rename {test => __tests__}/fixture/document-exported-export-default-object.input.js (100%) rename {test => __tests__}/fixture/document-exported-export-default-value.input.js (100%) rename {test => __tests__}/fixture/document-exported.input.js (100%) rename {test => __tests__}/fixture/document-exported/x.js (100%) rename {test => __tests__}/fixture/document-exported/y.js (100%) rename {test => __tests__}/fixture/document-exported/z.js (100%) rename {test => __tests__}/fixture/es6-class.input.js (100%) rename {test => __tests__}/fixture/es6-default2.input.js (100%) rename {test => __tests__}/fixture/es6-ext.es6 (100%) rename {test => __tests__}/fixture/es6-import.input.js (100%) rename {test => __tests__}/fixture/es6.input.js (100%) rename {test => __tests__}/fixture/es6.output-toc.md (100%) rename {test => __tests__}/fixture/event.input.js (100%) rename {test => __tests__}/fixture/example-caption.input.js (100%) rename {test => __tests__}/fixture/extension.jsx (100%) rename {test => __tests__}/fixture/extension/extension-required.jsx (100%) rename {test => __tests__}/fixture/extension/index.otherextension (100%) rename {test => __tests__}/fixture/external.input.js (93%) rename {test => __tests__}/fixture/factory.input.js (100%) rename {test => __tests__}/fixture/flow-unnamed-params.input.js (81%) rename {test => __tests__}/fixture/html/documentation.yml (100%) rename {test => __tests__}/fixture/html/nested.config-output.html (100%) rename {test => __tests__}/fixture/html/nested.input.js (99%) rename {test => __tests__}/fixture/html/nested.output.files (100%) rename {test => __tests__}/fixture/html/nested.output.json (100%) rename {test => __tests__}/fixture/infer-private.input.js (100%) rename {test => __tests__}/fixture/inheritance.input.js (100%) rename {test => __tests__}/fixture/inline-link.input.js (100%) rename {test => __tests__}/fixture/interface.input.js (100%) rename {test => __tests__}/fixture/internal.input.js (100%) rename {test => __tests__}/fixture/lends.input.js (100%) rename {test => __tests__}/fixture/lint/lint.input.js (100%) rename {test => __tests__}/fixture/lint/lint.output (100%) rename {test => __tests__}/fixture/literal_types.input.js (100%) rename {test => __tests__}/fixture/memberedclass.input.js (100%) rename {test => __tests__}/fixture/merge-infered-type.input.js (100%) rename {test => __tests__}/fixture/meta.input.js (100%) rename {test => __tests__}/fixture/multisignature.input.js (100%) rename {test => __tests__}/fixture/nearby_params.input.js (100%) rename {test => __tests__}/fixture/nest_params.input.js (100%) rename {test => __tests__}/fixture/newline-in-description.input.js (100%) rename {test => __tests__}/fixture/no-name.input.js (100%) rename {test => __tests__}/fixture/node_modules/external/index.js (100%) rename {test => __tests__}/fixture/node_modules/external/lib/main.js (92%) rename {test => __tests__}/fixture/node_modules/external/node_modules/external2/index.js (100%) rename {test => __tests__}/fixture/node_modules/external/package.json (100%) rename {test => __tests__}/fixture/node_modules/external2/index.js (100%) rename {test => __tests__}/fixture/optional-record-field-type.input.js (100%) rename {test => __tests__}/fixture/params.input.js (100%) rename {test => __tests__}/fixture/polyglot/blend.cpp (100%) rename {test => __tests__}/fixture/polyglot/blend.json (100%) rename {test => __tests__}/fixture/react-jsx.input.js (100%) rename {test => __tests__}/fixture/readme/README.input.md (100%) rename {test => __tests__}/fixture/readme/README.output.md (100%) rename {test => __tests__}/fixture/readme/index.js (100%) rename {test => __tests__}/fixture/require-json-no-extension.input.js (100%) rename {test => __tests__}/fixture/require-json.input.js (100%) rename {test => __tests__}/fixture/require-json.json (100%) rename {test => __tests__}/fixture/simple-hashbang.input.js (100%) rename {test => __tests__}/fixture/simple-private.input.js (100%) rename {test => __tests__}/fixture/simple-singlestar.input.js (100%) rename {test => __tests__}/fixture/simple-triplestar.input.js (100%) rename {test => __tests__}/fixture/simple-two.input.js (100%) rename {test => __tests__}/fixture/simple.config.yml (100%) rename {test => __tests__}/fixture/simple.input.js (100%) rename {test => __tests__}/fixture/snowflake.md (100%) rename {test => __tests__}/fixture/sort-order-alpha.input.js (100%) rename {test => __tests__}/fixture/sorting/input.js (100%) rename {test => __tests__}/fixture/sorting/output-bad.txt (100%) rename {test => __tests__}/fixture/sorting/output.json (100%) rename {test => __tests__}/fixture/string-literal-key.input.js (100%) rename {test => __tests__}/fixture/system-import.input.js (100%) rename {test => __tests__}/fixture/this-class.input.js (100%) rename {test => __tests__}/fixture/type_application.input.js (100%) rename {test => __tests__}/fixture/var-function-param-return.input.js (100%) rename {test => __tests__}/format_type.js (86%) create mode 100644 __tests__/lib/__snapshots__/server.js.snap create mode 100644 __tests__/lib/__snapshots__/sort.js.snap rename {test => __tests__}/lib/filter_access.js (60%) create mode 100644 __tests__/lib/flow_doctrine.js create mode 100644 __tests__/lib/git/find_git.js create mode 100644 __tests__/lib/git/url_prefix.js create mode 100644 __tests__/lib/github.js rename {test => __tests__}/lib/hierarchy.js (58%) create mode 100644 __tests__/lib/infer/__snapshots__/params.js.snap create mode 100644 __tests__/lib/infer/access.js rename {test => __tests__}/lib/infer/finders.js (51%) rename {test => __tests__}/lib/infer/kind.js (55%) rename {test => __tests__}/lib/infer/membership.js (56%) rename {test => __tests__}/lib/infer/name.js (56%) create mode 100644 __tests__/lib/infer/params.js rename {test => __tests__}/lib/infer/type.js (52%) create mode 100644 __tests__/lib/input/shallow.js create mode 100644 __tests__/lib/lint.js rename {test => __tests__}/lib/merge_config.js (82%) rename {test => __tests__}/lib/nest.js (70%) create mode 100644 __tests__/lib/output/util/formatters.js create mode 100644 __tests__/lib/parse.js create mode 100644 __tests__/lib/parsers/javascript.js create mode 100644 __tests__/lib/parsers/polyglot.js create mode 100644 __tests__/lib/server.js rename {test => __tests__}/lib/sort.js (60%) create mode 100644 __tests__/lib/walk.js create mode 100644 __tests__/linker.js rename {test => __tests__}/misc/package.json (100%) create mode 100644 __tests__/test.js rename test/lib/git/mock_repo.js => __tests__/utils.js (63%) delete mode 100644 default_theme/test/format_markdown.js delete mode 100644 default_theme/test/format_parameters.js delete mode 100644 default_theme/test/index.js delete mode 100644 lib/commands/serve.js rename {lib => src}/commands/build.js (89%) rename {lib => src}/commands/index.js (97%) rename {lib => src}/commands/lint.js (82%) rename {lib => src}/commands/readme.js (92%) create mode 100644 src/commands/serve.js rename {lib => src}/commands/shared_options.js (95%) rename {default_theme => src/default_theme}/README.md (100%) rename {default_theme => src/default_theme}/assets/anchor.js (97%) rename {default_theme => src/default_theme}/assets/bass-addons.css (100%) rename {default_theme => src/default_theme}/assets/bass.css (100%) rename {default_theme => src/default_theme}/assets/fonts/EOT/SourceCodePro-Bold.eot (100%) rename {default_theme => src/default_theme}/assets/fonts/EOT/SourceCodePro-Regular.eot (100%) rename {default_theme => src/default_theme}/assets/fonts/LICENSE.txt (100%) rename {default_theme => src/default_theme}/assets/fonts/OTF/SourceCodePro-Bold.otf (100%) rename {default_theme => src/default_theme}/assets/fonts/OTF/SourceCodePro-Regular.otf (100%) rename {default_theme => src/default_theme}/assets/fonts/TTF/SourceCodePro-Bold.ttf (100%) rename {default_theme => src/default_theme}/assets/fonts/TTF/SourceCodePro-Regular.ttf (100%) rename {default_theme => src/default_theme}/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff (100%) rename {default_theme => src/default_theme}/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff (100%) rename {default_theme => src/default_theme}/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff (100%) rename {default_theme => src/default_theme}/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff (100%) rename {default_theme => src/default_theme}/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 (100%) rename {default_theme => src/default_theme}/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 (100%) rename {default_theme => src/default_theme}/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 (100%) rename {default_theme => src/default_theme}/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 (100%) rename {default_theme => src/default_theme}/assets/fonts/source-code-pro.css (100%) rename {default_theme => src/default_theme}/assets/github.css (100%) rename {default_theme => src/default_theme}/assets/site.js (100%) rename {default_theme => src/default_theme}/assets/style.css (100%) rename {default_theme => src/default_theme}/index._ (100%) rename {default_theme => src/default_theme}/index.js (96%) rename {default_theme => src/default_theme}/note._ (100%) rename {default_theme => src/default_theme}/section._ (100%) rename {default_theme => src/default_theme}/section_list._ (100%) rename {lib => src}/extractors/comments.js (84%) rename {lib => src}/extractors/exported.js (95%) rename {lib => src}/filter_access.js (81%) rename {lib => src}/flow_doctrine.js (98%) rename {lib => src}/garbage_collect.js (66%) rename {lib => src}/git/find_git.js (90%) rename {lib => src}/git/url_prefix.js (87%) rename {lib => src}/github.js (81%) rename {lib => src}/hierarchy.js (88%) rename {lib => src}/index.js (93%) rename {lib => src}/infer/access.js (86%) rename {lib => src}/infer/augments.js (87%) rename {lib => src}/infer/finders.js (94%) rename {lib => src}/infer/kind.js (96%) rename {lib => src}/infer/membership.js (96%) rename {lib => src}/infer/name.js (95%) rename {lib => src}/infer/params.js (94%) rename {lib => src}/infer/properties.js (92%) rename {lib => src}/infer/return.js (94%) rename {lib => src}/infer/type.js (95%) rename {lib => src}/inline_tokenizer.js (99%) rename {lib => src}/input/dependency.js (82%) rename {lib => src}/input/shallow.js (90%) rename {lib => src}/is_jsdoc_comment.js (79%) rename {lib => src}/lint.js (86%) rename {lib => src}/merge_config.js (87%) rename {lib => src}/module_filters.js (89%) rename {lib => src}/nest.js (92%) rename {lib => src}/output/highlighter.js (82%) rename {lib => src}/output/html.js (87%) rename {lib => src}/output/json.js (85%) rename {lib => src}/output/markdown.js (87%) rename {lib => src}/output/markdown_ast.js (78%) rename {lib => src}/output/util/format_type.js (98%) rename {lib => src}/output/util/formatters.js (88%) rename {lib => src}/output/util/linker_stack.js (90%) rename {lib => src}/output/util/reroute_links.js (67%) rename {lib => src}/parse.js (98%) rename {lib => src}/parse_markdown.js (85%) rename {lib => src}/parsers/README.md (100%) rename {lib => src}/parsers/javascript.js (89%) rename {lib => src}/parsers/parse_to_ast.js (84%) rename {lib => src}/parsers/polyglot.js (81%) rename {lib => src}/serve/error_page.js (90%) rename {lib => src}/serve/server.js (76%) rename {lib => src}/smart_glob.js (95%) rename {lib => src}/sort.js (82%) rename {lib => src}/walk.js (79%) delete mode 100644 test/bin-readme.js delete mode 100644 test/bin-watch-serve.js delete mode 100644 test/bin.js delete mode 100644 test/fixture/boolean-literal-type.output.json delete mode 100644 test/fixture/boolean-literal-type.output.md delete mode 100644 test/fixture/boolean-literal-type.output.md.json delete mode 100644 test/fixture/class.config.output.md delete mode 100644 test/fixture/class.output.json delete mode 100644 test/fixture/class.output.md delete mode 100644 test/fixture/class.output.md.json delete mode 100644 test/fixture/default-export-function.output.json delete mode 100644 test/fixture/default-export-function.output.md delete mode 100644 test/fixture/default-export-function.output.md.json delete mode 100644 test/fixture/document-exported-export-default-object.output.json delete mode 100644 test/fixture/document-exported-export-default-object.output.md delete mode 100644 test/fixture/document-exported-export-default-object.output.md.json delete mode 100644 test/fixture/document-exported-export-default-value.output.json delete mode 100644 test/fixture/document-exported-export-default-value.output.md delete mode 100644 test/fixture/document-exported-export-default-value.output.md.json delete mode 100644 test/fixture/document-exported.output.json delete mode 100644 test/fixture/document-exported.output.md delete mode 100644 test/fixture/document-exported.output.md.json delete mode 100644 test/fixture/es6-class.output.json delete mode 100644 test/fixture/es6-class.output.md delete mode 100644 test/fixture/es6-class.output.md.json delete mode 100644 test/fixture/es6-default2.output.json delete mode 100644 test/fixture/es6-default2.output.md delete mode 100644 test/fixture/es6-default2.output.md.json delete mode 100644 test/fixture/es6-import.output.json delete mode 100644 test/fixture/es6-import.output.md delete mode 100644 test/fixture/es6-import.output.md.json delete mode 100644 test/fixture/es6.output.json delete mode 100644 test/fixture/es6.output.md delete mode 100644 test/fixture/es6.output.md.json delete mode 100644 test/fixture/event.output.json delete mode 100644 test/fixture/event.output.md delete mode 100644 test/fixture/event.output.md.json delete mode 100644 test/fixture/example-caption.output.json delete mode 100644 test/fixture/example-caption.output.md delete mode 100644 test/fixture/example-caption.output.md.json delete mode 100644 test/fixture/external.output.json delete mode 100644 test/fixture/external.output.md delete mode 100644 test/fixture/external.output.md.json delete mode 100644 test/fixture/factory.output.json delete mode 100644 test/fixture/factory.output.md delete mode 100644 test/fixture/factory.output.md.json delete mode 100644 test/fixture/flow-unnamed-params.output.json delete mode 100644 test/fixture/flow-unnamed-params.output.md delete mode 100644 test/fixture/flow-unnamed-params.output.md.json delete mode 100644 test/fixture/infer-params.output.json delete mode 100644 test/fixture/infer-params.output.md delete mode 100644 test/fixture/infer-params.output.md.json delete mode 100644 test/fixture/infer-private.output.json delete mode 100644 test/fixture/infer-private.output.md delete mode 100644 test/fixture/infer-private.output.md.json delete mode 100644 test/fixture/inheritance.output.json delete mode 100644 test/fixture/inheritance.output.md delete mode 100644 test/fixture/inheritance.output.md.json delete mode 100644 test/fixture/inline-link.output.json delete mode 100644 test/fixture/inline-link.output.md delete mode 100644 test/fixture/inline-link.output.md.json delete mode 100644 test/fixture/interface.output.json delete mode 100644 test/fixture/interface.output.md delete mode 100644 test/fixture/interface.output.md.json delete mode 100644 test/fixture/internal.output.json delete mode 100644 test/fixture/internal.output.md delete mode 100644 test/fixture/internal.output.md.json delete mode 100644 test/fixture/lends.output.json delete mode 100644 test/fixture/lends.output.md delete mode 100644 test/fixture/lends.output.md.json delete mode 100644 test/fixture/literal_types.output.json delete mode 100644 test/fixture/literal_types.output.md delete mode 100644 test/fixture/literal_types.output.md.json delete mode 100644 test/fixture/memberedclass.output.json delete mode 100644 test/fixture/memberedclass.output.md delete mode 100644 test/fixture/memberedclass.output.md.json delete mode 100644 test/fixture/merge-infered-type.output.json delete mode 100644 test/fixture/merge-infered-type.output.md delete mode 100644 test/fixture/merge-infered-type.output.md.json delete mode 100644 test/fixture/meta.output.json delete mode 100644 test/fixture/meta.output.md delete mode 100644 test/fixture/meta.output.md.json delete mode 100644 test/fixture/multisignature.output.json delete mode 100644 test/fixture/multisignature.output.md delete mode 100644 test/fixture/multisignature.output.md.json delete mode 100644 test/fixture/nearby_params.output.json delete mode 100644 test/fixture/nearby_params.output.md delete mode 100644 test/fixture/nearby_params.output.md.json delete mode 100644 test/fixture/nest_params.output.json delete mode 100644 test/fixture/nest_params.output.md delete mode 100644 test/fixture/nest_params.output.md.json delete mode 100644 test/fixture/newline-in-description.output.json delete mode 100644 test/fixture/newline-in-description.output.md delete mode 100644 test/fixture/newline-in-description.output.md.json delete mode 100644 test/fixture/no-name.output.json delete mode 100644 test/fixture/no-name.output.md delete mode 100644 test/fixture/no-name.output.md.json delete mode 100644 test/fixture/optional-record-field-type.output.json delete mode 100644 test/fixture/optional-record-field-type.output.md delete mode 100644 test/fixture/optional-record-field-type.output.md.json delete mode 100644 test/fixture/params.output.json delete mode 100644 test/fixture/params.output.md delete mode 100644 test/fixture/params.output.md.json delete mode 100644 test/fixture/react-jsx.output.json delete mode 100644 test/fixture/react-jsx.output.md delete mode 100644 test/fixture/react-jsx.output.md.json delete mode 100644 test/fixture/require-json-no-extension.output.json delete mode 100644 test/fixture/require-json-no-extension.output.md delete mode 100644 test/fixture/require-json-no-extension.output.md.json delete mode 100644 test/fixture/require-json.output.json delete mode 100644 test/fixture/require-json.output.md delete mode 100644 test/fixture/require-json.output.md.json delete mode 100644 test/fixture/simple-hashbang.output.json delete mode 100644 test/fixture/simple-hashbang.output.md delete mode 100644 test/fixture/simple-hashbang.output.md.json delete mode 100644 test/fixture/simple-private.output.json delete mode 100644 test/fixture/simple-private.output.md delete mode 100644 test/fixture/simple-private.output.md.json delete mode 100644 test/fixture/simple-singlestar.output.json delete mode 100644 test/fixture/simple-singlestar.output.md delete mode 100644 test/fixture/simple-singlestar.output.md.json delete mode 100644 test/fixture/simple-triplestar.output.json delete mode 100644 test/fixture/simple-triplestar.output.md delete mode 100644 test/fixture/simple-triplestar.output.md.json delete mode 100644 test/fixture/simple-two.output.json delete mode 100644 test/fixture/simple-two.output.md delete mode 100644 test/fixture/simple-two.output.md.json delete mode 100644 test/fixture/simple.output.github.json delete mode 100644 test/fixture/simple.output.github.md delete mode 100644 test/fixture/simple.output.json delete mode 100644 test/fixture/simple.output.md delete mode 100644 test/fixture/simple.output.md.json delete mode 100644 test/fixture/sort-order-alpha.output.json delete mode 100644 test/fixture/sort-order-alpha.output.md delete mode 100644 test/fixture/sort-order-alpha.output.md.json delete mode 100644 test/fixture/string-literal-key.output.json delete mode 100644 test/fixture/string-literal-key.output.md delete mode 100644 test/fixture/string-literal-key.output.md.json delete mode 100644 test/fixture/system-import.output.json delete mode 100644 test/fixture/system-import.output.md delete mode 100644 test/fixture/system-import.output.md.json delete mode 100644 test/fixture/this-class.output.json delete mode 100644 test/fixture/this-class.output.md delete mode 100644 test/fixture/this-class.output.md.json delete mode 100644 test/fixture/type_application.output.json delete mode 100644 test/fixture/type_application.output.md delete mode 100644 test/fixture/type_application.output.md.json delete mode 100644 test/fixture/var-function-param-return.output.json delete mode 100644 test/fixture/var-function-param-return.output.md delete mode 100644 test/fixture/var-function-param-return.output.md.json delete mode 100644 test/lib/flow_doctrine.js delete mode 100644 test/lib/git/find_git.js delete mode 100644 test/lib/git/url_prefix.js delete mode 100644 test/lib/github.js delete mode 100644 test/lib/infer/access.js delete mode 100644 test/lib/infer/params.js delete mode 100644 test/lib/input/shallow.js delete mode 100644 test/lib/lint.js delete mode 100644 test/lib/output/util/formatters.js delete mode 100644 test/lib/parse.js delete mode 100644 test/lib/parsers/javascript.js delete mode 100644 test/lib/parsers/polyglot.js delete mode 100644 test/lib/server.js delete mode 100644 test/lib/walk.js delete mode 100644 test/linker.js delete mode 100644 test/normalize.js delete mode 100644 test/test.js delete mode 100644 test/utils.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 000000000..c298bca39 --- /dev/null +++ b/.babelrc @@ -0,0 +1,6 @@ +{ + "presets": ["flow"], + "plugins": [ + "transform-es2015-modules-commonjs" + ] +} diff --git a/.eslintignore b/.eslintignore index cf2f465ce..8d6eafa02 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1 +1,5 @@ -test/fixture/* +__tests__/fixture/* +src/default_theme/* +coverage/* +lib/* +declarations/* diff --git a/.eslintrc b/.eslintrc index 389e3372a..9eff1ecc7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -2,7 +2,7 @@ "root": true, "parser": "babel-eslint", "parserOptions": { - "sourceType": "script" + "sourceType": "module" }, "plugins": [ "flowtype" @@ -31,6 +31,7 @@ }, "extends": [ "eslint:recommended", + "plugin:flowtype/recommended", "prettier" ], "env": { diff --git a/.flowconfig b/.flowconfig index 74fcf1e7d..3af8ba9da 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,7 +1,8 @@ [ignore] .*node_modules/.cache/.* .*node_modules/conventional-changelog-core/test/fixtures/.* -.*/test/fixture/.* +.*/__tests__/fixture/.* +./lib/.* [include] diff --git a/.gitignore b/.gitignore index 94196f192..da0121316 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/lib coverage .nyc_output -node_modules +/node_modules diff --git a/test/.eslintrc b/__tests__/.eslintrc similarity index 68% rename from test/.eslintrc rename to __tests__/.eslintrc index a30c31555..0a0dffb62 100644 --- a/test/.eslintrc +++ b/__tests__/.eslintrc @@ -2,5 +2,8 @@ "rules": { "valid-jsdoc": [0], "no-unused-vars": [0] + }, + "env": { + "jest": true } } diff --git a/__tests__/__snapshots__/bin-readme.js.snap b/__tests__/__snapshots__/bin-readme.js.snap new file mode 100644 index 000000000..efa5e3a23 --- /dev/null +++ b/__tests__/__snapshots__/bin-readme.js.snap @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`readme command --readme-file 1`] = ` +"# A title + +# API + + + +## foo + +A function with documentation. + +**Parameters** + +- \`a\` {string} blah + +Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** answer + +## bar + +A second function with docs + +**Parameters** + +- \`b\` + +# Another section +" +`; + +exports[`readme command updates README.md 1`] = ` +"# A title + +# API + + + +## foo + +A function with documentation. + +**Parameters** + +- \`a\` {string} blah + +Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** answer + +## bar + +A second function with docs + +**Parameters** + +- \`b\` + +# Another section +" +`; diff --git a/__tests__/__snapshots__/bin.js.snap b/__tests__/__snapshots__/bin.js.snap new file mode 100644 index 000000000..878415f05 --- /dev/null +++ b/__tests__/__snapshots__/bin.js.snap @@ -0,0 +1,2022 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`--config 1`] = ` +" + + + + documentation 4.0.0-rc.1 | Documentation + + + + + + +
+
+
+
+

documentation

+
4.0.0-rc.1
+ +
+ +
+ +
+
+
+ + +
+ +

+ Highlighted section +

+ + +

The public key is a base64 encoded string of a protobuf containing an RSA DER +buffer. This uses a node buffer to pass the base64 encoded public key protobuf +to the multihash for ID generation.

+
var PeerId = require('peer-id')
+
+PeerId.create({ bits: 1024 }, (err, id) => {
+  console.log(JSON.stringify(id.toJSON(), null, 2)
+})
+
{
+  \\"id\\": \\"Qma9T5YraSnpRDZqRR4krcSJabThc8nwZuJV3LercPHufi\\",
+  \\"privKey\\": \\"CAAS4AQwggJcAgEAAoGBAMBgbIqyOL26oV3nGPBYrdpbv..\\",
+  \\"pubKey\\": \\"CAASogEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMBgbIqyOL26oV3nGPBYrdpbvzCY...\\"
+}
+
+ + +
+
+ + + +
+ + +
+ +

+ Klass +

+ + +
+ + +

Creates a new Klass

+ + +
new Klass(foo: any)
+ + +

+ Extends + + Stream.Writable + +

+ + + + + + + + + + +
Parameters
+
+ +
+
+ foo (any) + +
+ +
+ +
+ + + + + + + + + + + +
Static Members
+
+ +
+
+
+ + isClass(other, also) +
+
+
+
+ + + +

Decide whether an object is a Klass instance +This is a [klasssic]Klass +This is a [link to something that does not exist]DoesNot

+ + +
isClass(other: Object, also: any): boolean
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ other (Object) + +
+ +
+ +
+
+ also (any) + +
+ +
+ +
+ + + + + + +
Returns
+ boolean: + whether the other thing is a Klass + + + + + + + + + + + + + + +
+ +
+
+ +
+
+
+ + isWeird(other) +
+
+
+
+ + + +

A function that triggers the case where the autolinker doesn't find +the referenced class type

+ + +
isWeird(other: Weird): boolean
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ other (Weird) + +
+ +
+ +
+ + + + + + +
Returns
+ boolean: + whether the other thing is a Klass + + + + + + + + + + + + + + +
+ +
+
+ +
+
+
+ + isBuffer(buf, size) +
+
+
+
+ + + +

This method takes a Buffer object that will be linked to nodejs.org

+ + +
isBuffer(buf: (Buffer | string), size: number): boolean
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ buf ((Buffer | string)) + +
+ +
+ +
+
+ size (number + = 0) + size + +
+ +
+ +
+ + + + + + +
Returns
+ boolean: + whether the other thing is a Klass + + + + + + + + + + + + + + +
+ +
+
+ +
+
+
+ + isArrayOfBuffers(buffers) +
+
+
+
+ + + +

This method takes an array of buffers and counts them

+ + +
isArrayOfBuffers(buffers: Array<Buffer>): number
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ buffers (Array<Buffer>) + some buffers + +
+ +
+ +
+ + + + + + +
Returns
+ number: + how many + + + + + + + + +
Example
+ + +
var k = new Klass();
+k.isArrayOfBuffers();
+ + + + + + + + +
+ +
+
+ +
+
+
+ + MAGIC_NUMBER +
+
+
+
+ + + +

A magic number that identifies this Klass.

+ + +
MAGIC_NUMBER
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
Instance Members
+
+ +
+
+
+ + getFoo() +
+
+
+
+ + + +

Get this Klass's foo

+ + +
getFoo(): Number
+ + + + + + + + + + + + + + + + +
Returns
+ Number: + foo + + + + + + + + +
Example
+ +

this shows you how to getFoo

+

+
var x = foo.getFoo();
+ + + + + + + + +
+ +
+
+ +
+
+
+ + withOptions(options, otherOptions) +
+
+
+
+ + + +

A function with an options parameter

+ + +
withOptions(options: Object, otherOptions: number?)
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ options (Object) + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
options.foo string +
options.bar number +
+ +
+ +
+
+ otherOptions (number?) + +
+ +
+ +
+ + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
Events
+
+ +
+
+
+ + event +
+
+
+
+ + + +

Klass event

+ + +
event
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + +
+ + + + +
+ + +
+ +

+ CustomError +

+ + +
+ + +

a typedef with nested properties

+ + +
CustomError(other: any, also: any)
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ other (any) + +
+ +
+ +
+
+ also (any) + +
+ +
+ +
+ + + +
Properties
+
+ +
+ error (object) + : An error + + +
    + +
  • error.code string + +

    The error's code

    +
  • + +
  • error.description string + +

    The error's description

    +
  • + +
+ +
+ +
+ + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ bar +

+ + +
+ + +

Get an instance of Klass. Will make +a klass instance multiword, +like a klass

+ + +
bar(): Klass
+ + + + + + + + + + + + + + + + +
Returns
+ Klass: + that class + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ bar +

+ + +
+ + +

Rest property function

+ + +
bar(toys: ...Number): undefined
+ + + + + + + + + + + +
Parameters
+
+ +
+
+ toys (...Number) + +
+ +
+ +
+ + + + + + +
Returns
+ undefined: + nothing + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ bar +

+ + +
+ + +

Get an instance of Klass. Will make +a klass instance multiword, +like a klass. This needs a number input.

+ + +
bar(): undefined
+ + + + + + + + + + + + + + + + +
Returns
+ undefined: + nothing + + + + + + + + + + + + + + +
+ + + + +
+ + +
+ +

+ Foo +

+ + +
+ + +

This is Foo

+ + +
new Foo()
+ + + + + + + + + + + + + + + + + + + + + + + +
Instance Members
+
+ +
+
+
+ + bar +
+
+
+
+ + + +

This is bar

+ + +
bar
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + + + +
+ + +
+ +

+ customStreams +

+ + +
+ + +

I am the container of stream types

+ + +
customStreams
+ + + + + + + + + + + + + + + + + + + + + +
Static Members
+
+ +
+
+
+ + new passthrough() +
+
+
+
+ + + +

I am a passthrough stream that belongs to customStreams

+ + +
new passthrough()
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + + + +
+ + + +
+
+
+ + + + +" +`; + +exports[`accepts config file 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "file": "[path]", + "loc": Object { + "end": Object { + "column": 2, + "line": 13, + }, + "start": Object { + "column": 0, + "line": 11, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Bananas are yellow", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 19, + "line": 1, + "offset": 18, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 10, + }, + "start": Object { + "column": 0, + "line": 8, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "bananas", + "namespace": "bananas", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "bananas", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "file": "[path]", + "loc": Object { + "end": Object { + "column": 2, + "line": 20, + }, + "start": Object { + "column": 0, + "line": 18, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Carrots are awesome", + }, + ], + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 20, + "line": 1, + "offset": 19, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 17, + }, + "start": Object { + "column": 0, + "line": 15, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "carrots", + "namespace": "carrots", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "carrots", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "file": "[path]", + "loc": Object { + "end": Object { + "column": 2, + "line": 6, + }, + "start": Object { + "column": 0, + "line": 4, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "Apples are red", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 15, + "line": 1, + "offset": 14, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "examples": Array [], + "kind": "function", + "loc": Object { + "end": Object { + "column": 3, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "apples", + "namespace": "apples", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "apples", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`build --document-exported 1`] = ` +" + +### Table of Contents + +- [z](#z) + - [zMethod](#zmethod) +- [x](#x) +- [Class](#class) + - [classMethod](#classmethod) + - [classGetter](#classgetter) + - [classSetter](#classsetter) + - [staticMethod](#staticmethod) + - [staticGetter](#staticgetter) + - [staticSetter](#staticsetter) +- [T5](#t5) +- [y2Default](#y2default) +- [y4](#y4) +- [object](#object) + - [method](#method) + - [getter](#getter) + - [setter](#setter) + - [prop](#prop) + - [func](#func) +- [f1](#f1) +- [f3](#f3) +- [T](#t) +- [T2](#t2) +- [T4](#t4) +- [f4](#f4) +- [o1](#o1) + - [om1](#om1) +- [f5](#f5) +- [o2](#o2) + - [om2](#om2) + +## z + +### zMethod + +## x + +**Parameters** + +- \`yparam\` + +## Class + +**Parameters** + +- \`a\` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** + +### classMethod + +### classGetter + +### classSetter + +**Parameters** + +- \`v\` + +### staticMethod + +### staticGetter + +### staticSetter + +**Parameters** + +- \`v\` + +## T5 + +Type: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) + +## y2Default + +## y4 + +Description of y3 + +**Parameters** + +- \`p\` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** + +Returns **void** + +## object + +### method + +### getter + +### setter + +**Parameters** + +- \`v\` + +### prop + +### func + +## f1 + +## f3 + +## T + +Type: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) + +## T2 + +Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) + +## T4 + +Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) + +## f4 + +**Parameters** + +- \`x\` **X** + +## o1 + +### om1 + +## f5 + +f5 comment + +**Parameters** + +- \`y\` **Y** + +## o2 + +### om2 +" +`; + +exports[`lint command generates lint output 1`] = `""`; + +exports[`polyglot mode 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "file": "[path]", + "loc": Object { + "end": Object { + "column": 3, + "line": 40, + }, + "start": Object { + "column": 1, + "line": 35, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 35, + "line": 1, + "offset": 34, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This method moves a hex to a color", + }, + ], + "position": Object { + "end": Object { + "column": 35, + "line": 1, + "offset": 34, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 35, + "line": 1, + "offset": 34, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "examples": Array [], + "loc": Object { + "end": Object { + "column": 3, + "line": 40, + }, + "start": Object { + "column": 1, + "line": 35, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "hexToUInt32Color", + "namespace": "hexToUInt32Color", + "params": Array [ + Object { + "lineNumber": 3, + "name": "hex", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "name": "hexToUInt32Color", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Object { + "end": Object { + "column": 6, + "line": 1, + "offset": 5, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "color", + }, + ], + "position": Object { + "end": Object { + "column": 6, + "line": 1, + "offset": 5, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 6, + "line": 1, + "offset": 5, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": null, + "lineNumber": 2, + "name": "hexToUInt32Color", + "title": "name", + }, + Object { + "description": null, + "lineNumber": 3, + "name": "hex", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + Object { + "description": "color", + "lineNumber": 4, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; diff --git a/__tests__/__snapshots__/test.js.snap b/__tests__/__snapshots__/test.js.snap new file mode 100644 index 000000000..e32dfb8c0 --- /dev/null +++ b/__tests__/__snapshots__/test.js.snap @@ -0,0 +1,1176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`config 1`] = ` +" + +## MyClass + +This is my class, a demo thing. + +**Properties** + +- \`howMany\` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how many things it contains + +### getFoo + +Get the number 42 + +**Parameters** + +- \`getIt\` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to get the number + +Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two + +### getUndefined + +Get undefined + +Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything. + +## Hello + +World + +" +`; + +exports[`external modules option 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": SourceLocation { + "end": Position { + "column": 1, + "line": 12, + }, + "start": Position { + "column": 0, + "line": 10, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "I am in ", + }, + Object { + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 9, + "line": 1, + "offset": 8, + }, + }, + "type": "inlineCode", + "value": "external.input.js", + }, + Object { + "position": Position { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + }, + "type": "text", + "value": ".", + }, + ], + "position": Position { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 29, + "line": 1, + "offset": 28, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 9, + }, + "start": Position { + "column": 0, + "line": 7, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "foo", + "namespace": "foo", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "foo", + }, + ], + "properties": Array [], + "returns": Array [], + "sees": Array [], + "tags": Array [], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": SourceLocation { + "end": Position { + "column": 2, + "line": 10, + }, + "start": Position { + "column": 0, + "line": 7, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 6, + }, + "start": Position { + "column": 0, + "line": 3, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "main", + "namespace": "main", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "main", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": SourceLocation { + "end": Position { + "column": 2, + "line": 8, + }, + "start": Position { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 4, + }, + "start": Position { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "index", + "namespace": "index", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "index", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "return", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`git option 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "github": "[github]", + "loc": SourceLocation { + "end": Position { + "column": 2, + "line": 8, + }, + "start": Position { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 4, + }, + "start": Position { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "simple.input", + "namespace": "simple.input", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "simple.input", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; + +exports[`git option 2`] = ` +" + +## simple.input + +[undefined:5-8](<> \\"Source code on GitHub\\") + +This function returns the number one. + +Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone +" +`; + +exports[`highlightAuto md output 1`] = ` +" + +## multilanguage.input + +**Extends Foo, Bar** + +This function returns the number one. + +**Examples** + +\`\`\`js +var myFoo = new Foo('[data-foo]'); +myFoo.foo(42); +\`\`\` + +\`\`\`html +

Data-Foo Element in the dom

+\`\`\` + +\`\`\`css +[data-foo] { + background-color: red; +} +\`\`\` + +- Throws **[Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)** if you give it something +- Throws **[TypeError](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError)** if you give it something else + +Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone +" +`; + +exports[`multi-file input 1`] = ` +Array [ + Object { + "augments": Array [], + "context": Object { + "loc": SourceLocation { + "end": Position { + "column": 1, + "line": 13, + }, + "start": Position { + "column": 0, + "line": 10, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number plus two.", + }, + ], + "position": Position { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 43, + "line": 1, + "offset": 42, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [ + Object { + "description": "var result = returnTwo(4); +// result is 6", + }, + ], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 9, + }, + "start": Position { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "returnTwo", + "namespace": "returnTwo", + "params": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "the number", + }, + ], + "position": Position { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 11, + "line": 1, + "offset": 10, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 3, + "name": "a", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "path": Array [ + Object { + "kind": "function", + "name": "returnTwo", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numbertwo", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "the number", + "lineNumber": 3, + "name": "a", + "title": "param", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + Object { + "description": "numbertwo", + "lineNumber": 4, + "title": "returns", + "type": Object { + "name": "Number", + "type": "NameExpression", + }, + }, + Object { + "description": "var result = returnTwo(4); +// result is 6", + "lineNumber": 5, + "title": "example", + }, + ], + "throws": Array [], + "todos": Array [], + }, + Object { + "augments": Array [], + "context": Object { + "loc": SourceLocation { + "end": Position { + "column": 2, + "line": 8, + }, + "start": Position { + "column": 0, + "line": 5, + }, + }, + }, + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "This function returns the number one.", + }, + ], + "position": Position { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 38, + "line": 1, + "offset": 37, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "errors": Array [], + "examples": Array [], + "kind": "function", + "loc": SourceLocation { + "end": Position { + "column": 3, + "line": 4, + }, + "start": Position { + "column": 0, + "line": 1, + }, + }, + "members": Object { + "events": Array [], + "global": Array [], + "inner": Array [], + "instance": Array [], + "static": Array [], + }, + "name": "simple.input", + "namespace": "simple.input", + "params": Array [], + "path": Array [ + Object { + "kind": "function", + "name": "simple.input", + }, + ], + "properties": Array [], + "returns": Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "numberone", + }, + ], + "position": Position { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 10, + "line": 1, + "offset": 9, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "sees": Array [], + "tags": Array [ + Object { + "description": "numberone", + "lineNumber": 2, + "title": "returns", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, + ], + "throws": Array [], + "todos": Array [], + }, +] +`; diff --git a/__tests__/bin-readme.js b/__tests__/bin-readme.js new file mode 100644 index 000000000..052f4e393 --- /dev/null +++ b/__tests__/bin-readme.js @@ -0,0 +1,125 @@ +var path = require('path'), + os = require('os'), + exec = require('child_process').exec, + tmp = require('tmp'), + fs = require('fs-extra'); + +function documentation(args, options, parseJSON) { + return new Promise((resolve, reject) => { + if (!options.cwd) { + options.cwd = __dirname; + } + + options.maxBuffer = 1024 * 1024; + + args.unshift( + 'node ' + path.join(__dirname, '..', 'bin', 'documentation.js') + ); + + exec(args.join(' '), options, (err, res) => { + resolve(res); + }); + }); +} + +describe('readme command', function() { + var fixtures = path.join(__dirname, 'fixture/readme'); + var sourceFile = path.join(fixtures, 'index.js'); + var d; + var removeCallback; + + beforeEach(() => { + var dirEntry = tmp.dirSync({ unsafeCleanup: true }); + d = dirEntry.name; + fs.copySync( + path.join(fixtures, 'README.input.md'), + path.join(d, 'README.md') + ); + fs.copySync(path.join(fixtures, 'index.js'), path.join(d, 'index.js')); + }); + + // run tests after setting up temp dir + + test('--diff-only: changes needed', async function() { + var before = fs.readFileSync(path.join(d, 'README.md'), 'utf-8'); + try { + await documentation(['readme index.js --diff-only -s API'], { + cwd: d + }); + } catch (err) { + var after = fs.readFileSync(path.join(d, 'README.md'), 'utf-8'); + expect(err).toBeTruthy(); + expect(err.code).not.toBe(0); + expect(after).toEqual(before); + } + }); + + test('updates README.md', async function() { + await documentation(['readme index.js -s API'], { cwd: d }); + var outputPath = path.join(d, 'README.md'); + expect(fs.readFileSync(outputPath, 'utf-8')).toMatchSnapshot(); + }); + + test('--readme-file', async function() { + fs.copySync( + path.join(fixtures, 'README.input.md'), + path.join(d, 'other.md') + ); + await documentation(['readme index.js -s API --readme-file other.md'], { + cwd: d + }); + var actual = fs.readFileSync(path.join(d, 'other.md'), 'utf8'); + expect(actual).toMatchSnapshot(); + }); + + test('--diff-only: changes NOT needed', function() { + fs.copySync( + path.join(fixtures, 'README.output.md'), + path.join(d, 'uptodate.md') + ); + return documentation( + ['readme index.js --diff-only -s API --readme-file uptodate.md'], + { cwd: d } + ).then(stdout => { + // t.match(stdout, 'is up to date.'); + }); + }); + + test('-s: not found', async function() { + fs.copySync( + path.join(fixtures, 'README.output.md'), + path.join(d, 'uptodate.md') + ); + try { + await documentation( + ['readme index.js --diff-only -s NOTFOUND --readme-file uptodate.md'], + { cwd: d } + ); + } catch (err) { + expect(err).toBeTruthy(); + } + }); + + test('requires -s option', async function() { + try { + await documentation(['readme index.js'], { cwd: d }); + } catch (err) { + expect(err).toBeTruthy(); + expect(err.code !== 0).toBeTruthy(); + expect(err.stderr.match(/Missing required argument/)).toBeTruthy(); + } + }); + + var badFixturePath = path.join(__dirname, 'fixture/bad/syntax.input'); + test('errors on invalid syntax', async function() { + try { + await documentation( + ['readme ' + badFixturePath + ' -s API --parseExtension input'], + { cwd: d } + ); + } catch (err) { + expect(err).toBeTruthy(); + expect(err.code !== 0).toBeTruthy(); + } + }); +}); diff --git a/__tests__/bin-watch-serve.js b/__tests__/bin-watch-serve.js new file mode 100644 index 000000000..33c2e401f --- /dev/null +++ b/__tests__/bin-watch-serve.js @@ -0,0 +1,161 @@ +var path = require('path'); +var os = require('os'); +var get = require('./utils').get; +var spawn = require('child_process').spawn; +var fs = require('fs'); +var pEvent = require('p-event'); + +function documentation(args, options) { + if (!options) { + options = {}; + } + if (!options.cwd) { + options.cwd = __dirname; + } + + options.maxBuffer = 1024 * 1024; + args.unshift(path.join(__dirname, '..', 'bin', 'documentation.js')); + + return spawn('node', args, options); +} + +function normalize(result) { + result.forEach(function(item) { + item.context.file = '[path]'; + }); + return result; +} + +const timeout = 20000; + +test('harness', function() { + var docProcess = documentation(['serve', 'fixture/simple.input.js']); + expect(docProcess).toBeTruthy(); + docProcess.kill(); +}); + +test( + 'provides index.html', + function() { + var docProcess = documentation(['serve', 'fixture/simple.input.js']); + return pEvent(docProcess.stdout, 'data').then(function(data) { + var portNumber = data + .toString() + .match(/documentation.js serving on port (\d+)/); + expect(portNumber).toBeTruthy(); + return get(`http://localhost:${portNumber[1]}/`).then(function(text) { + expect(text.match(//)).toBeTruthy(); + docProcess.kill(); + }); + }); + }, + timeout +); + +test( + 'accepts port argument', + function() { + var docProcess = documentation([ + 'serve', + 'fixture/simple.input.js', + '--port=4004' + ]); + return pEvent(docProcess.stdout, 'data').then(function(data) { + var portNumber = data + .toString() + .match(/documentation.js serving on port (\d+)/); + expect(portNumber).toBeTruthy(); + return get(`http://localhost:${portNumber[1]}/`).then(function(text) { + expect(text.match(//)).toBeTruthy(); + docProcess.kill(); + }); + }); + }, + timeout +); + +test( + '--watch', + function(done) { + var tmpFile = path.join(os.tmpdir(), '/simple.js'); + fs.writeFileSync(tmpFile, '/** a function */function apples() {}'); + var docProcess = documentation(['serve', tmpFile, '--watch']); + pEvent(docProcess.stdout, 'data').then(function(data) { + var portNumber = data + .toString() + .match(/documentation.js serving on port (\d+)/); + expect(portNumber).toBeTruthy(); + return get(`http://localhost:${portNumber[1]}/`).then(function(text) { + expect(text.match(/apples/)).toBeTruthy(); + fs.writeFileSync(tmpFile, '/** a function */function bananas() {}'); + function doGet() { + get(`http://localhost:${portNumber[1]}/`).then(function(text) { + if (text.match(/bananas/)) { + docProcess.kill(); + done(); + } else { + setTimeout(doGet, 100); + } + }); + } + doGet(); + }); + }); + }, + timeout +); + +test( + '--watch', + function(done) { + var tmpDir = os.tmpdir(); + var a = path.join(tmpDir, '/simple.js'); + var b = path.join(tmpDir, '/required.js'); + fs.writeFileSync(a, 'require("./required")'); + fs.writeFileSync(b, '/** soup */function soup() {}'); + var docProcess = documentation(['serve', a, '--watch']); + docProcess.stdout.once('data', function(data) { + var portNumber = data + .toString() + .match(/documentation.js serving on port (\d+)/); + expect(portNumber).toBeTruthy(); + get(`http://localhost:${portNumber[1]}/`).then(function(text) { + expect(text.match(/soup/)).toBeTruthy(); + fs.writeFileSync(b, '/** nuts */function nuts() {}'); + function doGet() { + get(`http://localhost:${portNumber[1]}/`).then(function(text) { + if (text.match(/nuts/)) { + docProcess.kill(); + done(); + } else { + setTimeout(doGet, 100); + } + }); + } + doGet(); + }); + }); + }, + timeout +); + +test( + 'error page', + function() { + var tmpDir = os.tmpdir(); + var a = path.join(tmpDir, '/simple.js'); + fs.writeFileSync(a, '**'); + var docProcess = documentation(['serve', a, '--watch']); + return pEvent(docProcess.stdout, 'data').then(function(data) { + var portNumber = data + .toString() + .match(/documentation.js serving on port (\d+)/); + expect(portNumber).toBeTruthy(); + return get(`http://localhost:${portNumber[1]}/`).then(function(text) { + expect(text.match(/Unexpected token/)).toBeTruthy(); + docProcess.kill(); + }); + }); + }, + timeout +); diff --git a/__tests__/bin.js b/__tests__/bin.js new file mode 100644 index 000000000..dcb43e8c6 --- /dev/null +++ b/__tests__/bin.js @@ -0,0 +1,407 @@ +/* global jasmine */ + +var path = require('path'), + os = require('os'), + exec = require('child_process').exec, + tmp = require('tmp'), + fs = require('fs-extra'); + +jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + +function documentation(args, options, parseJSON) { + if (!options) { + options = {}; + } + if (!options.cwd) { + options.cwd = __dirname; + } + + options.maxBuffer = 1024 * 1024; + + args.unshift('node ' + path.join(__dirname, '..', 'bin', 'documentation.js')); + + return new Promise((resolve, reject) => { + exec(args.join(' '), options, function(err, stdout, stderr) { + if (err) { + err.stderr = stderr; + return reject(err); + } + if (parseJSON === false) { + resolve(stdout); + } else { + try { + resolve(JSON.parse(stdout)); + } catch (e) { + reject(e); + } + } + }); + }); +} + +function normalize(result) { + result.forEach(function(item) { + item.context.file = '[path]'; + }); + return result; +} + +test('documentation binary', async function() { + const data = await documentation(['build fixture/simple.input.js'], {}); + expect(data.length).toBe(1); +}); + +test('defaults to parsing package.json main', async function() { + const data = await documentation(['build'], { + cwd: path.join(__dirname, '..') + }); + expect(data.length).toBeTruthy(); +}); + +test('polyglot mode', async function() { + const data = await documentation([ + 'build fixture/polyglot/blend.cpp --polyglot' + ]); + expect(normalize(data)).toMatchSnapshot(); +}); + +test('accepts config file', async function() { + const data = await documentation([ + 'build fixture/sorting/input.js -c fixture/config.json' + ]); + expect(normalize(data)).toMatchSnapshot(); +}); + +test('accepts config file - reports failures', async function() { + try { + await documentation( + ['build fixture/sorting/input.js -c fixture/config-bad.yml'], + {}, + false + ); + } catch (stderr) { + expect(stderr).toMatchSnapshot(); + } +}); + +test('accepts config file - reports parse failures', async function() { + try { + await documentation( + ['build fixture/sorting/input.js -c fixture/config-malformed.json'], + {}, + false + ); + } catch (stderr) { + expect(stderr.stderr.match(/SyntaxError/g)).toBeTruthy(); + } +}); + +test('--shallow option', async function() { + const data = await documentation([ + 'build --shallow fixture/internal.input.js' + ]); + expect(data.length).toBe(0); +}); + +test('external modules option', async function() { + const data = await documentation([ + 'build fixture/external.input.js ' + + '--external=external --external=external/node_modules' + ]); + expect(data.length).toBe(2); +}); + +test('when a file is specified both in a glob and explicitly, it is only documented once', async function() { + const data = await documentation([ + 'build fixture/simple.input.js fixture/simple.input.*' + ]); + expect(data.length).toBe(1); +}); + +test('extension option', async function() { + const data = await documentation([ + 'build fixture/extension/index.otherextension ' + + '--requireExtension=otherextension --parseExtension=otherextension' + ]); + expect(data.length).toBe(1); +}); + +/* + * This tests that parseExtension adds extensions to smartGlob's + * look through directories. + */ +test('polyglot + parseExtension + smartGlob', async function() { + const data = await documentation([ + 'build fixture/polyglot ' + '--polyglot --parseExtension=cpp' + ]); + expect(data.length).toBe(1); +}); + +test('extension option', function() { + return documentation(['build fixture/extension.jsx']); +}); + +test('invalid arguments', function() { + test('bad -f option', async function() { + try { + await documentation( + ['build -f DOES-NOT-EXIST fixture/internal.input.js'], + {}, + false + ); + } catch (err) { + expect(err).toBeTruthy(); + } + }); + + test('html with no destination', function() { + return documentation(['build -f html fixture/internal.input.js'], function( + err + ) { + expect( + err + .toString() + .match( + /The HTML output mode requires a destination directory set with -o/ + ) + ).toBeTruthy(); + }); + }); + + test('bad command', async function() { + try { + await documentation(['-f html fixture/internal.input.js'], {}, false); + } catch (err) { + expect(err.code).toBeTruthy(); + } + }); +}); + +test('--config', async function() { + var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); + fs.mkdirSync(dst); + var outputIndex = path.join(dst, 'index.html'); + var expectedOutputPath = path.join( + __dirname, + 'fixture/html/nested.config-output.html' + ); + const data = await documentation( + [ + 'build -c fixture/html/documentation.yml -f html fixture/html/nested.input.js -o ' + + dst + ], + {}, + false + ); + var output = fs.readFileSync(outputIndex, 'utf8'); + expect(output).toMatchSnapshot(); +}); + +test('--version', async function() { + const output = await documentation(['--version'], {}, false); + expect(output).toBeTruthy(); +}); + +describe('lint command', function() { + test('generates lint output', async function() { + try { + await documentation(['lint fixture/lint/lint.input.js'], {}, false); + } catch (err) { + var data = err.stderr.toString().split('\n').slice(2).join('\n'); + expect(data).toMatchSnapshot(); + } + }); + + test('generates no output on a good file', async function() { + const data = await documentation( + ['lint fixture/simple.input.js'], + {}, + false + ); + expect(data).toBe(''); + }); + + test('exposes syntax error on a bad file', async function() { + try { + await documentation( + ['lint fixture/bad/syntax.input', '--parseExtension input'], + {}, + false + ); + } catch (err) { + expect(err.code > 0).toBeTruthy(); + } + }); + + test('lint with no inputs', async function() { + try { + await documentation( + ['lint'], + { + cwd: path.join(__dirname, 'fixture/bad') + }, + false + ); + } catch (err) { + expect(err.code > 0).toBeTruthy(); + } + }); +}); + +test('given no files', async function() { + try { + await documentation(['build']); + } catch (err) { + expect( + err + .toString() + .match( + /documentation was given no files and was not run in a module directory/ + ) + ).toBeTruthy(); + } +}); + +test('with an invalid command', async function() { + try { + await documentation(['invalid'], {}, false); + } catch (err) { + expect(err).toBeTruthy(); + } +}); + +test('--access flag', async function() { + const data = await documentation( + ['build --shallow fixture/internal.input.js -a public'], + {}, + false + ); + expect(data).toBe('[]'); +}); + +test('--private flag', async function() { + const data = await documentation( + ['build fixture/internal.input.js --private'], + {}, + false + ); + expect(data.length > 2).toBeTruthy(); +}); + +test('--infer-private flag', async function() { + const data = await documentation( + ['build fixture/infer-private.input.js --infer-private ^_'], + {}, + false + ); + // This uses JSON.parse with a reviver used as a visitor. + JSON.parse(data, function(n, v) { + // Make sure we do not see any names that match `^_`. + if (n === 'name') { + expect(typeof v).toBe('string'); + expect(!/_$/.test(v)).toBeTruthy(); + } + return v; + }); +}); + +test('write to file', async function() { + var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); + + const data = await documentation( + ['build --shallow fixture/internal.input.js -o ' + dst], + {}, + false + ); + expect(data).toBe(''); + expect(fs.existsSync(dst)).toBeTruthy(); +}); + +test('write to html', async function() { + var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); + fs.mkdirSync(dstDir); + + const data = await documentation( + ['build --shallow fixture/internal.input.js -f html -o ' + dstDir], + {}, + false + ); + expect(data).toBe(''); + expect(fs.existsSync(path.join(dstDir, 'index.html'))).toBeTruthy(); +}); + +test('write to html with custom theme', async function() { + var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); + fs.mkdirSync(dstDir); + + const data = await documentation( + [ + 'build -t fixture/custom_theme --shallow fixture/internal.input.js -f html -o ' + + dstDir + ], + {}, + false + ); + expect(data).toBe(''); + expect(fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8')).toBeTruthy(); +}); + +test('write to html, highlightAuto', function() { + var fixture = 'fixture/auto_lang_hljs/multilanguage.input.js', + config = 'fixture/auto_lang_hljs/config.yml', + dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); + + fs.mkdirSync(dstDir); + + return documentation( + ['build --shallow ' + fixture + ' -c ' + config + ' -f html -o ' + dstDir], + {}, + false + ).then(() => { + var result = fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8'); + expect( + result.indexOf('42') > 0 + ).toBeTruthy(); + expect( + result.indexOf('[data-foo]') > 0 + ).toBeTruthy(); + expect( + result.indexOf('data-foo') > 0 + ).toBeTruthy(); + }); +}); + +test('fatal error', async function() { + try { + await documentation( + ['build --shallow fixture/bad/syntax.input --parseExtension input'], + {}, + false + ); + } catch (err) { + expect(err.toString().match(/Unexpected token/)).toBeTruthy(); + } +}); + +test('build --document-exported', async function() { + const data = await documentation( + ['build fixture/document-exported.input.js --document-exported -f md'], + {}, + false + ); + expect(data).toMatchSnapshot(); +}); + +test('build large file without error (no deoptimized styling error)', function() { + var dstFile = + path.join(os.tmpdir(), (Date.now() + Math.random()).toString()) + '.js'; + var contents = ''; + for (var i = 0; i < 4e4; i++) { + contents += '/* - */\n'; + } + fs.writeFileSync(dstFile, contents, 'utf8'); + + return documentation(['build ' + dstFile], {}, false).then(() => { + fs.unlinkSync(dstFile); + }); +}); diff --git a/test/config_fixture/config b/__tests__/config_fixture/config similarity index 100% rename from test/config_fixture/config rename to __tests__/config_fixture/config diff --git a/test/config_fixture/config.json b/__tests__/config_fixture/config.json similarity index 100% rename from test/config_fixture/config.json rename to __tests__/config_fixture/config.json diff --git a/test/config_fixture/config.yaml b/__tests__/config_fixture/config.yaml similarity index 100% rename from test/config_fixture/config.yaml rename to __tests__/config_fixture/config.yaml diff --git a/test/config_fixture/config.yml b/__tests__/config_fixture/config.yml similarity index 100% rename from test/config_fixture/config.yml rename to __tests__/config_fixture/config.yml diff --git a/test/config_fixture/config_comments.json b/__tests__/config_fixture/config_comments.json similarity index 100% rename from test/config_fixture/config_comments.json rename to __tests__/config_fixture/config_comments.json diff --git a/test/config_fixture/config_file.yml b/__tests__/config_fixture/config_file.yml similarity index 100% rename from test/config_fixture/config_file.yml rename to __tests__/config_fixture/config_file.yml diff --git a/test/config_fixture/config_links.yml b/__tests__/config_fixture/config_links.yml similarity index 100% rename from test/config_fixture/config_links.yml rename to __tests__/config_fixture/config_links.yml diff --git a/test/fixture/_external-deps-included.json b/__tests__/fixture/_external-deps-included.json similarity index 100% rename from test/fixture/_external-deps-included.json rename to __tests__/fixture/_external-deps-included.json diff --git a/test/fixture/_multi-file-input.json b/__tests__/fixture/_multi-file-input.json similarity index 100% rename from test/fixture/_multi-file-input.json rename to __tests__/fixture/_multi-file-input.json diff --git a/test/fixture/auto_lang_hljs/config.yml b/__tests__/fixture/auto_lang_hljs/config.yml similarity index 100% rename from test/fixture/auto_lang_hljs/config.yml rename to __tests__/fixture/auto_lang_hljs/config.yml diff --git a/test/fixture/auto_lang_hljs/multilanguage.input.js b/__tests__/fixture/auto_lang_hljs/multilanguage.input.js similarity index 100% rename from test/fixture/auto_lang_hljs/multilanguage.input.js rename to __tests__/fixture/auto_lang_hljs/multilanguage.input.js diff --git a/test/fixture/auto_lang_hljs/multilanguage.output.md b/__tests__/fixture/auto_lang_hljs/multilanguage.output.md similarity index 100% rename from test/fixture/auto_lang_hljs/multilanguage.output.md rename to __tests__/fixture/auto_lang_hljs/multilanguage.output.md diff --git a/test/fixture/bad/syntax.input b/__tests__/fixture/bad/syntax.input similarity index 100% rename from test/fixture/bad/syntax.input rename to __tests__/fixture/bad/syntax.input diff --git a/test/fixture/bad/syntax.output.json b/__tests__/fixture/bad/syntax.output.json similarity index 100% rename from test/fixture/bad/syntax.output.json rename to __tests__/fixture/bad/syntax.output.json diff --git a/test/fixture/boolean-literal-type.input.js b/__tests__/fixture/boolean-literal-type.input.js similarity index 100% rename from test/fixture/boolean-literal-type.input.js rename to __tests__/fixture/boolean-literal-type.input.js diff --git a/test/fixture/class.input.js b/__tests__/fixture/class.input.js similarity index 100% rename from test/fixture/class.input.js rename to __tests__/fixture/class.input.js diff --git a/test/fixture/config-bad.yml b/__tests__/fixture/config-bad.yml similarity index 100% rename from test/fixture/config-bad.yml rename to __tests__/fixture/config-bad.yml diff --git a/test/fixture/config-malformed.json b/__tests__/fixture/config-malformed.json similarity index 100% rename from test/fixture/config-malformed.json rename to __tests__/fixture/config-malformed.json diff --git a/test/fixture/config.json b/__tests__/fixture/config.json similarity index 100% rename from test/fixture/config.json rename to __tests__/fixture/config.json diff --git a/test/fixture/custom_theme/index.js b/__tests__/fixture/custom_theme/index.js similarity index 100% rename from test/fixture/custom_theme/index.js rename to __tests__/fixture/custom_theme/index.js diff --git a/test/fixture/default-export-function.input.js b/__tests__/fixture/default-export-function.input.js similarity index 100% rename from test/fixture/default-export-function.input.js rename to __tests__/fixture/default-export-function.input.js diff --git a/test/fixture/document-exported-bad/exports-z.js b/__tests__/fixture/document-exported-bad/exports-z.js similarity index 100% rename from test/fixture/document-exported-bad/exports-z.js rename to __tests__/fixture/document-exported-bad/exports-z.js diff --git a/test/fixture/document-exported-bad/x.js b/__tests__/fixture/document-exported-bad/x.js similarity index 100% rename from test/fixture/document-exported-bad/x.js rename to __tests__/fixture/document-exported-bad/x.js diff --git a/test/fixture/document-exported-export-default-object.input.js b/__tests__/fixture/document-exported-export-default-object.input.js similarity index 100% rename from test/fixture/document-exported-export-default-object.input.js rename to __tests__/fixture/document-exported-export-default-object.input.js diff --git a/test/fixture/document-exported-export-default-value.input.js b/__tests__/fixture/document-exported-export-default-value.input.js similarity index 100% rename from test/fixture/document-exported-export-default-value.input.js rename to __tests__/fixture/document-exported-export-default-value.input.js diff --git a/test/fixture/document-exported.input.js b/__tests__/fixture/document-exported.input.js similarity index 100% rename from test/fixture/document-exported.input.js rename to __tests__/fixture/document-exported.input.js diff --git a/test/fixture/document-exported/x.js b/__tests__/fixture/document-exported/x.js similarity index 100% rename from test/fixture/document-exported/x.js rename to __tests__/fixture/document-exported/x.js diff --git a/test/fixture/document-exported/y.js b/__tests__/fixture/document-exported/y.js similarity index 100% rename from test/fixture/document-exported/y.js rename to __tests__/fixture/document-exported/y.js diff --git a/test/fixture/document-exported/z.js b/__tests__/fixture/document-exported/z.js similarity index 100% rename from test/fixture/document-exported/z.js rename to __tests__/fixture/document-exported/z.js diff --git a/test/fixture/es6-class.input.js b/__tests__/fixture/es6-class.input.js similarity index 100% rename from test/fixture/es6-class.input.js rename to __tests__/fixture/es6-class.input.js diff --git a/test/fixture/es6-default2.input.js b/__tests__/fixture/es6-default2.input.js similarity index 100% rename from test/fixture/es6-default2.input.js rename to __tests__/fixture/es6-default2.input.js diff --git a/test/fixture/es6-ext.es6 b/__tests__/fixture/es6-ext.es6 similarity index 100% rename from test/fixture/es6-ext.es6 rename to __tests__/fixture/es6-ext.es6 diff --git a/test/fixture/es6-import.input.js b/__tests__/fixture/es6-import.input.js similarity index 100% rename from test/fixture/es6-import.input.js rename to __tests__/fixture/es6-import.input.js diff --git a/test/fixture/es6.input.js b/__tests__/fixture/es6.input.js similarity index 100% rename from test/fixture/es6.input.js rename to __tests__/fixture/es6.input.js diff --git a/test/fixture/es6.output-toc.md b/__tests__/fixture/es6.output-toc.md similarity index 100% rename from test/fixture/es6.output-toc.md rename to __tests__/fixture/es6.output-toc.md diff --git a/test/fixture/event.input.js b/__tests__/fixture/event.input.js similarity index 100% rename from test/fixture/event.input.js rename to __tests__/fixture/event.input.js diff --git a/test/fixture/example-caption.input.js b/__tests__/fixture/example-caption.input.js similarity index 100% rename from test/fixture/example-caption.input.js rename to __tests__/fixture/example-caption.input.js diff --git a/test/fixture/extension.jsx b/__tests__/fixture/extension.jsx similarity index 100% rename from test/fixture/extension.jsx rename to __tests__/fixture/extension.jsx diff --git a/test/fixture/extension/extension-required.jsx b/__tests__/fixture/extension/extension-required.jsx similarity index 100% rename from test/fixture/extension/extension-required.jsx rename to __tests__/fixture/extension/extension-required.jsx diff --git a/test/fixture/extension/index.otherextension b/__tests__/fixture/extension/index.otherextension similarity index 100% rename from test/fixture/extension/index.otherextension rename to __tests__/fixture/extension/index.otherextension diff --git a/test/fixture/external.input.js b/__tests__/fixture/external.input.js similarity index 93% rename from test/fixture/external.input.js rename to __tests__/fixture/external.input.js index d156ef676..aa034223a 100644 --- a/test/fixture/external.input.js +++ b/__tests__/fixture/external.input.js @@ -8,7 +8,6 @@ require('./polyglot/blend.cpp'); * I am in `external.input.js`. */ function foo() { - 'use strict'; return 'bar'; } diff --git a/test/fixture/factory.input.js b/__tests__/fixture/factory.input.js similarity index 100% rename from test/fixture/factory.input.js rename to __tests__/fixture/factory.input.js diff --git a/test/fixture/flow-unnamed-params.input.js b/__tests__/fixture/flow-unnamed-params.input.js similarity index 81% rename from test/fixture/flow-unnamed-params.input.js rename to __tests__/fixture/flow-unnamed-params.input.js index 62bdbbca2..113e2968e 100644 --- a/test/fixture/flow-unnamed-params.input.js +++ b/__tests__/fixture/flow-unnamed-params.input.js @@ -1,9 +1,7 @@ // @flow -'use strict'; - /** x */ -let x: (T) => string; +let x: T => string; /** x2 */ let x2: (a: T) => string; diff --git a/test/fixture/html/documentation.yml b/__tests__/fixture/html/documentation.yml similarity index 100% rename from test/fixture/html/documentation.yml rename to __tests__/fixture/html/documentation.yml diff --git a/test/fixture/html/nested.config-output.html b/__tests__/fixture/html/nested.config-output.html similarity index 100% rename from test/fixture/html/nested.config-output.html rename to __tests__/fixture/html/nested.config-output.html diff --git a/test/fixture/html/nested.input.js b/__tests__/fixture/html/nested.input.js similarity index 99% rename from test/fixture/html/nested.input.js rename to __tests__/fixture/html/nested.input.js index 1b2a61da8..47c443f52 100644 --- a/test/fixture/html/nested.input.js +++ b/__tests__/fixture/html/nested.input.js @@ -1,5 +1,3 @@ -'use strict'; - /** * Creates a new Klass * @extends Stream.Writable diff --git a/test/fixture/html/nested.output.files b/__tests__/fixture/html/nested.output.files similarity index 100% rename from test/fixture/html/nested.output.files rename to __tests__/fixture/html/nested.output.files diff --git a/test/fixture/html/nested.output.json b/__tests__/fixture/html/nested.output.json similarity index 100% rename from test/fixture/html/nested.output.json rename to __tests__/fixture/html/nested.output.json diff --git a/test/fixture/infer-private.input.js b/__tests__/fixture/infer-private.input.js similarity index 100% rename from test/fixture/infer-private.input.js rename to __tests__/fixture/infer-private.input.js diff --git a/test/fixture/inheritance.input.js b/__tests__/fixture/inheritance.input.js similarity index 100% rename from test/fixture/inheritance.input.js rename to __tests__/fixture/inheritance.input.js diff --git a/test/fixture/inline-link.input.js b/__tests__/fixture/inline-link.input.js similarity index 100% rename from test/fixture/inline-link.input.js rename to __tests__/fixture/inline-link.input.js diff --git a/test/fixture/interface.input.js b/__tests__/fixture/interface.input.js similarity index 100% rename from test/fixture/interface.input.js rename to __tests__/fixture/interface.input.js diff --git a/test/fixture/internal.input.js b/__tests__/fixture/internal.input.js similarity index 100% rename from test/fixture/internal.input.js rename to __tests__/fixture/internal.input.js diff --git a/test/fixture/lends.input.js b/__tests__/fixture/lends.input.js similarity index 100% rename from test/fixture/lends.input.js rename to __tests__/fixture/lends.input.js diff --git a/test/fixture/lint/lint.input.js b/__tests__/fixture/lint/lint.input.js similarity index 100% rename from test/fixture/lint/lint.input.js rename to __tests__/fixture/lint/lint.input.js diff --git a/test/fixture/lint/lint.output b/__tests__/fixture/lint/lint.output similarity index 100% rename from test/fixture/lint/lint.output rename to __tests__/fixture/lint/lint.output diff --git a/test/fixture/literal_types.input.js b/__tests__/fixture/literal_types.input.js similarity index 100% rename from test/fixture/literal_types.input.js rename to __tests__/fixture/literal_types.input.js diff --git a/test/fixture/memberedclass.input.js b/__tests__/fixture/memberedclass.input.js similarity index 100% rename from test/fixture/memberedclass.input.js rename to __tests__/fixture/memberedclass.input.js diff --git a/test/fixture/merge-infered-type.input.js b/__tests__/fixture/merge-infered-type.input.js similarity index 100% rename from test/fixture/merge-infered-type.input.js rename to __tests__/fixture/merge-infered-type.input.js diff --git a/test/fixture/meta.input.js b/__tests__/fixture/meta.input.js similarity index 100% rename from test/fixture/meta.input.js rename to __tests__/fixture/meta.input.js diff --git a/test/fixture/multisignature.input.js b/__tests__/fixture/multisignature.input.js similarity index 100% rename from test/fixture/multisignature.input.js rename to __tests__/fixture/multisignature.input.js diff --git a/test/fixture/nearby_params.input.js b/__tests__/fixture/nearby_params.input.js similarity index 100% rename from test/fixture/nearby_params.input.js rename to __tests__/fixture/nearby_params.input.js diff --git a/test/fixture/nest_params.input.js b/__tests__/fixture/nest_params.input.js similarity index 100% rename from test/fixture/nest_params.input.js rename to __tests__/fixture/nest_params.input.js diff --git a/test/fixture/newline-in-description.input.js b/__tests__/fixture/newline-in-description.input.js similarity index 100% rename from test/fixture/newline-in-description.input.js rename to __tests__/fixture/newline-in-description.input.js diff --git a/test/fixture/no-name.input.js b/__tests__/fixture/no-name.input.js similarity index 100% rename from test/fixture/no-name.input.js rename to __tests__/fixture/no-name.input.js diff --git a/test/fixture/node_modules/external/index.js b/__tests__/fixture/node_modules/external/index.js similarity index 100% rename from test/fixture/node_modules/external/index.js rename to __tests__/fixture/node_modules/external/index.js diff --git a/test/fixture/node_modules/external/lib/main.js b/__tests__/fixture/node_modules/external/lib/main.js similarity index 92% rename from test/fixture/node_modules/external/lib/main.js rename to __tests__/fixture/node_modules/external/lib/main.js index 1f609e296..707db5be6 100644 --- a/test/fixture/node_modules/external/lib/main.js +++ b/__tests__/fixture/node_modules/external/lib/main.js @@ -1,5 +1,3 @@ -'use strict'; - var otherDep = require('external2'); /** diff --git a/test/fixture/node_modules/external/node_modules/external2/index.js b/__tests__/fixture/node_modules/external/node_modules/external2/index.js similarity index 100% rename from test/fixture/node_modules/external/node_modules/external2/index.js rename to __tests__/fixture/node_modules/external/node_modules/external2/index.js diff --git a/test/fixture/node_modules/external/package.json b/__tests__/fixture/node_modules/external/package.json similarity index 100% rename from test/fixture/node_modules/external/package.json rename to __tests__/fixture/node_modules/external/package.json diff --git a/test/fixture/node_modules/external2/index.js b/__tests__/fixture/node_modules/external2/index.js similarity index 100% rename from test/fixture/node_modules/external2/index.js rename to __tests__/fixture/node_modules/external2/index.js diff --git a/test/fixture/optional-record-field-type.input.js b/__tests__/fixture/optional-record-field-type.input.js similarity index 100% rename from test/fixture/optional-record-field-type.input.js rename to __tests__/fixture/optional-record-field-type.input.js diff --git a/test/fixture/params.input.js b/__tests__/fixture/params.input.js similarity index 100% rename from test/fixture/params.input.js rename to __tests__/fixture/params.input.js diff --git a/test/fixture/polyglot/blend.cpp b/__tests__/fixture/polyglot/blend.cpp similarity index 100% rename from test/fixture/polyglot/blend.cpp rename to __tests__/fixture/polyglot/blend.cpp diff --git a/test/fixture/polyglot/blend.json b/__tests__/fixture/polyglot/blend.json similarity index 100% rename from test/fixture/polyglot/blend.json rename to __tests__/fixture/polyglot/blend.json diff --git a/test/fixture/react-jsx.input.js b/__tests__/fixture/react-jsx.input.js similarity index 100% rename from test/fixture/react-jsx.input.js rename to __tests__/fixture/react-jsx.input.js diff --git a/test/fixture/readme/README.input.md b/__tests__/fixture/readme/README.input.md similarity index 100% rename from test/fixture/readme/README.input.md rename to __tests__/fixture/readme/README.input.md diff --git a/test/fixture/readme/README.output.md b/__tests__/fixture/readme/README.output.md similarity index 100% rename from test/fixture/readme/README.output.md rename to __tests__/fixture/readme/README.output.md diff --git a/test/fixture/readme/index.js b/__tests__/fixture/readme/index.js similarity index 100% rename from test/fixture/readme/index.js rename to __tests__/fixture/readme/index.js diff --git a/test/fixture/require-json-no-extension.input.js b/__tests__/fixture/require-json-no-extension.input.js similarity index 100% rename from test/fixture/require-json-no-extension.input.js rename to __tests__/fixture/require-json-no-extension.input.js diff --git a/test/fixture/require-json.input.js b/__tests__/fixture/require-json.input.js similarity index 100% rename from test/fixture/require-json.input.js rename to __tests__/fixture/require-json.input.js diff --git a/test/fixture/require-json.json b/__tests__/fixture/require-json.json similarity index 100% rename from test/fixture/require-json.json rename to __tests__/fixture/require-json.json diff --git a/test/fixture/simple-hashbang.input.js b/__tests__/fixture/simple-hashbang.input.js similarity index 100% rename from test/fixture/simple-hashbang.input.js rename to __tests__/fixture/simple-hashbang.input.js diff --git a/test/fixture/simple-private.input.js b/__tests__/fixture/simple-private.input.js similarity index 100% rename from test/fixture/simple-private.input.js rename to __tests__/fixture/simple-private.input.js diff --git a/test/fixture/simple-singlestar.input.js b/__tests__/fixture/simple-singlestar.input.js similarity index 100% rename from test/fixture/simple-singlestar.input.js rename to __tests__/fixture/simple-singlestar.input.js diff --git a/test/fixture/simple-triplestar.input.js b/__tests__/fixture/simple-triplestar.input.js similarity index 100% rename from test/fixture/simple-triplestar.input.js rename to __tests__/fixture/simple-triplestar.input.js diff --git a/test/fixture/simple-two.input.js b/__tests__/fixture/simple-two.input.js similarity index 100% rename from test/fixture/simple-two.input.js rename to __tests__/fixture/simple-two.input.js diff --git a/test/fixture/simple.config.yml b/__tests__/fixture/simple.config.yml similarity index 100% rename from test/fixture/simple.config.yml rename to __tests__/fixture/simple.config.yml diff --git a/test/fixture/simple.input.js b/__tests__/fixture/simple.input.js similarity index 100% rename from test/fixture/simple.input.js rename to __tests__/fixture/simple.input.js diff --git a/test/fixture/snowflake.md b/__tests__/fixture/snowflake.md similarity index 100% rename from test/fixture/snowflake.md rename to __tests__/fixture/snowflake.md diff --git a/test/fixture/sort-order-alpha.input.js b/__tests__/fixture/sort-order-alpha.input.js similarity index 100% rename from test/fixture/sort-order-alpha.input.js rename to __tests__/fixture/sort-order-alpha.input.js diff --git a/test/fixture/sorting/input.js b/__tests__/fixture/sorting/input.js similarity index 100% rename from test/fixture/sorting/input.js rename to __tests__/fixture/sorting/input.js diff --git a/test/fixture/sorting/output-bad.txt b/__tests__/fixture/sorting/output-bad.txt similarity index 100% rename from test/fixture/sorting/output-bad.txt rename to __tests__/fixture/sorting/output-bad.txt diff --git a/test/fixture/sorting/output.json b/__tests__/fixture/sorting/output.json similarity index 100% rename from test/fixture/sorting/output.json rename to __tests__/fixture/sorting/output.json diff --git a/test/fixture/string-literal-key.input.js b/__tests__/fixture/string-literal-key.input.js similarity index 100% rename from test/fixture/string-literal-key.input.js rename to __tests__/fixture/string-literal-key.input.js diff --git a/test/fixture/system-import.input.js b/__tests__/fixture/system-import.input.js similarity index 100% rename from test/fixture/system-import.input.js rename to __tests__/fixture/system-import.input.js diff --git a/test/fixture/this-class.input.js b/__tests__/fixture/this-class.input.js similarity index 100% rename from test/fixture/this-class.input.js rename to __tests__/fixture/this-class.input.js diff --git a/test/fixture/type_application.input.js b/__tests__/fixture/type_application.input.js similarity index 100% rename from test/fixture/type_application.input.js rename to __tests__/fixture/type_application.input.js diff --git a/test/fixture/var-function-param-return.input.js b/__tests__/fixture/var-function-param-return.input.js similarity index 100% rename from test/fixture/var-function-param-return.input.js rename to __tests__/fixture/var-function-param-return.input.js diff --git a/test/format_type.js b/__tests__/format_type.js similarity index 86% rename from test/format_type.js rename to __tests__/format_type.js index 6bb3c7279..4971f41b4 100644 --- a/test/format_type.js +++ b/__tests__/format_type.js @@ -1,11 +1,9 @@ /*eslint max-len: 0 */ -'use strict'; -var _formatType = require('../lib/output/util/format_type'), - LinkerStack = require('../lib/output/util/linker_stack'), +var _formatType = require('../src/output/util/format_type'), + LinkerStack = require('../src/output/util/linker_stack'), remark = require('remark'), - parse = require('doctrine-temporary-fork').parse, - test = require('tap').test; + parse = require('doctrine-temporary-fork').parse; function stringify(children) { return remark().stringify({ @@ -14,7 +12,7 @@ function stringify(children) { }); } -test('formatType', function(t) { +test('formatType', function() { var linkerStack = new LinkerStack({}); var formatType = _formatType.bind(undefined, linkerStack.link); [ @@ -84,26 +82,24 @@ test('formatType', function(t) { '[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)' ] ].forEach(function(example) { - t.deepEqual( + expect( stringify( formatType( parse('@param {' + example[0] + '} a', { sloppy: true }).tags[0].type ) - ), - example[1], - example[0] - ); + ) + ).toEqual(example[1]); }); - t.deepEqual( + expect( stringify( formatType(parse('@param {number} [a=1]', { sloppy: true }).tags[0].type) - ), - '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?', - 'default' + ) + ).toEqual( + '[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?' ); - t.deepEqual( + expect( stringify( _formatType( function(str) { @@ -113,16 +109,12 @@ test('formatType', function(t) { sloppy: true }).tags[0].type ) - ), - '[Foo](FOO)', - 'with custom linker' - ); + ) + ).toEqual('[Foo](FOO)'); - t.deepEqual(stringify(formatType()), 'any', 'empty case'); + expect(stringify(formatType())).toEqual('any'); - t.throws(function() { + expect(function() { formatType({}); - }); - - t.end(); + }).toThrow(); }); diff --git a/__tests__/lib/__snapshots__/server.js.snap b/__tests__/lib/__snapshots__/server.js.snap new file mode 100644 index 000000000..102e52d2f --- /dev/null +++ b/__tests__/lib/__snapshots__/server.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`server 1`] = `"test = 123"`; + +exports[`server 2`] = `"var test = 123;"`; + +exports[`server 3`] = `""`; diff --git a/__tests__/lib/__snapshots__/sort.js.snap b/__tests__/lib/__snapshots__/sort.js.snap new file mode 100644 index 000000000..ff8f5c7cc --- /dev/null +++ b/__tests__/lib/__snapshots__/sort.js.snap @@ -0,0 +1,109 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`sort toc with files 1`] = ` +Array [ + Object { + "file": "test/fixture/snowflake.md", + "kind": "note", + "name": "snowflake", + }, + Object { + "context": Object { + "sortKey": "a", + }, + "name": "apples", + }, + Object { + "context": Object { + "sortKey": "b", + }, + "name": "carrot", + }, + Object { + "context": Object { + "sortKey": "c", + }, + "name": "bananas", + }, +] +`; + +exports[`sort toc with files absolute path 1`] = ` +Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 3, + "line": 1, + "offset": 2, + }, + }, + "type": "text", + "value": "The Snowflake", + }, + ], + "depth": 1, + "position": Position { + "end": Object { + "column": 16, + "line": 1, + "offset": 15, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "heading", + }, + ], + "position": Object { + "end": Object { + "column": 1, + "line": 2, + "offset": 16, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "kind": "note", + "name": "snowflake", + }, + Object { + "context": Object { + "sortKey": "a", + }, + "name": "apples", + }, + Object { + "context": Object { + "sortKey": "b", + }, + "name": "carrot", + }, + Object { + "context": Object { + "sortKey": "c", + }, + "name": "bananas", + }, +] +`; diff --git a/test/lib/filter_access.js b/__tests__/lib/filter_access.js similarity index 60% rename from test/lib/filter_access.js rename to __tests__/lib/filter_access.js index ccab5b99e..85ab0bea8 100644 --- a/test/lib/filter_access.js +++ b/__tests__/lib/filter_access.js @@ -1,10 +1,7 @@ -'use strict'; +var filterAccess = require('../../src/filter_access'); -var test = require('tap').test, - filterAccess = require('../../lib/filter_access'); - -test('filterAccess ignore', function(t) { - t.deepEqual( +test('filterAccess ignore', function() { + expect( filterAccess( ['public', 'protected', 'undefined'], [ @@ -13,14 +10,12 @@ test('filterAccess ignore', function(t) { ignore: true } ] - ), - [] - ); - t.end(); + ) + ).toEqual([]); }); -test('filterAccess public, protected, undefined, no private', function(t) { - t.deepEqual( +test('filterAccess public, protected, undefined, no private', function() { + expect( filterAccess( ['public', 'protected', 'undefined'], [ @@ -37,24 +32,22 @@ test('filterAccess public, protected, undefined, no private', function(t) { access: 'private' } ] - ), - [ - { - access: 'public' - }, - { - access: 'protected' - }, - { - foo: 2 - } - ] - ); - t.end(); + ) + ).toEqual([ + { + access: 'public' + }, + { + access: 'protected' + }, + { + foo: 2 + } + ]); }); -test('filterAccess explicit public', function(t) { - t.deepEqual( +test('filterAccess explicit public', function() { + expect( filterAccess( ['public'], [ @@ -63,18 +56,16 @@ test('filterAccess explicit public', function(t) { { foo: 2 }, { access: 'private' } ] - ), - [ - { - access: 'public' - } - ] - ); - t.end(); + ) + ).toEqual([ + { + access: 'public' + } + ]); }); -test('filterAccess override', function(t) { - t.deepEqual( +test('filterAccess override', function() { + expect( filterAccess( ['private'], [ @@ -82,18 +73,16 @@ test('filterAccess override', function(t) { access: 'private' } ] - ), - [ - { - access: 'private' - } - ] - ); - t.end(); + ) + ).toEqual([ + { + access: 'private' + } + ]); }); -test('filterAccess nesting', function(t) { - t.deepEqual( +test('filterAccess nesting', function() { + expect( filterAccess( ['public', 'protected', 'undefined'], [ @@ -124,19 +113,17 @@ test('filterAccess nesting', function(t) { } } ] - ), - [ - { - access: 'public', - members: { - static: [ - { - access: 'public' - } - ] - } + ) + ).toEqual([ + { + access: 'public', + members: { + static: [ + { + access: 'public' + } + ] } - ] - ); - t.end(); + } + ]); }); diff --git a/__tests__/lib/flow_doctrine.js b/__tests__/lib/flow_doctrine.js new file mode 100644 index 000000000..00365694c --- /dev/null +++ b/__tests__/lib/flow_doctrine.js @@ -0,0 +1,305 @@ +var flowDoctrine = require('../../src/flow_doctrine.js'), + parse = require('../../src/parsers/javascript'), + FLOW_TYPES = require('babel-types').FLOW_TYPES; + +function toComment(fn, filename) { + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; +} + +test('flowDoctrine', function() { + var types = FLOW_TYPES.filter(function(type) { + return type.match(/\wTypeAnnotation$/); + }); + + function toDoctrineType(flowType) { + var annotation = toComment( + '/** add */function add(a: ' + flowType + ' ) { }' + ).context.ast.node.params[0].typeAnnotation.typeAnnotation; + if (types.indexOf(annotation.type) !== -1) { + types.splice(types.indexOf(annotation.type), 1); + } + return flowDoctrine(annotation); + } + + expect(toDoctrineType('number')).toEqual({ + type: 'NameExpression', + name: 'number' + }); + + expect(toDoctrineType('string')).toEqual({ + type: 'NameExpression', + name: 'string' + }); + + expect(toDoctrineType('any')).toEqual({ + type: 'AllLiteral' + }); + + expect(toDoctrineType('(y:Foo) => Bar')).toEqual({ + type: 'FunctionType', + params: [ + { + type: 'ParameterType', + name: 'y', + expression: { + type: 'NameExpression', + name: 'Foo' + } + } + ], + result: { + type: 'NameExpression', + name: 'Bar' + } + }); + + expect(toDoctrineType('?number')).toEqual({ + type: 'NullableType', + expression: { + type: 'NameExpression', + name: 'number' + } + }); + + expect(toDoctrineType('number | string')).toEqual({ + type: 'UnionType', + elements: [ + { + type: 'NameExpression', + name: 'number' + }, + { + type: 'NameExpression', + name: 'string' + } + ] + }); + + expect(toDoctrineType('Object')).toEqual({ + type: 'NameExpression', + name: 'Object' + }); + + expect(toDoctrineType('namedType.propertyOfType')).toEqual({ + type: 'NameExpression', + name: 'namedType.propertyOfType' + }); + + expect(toDoctrineType('Array')).toEqual({ + applications: [ + { + type: 'NameExpression', + name: 'namedType.propertyOfType' + } + ], + expression: { + name: 'Array', + type: 'NameExpression' + }, + type: 'TypeApplication' + }); + + expect(toDoctrineType('Array>')).toEqual({ + applications: [ + { + applications: [ + { + name: 'boolean', + type: 'NameExpression' + } + ], + expression: { + type: 'NameExpression', + name: 'namedType.propertyOfType' + }, + type: 'TypeApplication' + } + ], + expression: { + name: 'Array', + type: 'NameExpression' + }, + type: 'TypeApplication' + }); + + expect(toDoctrineType('{ a: foo.bar }')).toEqual({ + fields: [ + { + key: 'a', + type: 'FieldType', + value: { + name: 'foo.bar', + type: 'NameExpression' + } + } + ], + type: 'RecordType' + }); + + expect(toDoctrineType('{ a: { b: foo.bar } }')).toEqual({ + fields: [ + { + key: 'a', + type: 'FieldType', + value: { + type: 'RecordType', + fields: [ + { + key: 'b', + type: 'FieldType', + value: { + name: 'foo.bar', + type: 'NameExpression' + } + } + ] + } + } + ], + type: 'RecordType' + }); + + expect(toDoctrineType('{ a: 1 }')).toEqual({ + type: 'RecordType', + fields: [ + { + type: 'FieldType', + key: 'a', + value: { + type: 'NumericLiteralType', + value: 1 + } + } + ] + }); + + expect(toDoctrineType('mixed')).toEqual({ + type: 'AllLiteral' + }); + + expect(toDoctrineType('Array')).toEqual({ + type: 'NameExpression', + name: 'Array' + }); + + expect(toDoctrineType('Array')).toEqual({ + type: 'TypeApplication', + expression: { + type: 'NameExpression', + name: 'Array' + }, + applications: [ + { + type: 'NameExpression', + name: 'number' + } + ] + }); + + expect(toDoctrineType('number[]')).toEqual({ + type: 'TypeApplication', + expression: { + type: 'NameExpression', + name: 'Array' + }, + applications: [ + { + type: 'NameExpression', + name: 'number' + } + ] + }); + + expect(toDoctrineType('[]')).toEqual({ + type: 'ArrayType', + elements: [] + }); + + expect(toDoctrineType('[number]')).toEqual({ + type: 'ArrayType', + elements: [ + { + type: 'NameExpression', + name: 'number' + } + ] + }); + + expect(toDoctrineType('[string, boolean]')).toEqual({ + type: 'ArrayType', + elements: [ + { + type: 'NameExpression', + name: 'string' + }, + { + type: 'NameExpression', + name: 'boolean' + } + ] + }); + + expect(toDoctrineType('boolean')).toEqual({ + type: 'NameExpression', + name: 'boolean' + }); + + expect(toDoctrineType('any => any')).toEqual({ + type: 'FunctionType', + params: [ + { + expression: { type: 'AllLiteral' }, + name: '', + type: 'ParameterType' + } + ], + result: { type: 'AllLiteral' } + }); + + expect(toDoctrineType('undefined')).toEqual({ + type: 'NameExpression', + name: 'undefined' + }); + + expect(toDoctrineType('"value"')).toEqual({ + type: 'StringLiteralType', + value: 'value' + }); + + expect(toDoctrineType('1')).toEqual({ + type: 'NumericLiteralType', + value: 1 + }); + + expect(toDoctrineType('true')).toEqual({ + type: 'BooleanLiteralType', + value: true + }); + + expect(toDoctrineType('false')).toEqual({ + type: 'BooleanLiteralType', + value: false + }); + + expect(toDoctrineType('null')).toEqual({ + type: 'NullLiteral' + }); + + expect(toDoctrineType('void')).toEqual({ + type: 'VoidLiteral' + }); + + // TODO: remove all these types + expect(types).toEqual([ + 'IntersectionTypeAnnotation', + 'EmptyTypeAnnotation', + 'ThisTypeAnnotation', + 'TypeofTypeAnnotation' + ]); +}); diff --git a/__tests__/lib/git/find_git.js b/__tests__/lib/git/find_git.js new file mode 100644 index 000000000..aed510251 --- /dev/null +++ b/__tests__/lib/git/find_git.js @@ -0,0 +1,16 @@ +var mock = require('mock-fs'); +var mockRepo = require('../../utils').mockRepo; +var path = require('path'); +var findGit = require('../../../src/git/find_git'); + +test('findGit', function() { + mock(mockRepo.master); + + const root = path.parse(__dirname).root; + + expect( + findGit(root + path.join('my', 'repository', 'path', 'index.js')) + ).toBe(root + path.join('my', 'repository', 'path', '.git')); + + mock.restore(); +}); diff --git a/__tests__/lib/git/url_prefix.js b/__tests__/lib/git/url_prefix.js new file mode 100644 index 000000000..3c1ace557 --- /dev/null +++ b/__tests__/lib/git/url_prefix.js @@ -0,0 +1,32 @@ +var mock = require('mock-fs'); +var mockRepo = require('../../utils').mockRepo; +var getGithubURLPrefix = require('../../../src/git/url_prefix'); +var parsePackedRefs = getGithubURLPrefix.parsePackedRefs; + +test('getGithubURLPrefix', function() { + mock(mockRepo.master); + + expect(getGithubURLPrefix('/my/repository/path/')).toBe( + 'https://github.com/foo/bar/blob/this_is_the_sha/' + ); + + mock.restore(); + + mock(mockRepo.detached); + + expect(getGithubURLPrefix('/my/repository/path/')).toBe( + 'https://github.com/foo/bar/blob/e4cb2ffe677571d0503e659e4e64e01f45639c62/' + ); + + mock.restore(); +}); + +test('parsePackedRefs', function() { + var input = + '# pack-refs with: peeled fully-peeled\n' + + '4acd658617928bd17ae7364ef2512630d97c007a refs/heads/babel-6\n' + + '11826ad98c6c08d00f4af77f64d3e2687e0f7dba refs/remotes/origin/flow-types'; + expect(parsePackedRefs(input, 'refs/heads/babel-6')).toBe( + '4acd658617928bd17ae7364ef2512630d97c007a' + ); +}); diff --git a/__tests__/lib/github.js b/__tests__/lib/github.js new file mode 100644 index 000000000..76e7d7a67 --- /dev/null +++ b/__tests__/lib/github.js @@ -0,0 +1,86 @@ +/* eslint no-unused-vars: 0 */ + +var mock = require('mock-fs'), + path = require('path'), + mockRepo = require('../utils').mockRepo, + parse = require('../../src/parsers/javascript'), + github = require('../../src/github'); + +function toComment(fn, filename) { + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + ).map(github); +} + +const root = path.parse(__dirname).root; + +function evaluate(fn) { + return toComment( + fn, + root + path.join('my', 'repository', 'path', 'index.js') + ); +} + +test('github', function() { + mock(mockRepo.master); + + expect( + evaluate(function() { + /** + * get one + * @returns {number} one + */ + function getOne() { + return 1; + } + })[0].context.github + ).toEqual({ + path: 'index.js', + url: 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' + }); + + mock.restore(); +}); + +test('malformed repository', function() { + mock(mockRepo.malformed); + + expect( + evaluate(function() { + /** + * get one + * @returns {number} one + */ + function getOne() { + return 1; + } + })[0].context.github + ).toBe(undefined); + + mock.restore(); +}); + +test('enterprise repository', function() { + mock(mockRepo.enterprise); + + expect( + evaluate(function() { + /** + * get one + * @returns {number} one + */ + function getOne() { + return 1; + } + })[0].context.github + ).toEqual({ + path: 'index.js', + url: 'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' + }); + + mock.restore(); +}); diff --git a/test/lib/hierarchy.js b/__tests__/lib/hierarchy.js similarity index 58% rename from test/lib/hierarchy.js rename to __tests__/lib/hierarchy.js index 478ad03c1..a30e7e3f8 100644 --- a/test/lib/hierarchy.js +++ b/__tests__/lib/hierarchy.js @@ -1,8 +1,5 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../lib/parsers/javascript'), - hierarchy = require('../../lib/hierarchy'); +var parse = require('../../src/parsers/javascript'), + hierarchy = require('../../src/hierarchy'); function toComments(fn, filename) { return parse( @@ -24,7 +21,7 @@ function map(arr, prop) { }); } -test('hierarchy', function(t) { +test('hierarchy', function() { var comments = evaluate(function() { /** * @name Class @@ -51,21 +48,25 @@ test('hierarchy', function(t) { */ }); - t.deepEqual(map(comments, 'name'), ['Class']); + expect(map(comments, 'name')).toEqual(['Class']); var classMembers = comments[0].members; - t.deepEqual(map(classMembers.static, 'name'), ['isClass', 'MAGIC_NUMBER']); - t.deepEqual(map(classMembers.instance, 'name'), ['getFoo']); - - t.deepEqual(map(classMembers.static[0].path, 'name'), ['Class', 'isClass']); - t.deepEqual(map(classMembers.instance[0].path, 'name'), ['Class', 'getFoo']); - t.deepEqual(map(classMembers.events[0].path, 'name'), ['Class', 'event']); + expect(map(classMembers.static, 'name')).toEqual(['isClass', 'MAGIC_NUMBER']); + expect(map(classMembers.instance, 'name')).toEqual(['getFoo']); - t.end(); + expect(map(classMembers.static[0].path, 'name')).toEqual([ + 'Class', + 'isClass' + ]); + expect(map(classMembers.instance[0].path, 'name')).toEqual([ + 'Class', + 'getFoo' + ]); + expect(map(classMembers.events[0].path, 'name')).toEqual(['Class', 'event']); }); -test('hierarchy - nesting', function(t) { +test('hierarchy - nesting', function() { var comments = evaluate(function() { /** * @name Parent @@ -85,28 +86,26 @@ test('hierarchy - nesting', function(t) { */ }); - t.deepEqual(map(comments, 'name'), ['Parent']); + expect(map(comments, 'name')).toEqual(['Parent']); var classMembers = comments[0].members; - t.deepEqual(map(classMembers.static, 'name'), ['enum']); + expect(map(classMembers.static, 'name')).toEqual(['enum']); var enumMembers = classMembers.static[0].members; - t.deepEqual(map(enumMembers.static, 'name'), ['Parent', 'Child']); - t.deepEqual(map(enumMembers.static[0].path, 'name'), [ + expect(map(enumMembers.static, 'name')).toEqual(['Parent', 'Child']); + expect(map(enumMembers.static[0].path, 'name')).toEqual([ 'Parent', 'enum', 'Parent' ]); - t.deepEqual(map(enumMembers.static[1].path, 'name'), [ + expect(map(enumMembers.static[1].path, 'name')).toEqual([ 'Parent', 'enum', 'Child' ]); - - t.end(); }); -test('hierarchy - multisignature', function(t) { +test('hierarchy - multisignature', function() { var comments = evaluate(function() { /** * @name Parent @@ -124,11 +123,10 @@ test('hierarchy - multisignature', function(t) { */ }); - t.deepEqual(map(comments[0].members.instance, 'name'), ['foo', 'foo']); - t.end(); + expect(map(comments[0].members.instance, 'name')).toEqual(['foo', 'foo']); }); -test('hierarchy - missing memberof', function(t) { +test('hierarchy - missing memberof', function() { var test = evaluate(function() { /** * @name test @@ -136,33 +134,27 @@ test('hierarchy - missing memberof', function(t) { */ })[0]; - t.deepEqual( - test.errors, - [ - { - message: '@memberof reference to DoesNotExist not found', - commentLineNumber: 2 - } - ], - 'correct error message' - ); - t.end(); + expect(test.errors).toEqual([ + { + message: '@memberof reference to DoesNotExist not found', + commentLineNumber: 2 + } + ]); }); -test('hierarchy - anonymous', function(t) { +test('hierarchy - anonymous', function() { var result = evaluate(function() { /** Test */ })[0]; - t.deepEqual(result.errors, [ + expect(result.errors).toEqual([ { message: 'could not determine @name for hierarchy' } ]); - t.end(); }); -test('hierarchy - object prototype member names', function(t) { +test('hierarchy - object prototype member names', function() { var comments = evaluate(function() { /** * @name should @@ -187,10 +179,8 @@ test('hierarchy - object prototype member names', function(t) { **/ }); - t.deepEqual(map(comments[0].members.static[0].members.instance, 'name'), [ + expect(map(comments[0].members.static[0].members.instance, 'name')).toEqual([ 'hasOwnProperty', 'otherMethod' ]); - - t.end(); }); diff --git a/__tests__/lib/infer/__snapshots__/params.js.snap b/__tests__/lib/infer/__snapshots__/params.js.snap new file mode 100644 index 000000000..4dd7dcd46 --- /dev/null +++ b/__tests__/lib/infer/__snapshots__/params.js.snap @@ -0,0 +1,223 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`inferParams 1`] = ` +Array [ + Object { + "anonymous": true, + "name": "$0", + "properties": Array [ + Object { + "lineNumber": 1, + "name": "$0.x", + "title": "param", + }, + Object { + "lineNumber": 1, + "name": "$0.xs", + "title": "param", + "type": Object { + "type": "RestType", + }, + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, +] +`; + +exports[`inferParams 2`] = ` +Array [ + Object { + "description": Object { + "children": Array [ + Object { + "children": Array [ + Object { + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "text", + "value": "renamed destructuring param", + }, + ], + "position": Position { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "indent": Array [], + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "paragraph", + }, + ], + "position": Object { + "end": Object { + "column": 28, + "line": 1, + "offset": 27, + }, + "start": Object { + "column": 1, + "line": 1, + "offset": 0, + }, + }, + "type": "root", + }, + "lineNumber": 2, + "name": "a", + "properties": Array [ + Object { + "lineNumber": 6, + "name": "a.x", + "title": "param", + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, +] +`; + +exports[`inferParams 3`] = ` +Array [ + Object { + "default": "4", + "lineNumber": 3, + "name": "x", + "title": "param", + "type": undefined, + }, +] +`; + +exports[`inferParams 4`] = ` +Array [ + Object { + "default": "4", + "lineNumber": 1, + "name": "x", + "title": "param", + "type": Object { + "name": "number", + "type": "NameExpression", + }, + }, +] +`; + +exports[`inferParams 5`] = ` +Array [ + Object { + "anonymous": true, + "name": "$0", + "properties": Array [ + Object { + "lineNumber": 3, + "name": "$0.x", + "title": "param", + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, +] +`; + +exports[`inferParams 6`] = ` +Array [ + Object { + "anonymous": true, + "name": "$0", + "properties": Array [ + Object { + "lineNumber": 3, + "name": "$0.x.y.z", + "title": "param", + }, + ], + "title": "param", + "type": Object { + "name": "Object", + "type": "NameExpression", + }, + }, +] +`; + +exports[`mergeTrees 1`] = ` +Object { + "errors": Array [ + Object { + "commentLineNumber": undefined, + "message": "An explicit parameter named a was specified but didn't match inferred information ", + }, + ], + "mergedParams": Array [ + Object { + "description": "First arg!", + "name": "a", + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], +} +`; + +exports[`mergeTrees 2`] = ` +Object { + "errors": Array [], + "mergedParams": Array [ + Object { + "description": "First arg!", + "name": "a", + "properties": Array [ + Object { + "name": "a.a", + "parameterIndex": 0, + "properties": Array [], + "title": "param", + "type": Object { + "name": "string", + "type": "NameExpression", + }, + }, + ], + "title": "param", + "type": Object { + "name": "object", + "type": "NameExpression", + }, + }, + ], +} +`; diff --git a/__tests__/lib/infer/access.js b/__tests__/lib/infer/access.js new file mode 100644 index 000000000..59d3bbf64 --- /dev/null +++ b/__tests__/lib/infer/access.js @@ -0,0 +1,46 @@ +var parse = require('../../../src/parsers/javascript'), + inferName = require('../../../src/infer/name'), + inferAccess = require('../../../src/infer/access'); + +function toComment(fn) { + return parse( + { + source: '(' + fn.toString() + ')' + }, + {} + )[0]; +} + +function evaluate(fn, re) { + return inferAccess(re)(inferName(toComment(fn))); +} + +test('inferAccess', function() { + expect( + evaluate(function() { + /** Test */ + function _name() {} + }, '^_').access + ).toBe('private'); + + expect( + evaluate(function() { + /** @private */ + function name() {} + }, '^_').access + ).toBe('private'); + + expect( + evaluate(function() { + /** @public */ + function _name() {} + }, '^_').access + ).toBe('public'); + + expect( + evaluate(function() { + /** Test */ + function name_() {} + }, '_$').access + ).toBe('private'); +}); diff --git a/test/lib/infer/finders.js b/__tests__/lib/infer/finders.js similarity index 51% rename from test/lib/infer/finders.js rename to __tests__/lib/infer/finders.js index 2bc566414..3c86b0473 100644 --- a/test/lib/infer/finders.js +++ b/__tests__/lib/infer/finders.js @@ -1,8 +1,5 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - findTarget = require('../../../lib/infer/finders').findTarget; +var parse = require('../../../src/parsers/javascript'), + findTarget = require('../../../src/infer/finders').findTarget; function toComment(fn) { if (typeof fn == 'function') { @@ -21,19 +18,17 @@ function evaluate(fn, re) { return toComment(fn); } -test('findTarget', function(t) { - t.equal( +test('findTarget', function() { + expect( findTarget( toComment(function() { /** Test */ var x = 10; }).context.ast - ).type, - 'VariableDeclarator', - 'variable declarator' - ); + ).type + ).toBe('VariableDeclarator'); - t.equal( + expect( findTarget( toComment(function() { var z = {}; @@ -41,12 +36,10 @@ test('findTarget', function(t) { /** Test */ z.y = 10; }).context.ast - ).type, - 'NumericLiteral', - 'assigned object value' - ); + ).type + ).toBe('NumericLiteral'); - t.equal( + expect( findTarget( toComment(function() { var z = { @@ -54,36 +47,28 @@ test('findTarget', function(t) { y: 10 }; }).context.ast - ).type, - 'NumericLiteral', - 'object property' - ); + ).type + ).toBe('NumericLiteral'); - t.equal( + expect( findTarget( toComment( ` - /** Test */ - export var z = 10; - ` + /** Test */ + export var z = 10; +` ).context.ast - ).type, - 'VariableDeclarator', - 'variable declarator in export' - ); + ).type + ).toBe('VariableDeclarator'); - t.equal( + expect( findTarget( toComment( ` - /** Test */ - export default 10; - ` + /** Test */ + export default 10; +` ).context.ast - ).type, - 'NumericLiteral', - 'default export' - ); - - t.end(); + ).type + ).toBe('NumericLiteral'); }); diff --git a/test/lib/infer/kind.js b/__tests__/lib/infer/kind.js similarity index 55% rename from test/lib/infer/kind.js rename to __tests__/lib/infer/kind.js index 1509ebb99..fa9c8d3d7 100644 --- a/test/lib/infer/kind.js +++ b/__tests__/lib/infer/kind.js @@ -1,8 +1,6 @@ -'use strict'; /*eslint-disable no-unused-vars*/ -var test = require('tap').test, - inferKind = require('../../../lib/infer/kind'), - parse = require('../../../lib/parsers/javascript'); +var inferKind = require('../../../src/infer/kind'), + parse = require('../../../src/parsers/javascript'); function toComment(fn, filename) { return parse( @@ -14,128 +12,100 @@ function toComment(fn, filename) { )[0]; } -test('inferKind', function(t) { - t.equal( +test('inferKind', function() { + expect( inferKind({ kind: 'class', tags: [] - }).kind, - 'class', - 'explicit' - ); + }).kind + ).toBe('class'); - t.equal( - inferKind(toComment('/**' + ' * Class' + ' */' + 'class C {}')).kind, - 'class', - 'es6 syntax' - ); + expect( + inferKind(toComment('/**' + ' * Class' + ' */' + 'class C {}')).kind + ).toBe('class'); - t.equal( + expect( inferKind( toComment('/**' + ' * Exported class' + ' */' + 'export class C {}') - ).kind, - 'class', - 'es6 syntax with export' - ); + ).kind + ).toBe('class'); - t.equal( + expect( inferKind( toComment( '/**' + ' * Export default class' + ' */' + 'export default class C {}' ) - ).kind, - 'class', - 'es6 syntax with default export' - ); + ).kind + ).toBe('class'); - t.equal( + expect( inferKind( toComment(function() { /** function */ function foo() {} foo(); }) - ).kind, - 'function', - 'inferred function' - ); + ).kind + ).toBe('function'); - t.equal( + expect( inferKind( toComment(function() { /** function */ var foo = function() {}; foo(); }) - ).kind, - 'function', - 'inferred var function' - ); + ).kind + ).toBe('function'); - t.equal( + expect( inferKind( toComment('/** Exported function */' + 'export function foo() {}') - ).kind, - 'function', - 'inferred exported function' - ); + ).kind + ).toBe('function'); - t.equal( + expect( inferKind( toComment( '/** Export default function */' + 'export default function foo() {}' ) - ).kind, - 'function', - 'inferred exported function' - ); + ).kind + ).toBe('function'); - t.equal( - inferKind(toComment('class Foo { /** set b */ set b(v) { } }')).kind, - 'member', - 'member via set' - ); + expect( + inferKind(toComment('class Foo { /** set b */ set b(v) { } }')).kind + ).toBe('member'); - t.equal( - inferKind(toComment('var foo = { /** thing */ b: function(v) { } }')).kind, - 'function', - 'function via set' - ); + expect( + inferKind(toComment('var foo = { /** thing */ b: function(v) { } }')).kind + ).toBe('function'); - t.equal( - inferKind(toComment('class Foo { /** get b */ get b() { } }')).kind, - 'member', - 'member via get' - ); + expect( + inferKind(toComment('class Foo { /** get b */ get b() { } }')).kind + ).toBe('member'); - t.equal( - inferKind(toComment('class Foo { /** b */ b(v) { } }')).kind, - 'function', - 'normal function as part of class' + expect(inferKind(toComment('class Foo { /** b */ b(v) { } }')).kind).toBe( + 'function' ); - t.equal( + expect( inferKind( toComment(function() { /** class */ function Foo() {} }) - ).kind, - 'class', - 'class via uppercase' - ); + ).kind + ).toBe('class'); - t.equal( + expect( inferKind( toComment(function() { /** undefined */ }) - ).kind, - undefined, - 'undetectable' - ); + ).kind + ).toBe(undefined); - t.equal( + expect( inferKind( toComment( '/**' + @@ -143,20 +113,14 @@ test('inferKind', function(t) { ' */' + 'const foo = "bar";' ) - ).kind, - 'constant', - 'constant via const' - ); + ).kind + ).toBe('constant'); - t.equal( + expect( inferKind( toComment( '/**' + ' * Exported constant' + ' */' + 'export const foo = "bar";' ) - ).kind, - 'constant', - 'constant via export const' - ); - - t.end(); + ).kind + ).toBe('constant'); }); diff --git a/test/lib/infer/membership.js b/__tests__/lib/infer/membership.js similarity index 56% rename from test/lib/infer/membership.js rename to __tests__/lib/infer/membership.js index f20750709..20bf78d60 100644 --- a/test/lib/infer/membership.js +++ b/__tests__/lib/infer/membership.js @@ -1,8 +1,5 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - inferMembership = require('../../../lib/infer/membership')(); +var parse = require('../../../src/parsers/javascript'), + inferMembership = require('../../../src/infer/membership')(); function toComment(fn, file) { return parse( @@ -15,15 +12,12 @@ function toComment(fn, file) { } function pick(obj, props) { - return props.reduce( - function(memo, prop) { - if (obj[prop] !== undefined) { - memo[prop] = obj[prop]; - } - return memo; - }, - {} - ); + return props.reduce(function(memo, prop) { + if (obj[prop] !== undefined) { + memo[prop] = obj[prop]; + } + return memo; + }, {}); } function evaluate(fn, file) { @@ -33,120 +27,106 @@ function evaluate(fn, file) { function Foo() {} function lend() {} -test('inferMembership - explicit', function(t) { - t.deepEqual( +test('inferMembership - explicit', function() { + expect( pick( evaluate(function() { /** - * Test - * @memberof Bar - * @static - */ + * Test + * @memberof Bar + * @static + */ Foo.bar = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Bar', - scope: 'static' - }, - 'explicit, static' - ); + ) + ).toEqual({ + memberof: 'Bar', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** - * Test - * @memberof Bar# - */ + * Test + * @memberof Bar# + */ Foo.bar = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Bar', - scope: 'instance' - }, - 'explicit, instance' - ); + ) + ).toEqual({ + memberof: 'Bar', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** - * Test - * @memberof Bar.prototype - */ + * Test + * @memberof Bar.prototype + */ Foo.bar = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Bar', - scope: 'instance' - }, - 'explicit, prototype' - ); + ) + ).toEqual({ + memberof: 'Bar', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** Test */ Foo.bar = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'static' - }, - 'implicit' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** Test */ Foo.prototype.bar = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'instance' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** Test */ Foo.bar.baz = 0; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo.bar', - scope: 'static' - }, - 'compound' - ); + ) + ).toEqual({ + memberof: 'Foo.bar', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** Test */ (0).baz = 0; })[0], ['memberof', 'scope'] - ), - {}, - 'unknown' - ); + ) + ).toEqual({}); - t.deepEqual( + expect( pick( evaluate(function() { Foo.bar = { @@ -155,15 +135,13 @@ test('inferMembership - explicit', function(t) { }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo.bar', - scope: 'static' - }, - 'static object assignment' - ); + ) + ).toEqual({ + memberof: 'Foo.bar', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { Foo.prototype = { @@ -172,54 +150,48 @@ test('inferMembership - explicit', function(t) { }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'instance object assignment' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); /* eslint object-shorthand: 0 */ - t.deepEqual( + expect( pick( evaluate(function() { Foo.prototype = { /** - * Test - */ + * Test + */ bar: function() {} }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'instance object assignment, function' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { Foo.prototype = { /** - * Test - */ + * Test + */ bar() {} }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'instance object assignment, shorthand function' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { var Foo = { @@ -229,15 +201,13 @@ test('inferMembership - explicit', function(t) { return Foo; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'static' - }, - 'variable object assignment' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { var Foo = { @@ -247,15 +217,13 @@ test('inferMembership - explicit', function(t) { return Foo; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'static' - }, - 'variable object assignment, function' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { function Foo() { @@ -266,15 +234,13 @@ test('inferMembership - explicit', function(t) { } })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'constructor function declaration assignment' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { var Foo = function Bar() { @@ -285,15 +251,13 @@ test('inferMembership - explicit', function(t) { }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'constructor function expression assignment' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { class Foo { @@ -306,30 +270,26 @@ test('inferMembership - explicit', function(t) { } })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'constructor assignment' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { /** Test */ module.exports = function() {}; })[0], ['memberof', 'scope'] - ), - { - memberof: 'module', - scope: 'static' - }, - 'simple' - ); + ) + ).toEqual({ + memberof: 'module', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { lend( @@ -340,15 +300,13 @@ test('inferMembership - explicit', function(t) { ); })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'static' - }, - 'lends, static' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { lend( @@ -359,15 +317,13 @@ test('inferMembership - explicit', function(t) { ); })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'static' - }, - 'inferMembership - lends, static, function' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'static' + }); - t.deepEqual( + expect( pick( evaluate(function() { lend( @@ -378,14 +334,13 @@ test('inferMembership - explicit', function(t) { ); })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - } - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate(function() { lend( @@ -396,13 +351,11 @@ test('inferMembership - explicit', function(t) { ); })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - }, - 'inferMembership - lends, instance, function' - ); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); // t.deepEqual(pick(evaluate(function () { // /** Foo */ @@ -418,247 +371,210 @@ test('inferMembership - explicit', function(t) { // scope: 'static' // }, 'inferMembership - revealing, static, function'); - t.equal( + expect( evaluate(function() { lend(/** @lends Foo */ {}); /** Test */ - })[0].memberof, - undefined, - 'inferMembership - lends applies only to following object' - ); - - t.end(); + })[0].memberof + ).toBe(undefined); }); -test('inferMembership - exports', function(t) { - t.equal( +test('inferMembership - exports', function() { + expect( evaluate(function() { /** @module mod */ /** foo */ exports.foo = 1; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** foo */ exports.foo = function() {}; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** bar */ exports.foo.bar = 1; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ exports.foo = { /** bar */ bar: 1 }; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ exports.foo = { /** bar */ bar() {} }; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** bar */ exports.foo.prototype.bar = function() {}; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ exports.foo.prototype = { /** bar */ bar() {} }; - })[1].memberof, - 'mod.foo' - ); - - t.end(); + })[1].memberof + ).toBe('mod.foo'); }); -test('inferMembership - module.exports', function(t) { - t.equal( +test('inferMembership - module.exports', function() { + expect( evaluate(function() { /** @module mod */ /** foo */ module.exports.foo = 1; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** foo */ module.exports.foo = function() {}; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** bar */ module.exports.foo.bar = 1; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ module.exports.foo = { /** bar */ bar: 1 }; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ module.exports.foo = { /** bar */ bar() {} }; - })[1].memberof, - 'mod.foo' - ); + })[1].memberof + ).toBe('mod.foo'); - t.equal( + expect( evaluate(function() { /** @module mod */ /** bar */ module.exports.prototype.bar = function() {}; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** @module mod */ module.exports.prototype = { /** bar */ bar() {} }; - })[1].memberof, - 'mod' - ); + })[1].memberof + ).toBe('mod'); - t.equal( + expect( evaluate(function() { /** - * @module mod - * @name exports - */ + * @module mod + * @name exports + */ module.exports = 1; - })[0].memberof, - undefined - ); + })[0].memberof + ).toBe(undefined); - t.equal( + expect( evaluate(function() { /** - * @module mod - * @name exports - */ + * @module mod + * @name exports + */ module.exports = function() {}; - })[0].memberof, - undefined - ); + })[0].memberof + ).toBe(undefined); - t.equal( + expect( evaluate(function() { /** @module mod */ module.exports = { /** foo */ foo: 1 }; - })[1].memberof, - 'mod' - ); - - t.end(); + })[1].memberof + ).toBe('mod'); }); -test('inferMembership - not module exports', function(t) { - var result = evaluate( - function() { - /** +test('inferMembership - not module exports', function() { + var result = evaluate(function() { + /** * @module mod */ - /** Test */ - global.module.exports.foo = 1; - }, - '/path/mod.js' - ); + /** Test */ + global.module.exports.foo = 1; + }, '/path/mod.js'); - t.equal(result.length, 2); - t.notEqual(result[0].memberof, 'mod'); - t.end(); + expect(result.length).toBe(2); + expect(result[0].memberof).not.toBe('mod'); }); -test('inferMembership - anonymous @module', function(t) { - var result = evaluate( - function() { - /** +test('inferMembership - anonymous @module', function() { + var result = evaluate(function() { + /** * @module */ - /** Test */ - exports.foo = 1; - }, - '/path/mod.js' - ); + /** Test */ + exports.foo = 1; + }, '/path/mod.js'); - t.equal(result.length, 2); - t.equal(result[1].memberof, 'mod'); - t.end(); + expect(result.length).toBe(2); + expect(result[1].memberof).toBe('mod'); }); -test('inferMembership - no @module', function(t) { - var result = evaluate( - function() { - /** Test */ - exports.foo = 1; - }, - '/path/mod.js' - ); +test('inferMembership - no @module', function() { + var result = evaluate(function() { + /** Test */ + exports.foo = 1; + }, '/path/mod.js'); - t.equal(result.length, 1); - t.equal(result[0].memberof, 'mod'); - t.end(); + expect(result.length).toBe(1); + expect(result[0].memberof).toBe('mod'); }); -test('inferMembership - https://github.com/documentationjs/documentation/issues/378', function(t) { - t.deepEqual( +test('inferMembership - https://github.com/documentationjs/documentation/issues/378', function() { + expect( pick( evaluate(function() { Foo.prototype = { @@ -670,58 +586,50 @@ test('inferMembership - https://github.com/documentationjs/documentation/issues/ }; })[0], ['memberof', 'scope'] - ), - { - memberof: 'Foo', - scope: 'instance' - } - ); - - t.end(); + ) + ).toEqual({ + memberof: 'Foo', + scope: 'instance' + }); }); -test('inferMembership - export', function(t) { - t.deepEqual( +test('inferMembership - export', function() { + expect( pick( evaluate( 'export default class {' + ' /** */' + ' method() {}' + '}', 'test-file' )[0], ['memberof', 'scope'] - ), - { - memberof: 'test-file', - scope: 'instance' - } - ); + ) + ).toEqual({ + memberof: 'test-file', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate( 'export default class C {' + ' /** */' + ' method() {}' + '}', 'test-file' )[0], ['memberof', 'scope'] - ), - { - memberof: 'C', - scope: 'instance' - } - ); + ) + ).toEqual({ + memberof: 'C', + scope: 'instance' + }); - t.deepEqual( + expect( pick( evaluate( 'export class C {' + ' /** */' + ' method() {}' + '}', 'test-file' )[0], ['memberof', 'scope'] - ), - { - memberof: 'C', - scope: 'instance' - } - ); - - t.end(); + ) + ).toEqual({ + memberof: 'C', + scope: 'instance' + }); }); diff --git a/test/lib/infer/name.js b/__tests__/lib/infer/name.js similarity index 56% rename from test/lib/infer/name.js rename to __tests__/lib/infer/name.js index eb1851c29..a07a46c8b 100644 --- a/test/lib/infer/name.js +++ b/__tests__/lib/infer/name.js @@ -1,8 +1,5 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - inferName = require('../../../lib/infer/name'); +var parse = require('../../../src/parsers/javascript'), + inferName = require('../../../src/infer/name'); function toComment(fn, file) { return parse( @@ -18,8 +15,8 @@ function evaluate(fn, file) { return inferName(toComment(fn, file)); } -test('inferName', function(t) { - t.equal( +test('inferName', function() { + expect( evaluate(function() { // ExpressionStatement (comment attached here) // AssignmentExpression @@ -27,12 +24,10 @@ test('inferName', function(t) { // Identifier /** Test */ exports.name = test; - }).name, - 'name', - 'expression statement' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { // ExpressionStatement // AssignmentExpression @@ -40,12 +35,10 @@ test('inferName', function(t) { // FunctionExpression /** Test */ exports.name = function() {}; - }).name, - 'name', - 'expression statement, function' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { exports = { // Property (comment attached here) @@ -54,12 +47,10 @@ test('inferName', function(t) { /** Test */ name: test }; - }).name, - 'name', - 'property' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { exports = { // Property @@ -68,178 +59,139 @@ test('inferName', function(t) { /** Test */ name() {} }; - }).name, - 'name', - 'property, function' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { /** Test */ function name() {} - }).name, - 'name', - 'function declaration' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { /** Test */ var name = function() {}; - }).name, - 'name', - 'anonymous function expression' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { /** Test */ var name = function name2() {}; - }).name, - 'name', - 'named function expression' - ); + }).name + ).toBe('name'); - t.equal( + expect( evaluate(function() { /** @name explicitName */ function implicitName() {} - }).name, - 'explicitName', - 'explicit name' - ); + }).name + ).toBe('explicitName'); - t.equal( + expect( evaluate(function() { /** @alias explicitAlias */ function implicitName() {} - }).name, - 'explicitAlias', - 'explicit alias' - ); + }).name + ).toBe('explicitAlias'); - t.equal( + expect( evaluate(function() { /** @class ExplicitClass */ function ImplicitClass() {} - }).name, - 'ExplicitClass', - 'explicit class' - ); + }).name + ).toBe('ExplicitClass'); - t.equal( + expect( evaluate(function() { /** @class */ function ImplicitClass() {} - }).name, - 'ImplicitClass', - 'anonymous class' - ); + }).name + ).toBe('ImplicitClass'); - t.equal( + expect( evaluate(function() { /** @event explicitEvent */ function implicitName() {} - }).name, - 'explicitEvent', - 'explicitEvent' - ); + }).name + ).toBe('explicitEvent'); - t.equal( + expect( evaluate(function() { /** @typedef {Object} ExplicitTypedef */ function implicitName() {} - }).name, - 'ExplicitTypedef', - 'ExplicitTypedef' - ); + }).name + ).toBe('ExplicitTypedef'); - t.equal( + expect( evaluate(function() { /** @callback explicitCallback */ function implicitName() {} - }).name, - 'explicitCallback', - 'explicitCallback' - ); + }).name + ).toBe('explicitCallback'); - t.equal( + expect( evaluate(function() { /** @module explicitModule */ function implicitName() {} - }).name, - 'explicitModule' - ); + }).name + ).toBe('explicitModule'); - t.equal( + expect( evaluate(function() { /** @module {Function} explicitModule */ function implicitName() {} - }).name, - 'explicitModule' - ); + }).name + ).toBe('explicitModule'); - t.equal( - evaluate( - function() { - /** @module */ - function implicitName() {} - }, - '/path/inferred-from-file.js' - ).name, - 'inferred-from-file' - ); + expect( + evaluate(function() { + /** @module */ + function implicitName() {} + }, '/path/inferred-from-file.js').name + ).toBe('inferred-from-file'); - t.equal( - evaluate( - function() { - /** @module */ - }, - '/path/inferred-from-file.js' - ).name, - 'inferred-from-file' - ); + expect( + evaluate(function() { + /** @module */ + }, '/path/inferred-from-file.js').name + ).toBe('inferred-from-file'); - t.equal( - evaluate('/** Test */ export function exported() {}').name, + expect(evaluate('/** Test */ export function exported() {}').name).toBe( 'exported' ); - t.equal( + expect( evaluate( '/** Test */ export default function() {}', '/path/inferred-from-file.js' - ).name, - 'inferred-from-file' - ); + ).name + ).toBe('inferred-from-file'); - t.equal( + expect( evaluate( '/** Test */ export default function exported() {}', '/path/inferred-from-file.js' - ).name, - 'exported' - ); + ).name + ).toBe('exported'); - t.equal(evaluate('/** Test */ export var life = 42;').name, 'life'); + expect(evaluate('/** Test */ export var life = 42;').name).toBe('life'); - t.equal(evaluate('/** Test */ export class Wizard {}').name, 'Wizard'); + expect(evaluate('/** Test */ export class Wizard {}').name).toBe('Wizard'); - t.equal( + expect( evaluate( '/** Test */ export default class Warlock {}', '/path/inferred-from-file.js' - ).name, - 'Warlock' - ); + ).name + ).toBe('Warlock'); - t.equal( + expect( evaluate( '/** Test */ export default class {}', '/path/inferred-from-file.js' - ).name, - 'inferred-from-file' - ); - - t.end(); + ).name + ).toBe('inferred-from-file'); }); diff --git a/__tests__/lib/infer/params.js b/__tests__/lib/infer/params.js new file mode 100644 index 000000000..01eba07d3 --- /dev/null +++ b/__tests__/lib/infer/params.js @@ -0,0 +1,166 @@ +var parse = require('../../../src/parsers/javascript'), + inferParams = require('../../../src/infer/params'); + +function toComment(fn, file) { + return parse( + { + file, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; +} + +function evaluate(fn, file) { + return inferParams(toComment(fn, file)); +} + +test('mergeTrees', function() { + expect( + inferParams.mergeTrees( + [], + [ + { + title: 'param', + description: 'First arg!', + name: 'a', + type: { + type: 'NameExpression', + name: 'string' + } + } + ] + ) + ).toMatchSnapshot(); + + expect( + inferParams.mergeTrees( + [ + { + title: 'param', + name: '$0', + anonymous: true, + parameterIndex: 0, + type: { + type: 'NameExpression', + name: 'object' + }, + properties: [ + { + title: 'param', + name: '$0.a', + parameterIndex: 0, + type: { + type: 'NameExpression', + name: 'string' + }, + properties: [] + } + ] + } + ], + [ + { + title: 'param', + description: 'First arg!', + name: 'a', + type: { + type: 'NameExpression', + name: 'object' + } + } + ] + ) + ).toMatchSnapshot(); +}); + +test('inferParams', function() { + expect( + evaluate(function() { + /** Test */ + function f(x) {} + }).params + ).toEqual([{ lineNumber: 3, name: 'x', title: 'param' }]); + + expect( + evaluate(function() { + /** Test */ + var f = function(x) {}; + }).params + ).toEqual([{ lineNumber: 3, name: 'x', title: 'param' }]); + + expect( + evaluate(`/** Test */function f({ x, ...xs }) {};`).params + ).toMatchSnapshot(); + + expect( + evaluate( + ` + /** + * Test + * @param {Object} a renamed destructuring param + */ + var f = function({ x }) {}; + ` + ).params + ).toMatchSnapshot(); + + expect(evaluate('/** Test */ var f = (x) => {}').params).toEqual([ + { lineNumber: 1, name: 'x', title: 'param' } + ]); + + expect( + evaluate(function() { + var x = 1, + g = function(y) {}, + /** Test */ + f = function(x) {}; + }).params + ).toEqual([{ lineNumber: 5, name: 'x', title: 'param' }]); + + expect( + evaluate( + ` + /** Test */ + function f(x = 4) {} + ` + ).params + ).toMatchSnapshot(); + + expect( + evaluate( + ` + /** Test + * @param {number} x + */ + function f(x = 4) {} + ` + ).params + ).toMatchSnapshot(); + + expect( + evaluate( + ` + /** Test */ + function f({ x: y }) {} + ` + ).params + ).toMatchSnapshot(); + + expect( + evaluate( + ` + /** Test */ + function f({ x: { y: { z } } }) {} + ` + ).params + ).toMatchSnapshot(); + + expect(evaluate('/** Test */ export function f(x) {}').params).toEqual([ + { lineNumber: 1, name: 'x', title: 'param' } + ]); + + expect( + evaluate('/** Test */ export default function f(x) {}').params + ).toEqual([{ lineNumber: 1, name: 'x', title: 'param' }]); +}); diff --git a/test/lib/infer/type.js b/__tests__/lib/infer/type.js similarity index 52% rename from test/lib/infer/type.js rename to __tests__/lib/infer/type.js index 0a72e4e1d..4832d9d1c 100644 --- a/test/lib/infer/type.js +++ b/__tests__/lib/infer/type.js @@ -1,9 +1,6 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - inferKind = require('../../../lib/infer/kind'), - inferType = require('../../../lib/infer/type'); +var parse = require('../../../src/parsers/javascript'), + inferKind = require('../../../src/infer/kind'), + inferType = require('../../../src/infer/type'); function toComment(code) { return parse( @@ -18,18 +15,18 @@ function evaluate(code) { return inferType(inferKind(toComment(code))); } -test('inferType', function(t) { - t.deepEqual(evaluate('/** @typedef {T} V */').type, { +test('inferType', function() { + expect(evaluate('/** @typedef {T} V */').type).toEqual({ name: 'T', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'type V = T').type, { + expect(evaluate('/** */' + 'type V = T').type).toEqual({ name: 'T', type: 'NameExpression' }); - t.deepEqual(evaluate('/** @typedef {Array} V */').type, { + expect(evaluate('/** @typedef {Array} V */').type).toEqual({ applications: [ { name: 'T', @@ -43,7 +40,7 @@ test('inferType', function(t) { type: 'TypeApplication' }); - t.deepEqual(evaluate('/** */' + 'type V = Array').type, { + expect(evaluate('/** */' + 'type V = Array').type).toEqual({ applications: [ { name: 'T', @@ -57,45 +54,43 @@ test('inferType', function(t) { type: 'TypeApplication' }); - t.deepEqual(evaluate('/** */' + 'var x: number').type, { + expect(evaluate('/** */' + 'var x: number').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'let x: number').type, { + expect(evaluate('/** */' + 'let x: number').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'const x: number = 42;').type, { + expect(evaluate('/** */' + 'const x: number = 42;').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('let x,' + '/** */' + 'y: number').type, { + expect(evaluate('let x,' + '/** */' + 'y: number').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('class C {' + '/** */' + 'x: number;' + '}').type, { + expect(evaluate('class C {' + '/** */' + 'x: number;' + '}').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'const x = 42;').type, { + expect(evaluate('/** */' + 'const x = 42;').type).toEqual({ name: 'number', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'const x = "abc";').type, { + expect(evaluate('/** */' + 'const x = "abc";').type).toEqual({ name: 'string', type: 'NameExpression' }); - t.deepEqual(evaluate('/** */' + 'const x = true;').type, { + expect(evaluate('/** */' + 'const x = true;').type).toEqual({ name: 'boolean', type: 'NameExpression' }); - - t.end(); }); diff --git a/__tests__/lib/input/shallow.js b/__tests__/lib/input/shallow.js new file mode 100644 index 000000000..9e075b889 --- /dev/null +++ b/__tests__/lib/input/shallow.js @@ -0,0 +1,46 @@ +var path = require('path'), shallow = require('../../../src/input/shallow'); + +test('shallow deps', async function() { + const deps = await shallow( + [path.resolve(path.join(__dirname, '../../fixture/es6.input.js'))], + {} + ); + expect(deps.length).toBe(1); + expect(deps[0]).toBeTruthy(); +}); + +test('shallow deps multi', async function() { + const deps = await shallow( + [ + path.resolve(path.join(__dirname, '../../fixture/es6.input.js')), + path.resolve(path.join(__dirname, '../../fixture/simple.input.js')) + ], + {} + ); + expect(deps.length).toBe(2); + expect(deps[0]).toBeTruthy(); +}); + +test('shallow deps directory', async function() { + const deps = await shallow( + [path.resolve(path.join(__dirname, '../../fixture/html'))], + {} + ); + expect(deps.length).toBe(1); + expect(deps[0].file.match(/input.js/)).toBeTruthy(); +}); + +test('throws on non-string or object input', function() { + return shallow([true], {}).catch(err => { + expect(err.message).toBe('Indexes should be either strings or objects'); + }); +}); + +test('shallow deps literal', async function() { + var obj = { + file: 'foo.js', + source: '//bar' + }; + const deps = await shallow([obj], {}); + expect(deps[0]).toBe(obj); +}); diff --git a/__tests__/lib/lint.js b/__tests__/lib/lint.js new file mode 100644 index 000000000..0f035b480 --- /dev/null +++ b/__tests__/lib/lint.js @@ -0,0 +1,74 @@ +var parse = require('../../src/parsers/javascript'), + lintComments = require('../../src/lint').lintComments, + formatLint = require('../../src/lint').formatLint; + +function toComment(fn, filename) { + return parse( + { + file: filename, + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + )[0]; +} + +function evaluate(fn) { + return lintComments(toComment(fn, 'input.js')); +} + +test('lintComments', function() { + expect( + evaluate(function() { + /** + * @param {foo + */ + }).errors + ).toEqual([ + { message: 'Braces are not balanced' }, + { message: 'Missing or invalid tag name' } + ]); + + expect( + evaluate(function() { + /** + * @param {String} foo + * @param {array} bar + */ + }).errors + ).toEqual([ + { + commentLineNumber: 1, + message: 'type String found, string is standard' + }, + { commentLineNumber: 2, message: 'type array found, Array is standard' } + ]); + + expect( + evaluate(function() { + /** + * @param {string} foo + */ + }).errors + ).toEqual([]); +}); + +test('formatLint', function() { + var comment = evaluate(function() { + // 2 + // 3 + /** 4 + * @param {String} foo + * @param {array} bar + * @param {foo + */ + }); + + var formatted = formatLint([comment]); + + expect(formatted.match(/input.js/g)); + expect(formatted.match(/4:1[^\n]+Braces are not balanced/g)); + expect(formatted.match(/4:1[^\n]+Missing or invalid tag name/g)); + expect(formatted.match(/5:1[^\n]+type String found, string is standard/g)); + expect(formatted.match(/6:1[^\n]+type array found, Array is standard/g)); + expect(formatted.match(/4 warnings/g)); +}); diff --git a/test/lib/merge_config.js b/__tests__/lib/merge_config.js similarity index 82% rename from test/lib/merge_config.js rename to __tests__/lib/merge_config.js index 4dd14ae54..45a42836a 100644 --- a/test/lib/merge_config.js +++ b/__tests__/lib/merge_config.js @@ -1,18 +1,16 @@ -'use strict'; - -var test = require('tap').test, - path = require('path'), +var path = require('path'), _ = require('lodash'), - mergeConfig = require('../../lib/merge_config'); + mergeConfig = require('../../src/merge_config'); -test('bad config', function(t) { - mergeConfig({ config: 'DOES-NOT-EXIST' }).catch(err => { - t.ok(err); - t.end(); - }); +test('bad config', async function() { + try { + await mergeConfig({ config: 'DOES-NOT-EXIST' }); + } catch (err) { + expect(err).toBeTruthy(); + } }); -test('nc(mergeConfig)', function(t) { +test('nc(mergeConfig)', function(done) { // Omit configuration from output, for simplicity var nc = _.curryRight(_.omit, 2)([ 'config', @@ -73,9 +71,10 @@ test('nc(mergeConfig)', function(t) { mergeConfig(Object.assign(pair[0], { 'no-package': true })) .then(nc) .then(res => { - t.deepEqual(res, pair[1]); - })) + expect(res).toEqual(pair[1]); + }) + ) ).then(res => { - t.end(); + done(); }); }); diff --git a/test/lib/nest.js b/__tests__/lib/nest.js similarity index 70% rename from test/lib/nest.js rename to __tests__/lib/nest.js index fb603cabd..40469949f 100644 --- a/test/lib/nest.js +++ b/__tests__/lib/nest.js @@ -1,20 +1,16 @@ -'use strict'; - -var test = require('tap').test; -var nestTag = require('../../lib/nest').nestTag; +var nestTag = require('../../src/nest').nestTag; // Print a tree of tags in a way that's easy to test. -var printTree = indent => - node => - `${new Array(indent + 1).join(' ')}- ${node.name}${node.properties ? '\n' : ''}${(node.properties || [ - ]) - .map(printTree(indent + 1)) - .join('\n')}`; +var printTree = indent => node => + `${new Array(indent + 1).join(' ')}- ${node.name}${node.properties ? '\n' : ''}${(node.properties || [ + ]) + .map(printTree(indent + 1)) + .join('\n')}`; var printNesting = params => printTree(0)({ properties: nestTag(params), name: 'root' }); -test('nest params - basic', function(t) { +test('nest params - basic', function() { var params = [ 'foo', 'foo.bar', @@ -22,8 +18,7 @@ test('nest params - basic', function(t) { 'foo.third', 'foo.third[].baz' ].map(name => ({ name })); - t.equal( - printNesting(params), + expect(printNesting(params)).toBe( `- root - foo - foo.bar @@ -31,30 +26,26 @@ test('nest params - basic', function(t) { - foo.third - foo.third[].baz` ); - t.end(); }); -test('nest params - multiple roots', function(t) { +test('nest params - multiple roots', function() { var params = ['a', 'b', 'c'].map(name => ({ name })); - t.equal( - printNesting(params), + expect(printNesting(params)).toBe( `- root - a - b - c` ); - t.end(); }); -test('nest params - missing parent', function(t) { +test('nest params - missing parent', function() { var params = ['foo', 'foo.bar.third'].map(name => ({ name })); - t.throws(() => { + expect(() => { nestTag(params); - }); - t.end(); + }).toThrow(); }); -test('nest params - #658', function(t) { +test('nest params - #658', function() { var params = [ 'state', 'payload', @@ -65,8 +56,7 @@ test('nest params - #658', function(t) { 'payload.output_meter_levels[].peak', 'payload.output_meter_levels[].rms' ].map(name => ({ name })); - t.equal( - printNesting(params), + expect(printNesting(params)).toBe( `- root - state - payload @@ -77,10 +67,9 @@ test('nest params - #658', function(t) { - payload.output_meter_levels[].peak - payload.output_meter_levels[].rms` ); - t.end(); }); -test('nest params - #554', function(t) { +test('nest params - #554', function() { var params = [ 'x', 'yIn', @@ -96,8 +85,7 @@ test('nest params - #554', function(t) { 'options.boundaries', 'options.derivativeThreshold' ].map(name => ({ name })); - t.equal( - printNesting(params), + expect(printNesting(params)).toBe( `- root - x - yIn @@ -113,5 +101,4 @@ test('nest params - #554', function(t) { - options.boundaries - options.derivativeThreshold` ); - t.end(); }); diff --git a/__tests__/lib/output/util/formatters.js b/__tests__/lib/output/util/formatters.js new file mode 100644 index 000000000..3861e12c4 --- /dev/null +++ b/__tests__/lib/output/util/formatters.js @@ -0,0 +1,56 @@ +var formatters = require('../../../../src/output/util/formatters')(getHref); + +test('formatters.parameters -- long form', function() { + expect(formatters.parameters({})).toEqual('()'); + expect(formatters.parameters({ params: [] })).toEqual('()'); + expect(formatters.parameters({ params: [{ name: 'foo' }] })).toEqual( + '(foo: any)' + ); + expect( + formatters.parameters({ + params: [{ name: 'foo', type: { type: 'OptionalType' } }] + }) + ).toEqual('(foo: any?)'); +}); + +test('formatters.parameters -- short form', function() { + expect(formatters.parameters({}, true)).toEqual('()'); + expect(formatters.parameters({ params: [] }, true)).toEqual('()'); + expect(formatters.parameters({ params: [{ name: 'foo' }] }, true)).toEqual( + '(foo)' + ); + expect( + formatters.parameters( + { + params: [{ name: 'foo', type: { type: 'OptionalType' } }] + }, + true + ) + ).toEqual('(foo?)'); + expect( + formatters.parameters( + { + params: [ + { + title: 'param', + description: 'param', + type: { + type: 'OptionalType', + expression: { + type: 'NameExpression', + name: 'number' + } + }, + name: 'bar', + default: '1' + } + ] + }, + true + ) + ).toEqual('(bar = 1)'); +}); + +function getHref(x) { + return x; +} diff --git a/__tests__/lib/parse.js b/__tests__/lib/parse.js new file mode 100644 index 000000000..2349ec8ff --- /dev/null +++ b/__tests__/lib/parse.js @@ -0,0 +1,1142 @@ +var parse = require('../../src/parsers/javascript'), + remark = require('remark'), + visit = require('unist-util-visit'); + +function pick(obj, props) { + if (Array.isArray(props)) { + return props.reduce(function(memo, prop) { + if (obj[prop] !== undefined) { + memo[prop] = obj[prop]; + } + return memo; + }, {}); + } + return obj[props]; +} + +function evaluate(fn, filename) { + return parse( + { + file: filename || 'test.js', + source: fn instanceof Function ? '(' + fn.toString() + ')' : fn + }, + {} + ); +} + +function addJSDocTag(tree) { + visit(tree, 'link', function(node) { + node.jsdoc = true; + }); + return tree; +} + +function removePosition(tree) { + visit(tree, function(node) { + delete node.position; + }); + return tree; +} + +test('parse - @abstract', function() { + expect( + evaluate(function() { + /** @abstract */ + })[0].abstract + ).toBe(true); +}); + +test('parse - @access', function() { + expect( + evaluate(function() { + /** @access public */ + })[0].access + ).toBe('public'); + + expect( + evaluate(function() { + /** @access protected */ + })[0].access + ).toBe('protected'); + + expect( + evaluate(function() { + /** @access private */ + })[0].access + ).toBe('private'); +}); + +test('parse - @alias', function() {}); + +test('parse - @arg', function() {}); + +test('parse - @argument', function() {}); + +test('parse - @augments', function() { + expect( + evaluate(function() { + /** @augments Foo */ + })[0].augments[0].name + ).toBe('Foo'); +}); + +test('parse - @description', function() { + expect( + evaluate(function() { + /** + * This is a free-form description + * @description This tagged description wins, and [is markdown](http://markdown.com). + */ + })[0].description + ).toEqual( + remark().parse( + 'This tagged description wins, and [is markdown](http://markdown.com).' + ) + ); +}); + +/* + * Dossier-style augments tag + * https://github.com/google/closure-library/issues/746 + */ +test('parse - @augments in dossier style', function() { + expect( + evaluate(function() { + /** @augments {Foo} */ + })[0].augments[0].name + ).toBe('Foo'); +}); + +test('parse - @augments of complex passes through', function() { + expect( + evaluate(function() { + /** @augments {function()} */ + })[0].augments + ).toEqual([]); +}); + +test('parse - @author', function() {}); + +test('parse - @borrows', function() {}); + +test('parse - @callback', function() { + expect( + pick( + evaluate(function() { + /** @callback name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + name: 'name', + kind: 'typedef', + type: { + type: 'NameExpression', + name: 'Function' + } + }); +}); + +test('parse - @class', function() { + expect( + pick( + evaluate(function() { + /** @class */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'class' + }); + + expect( + pick( + evaluate(function() { + /** @class name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + name: 'name', + kind: 'class' + }); + + expect( + pick( + evaluate(function() { + /** @class {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + name: 'name', + kind: 'class', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @classdesc', function() { + expect( + evaluate(function() { + /** @classdesc test */ + })[0].classdesc + ).toEqual(remark().parse('test')); +}); + +test('parse - @const', function() {}); + +test('parse - @constant', function() { + expect( + pick( + evaluate(function() { + /** @constant */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'constant' + }); + + expect( + pick( + evaluate(function() { + /** @constant name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'constant', + name: 'name' + }); + + expect( + pick( + evaluate(function() { + /** @constant {Object} */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'constant', + type: { + type: 'NameExpression', + name: 'Object' + } + }); + + expect( + pick( + evaluate(function() { + /** @constant {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'constant', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @constructor', function() {}); + +test('parse - @constructs', function() {}); + +test('parse - @copyright', function() { + expect( + evaluate(function() { + /** @copyright test */ + })[0].copyright + ).toEqual(remark().parse('test')); +}); + +test('parse - @default', function() {}); + +test('parse - @defaultvalue', function() {}); + +test('parse - @deprecated', function() { + expect( + evaluate(function() { + /** @deprecated test */ + })[0].deprecated + ).toEqual(remark().parse('test')); +}); + +test('parse - @desc', function() { + expect( + evaluate(function() { + /** @desc test */ + })[0].description + ).toEqual(remark().parse('test')); +}); + +test('parse - @description', function() { + expect( + evaluate(function() { + /** @description test */ + })[0].description + ).toEqual(remark().parse('test')); +}); + +test('parse - description', function() { + expect( + evaluate(function() { + /** test */ + })[0].description + ).toEqual(remark().parse('test')); +}); + +test('parse - @emits', function() {}); + +test('parse - @enum', function() {}); + +test('parse - @event', function() { + expect( + pick( + evaluate(function() { + /** @event name */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'event', + name: 'name' + }); +}); + +test('parse - @example', function() { + expect( + evaluate(function() { + /** @example test */ + })[0].examples[0] + ).toEqual({ + description: 'test' + }); + + expect( + evaluate(function() { + /** + * @example + * a + * b + */ + })[0].examples[0] + ).toEqual({ + description: 'a\nb' + }); + + expect( + evaluate(function() { + /** + * @example caption + * a + * b + */ + })[0].examples[0] + ).toEqual({ + description: 'a\nb', + caption: remark().parse('caption') + }); + + expect( + evaluate(function() { + /** @example */ + })[0].errors[0] + ).toEqual({ + message: '@example without code', + commentLineNumber: 0 + }); +}); + +test('parse - @exception', function() {}); + +test('parse - @exports', function() {}); + +test('parse - @extends', function() { + expect( + evaluate(function() { + /** @extends Foo */ + })[0].augments[0].name + ).toEqual('Foo'); +}); + +test('parse - @external', function() { + expect( + pick( + evaluate(function() { + /** @external name */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'external', + name: 'name' + }); +}); + +test('parse - @file', function() { + expect( + pick( + evaluate(function() { + /** @file */ + })[0], + ['kind'] + ) + ).toEqual({ + kind: 'file' + }); + + expect( + pick( + evaluate(function() { + /** @file desc */ + })[0], + ['kind', 'description'] + ) + ).toEqual({ + kind: 'file', + description: remark().parse('desc') + }); +}); + +test('parse - @fileoverview', function() {}); + +test('parse - @fires', function() {}); + +test('parse - @func', function() {}); + +test('parse - @function', function() { + expect( + pick( + evaluate(function() { + /** @function */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'function' + }); + + expect( + pick( + evaluate(function() { + /** @function name */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'function', + name: 'name' + }); +}); + +test('parse - @global', function() { + expect( + evaluate(function() { + /** @global */ + })[0].scope + ).toBe('global'); +}); + +test('parse - @host', function() {}); + +test('parse - @ignore', function() { + expect( + evaluate(function() { + /** @ignore */ + })[0].ignore + ).toBe(true); +}); + +test('parse - @implements', function() {}); + +test('parse - @inheritdoc', function() {}); + +test('parse - @inner', function() { + expect( + evaluate(function() { + /** @inner*/ + })[0].scope + ).toBe('inner'); +}); + +test('parse - @instance', function() { + expect( + evaluate(function() { + /** @instance*/ + })[0].scope + ).toBe('instance'); +}); + +test('parse - @interface', function() { + expect( + evaluate(function() { + /** @interface */ + })[0].interface + ).toEqual(true); + + expect( + evaluate(function() { + /** @interface Foo */ + })[0].name + ).toEqual('Foo'); +}); + +test('parse - @kind', function() { + expect( + evaluate(function() { + /** @kind class */ + })[0].kind + ).toBe('class'); +}); + +test('parse - @license', function() {}); + +test('parse - @listens', function() {}); + +test('parse - @member', function() { + expect( + pick( + evaluate(function() { + /** @member */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'member' + }); + + expect( + pick( + evaluate(function() { + /** @member name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'member', + name: 'name' + }); + + expect( + pick( + evaluate(function() { + /** @member {Object} */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'member', + type: { + type: 'NameExpression', + name: 'Object' + } + }); + + expect( + pick( + evaluate(function() { + /** @member {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'member', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @memberof', function() { + expect( + evaluate(function() { + /** @memberof test */ + })[0].memberof + ).toBe('test'); +}); + +test('parse - @method', function() {}); + +test('parse - @mixes', function() {}); + +test('parse - @mixin', function() { + expect( + pick( + evaluate(function() { + /** @mixin */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'mixin' + }); + + expect( + pick( + evaluate(function() { + /** @mixin name */ + })[0], + ['kind', 'name'] + ) + ).toEqual({ + kind: 'mixin', + name: 'name' + }); +}); + +test('parse - @module', function() { + expect( + pick( + evaluate(function() { + /** @module */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'module' + }); + + expect( + pick( + evaluate(function() { + /** @module name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'module', + name: 'name' + }); + + expect( + pick( + evaluate(function() { + /** @module {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'module', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @name', function() { + expect( + evaluate(function() { + /** @name test */ + })[0].name + ).toBe('test'); +}); + +test('parse - @namespace', function() { + expect( + pick( + evaluate(function() { + /** @namespace */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'namespace' + }); + + expect( + pick( + evaluate(function() { + /** @namespace name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'namespace', + name: 'name' + }); + + expect( + pick( + evaluate(function() { + /** @namespace {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'namespace', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @override', function() { + expect( + evaluate(function() { + /** @override */ + })[0].override + ).toBe(true); +}); + +test('parse - @overview', function() {}); + +test('parse - @param', function() { + expect( + evaluate(function() { + /** @param test */ + })[0].params[0] + ).toEqual({ + name: 'test', + title: 'param', + lineNumber: 0 + }); + + expect( + evaluate(function() { + /** @param {number} test */ + })[0].params[0] + ).toEqual({ + name: 'test', + title: 'param', + type: { + name: 'number', + type: 'NameExpression' + }, + lineNumber: 0 + }); + + expect( + evaluate(function() { + /** @param {number} test - desc */ + })[0].params[0] + ).toEqual({ + name: 'test', + title: 'param', + type: { + name: 'number', + type: 'NameExpression' + }, + description: remark().parse('desc'), + lineNumber: 0 + }); +}); + +test('parse - @private', function() { + expect( + evaluate(function() { + /** @private */ + })[0].access + ).toBe('private'); +}); + +test('parse - @prop', function() { + expect( + evaluate(function() { + /** @prop {number} test */ + })[0].properties[0] + ).toEqual({ + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + lineNumber: 0 + }); + + expect( + evaluate(function() { + /** @prop {number} test - desc */ + })[0].properties[0] + ).toEqual({ + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + description: remark().parse('desc'), + lineNumber: 0 + }); +}); + +test('parse - @property', function() { + expect( + evaluate(function() { + /** @property {number} test */ + })[0].properties[0] + ).toEqual({ + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + lineNumber: 0 + }); + + expect( + evaluate(function() { + /** @property {number} test - desc */ + })[0].properties[0] + ).toEqual({ + name: 'test', + title: 'property', + type: { + name: 'number', + type: 'NameExpression' + }, + description: remark().parse('desc'), + lineNumber: 0 + }); +}); + +test('parse - @protected', function() { + expect( + evaluate(function() { + /** @protected */ + })[0].access + ).toBe('protected'); +}); + +test('parse - @public', function() {}); + +test('parse - @readonly', function() { + expect( + evaluate(function() { + /** @readonly */ + })[0].readonly + ).toBe(true); +}); + +test('parse - @requires', function() {}); + +test('parse - @return', function() { + expect( + evaluate(function() { + /** @return test */ + })[0].returns[0] + ).toEqual({ + title: 'returns', + description: remark().parse('test') + }); + + expect( + evaluate(function() { + /** @return {number} test */ + })[0].returns[0] + ).toEqual({ + description: remark().parse('test'), + title: 'returns', + type: { + name: 'number', + type: 'NameExpression' + } + }); +}); + +test('parse - @returns', function() { + expect( + evaluate(function() { + /** @returns test */ + })[0].returns[0] + ).toEqual({ + title: 'returns', + description: remark().parse('test') + }); + + expect( + evaluate(function() { + /** @returns {number} test */ + })[0].returns[0] + ).toEqual({ + description: remark().parse('test'), + title: 'returns', + type: { + name: 'number', + type: 'NameExpression' + } + }); +}); + +test('parse - @see', function() { + expect( + evaluate(function() { + /** @see test */ + })[0].sees + ).toEqual([remark().parse('test')]); + + expect( + evaluate(function() { + /** + * @see a + * @see b + */ + })[0].sees + ).toEqual([remark().parse('a'), remark().parse('b')]); +}); + +test('parse - @since', function() {}); + +test('parse - @static', function() { + expect( + evaluate(function() { + /** @static */ + })[0].scope + ).toBe('static'); +}); + +test('parse - @summary', function() { + expect( + evaluate(function() { + /** @summary test */ + })[0].summary + ).toEqual(remark().parse('test')); +}); + +test('parse - @this', function() {}); + +test('parse - @throws', function() { + expect( + evaluate(function() { + /** @throws desc */ + })[0].throws[0] + ).toEqual({ + description: remark().parse('desc') + }); + + expect( + evaluate(function() { + /** @throws {Error} */ + })[0].throws[0] + ).toEqual({ + type: { + name: 'Error', + type: 'NameExpression' + } + }); + + expect( + evaluate(function() { + /** @throws {Error} desc */ + })[0].throws[0] + ).toEqual({ + type: { + name: 'Error', + type: 'NameExpression' + }, + description: remark().parse('desc') + }); + + expect( + evaluate(function() { + /** + * @throws a + * @throws b + */ + })[0].throws + ).toEqual([ + { + description: remark().parse('a') + }, + { + description: remark().parse('b') + } + ]); +}); + +test('parse - @todo', function() { + expect( + evaluate(function() { + /** @todo test */ + })[0].todos + ).toEqual([remark().parse('test')]); + + expect( + evaluate(function() { + /** + * @todo a + * @todo b + */ + })[0].todos + ).toEqual([remark().parse('a'), remark().parse('b')]); +}); + +test('parse - @tutorial', function() {}); + +test('parse - @type', function() {}); + +test('parse - @typedef', function() { + expect( + pick( + evaluate(function() { + /** @typedef {Object} name */ + })[0], + ['kind', 'name', 'type'] + ) + ).toEqual({ + kind: 'typedef', + name: 'name', + type: { + type: 'NameExpression', + name: 'Object' + } + }); +}); + +test('parse - @var', function() {}); + +test('parse - @variation', function() { + expect( + evaluate(function() { + /** @variation 1 */ + })[0].variation + ).toBe(1); +}); + +test('parse - @version', function() {}); + +test('parse - @virtual', function() {}); + +test('parse - unknown tag', function() { + expect( + evaluate(function() { + /** @unknown */ + })[0].errors[0] + ).toEqual({ + message: 'unknown tag @unknown', + commentLineNumber: 0 + }); +}); + +test('parse - {@link}', function() { + expect( + removePosition( + evaluate(function() { + /** {@link Foo} */ + })[0].description + ) + ).toEqual(addJSDocTag(removePosition(remark().parse('[Foo](Foo)')))); + + expect( + removePosition( + evaluate(function() { + /** {@link Foo|text} */ + })[0].description + ) + ).toEqual(addJSDocTag(removePosition(remark().parse('[text](Foo)')))); + + expect( + removePosition( + evaluate(function() { + /** {@link Foo text} */ + })[0].description + ) + ).toEqual(addJSDocTag(removePosition(remark().parse('[text](Foo)')))); +}); + +test('parse - {@linkcode}', function() {}); + +test('parse - {@linkplain}', function() {}); + +test('parse - {@tutorial}', function() { + expect( + removePosition( + evaluate(function() { + /** {@tutorial id} */ + })[0].description + ) + ).toEqual({ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'tutorial', + url: 'id', + jsdoc: true, + title: null, + children: [ + { + type: 'text', + value: 'id' + } + ] + } + ] + } + ] + }); + + expect( + removePosition( + evaluate(function() { + /** {@tutorial id|text} */ + })[0].description + ) + ).toEqual({ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'tutorial', + url: 'id', + jsdoc: true, + title: null, + children: [ + { + type: 'text', + value: 'text' + } + ] + } + ] + } + ] + }); + + expect( + removePosition( + evaluate(function() { + /** {@tutorial id text} */ + })[0].description + ) + ).toEqual({ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + { + type: 'tutorial', + url: 'id', + jsdoc: true, + title: null, + children: [ + { + type: 'text', + value: 'text' + } + ] + } + ] + } + ] + }); +}); diff --git a/__tests__/lib/parsers/javascript.js b/__tests__/lib/parsers/javascript.js new file mode 100644 index 000000000..46b840551 --- /dev/null +++ b/__tests__/lib/parsers/javascript.js @@ -0,0 +1,86 @@ +var remark = require('remark'), + parse = require('../../../src/parsers/javascript'); + +function toComments(source, filename, opts) { + source = typeof source === 'string' ? source : '(' + source.toString() + ')'; + return parse( + { + file: filename || 'test.js', + source + }, + opts || {} + ); +} + +test('parse - leading comment', function() { + expect( + toComments(function() { + /** one */ + /** two */ + function two() {} + }).map(function(c) { + return c.description; + }) + ).toEqual([remark().parse('one'), remark().parse('two')]); +}); + +test('parse - trailing comment', function() { + expect( + toComments(function() { + /** one */ + function one() {} + /** two */ + }).map(function(c) { + return c.description; + }) + ).toEqual([remark().parse('one'), remark().parse('two')]); +}); + +test('parse - unknown tag', function() { + expect( + toComments(function() { + /** @unknown */ + })[0].tags[0].title + ).toBe('unknown'); +}); + +test('parse - error', function() { + expect( + toComments(function() { + /** @param {foo */ + })[0].errors + ).toEqual([ + { message: 'Braces are not balanced' }, + { message: 'Missing or invalid tag name' } + ]); +}); + +test('parse - document exported', function() { + expect( + toComments( + ` + export class C {} +` + ).length + ).toBe(0); + expect( + toComments( + ` + export class C {} +`, + 'test.js', + { documentExported: true } + ).length + ).toBe(1); + expect( + toComments( + ` + export class C { + method() {} + } +`, + 'test.js', + { documentExported: true } + ).length + ).toBe(2); +}); diff --git a/__tests__/lib/parsers/polyglot.js b/__tests__/lib/parsers/polyglot.js new file mode 100644 index 000000000..10b268c58 --- /dev/null +++ b/__tests__/lib/parsers/polyglot.js @@ -0,0 +1,81 @@ +var fs = require('fs'), + path = require('path'), + remark = require('remark'), + polyglot = require('../../../src/parsers/polyglot'); + +test('polyglot', function() { + var file = path.resolve( + path.join(__dirname, '../../fixture/polyglot/blend.cpp') + ); + var result = polyglot({ + file, + source: fs.readFileSync(file, 'utf8') + }); + delete result[0].context.file; + delete result[0].context.sortKey; + expect(result).toEqual([ + { + errors: [], + augments: [], + examples: [], + properties: [], + throws: [], + todos: [], + sees: [], + context: { + loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } } + }, + description: remark().parse('This method moves a hex to a color'), + loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } }, + name: 'hexToUInt32Color', + params: [ + { + lineNumber: 3, + title: 'param', + name: 'hex', + type: { + name: 'string', + type: 'NameExpression' + } + } + ], + returns: [ + { + title: 'returns', + description: remark().parse('color'), + type: { + name: 'number', + type: 'NameExpression' + } + } + ], + tags: [ + { + description: null, + lineNumber: 2, + name: 'hexToUInt32Color', + title: 'name' + }, + { + description: null, + lineNumber: 3, + name: 'hex', + title: 'param', + type: { + name: 'string', + type: 'NameExpression' + } + }, + { + description: 'color', + lineNumber: 4, + title: 'returns', + type: { + name: 'number', + type: 'NameExpression' + } + } + ] + } + ]); +}); diff --git a/__tests__/lib/server.js b/__tests__/lib/server.js new file mode 100644 index 000000000..8ad9fa332 --- /dev/null +++ b/__tests__/lib/server.js @@ -0,0 +1,59 @@ +var get = require('../utils').get; +var File = require('vinyl'); +var getPort = require('get-port'); +var Server = require('../../src/serve/server'); + +var jsFile = new File({ + cwd: '/', + base: '/test/', + path: '/test/file.js', + contents: new Buffer('var test = 123;') +}); + +var coffeeFile = new File({ + cwd: '/', + base: '/test/', + path: '/test/file.coffee', + contents: new Buffer('test = 123') +}); + +var indexFile = new File({ + cwd: '/', + base: '/test/', + path: '/test/index.html', + contents: new Buffer('') +}); + +test('server - throws on bad port', function() { + expect(function() { + var server = new Server('${port}'); + }).toThrow(); + expect(function() { + var server = new Server(); + }).toThrow(); +}); + +test('server', async function() { + const port = await getPort(); + const server = new Server(port, true); + expect(server).toBeTruthy(); + await server.start(); + try { + await get(`http://localhost:${port}/file.coffee`); + } catch (code) { + expect(code).toEqual(404); + } + + server.setFiles([coffeeFile]); + var text; + + text = await get(`http://localhost:${port}/file.coffee`); + expect(text).toMatchSnapshot(); + server.setFiles([coffeeFile, jsFile]); + text = await get(`http://localhost:${port}/file.js`); + expect(text).toMatchSnapshot(); + server.setFiles([coffeeFile, indexFile, jsFile]); + text = await get(`http://localhost:${port}/`); + expect(text).toMatchSnapshot(); + await server.stop(); +}); diff --git a/test/lib/sort.js b/__tests__/lib/sort.js similarity index 60% rename from test/lib/sort.js rename to __tests__/lib/sort.js index a90cc6673..df6ca8856 100644 --- a/test/lib/sort.js +++ b/__tests__/lib/sort.js @@ -1,46 +1,28 @@ -'use strict'; +var sort = require('../../src/sort'), path = require('path'); -var test = require('tap').test, - sort = require('../../lib/sort'), - path = require('path'); - -test('sort stream alphanumeric', function(t) { +test('sort stream alphanumeric', function() { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var banana = { context: { sortKey: 'c' }, name: 'bananas' }; - t.deepEqual( - sort([apples, carrot, banana]), - [apples, carrot, banana], - 'sort stream alphanumeric' - ); - - t.deepEqual( - sort([carrot, apples, banana]), - [apples, carrot, banana], - 'sort stream alphanumeric' - ); + expect(sort([apples, carrot, banana])).toEqual([apples, carrot, banana]); - t.end(); + expect(sort([carrot, apples, banana])).toEqual([apples, carrot, banana]); }); -test('sort stream with configuration', function(t) { +test('sort stream with configuration', function() { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; - t.deepEqual( + expect( sort([apples, carrot, bananas], { toc: ['carrot', 'bananas'] - }), - [carrot, bananas, apples], - 'with configuration' - ); - - t.end(); + }) + ).toEqual([carrot, bananas, apples]); }); -test('sort stream with configuration and a section', function(t) { +test('sort stream with configuration and a section', function() { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; @@ -107,18 +89,14 @@ test('sort stream with configuration and a section', function(t) { kind: 'note' }; - t.deepEqual( + expect( sort([apples, carrot, bananas], { toc: ['carrot', section, 'bananas'] - }), - [carrot, sectionMarkdown, bananas, apples], - 'with configuration' - ); - - t.end(); + }) + ).toEqual([carrot, sectionMarkdown, bananas, apples]); }); -test('sort an already-sorted stream containing a section/description', function(t) { +test('sort an already-sorted stream containing a section/description', function() { // this happens in the 'serve' task var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; @@ -191,11 +169,10 @@ test('sort an already-sorted stream containing a section/description', function( var sortOnce = sort([apples, carrot, bananas], config); var sortTwice = sort(sortOnce, config); - t.deepEqual(sortTwice, [carrot, sectionMarkdown, bananas, apples]); - t.end(); + expect(sortTwice).toEqual([carrot, sectionMarkdown, bananas, apples]); }); -test('sort toc with files', function(t) { +test('sort toc with files', function() { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; @@ -205,51 +182,14 @@ test('sort toc with files', function(t) { file: 'test/fixture/snowflake.md' }; - var processedSnowflake = { - name: 'snowflake', - kind: 'note', - description: { - children: [ - { - children: [ - { - position: { - end: { column: 16, line: 1, offset: 15 }, - indent: [], - start: { column: 3, line: 1, offset: 2 } - }, - type: 'text', - value: 'The Snowflake' - } - ], - depth: 1, - position: { - end: { column: 16, line: 1, offset: 15 }, - indent: [], - start: { column: 1, line: 1, offset: 0 } - }, - type: 'heading' - } - ], - position: { - end: { column: 1, line: 2, offset: 16 }, - start: { column: 1, line: 1, offset: 0 } - }, - type: 'root' - } - }; - t.deepEqual( + expect( sort([apples, carrot, bananas], { toc: [snowflake] - }), - [processedSnowflake, apples, carrot, bananas], - 'with configuration' - ); - - t.end(); + }) + ).toMatchSnapshot(); }); -test('sort toc with files absolute path', function(t) { +test('sort toc with files absolute path', function() { var apples = { context: { sortKey: 'a' }, name: 'apples' }; var carrot = { context: { sortKey: 'b' }, name: 'carrot' }; var bananas = { context: { sortKey: 'c' }, name: 'bananas' }; @@ -258,47 +198,9 @@ test('sort toc with files absolute path', function(t) { name: 'snowflake', file: path.join(__dirname, '../fixture/snowflake.md') }; - - var processedSnowflake = { - name: 'snowflake', - kind: 'note', - description: { - children: [ - { - children: [ - { - position: { - end: { column: 16, line: 1, offset: 15 }, - indent: [], - start: { column: 3, line: 1, offset: 2 } - }, - type: 'text', - value: 'The Snowflake' - } - ], - depth: 1, - position: { - end: { column: 16, line: 1, offset: 15 }, - indent: [], - start: { column: 1, line: 1, offset: 0 } - }, - type: 'heading' - } - ], - position: { - end: { column: 1, line: 2, offset: 16 }, - start: { column: 1, line: 1, offset: 0 } - }, - type: 'root' - } - }; - t.deepEqual( + expect( sort([apples, carrot, bananas], { toc: [snowflake] - }), - [processedSnowflake, apples, carrot, bananas], - 'with configuration' - ); - - t.end(); + }) + ).toMatchSnapshot(); }); diff --git a/__tests__/lib/walk.js b/__tests__/lib/walk.js new file mode 100644 index 000000000..e63db9b20 --- /dev/null +++ b/__tests__/lib/walk.js @@ -0,0 +1,74 @@ +var walk = require('../../src/walk'); + +test('walk', function() { + test('flat comments', function(t) { + var comments = [{ name: 'Tom' }]; + + function renamer(comment, options) { + if (options) { + comment.name = options.name; + } else { + comment.name = 'Tim'; + } + } + + expect(walk(comments, renamer)).toEqual([{ name: 'Tim' }]); + + expect(walk(comments, renamer, { name: 'John' })).toEqual([ + { name: 'John' } + ]); + }); + + test('nested comments', function(t) { + var comments = [ + { + name: 'Tom', + members: { + static: [ + { + name: 'Billy' + } + ] + } + } + ]; + + function renamer(comment, options) { + if (options) { + comment.name = options.name; + } else { + comment.name = 'Tim'; + } + } + + expect(walk(comments, renamer)).toEqual([ + { + name: 'Tim', + members: { + static: [ + { + name: 'Tim' + } + ] + } + } + ]); + + expect( + walk(comments, renamer, { + name: 'Bob' + }) + ).toEqual([ + { + name: 'Bob', + members: { + static: [ + { + name: 'Bob' + } + ] + } + } + ]); + }); +}); diff --git a/__tests__/linker.js b/__tests__/linker.js new file mode 100644 index 000000000..41d646fef --- /dev/null +++ b/__tests__/linker.js @@ -0,0 +1,44 @@ +var LinkerStack = require('../src/output/util/linker_stack'); + +test('linkerStack', function() { + var linkerStack = new LinkerStack({}); + + expect(linkerStack.link('string')).toBe( + 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String' + ); + + expect( + new LinkerStack({ + paths: { + Point: 'http://geojson.org/geojson-spec.html#point' + } + }).link('Point') + ).toBe('http://geojson.org/geojson-spec.html#point'); + + expect( + new LinkerStack({ + paths: { + Image: 'http://custom.com/' + } + }).link('Image') + ).toBe('http://custom.com/'); + + var linker = new LinkerStack({ + paths: { + Image: 'http://custom.com/' + } + }); + + linker.namespaceResolver( + [ + { + namespace: 'Image' + } + ], + function(namespace) { + return '#' + namespace; + } + ); + + expect(linker.link('Image')).toBe('#Image'); +}); diff --git a/test/misc/package.json b/__tests__/misc/package.json similarity index 100% rename from test/misc/package.json rename to __tests__/misc/package.json diff --git a/__tests__/test.js b/__tests__/test.js new file mode 100644 index 000000000..2da48557e --- /dev/null +++ b/__tests__/test.js @@ -0,0 +1,221 @@ +var documentationSchema = require('documentation-schema'), + validate = require('json-schema'), + documentation = require('../'), + outputMarkdown = require('../src/output/markdown.js'), + outputMarkdownAST = require('../src/output/markdown_ast.js'), + outputHtml = require('../src/output/html.js'), + normalize = require('./utils').normalize, + glob = require('glob'), + pify = require('pify'), + path = require('path'), + fs = require('fs'), + _ = require('lodash'), + chdir = require('chdir'); + +var UPDATE = !!process.env.UPDATE; + +function makePOJO(ast) { + return JSON.parse(JSON.stringify(ast)); +} + +function readOptionsFromFile(file) { + var s = fs.readFileSync(file, 'utf-8'); + var lines = s.split(/\n/, 20); + for (var i = 0; i < lines.length; i++) { + var m = lines[i].match(/^\/\/\s+Options:\s*(.+)$/); + if (m) { + return JSON.parse(m[1]); + } + } + return {}; +} + +if (fs.existsSync(path.join(__dirname, '../.git'))) { + test('git option', async function() { + var file = path.join(__dirname, './fixture/simple.input.js'); + const result = await documentation.build([file], { github: true }); + normalize(result); + expect(result).toMatchSnapshot(); + + const md = await outputMarkdown(result, {}); + expect(md.toString()).toMatchSnapshot(); + }); +} + +test('document-exported error', async function() { + var file = path.join(__dirname, 'fixture', 'document-exported-bad', 'x.js'); + try { + await documentation.build([file], { documentExported: true }); + } catch (err) { + expect(err.message.match(/Unable to find the value x/g)).toBeTruthy(); + } +}); + +test('external modules option', async function() { + const result = await documentation.build( + [path.join(__dirname, 'fixture', 'external.input.js')], + { + external: '(external|external/node_modules/*)' + } + ); + normalize(result); + var outputfile = path.join( + __dirname, + 'fixture', + '_external-deps-included.json' + ); + expect(result).toMatchSnapshot(); +}); + +test('bad input', function() { + glob + .sync(path.join(__dirname, 'fixture/bad', '*.input.js')) + .forEach(function(file) { + test(path.basename(file), function(t) { + return documentation + .build([file], readOptionsFromFile(file)) + .then(res => { + expect(res).toBe(undefined); + }) + .catch(error => { + // make error a serializable object + error = JSON.parse(JSON.stringify(error)); + // remove system-specific path + delete error.filename; + delete error.codeFrame; + expect(error).toMatchSnapshot(); + }); + }); + }); +}); + +test('html', function() { + glob + .sync(path.join(__dirname, 'fixture/html', '*.input.js')) + .forEach(function(file) { + test(path.basename(file), async function(t) { + const result = await documentation.build( + [file], + readOptionsFromFile(file) + ); + const html = await outputHtml(result, {}); + var clean = html + .sort((a, b) => a.path > b.path) + .filter(r => r.path.match(/(html)$/)) + .map(r => r.contents) + .join('\n'); + expect(clean).toMatchSnapshot(); + }); + }); +}); + +test('outputs', function() { + glob + .sync(path.join(__dirname, 'fixture', '*.input.js')) + .forEach(function(file) { + test(path.basename(file), async function(tt) { + const result = await documentation.build( + [file], + readOptionsFromFile(file) + ); + test('markdown', async function(t) { + const md = await outputMarkdown(_.cloneDeep(result), { + markdownToc: true + }); + expect(result.toString()).toMatchSnapshot(); + }); + + if (file.match(/es6.input.js/)) { + test('no markdown TOC', async function(t) { + const txt = await outputMarkdown(_.cloneDeep(result), { + markdownToc: false + }); + expect(result.toString()).toMatchSnapshot(); + }); + } + + test('markdown AST', async function(t) { + const ast = await outputMarkdownAST(_.cloneDeep(result), {}); + expect(ast).toMatchSnapshot(); + }); + + test('JSON', function(t) { + normalize(result); + result.forEach(function(comment) { + validate( + comment, + documentationSchema.jsonSchema + ).errors.forEach(function(error) { + expect(error).toBeFalsy(); + }); + }); + expect(makePOJO(result)).toMatchSnapshot(); + }); + }); + }); +}); + +test('highlightAuto md output', async function() { + var file = path.join( + __dirname, + 'fixture/auto_lang_hljs/multilanguage.input.js' + ), + hljsConfig = { + hljs: { highlightAuto: true, languages: ['js', 'css', 'html'] } + }; + + const result = await documentation.build(file, {}); + const md = await outputMarkdown(result, hljsConfig); + expect(md.toString()).toMatchSnapshot(); +}); + +test('config', async function() { + var file = path.join(__dirname, 'fixture', 'class.input.js'); + var outputfile = path.join(__dirname, 'fixture', 'class.config.output.md'); + const out = await documentation.build([file], { + config: path.join(__dirname, 'fixture', 'simple.config.yml') + }); + const md = await outputMarkdown(out, {}); + expect(md).toMatchSnapshot(); +}); + +test('multi-file input', async function() { + const result = await documentation.build( + [ + path.join(__dirname, 'fixture', 'simple.input.js'), + path.join(__dirname, 'fixture', 'simple-two.input.js') + ], + {} + ); + normalize(result); + expect(result).toMatchSnapshot(); +}); + +test('accepts simple relative paths', async function() { + await pify(chdir)(__dirname); + const data = await documentation.build( + '__tests__/fixture/simple.input.js', + {} + ); + expect(data.length).toBe(1); +}); + +test('.lint', async function() { + await pify(chdir)(__dirname); + const data = await documentation.lint( + '__tests__/fixture/simple.input.js', + {} + ); + expect(data).toBe(''); +}); + +test('.lint with bad input', async function() { + await pify(chdir)(__dirname); + try { + await documentation.lint('__tests__/fixture/bad/syntax.input', { + parseExtension: ['input'] + }); + } catch (err) { + expect(err).toBeTruthy(); + } +}); diff --git a/test/lib/git/mock_repo.js b/__tests__/utils.js similarity index 63% rename from test/lib/git/mock_repo.js rename to __tests__/utils.js index 5095fb865..9031b6181 100644 --- a/test/lib/git/mock_repo.js +++ b/__tests__/utils.js @@ -1,5 +1,39 @@ -'use strict'; -module.exports = { +var http = require('http'); +import { walk } from '../src/walk'; +var concat = require('concat-stream'); + +function get(url, callback) { + return new Promise((resolve, reject) => { + http.get(url, function(res) { + res.pipe( + concat(function(text) { + if (res.statusCode >= 400) { + return reject(res.statusCode); + } + resolve(text.toString()); + }) + ); + }); + }); +} + +function normalize(comments) { + return walk(comments, function(comment) { + var hasGithub = !!comment.context.github; + var path = comment.context.path; + comment.context = { + loc: comment.context.loc + }; + if (hasGithub) { + comment.context.github = '[github]'; + } + if (path) { + comment.context.path = path; + } + }); +} + +module.exports.mockRepo = { master: { '/my': { repository: { @@ -66,3 +100,6 @@ module.exports = { } } }; + +module.exports.get = get; +module.exports.normalize = normalize; diff --git a/bin/documentation.js b/bin/documentation.js index 9ecd0ff16..7c8d41ce4 100755 --- a/bin/documentation.js +++ b/bin/documentation.js @@ -2,9 +2,8 @@ /* eslint no-console: 0 */ -'use strict'; - -var yargs = require('yargs'), commands = require('../lib/commands'); +var yargs = require('yargs'); +var commands = require('../lib/commands'); var argv = yargs .command(commands.serve) diff --git a/circle.yml b/circle.yml index fe4654099..656373967 100644 --- a/circle.yml +++ b/circle.yml @@ -1,3 +1,6 @@ machine: node: - version: 4 + version: 7 +test: + override: + - npm run test-ci diff --git a/declarations/comment.js b/declarations/comment.js index b1c7744a9..a3dfa8735 100644 --- a/declarations/comment.js +++ b/declarations/comment.js @@ -1,3 +1,5 @@ +/* @flow */ +/* eslint no-use-before-define: 0 */ type DocumentationConfig = { polyglot?: boolean, inferPrivate?: string, @@ -13,11 +15,6 @@ type DocumentationConfig = { parseExtension: Array }; -type InputsConfig = { - inputs: Array, - config: DocumentationConfig -}; - type CommentError = { message: string, commentLineNumber?: number @@ -69,40 +66,6 @@ type CommentTag = { properties?: Array }; -type CommentMembers = { - static: Array, - instance: Array, - events: Array, - global: Array, - inner: Array -}; - -type CommentExample = { - caption?: string, - description?: Object -}; - -type Remark = { - type: string, - children: Array -}; - -type Access = 'private' | 'public' | 'protected'; -type Scope = 'instance' | 'static' | 'inner' | 'global'; -type Kind = - | 'class' - | 'constant' - | 'event' - | 'external' - | 'file' - | 'function' - | 'member' - | 'mixin' - | 'module' - | 'namespace' - | 'typedef' - | 'interface'; - type Comment = { errors: Array, tags: Array, @@ -150,8 +113,36 @@ type Comment = { }> }; -type ReducedComment = { - name: string, - kind: ?Kind, - scope?: ?Scope +type CommentMembers = { + static: Array, + instance: Array, + events: Array, + global: Array, + inner: Array +}; + +type CommentExample = { + caption?: string, + description?: Object +}; + +type Remark = { + type: string, + children: Array }; + +type Access = 'private' | 'public' | 'protected'; +type Scope = 'instance' | 'static' | 'inner' | 'global'; +type Kind = + | 'class' + | 'constant' + | 'event' + | 'external' + | 'file' + | 'function' + | 'member' + | 'mixin' + | 'module' + | 'namespace' + | 'typedef' + | 'interface'; diff --git a/default_theme/test/format_markdown.js b/default_theme/test/format_markdown.js deleted file mode 100644 index d50b71ce0..000000000 --- a/default_theme/test/format_markdown.js +++ /dev/null @@ -1,119 +0,0 @@ -var test = require('tap').test; -var remark = require('remark'); -var formatMarkdown = require('../lib/format_markdown'); - -test('main', function(t) { - t.deepEqual( - formatMarkdown(remark().parse('Converts from `Result` to `?Error`')), - '

Converts from Result<T> to ?Error

\n' - ); - t.done(); -}); - -test('type', function(t) { - var formatType = formatMarkdown.type; - - t.deepEqual(formatType(undefined), ''); - - t.deepEqual( - formatType({ - type: 'NameExpression', - name: 'Foo' - }), - 'Foo' - ); - - t.deepEqual( - formatType( - { - type: 'NameExpression', - name: 'Foo' - }, - ['Foo'] - ), - 'Foo' - ); - - t.deepEqual( - formatType({ - type: 'UnionType', - elements: [ - { - type: 'NameExpression', - name: 'Foo' - }, - { - type: 'NameExpression', - name: 'Bar' - } - ] - }), - '(Foo | Bar)' - ); - - t.deepEqual( - formatType({ - type: 'AllLiteral' - }), - 'Any' - ); - - t.deepEqual( - formatType({ - type: 'RestType' - }), - '...' - ); - - t.deepEqual( - formatType({ - type: 'OptionalType', - expression: { - type: 'NameExpression', - name: 'Foo' - } - }), - '[Foo]' - ); - - t.deepEqual( - formatType({ - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Foo' - }, - applications: [ - { - type: 'NameExpression', - name: 'Bar' - } - ] - }), - 'Foo<Bar>' - ); - - t.deepEqual( - formatType({ - type: 'UndefinedLiteral' - }), - 'undefined' - ); - - t.done(); -}); - -test('autolink', function(t) { - var autolink = formatMarkdown.link; - - t.equal(autolink([], 'Foo'), 'Foo'); - t.equal(autolink(['Foo'], 'Foo'), 'Foo'); - t.equal( - autolink([], 'Array'), - 'Array' - ); - t.equal(autolink([], 'C&O'), 'C&O'); - - t.done(); -}); diff --git a/default_theme/test/format_parameters.js b/default_theme/test/format_parameters.js deleted file mode 100644 index e59ca5937..000000000 --- a/default_theme/test/format_parameters.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tap').test; -var formatParameters = require('../lib/format_parameters'); - -test('main', function(t) { - t.deepEqual(formatParameters({}), ''); - t.deepEqual(formatParameters({ params: [] }), '()'); - t.deepEqual(formatParameters({ params: [{ name: 'foo' }] }), '(foo: )'); - t.deepEqual( - formatParameters({ - params: [{ name: 'foo', type: { type: 'OptionalType' } }] - }), - '(foo: [])' - ); - t.done(); -}); diff --git a/default_theme/test/index.js b/default_theme/test/index.js deleted file mode 100644 index a613069b4..000000000 --- a/default_theme/test/index.js +++ /dev/null @@ -1,30 +0,0 @@ -var test = require('tap').test; -var remark = require('remark'); -var theme = require('..'); - -test('main', function(t) { - var comments = [ - { - path: [], - context: {}, - description: remark().parse('test'), - members: { - static: [], - instance: [] - }, - returns: [ - { - type: { - type: 'NameExpression', - name: 'Foo' - } - } - ] - } - ]; - - theme(comments, {}, function(err) { - t.ifError(err); - t.done(); - }); -}); diff --git a/lib/commands/serve.js b/lib/commands/serve.js deleted file mode 100644 index ebc386878..000000000 --- a/lib/commands/serve.js +++ /dev/null @@ -1,100 +0,0 @@ -/* @flow */ -'use strict'; - -var errorPage = require('../../lib/serve/error_page'), - fs = require('fs'), - path = require('path'), - chokidar = require('chokidar'), - sharedOptions = require('./shared_options'), - Server = require('../../lib/serve/server'), - _ = require('lodash'), - documentation = require('../../'); - -module.exports.command = 'serve [input..]'; -module.exports.description = 'generate, update, and display HTML documentation'; -/** - * Add yargs parsing for the serve command - * @param {Object} yargs module instance - * @returns {Object} yargs with options - * @private - */ -module.exports.builder = _.assign( - {}, - sharedOptions.sharedOutputOptions, - sharedOptions.sharedInputOptions, - { - port: { - describe: 'port for the local server', - type: 'number', - default: 4001 - } - } -); - -/** - * Wrap the documentation build command along with a server, making it possible - * to preview changes live - * @private - * @param {Object} argv cli input - * @returns {undefined} has side effects - */ -module.exports.handler = function serve(argv /*: Object*/) { - argv._handled = true; - - if (!argv.input.length) { - try { - argv.input = [ - JSON.parse( - fs.readFileSync(path.resolve('package.json'), 'utf8') - ).main || 'index.js' - ]; - } catch (e) { - throw new Error( - 'documentation was given no files and was not run in a module directory' - ); - } - } - - var server = new Server(argv.port); - var watcher; - - server.on('listening', function() { - process.stdout.write(`documentation.js serving on port ${argv.port}\n`); - }); - - function updateWatcher() { - if (!watcher) { - watcher = chokidar.watch(argv.input); - watcher.on('all', _.debounce(updateServer, 300)); - } - - documentation - .expandInputs(argv.input, argv) - .then(files => { - watcher.add( - files.map(data => typeof data === 'string' ? data : data.file) - ); - }) - .catch(err => { - /* eslint no-console: 0 */ - return server.setFiles([errorPage(err)]).start(); - }); - } - - function updateServer() { - documentation - .build(argv.input, argv) - .then(comments => documentation.formats.html(comments, argv)) - .then(files => { - if (argv.watch) { - updateWatcher(); - } - server.setFiles(files).start(); - }) - .catch(err => { - return server.setFiles([errorPage(err)]).start(); - }); - } - - updateServer(); -}; diff --git a/package.json b/package.json index 89271dc77..758daa124 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "disparity": "^2.0.0", "doctrine-temporary-fork": "2.0.0-alpha-allowarrayindex", "get-comments": "^1.0.1", + "get-port": "^3.1.0", "git-url-parse": "^6.0.1", "github-slugger": "1.1.1", "glob": "^7.0.0", @@ -58,22 +59,28 @@ }, "devDependencies": { "are-we-flow-yet": "^1.0.0", + "babel-cli": "^6.24.1", "babel-eslint": "^7.2.3", + "babel-jest": "^19.0.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-preset-flow": "^6.23.0", "chdir": "0.0.0", + "coveralls": "^2.13.1", "cz-conventional-changelog": "2.0.0", "documentation-schema": "0.0.1", "eslint": "^3.19.0", "eslint-config-prettier": "^1.7.0", "eslint-plugin-flowtype": "^2.32.1", - "flow-bin": "^0.44.0", + "flow-bin": "^0.45.0", "fs-extra": "^3.0.0", "husky": "^0.13.3", + "jest": "^19.0.2", "json-schema": "0.2.3", "lint-staged": "^3.4.0", "mock-fs": "^4.2.0", - "prettier": "^0.22.0", + "p-event": "^1.0.0", + "prettier": "^1.0.0", "standard-version": "^4.0.0", - "tap": "^10.3.2", "tmp": "^0.0.31" }, "keywords": [ @@ -91,14 +98,27 @@ "url": "git@github.com:documentationjs/documentation.git" }, "scripts": { + "build": "rm -rf lib && babel -D src -d lib", "release": "standard-version", "precommit": "lint-staged --verbose", - "format": "prettier --write '{lib,test,declarations,bin,default_theme}/**/*.js' --single-quote", + "format": "prettier --write '{src,__tests__,declarations,bin,default_theme}/**/*.js' --single-quote", "doc": "./bin/documentation.js build lib/index.js -f md --access=public > docs/NODE_API.md", "changelog": "standard-changelog -i CHANGELOG.md -w", - "self-lint": "node ./bin/documentation.js lint", - "test": "eslint lib && are-we-flow-yet lib && flow check && npm run self-lint && npm run test-tap", - "test-tap": "tap -t 120 --coverage --nyc-arg=--cache test/*.js test/lib test/streams" + "self-lint": "node ./bin/documentation.js lint src", + "test": "npm run build && eslint . && are-we-flow-yet src && flow check && jest", + "test-ci": "npm run build && eslint . && are-we-flow-yet src && flow check && jest --runInBand && coveralls < coverage/lcov.info" + }, + "jest": { + "testPathIgnorePatterns": [ + "/node_modules/", + "utils.js", + "fixture" + ], + "coveragePathIgnorePatterns": [ + "/lib/" + ], + "collectCoverage": true, + "testEnvironment": "node" }, "config": { "commitizen": { diff --git a/lib/commands/build.js b/src/commands/build.js similarity index 89% rename from lib/commands/build.js rename to src/commands/build.js index 63def7210..17b89611b 100644 --- a/lib/commands/build.js +++ b/src/commands/build.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var streamArray = require('stream-array'), sharedOptions = require('./shared_options'), @@ -7,7 +6,7 @@ var streamArray = require('stream-array'), fs = require('fs'), vfs = require('vinyl-fs'), chokidar = require('chokidar'), - documentation = require('../../'), + documentation = require('../'), _ = require('lodash'); module.exports.command = 'build [input..]'; @@ -42,16 +41,15 @@ module.exports.builder = _.assign( * The former case, with the callback, is used by the `serve` command, which is * just a thin wrapper around this one. */ -module.exports.handler = function build(argv /*: Object*/) { +module.exports.handler = function build(argv: Object) { var watcher; argv._handled = true; if (!argv.input.length) { try { argv.input = [ - JSON.parse( - fs.readFileSync(path.resolve('package.json'), 'utf8') - ).main || 'index.js' + JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')) + .main || 'index.js' ]; } catch (e) { throw new Error( @@ -70,7 +68,8 @@ module.exports.handler = function build(argv /*: Object*/) { return documentation .build(argv.input, argv) .then(comments => - documentation.formats[argv.format](comments, argv).then(onFormatted)) + documentation.formats[argv.format](comments, argv).then(onFormatted) + ) .catch(err => { /* eslint no-console: 0 */ if (err instanceof Error) { @@ -110,8 +109,9 @@ module.exports.handler = function build(argv /*: Object*/) { .expandInputs(argv.input, argv) .then(files => watcher.add( - files.map(data => typeof data === 'string' ? data : data.file) - )); + files.map(data => (typeof data === 'string' ? data : data.file)) + ) + ); } return generator(); diff --git a/lib/commands/index.js b/src/commands/index.js similarity index 97% rename from lib/commands/index.js rename to src/commands/index.js index 8f09831ff..b1c38ebbf 100644 --- a/lib/commands/index.js +++ b/src/commands/index.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; /* * Maps command name to a command plugin module. Each command plugin module diff --git a/lib/commands/lint.js b/src/commands/lint.js similarity index 82% rename from lib/commands/lint.js rename to src/commands/lint.js index 2b9d06d77..3e465cc9c 100644 --- a/lib/commands/lint.js +++ b/src/commands/lint.js @@ -1,7 +1,6 @@ /* @flow */ -'use strict'; -var documentation = require('../../'); +var documentation = require('../'); var fs = require('fs'); var path = require('path'); @@ -19,14 +18,13 @@ module.exports.builder = {}; * @returns {undefined} has side-effects * @private */ -module.exports.handler = function(argv /*: Object*/) { +module.exports.handler = function(argv: Object) { argv._handled = true; if (!argv.input.length) { try { argv.input = [ - JSON.parse( - fs.readFileSync(path.resolve('package.json'), 'utf8') - ).main || 'index.js' + JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')) + .main || 'index.js' ]; } catch (e) { throw new Error( diff --git a/lib/commands/readme.js b/src/commands/readme.js similarity index 92% rename from lib/commands/readme.js rename to src/commands/readme.js index 27202da4e..81176c29b 100644 --- a/lib/commands/readme.js +++ b/src/commands/readme.js @@ -1,10 +1,9 @@ /* @flow */ -'use strict'; var fs = require('fs'); var remark = require('remark'); var path = require('path'); -var documentation = require('../../'); +var documentation = require('../'); var inject = require('mdast-util-inject'); var chalk = require('chalk'); var disparity = require('disparity'); @@ -51,15 +50,14 @@ function noop() {} * @param {Object} argv args from the CLI option parser * @return {undefined} has the side-effect of writing a file or printing to stdout */ -module.exports.handler = function readme(argv /*: Object*/) { +module.exports.handler = function readme(argv: Object) { argv._handled = true; if (!argv.input.length) { try { argv.input = [ - JSON.parse( - fs.readFileSync(path.resolve('package.json'), 'utf8') - ).main || 'index.js' + JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')) + .main || 'index.js' ]; } catch (e) { throw new Error( @@ -85,7 +83,8 @@ module.exports.handler = function readme(argv /*: Object*/) { section: argv.section, toInject: JSON.parse(docsAst) }) - .process(readmeContent)) + .process(readmeContent) + ) .then(file => { var diffOutput = disparity.unified(readmeContent, file.contents, { paths: [argv.readmeFile, argv.readmeFile] diff --git a/src/commands/serve.js b/src/commands/serve.js new file mode 100644 index 000000000..b83c8488f --- /dev/null +++ b/src/commands/serve.js @@ -0,0 +1,101 @@ +/* @flow */ + +var errorPage = require('../serve/error_page'), + fs = require('fs'), + path = require('path'), + chokidar = require('chokidar'), + sharedOptions = require('./shared_options'), + Server = require('../serve/server'), + _ = require('lodash'), + getPort = require('get-port'), + documentation = require('../'); + +module.exports.command = 'serve [input..]'; +module.exports.description = 'generate, update, and display HTML documentation'; +/** + * Add yargs parsing for the serve command + * @param {Object} yargs module instance + * @returns {Object} yargs with options + * @private + */ +module.exports.builder = _.assign( + {}, + sharedOptions.sharedOutputOptions, + sharedOptions.sharedInputOptions, + { + port: { + describe: 'preferred port for the local server', + type: 'number', + default: 4001 + } + } +); + +/** + * Wrap the documentation build command along with a server, making it possible + * to preview changes live + * @private + * @param {Object} argv cli input + * @returns {undefined} has side effects + */ +module.exports.handler = function serve(argv: Object) { + argv._handled = true; + + if (!argv.input.length) { + try { + argv.input = [ + JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf8')) + .main || 'index.js' + ]; + } catch (e) { + throw new Error( + 'documentation was given no files and was not run in a module directory' + ); + } + } + + getPort(argv.port).then(port => { + var server = new Server(port); + var watcher; + + server.on('listening', function() { + process.stdout.write(`documentation.js serving on port ${port}\n`); + }); + + function updateWatcher() { + if (!watcher) { + watcher = chokidar.watch(argv.input); + watcher.on('all', _.debounce(updateServer, 300)); + } + + documentation + .expandInputs(argv.input, argv) + .then(files => { + watcher.add( + files.map(data => (typeof data === 'string' ? data : data.file)) + ); + }) + .catch(err => { + /* eslint no-console: 0 */ + return server.setFiles([errorPage(err)]).start(); + }); + } + + function updateServer() { + documentation + .build(argv.input, argv) + .then(comments => documentation.formats.html(comments, argv)) + .then(files => { + if (argv.watch) { + updateWatcher(); + } + server.setFiles(files).start(); + }) + .catch(err => { + return server.setFiles([errorPage(err)]).start(); + }); + } + + updateServer(); + }); +}; diff --git a/lib/commands/shared_options.js b/src/commands/shared_options.js similarity index 95% rename from lib/commands/shared_options.js rename to src/commands/shared_options.js index 605a7452f..2ffeb362c 100644 --- a/lib/commands/shared_options.js +++ b/src/commands/shared_options.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; /** * Adds shared options to any command that runs documentation @@ -32,13 +31,13 @@ module.exports.sharedInputOptions = { describe: "additional extensions to include in require() and import's search algorithm." + 'For instance, adding .es5 would allow require("adder") to find "adder.es5"', // Ensure that the value is an array - coerce: (value /*: string | Array*/) => [].concat(value), + coerce: (value: string | Array) => [].concat(value), alias: 're' }, 'parse-extension': { describe: 'additional extensions to parse as source code.', // Ensure that the value is an array - coerce: (value /*: string | Array*/) => [].concat(value), + coerce: (value: string | Array) => [].concat(value), alias: 'pe' }, polyglot: { diff --git a/default_theme/README.md b/src/default_theme/README.md similarity index 100% rename from default_theme/README.md rename to src/default_theme/README.md diff --git a/default_theme/assets/anchor.js b/src/default_theme/assets/anchor.js similarity index 97% rename from default_theme/assets/anchor.js rename to src/default_theme/assets/anchor.js index 476a8f9ab..2ec9a1d4b 100644 --- a/default_theme/assets/anchor.js +++ b/src/default_theme/assets/anchor.js @@ -5,7 +5,6 @@ */ function AnchorJS(options) { - 'use strict'; this.options = options || {}; this._applyRemainingDefaultOptions = function(opts) { @@ -154,23 +153,27 @@ function AnchorJS(options) { } var style = document.createElement('style'), - linkRule = ' .anchorjs-link {' + + linkRule = + ' .anchorjs-link {' + ' opacity: 0;' + ' text-decoration: none;' + ' -webkit-font-smoothing: antialiased;' + ' -moz-osx-font-smoothing: grayscale;' + ' }', - hoverRule = ' *:hover > .anchorjs-link,' + + hoverRule = + ' *:hover > .anchorjs-link,' + ' .anchorjs-link:focus {' + ' opacity: 1;' + ' }', - anchorjsLinkFontFace = ' @font-face {' + + anchorjsLinkFontFace = + ' @font-face {' + ' font-family: "anchorjs-icons";' + ' font-style: normal;' + ' font-weight: normal;' + // Icon from icomoon; 10px wide & 10px tall; 2 empty below & 4 above ' src: url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBTUAAAC8AAAAYGNtYXAWi9QdAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5Zgq29TcAAAF4AAABNGhlYWQEZM3pAAACrAAAADZoaGVhBhUDxgAAAuQAAAAkaG10eASAADEAAAMIAAAAFGxvY2EAKACuAAADHAAAAAxtYXhwAAgAVwAAAygAAAAgbmFtZQ5yJ3cAAANIAAAB2nBvc3QAAwAAAAAFJAAAACAAAwJAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpywPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6cv//f//AAAAAAAg6cv//f//AAH/4xY5AAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAACADEARAJTAsAAKwBUAAABIiYnJjQ/AT4BMzIWFxYUDwEGIicmND8BNjQnLgEjIgYPAQYUFxYUBw4BIwciJicmND8BNjIXFhQPAQYUFx4BMzI2PwE2NCcmNDc2MhcWFA8BDgEjARQGDAUtLXoWOR8fORYtLTgKGwoKCjgaGg0gEhIgDXoaGgkJBQwHdR85Fi0tOAobCgoKOBoaDSASEiANehoaCQkKGwotLXoWOR8BMwUFLYEuehYXFxYugC44CQkKGwo4GkoaDQ0NDXoaShoKGwoFBe8XFi6ALjgJCQobCjgaShoNDQ0NehpKGgobCgoKLYEuehYXAAEAAAABAACiToc1Xw889QALBAAAAAAA0XnFFgAAAADRecUWAAAAAAJTAsAAAAAIAAIAAAAAAAAAAQAAA8D/wAAABAAAAAAAAlMAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAACAAAAAoAAMQAAAAAACgAUAB4AmgABAAAABQBVAAIAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEADgAAAAEAAAAAAAIABwCfAAEAAAAAAAMADgBLAAEAAAAAAAQADgC0AAEAAAAAAAUACwAqAAEAAAAAAAYADgB1AAEAAAAAAAoAGgDeAAMAAQQJAAEAHAAOAAMAAQQJAAIADgCmAAMAAQQJAAMAHABZAAMAAQQJAAQAHADCAAMAAQQJAAUAFgA1AAMAAQQJAAYAHACDAAMAAQQJAAoANAD4YW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzUmVndWxhcgBSAGUAZwB1AGwAYQByYW5jaG9yanMtaWNvbnMAYQBuAGMAaABvAHIAagBzAC0AaQBjAG8AbgBzRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format("truetype");' + ' }', - pseudoElContent = ' [data-anchorjs-icon]::after {' + + pseudoElContent = + ' [data-anchorjs-icon]::after {' + ' content: attr(data-anchorjs-icon);' + ' }', firstStyleEl; diff --git a/default_theme/assets/bass-addons.css b/src/default_theme/assets/bass-addons.css similarity index 100% rename from default_theme/assets/bass-addons.css rename to src/default_theme/assets/bass-addons.css diff --git a/default_theme/assets/bass.css b/src/default_theme/assets/bass.css similarity index 100% rename from default_theme/assets/bass.css rename to src/default_theme/assets/bass.css diff --git a/default_theme/assets/fonts/EOT/SourceCodePro-Bold.eot b/src/default_theme/assets/fonts/EOT/SourceCodePro-Bold.eot similarity index 100% rename from default_theme/assets/fonts/EOT/SourceCodePro-Bold.eot rename to src/default_theme/assets/fonts/EOT/SourceCodePro-Bold.eot diff --git a/default_theme/assets/fonts/EOT/SourceCodePro-Regular.eot b/src/default_theme/assets/fonts/EOT/SourceCodePro-Regular.eot similarity index 100% rename from default_theme/assets/fonts/EOT/SourceCodePro-Regular.eot rename to src/default_theme/assets/fonts/EOT/SourceCodePro-Regular.eot diff --git a/default_theme/assets/fonts/LICENSE.txt b/src/default_theme/assets/fonts/LICENSE.txt similarity index 100% rename from default_theme/assets/fonts/LICENSE.txt rename to src/default_theme/assets/fonts/LICENSE.txt diff --git a/default_theme/assets/fonts/OTF/SourceCodePro-Bold.otf b/src/default_theme/assets/fonts/OTF/SourceCodePro-Bold.otf similarity index 100% rename from default_theme/assets/fonts/OTF/SourceCodePro-Bold.otf rename to src/default_theme/assets/fonts/OTF/SourceCodePro-Bold.otf diff --git a/default_theme/assets/fonts/OTF/SourceCodePro-Regular.otf b/src/default_theme/assets/fonts/OTF/SourceCodePro-Regular.otf similarity index 100% rename from default_theme/assets/fonts/OTF/SourceCodePro-Regular.otf rename to src/default_theme/assets/fonts/OTF/SourceCodePro-Regular.otf diff --git a/default_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf b/src/default_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf similarity index 100% rename from default_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf rename to src/default_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf diff --git a/default_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf b/src/default_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf similarity index 100% rename from default_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf rename to src/default_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf diff --git a/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff b/src/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff similarity index 100% rename from default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff rename to src/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff diff --git a/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff b/src/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff similarity index 100% rename from default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff rename to src/default_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff diff --git a/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff b/src/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff similarity index 100% rename from default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff rename to src/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff diff --git a/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff b/src/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff similarity index 100% rename from default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff rename to src/default_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff diff --git a/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 b/src/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 similarity index 100% rename from default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 rename to src/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2 diff --git a/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 b/src/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 similarity index 100% rename from default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 rename to src/default_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2 diff --git a/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 b/src/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 similarity index 100% rename from default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 rename to src/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2 diff --git a/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 b/src/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 similarity index 100% rename from default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 rename to src/default_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2 diff --git a/default_theme/assets/fonts/source-code-pro.css b/src/default_theme/assets/fonts/source-code-pro.css similarity index 100% rename from default_theme/assets/fonts/source-code-pro.css rename to src/default_theme/assets/fonts/source-code-pro.css diff --git a/default_theme/assets/github.css b/src/default_theme/assets/github.css similarity index 100% rename from default_theme/assets/github.css rename to src/default_theme/assets/github.css diff --git a/default_theme/assets/site.js b/src/default_theme/assets/site.js similarity index 100% rename from default_theme/assets/site.js rename to src/default_theme/assets/site.js diff --git a/default_theme/assets/style.css b/src/default_theme/assets/style.css similarity index 100% rename from default_theme/assets/style.css rename to src/default_theme/assets/style.css diff --git a/default_theme/index._ b/src/default_theme/index._ similarity index 100% rename from default_theme/index._ rename to src/default_theme/index._ diff --git a/default_theme/index.js b/src/default_theme/index.js similarity index 96% rename from default_theme/index.js rename to src/default_theme/index.js index 1c5347215..48ef6682a 100644 --- a/default_theme/index.js +++ b/src/default_theme/index.js @@ -1,5 +1,3 @@ -'use strict'; - var fs = require('fs'), path = require('path'), File = require('vinyl'), @@ -12,8 +10,8 @@ var fs = require('fs'), hljs = require('highlight.js'); module.exports = function( - comments /*: Array */, - config /*: DocumentationConfig */ + comments: Array, + config: DocumentationConfig ) { var linkerStack = new LinkerStack( config @@ -108,7 +106,7 @@ module.exports = function( contents: new Buffer( pageTemplate({ docs: comments, - config: config + config }), 'utf8' ) diff --git a/default_theme/note._ b/src/default_theme/note._ similarity index 100% rename from default_theme/note._ rename to src/default_theme/note._ diff --git a/default_theme/section._ b/src/default_theme/section._ similarity index 100% rename from default_theme/section._ rename to src/default_theme/section._ diff --git a/default_theme/section_list._ b/src/default_theme/section_list._ similarity index 100% rename from default_theme/section_list._ rename to src/default_theme/section_list._ diff --git a/lib/extractors/comments.js b/src/extractors/comments.js similarity index 84% rename from lib/extractors/comments.js rename to src/extractors/comments.js index f6e4abaf7..8130e4dbe 100644 --- a/lib/extractors/comments.js +++ b/src/extractors/comments.js @@ -1,7 +1,6 @@ /* @flow */ -'use strict'; -var traverse = require('babel-traverse').default, - isJSDocComment = require('../../lib/is_jsdoc_comment'); +import traverse from 'babel-traverse'; +var isJSDocComment = require('../is_jsdoc_comment'); /** * Iterate through the abstract syntax tree, finding a different kind of comment @@ -16,12 +15,12 @@ var traverse = require('babel-traverse').default, * @private */ function walkComments( - type /*: string*/, - includeContext /*: boolean*/, - ast /*: Object*/, - data /*: Object*/, - addComment /*: Function*/ -) /*: Array*/ { + type: string, + includeContext: boolean, + ast: Object, + data: Object, + addComment: Function +): Array { var newResults = []; traverse(ast, { diff --git a/lib/extractors/exported.js b/src/extractors/exported.js similarity index 95% rename from lib/extractors/exported.js rename to src/extractors/exported.js index 8e00ae917..e9be88a44 100644 --- a/lib/extractors/exported.js +++ b/src/extractors/exported.js @@ -1,12 +1,11 @@ /* @flow */ -'use strict'; -var traverse = require('babel-traverse').default, - isJSDocComment = require('../../lib/is_jsdoc_comment'), - t = require('babel-types'), - nodePath = require('path'), - fs = require('fs'), - parseToAst = require('../parsers/parse_to_ast'), - findTarget = require('../infer/finders').findTarget; +import traverse from 'babel-traverse'; +var isJSDocComment = require('../is_jsdoc_comment'); +var t = require('babel-types'); +var nodePath = require('path'); +var fs = require('fs'); +import { parseToAst } from '../parsers/parse_to_ast'; +var findTarget = require('../infer/finders').findTarget; /** * Iterate through the abstract syntax tree, finding ES6-style exports, @@ -20,11 +19,11 @@ var traverse = require('babel-traverse').default, * @private */ function walkExported( - ast /*: Object */, + ast: Object, data /*: { file: string } */, - addComment /*: Function */ + addComment: Function ) { var newResults = []; var filename = data.file; diff --git a/lib/filter_access.js b/src/filter_access.js similarity index 81% rename from lib/filter_access.js rename to src/filter_access.js index 5cfe53650..94fb89495 100644 --- a/lib/filter_access.js +++ b/src/filter_access.js @@ -1,7 +1,6 @@ -'use strict'; /* @flow */ -var walk = require('./walk'); +import { walk } from './walk'; /** * Exclude given access levels from the generated documentation: this allows @@ -12,15 +11,14 @@ var walk = require('./walk'); * @param {Array} comments parsed comments (can be nested) * @return {Array} filtered comments */ -function filterAccess( - levels /*: Array*/, - comments /*: Array*/ -) { +function filterAccess(levels: Array, comments: Array) { levels = levels || ['public', 'undefined', 'protected']; function filter(comment) { - return comment.kind === 'note' || - (!comment.ignore && levels.indexOf(String(comment.access)) !== -1); + return ( + comment.kind === 'note' || + (!comment.ignore && levels.indexOf(String(comment.access)) !== -1) + ); } function recurse(comment) { diff --git a/lib/flow_doctrine.js b/src/flow_doctrine.js similarity index 98% rename from lib/flow_doctrine.js rename to src/flow_doctrine.js index dd1d7b004..031c4124e 100644 --- a/lib/flow_doctrine.js +++ b/src/flow_doctrine.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ const generate = require('babel-generator').default; @@ -44,7 +43,7 @@ function propertyToField(property) { * @param {Object} type babel-parsed flow type * @returns {Object} doctrine compatible type */ -function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { +function flowDoctrine(type: Object): DoctrineType { if (type.type in namedTypes) { let doctrineType = { type: 'NameExpression', @@ -68,7 +67,6 @@ function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { type: 'UnionType', elements: type.types.map(flowDoctrine) }; - // [number] // [string, boolean, number] case 'TupleTypeAnnotation': @@ -76,7 +74,6 @@ function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { type: 'ArrayType', elements: type.types.map(flowDoctrine) }; - // number[] case 'ArrayTypeAnnotation': return { @@ -87,7 +84,6 @@ function flowDoctrine(type /*: Object */) /*: DoctrineType*/ { }, applications: [flowDoctrine(type.elementType)] }; - // (y: number) => bool case 'FunctionTypeAnnotation': return { diff --git a/lib/garbage_collect.js b/src/garbage_collect.js similarity index 66% rename from lib/garbage_collect.js rename to src/garbage_collect.js index 38569298a..78a698d4e 100644 --- a/lib/garbage_collect.js +++ b/src/garbage_collect.js @@ -1,6 +1,5 @@ /* @flow */ -'use strict'; -function garbageCollect(comment /*: Comment*/) { +function garbageCollect(comment: Comment) { delete comment.context.code; delete comment.context.ast; return comment; diff --git a/lib/git/find_git.js b/src/git/find_git.js similarity index 90% rename from lib/git/find_git.js rename to src/git/find_git.js index e3f342415..8dfb0e8e5 100644 --- a/lib/git/find_git.js +++ b/src/git/find_git.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var path = require('path'); @@ -10,7 +9,7 @@ var fs = require('fs'); * @param filename any file within a repository * @returns repository path */ -function findGit(filename /*: string*/) { +function findGit(filename: string) { var paths = filename.split(path.sep); for (var i = paths.length; i > 0; i--) { var p = path.resolve(paths.slice(0, i).join(path.sep) + path.sep + '.git'); diff --git a/lib/git/url_prefix.js b/src/git/url_prefix.js similarity index 87% rename from lib/git/url_prefix.js rename to src/git/url_prefix.js index 1e0972df6..07562a5aa 100644 --- a/lib/git/url_prefix.js +++ b/src/git/url_prefix.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var fs = require('fs'); var path = require('path'); var gitUrlParse = require('git-url-parse'); @@ -20,13 +19,10 @@ function parsePackedRefs(packedRefs, branchName) { return packedRefs .split(/\n/) .filter(line => line[0] !== '#' && line[0] !== '^') - .reduce( - (memo, line) => { - memo[line.split(' ')[1]] = line.split(' ')[0]; - return memo; - }, - {} - )[branchName]; + .reduce((memo, line) => { + memo[line.split(' ')[1]] = line.split(' ')[0]; + return memo; + }, {})[branchName]; } /** @@ -37,7 +33,7 @@ function parsePackedRefs(packedRefs, branchName) { * @returns {string} base HTTPS url of the GitHub repository * @throws {Error} if the root is not a git repo */ -function getGithubURLPrefix(root /*: string*/) { +function getGithubURLPrefix(root: string) { var sha; try { var head = fs.readFileSync(path.join(root, '.git', 'HEAD'), 'utf8'); @@ -62,10 +58,12 @@ function getGithubURLPrefix(root /*: string*/) { sha = head; } if (sha) { - return gitUrlParse(getRemoteOrigin.sync(root)).toString('https') + + return ( + gitUrlParse(getRemoteOrigin.sync(root)).toString('https') + '/blob/' + sha.trim() + - '/'; + '/' + ); } } catch (e) { return null; diff --git a/lib/github.js b/src/github.js similarity index 81% rename from lib/github.js rename to src/github.js index ac0462262..c25817e47 100644 --- a/lib/github.js +++ b/src/github.js @@ -1,9 +1,8 @@ -'use strict'; /* @flow */ var path = require('path'); -var findGit = require('../lib/git/find_git'); -var getGithubURLPrefix = require('../lib/git/url_prefix'); +var findGit = require('./git/find_git'); +var getGithubURLPrefix = require('./git/url_prefix'); /** * Attempts to link code to its place on GitHub. @@ -12,7 +11,7 @@ var getGithubURLPrefix = require('../lib/git/url_prefix'); * @param {Object} comment parsed comment * @return {Object} comment with github inferred */ -module.exports = function(comment /*: Comment*/) { +module.exports = function(comment: Comment) { var repoPath = findGit(comment.context.file); var root = repoPath ? path.dirname(repoPath) : '.'; var urlPrefix = getGithubURLPrefix(root); diff --git a/lib/hierarchy.js b/src/hierarchy.js similarity index 88% rename from lib/hierarchy.js rename to src/hierarchy.js index 59776eb57..f8bb120fb 100644 --- a/lib/hierarchy.js +++ b/src/hierarchy.js @@ -1,5 +1,3 @@ -'use strict'; - var _ = require('lodash'); var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -29,12 +27,12 @@ let getMembers = () => ({ * @returns reduced comment * @private */ -function pick(comment /*: Comment */) /*: ?ReducedComment */ { +function pick(comment) { if (typeof comment.name !== 'string') { return undefined; } - var item /*: ReducedComment */ = { + var item = { name: comment.name, kind: comment.kind }; @@ -51,7 +49,7 @@ function pick(comment /*: Comment */) /*: ?ReducedComment */ { * @returns {Array} nested comments, with only root comments * at the top level. */ -module.exports = function(comments /*: Array*/) { +module.exports = function(comments) { var id = 0, root = { members: getMembers() @@ -175,26 +173,23 @@ module.exports = function(comments /*: Array*/) { global: '' }; - comment.namespace = comment.path.reduce( - (memo, part) => { - if (part.kind === 'event') { - return memo + '.event:' + part.name; - } - let scopeChar = ''; - if (part.scope) { - scopeChar = scopeChars[part.scope]; - } - return memo + scopeChar + part.name; - }, - '' - ); + comment.namespace = comment.path.reduce((memo, part) => { + if (part.kind === 'event') { + return memo + '.event:' + part.name; + } + let scopeChar = ''; + if (part.scope) { + scopeChar = scopeChars[part.scope]; + } + return memo + scopeChar + part.name; + }, ''); if (hasUndefinedParent) { var memberOfTag = comment.tags.filter( tag => tag.title === 'memberof' )[0]; - var memberOfTagLineNumber = (memberOfTag && memberOfTag.lineNumber) || - 0; + var memberOfTagLineNumber = + (memberOfTag && memberOfTag.lineNumber) || 0; comment.errors.push({ message: `@memberof reference to ${comment.memberof} not found`, diff --git a/lib/index.js b/src/index.js similarity index 93% rename from lib/index.js rename to src/index.js index 653cb43d2..e06f04986 100644 --- a/lib/index.js +++ b/src/index.js @@ -1,5 +1,3 @@ -'use strict'; - var fs = require('fs'), _ = require('lodash'), sort = require('./sort'), @@ -44,10 +42,7 @@ function pipeline(fns) { }; } -function configure( - indexes /*: Array */, - args /*: Object */ -) /*: Promise */ { +function configure(indexes, args) { let mergedConfig = mergeConfig(args); return mergedConfig.then(config => { @@ -70,10 +65,7 @@ function configure( * @param {Object} config options * @returns {Promise>} promise with results */ -function expandInputs( - indexes /*: string|Array */, - config /*: DocumentationConfig */ -) { +function expandInputs(indexes, config) { // Ensure that indexes is an array of strings indexes = [].concat(indexes); @@ -187,8 +179,7 @@ function lintInternal(inputsAndConfig) { * } * }); */ -let lint = (indexes /*: Array */, args) => - configure(indexes, args).then(lintInternal); +let lint = (indexes, args) => configure(indexes, args).then(lintInternal); /** * Generate JavaScript documentation as a list of parsed JSDoc @@ -231,8 +222,7 @@ let lint = (indexes /*: Array */, args) => * // any other kind of code data. * }); */ -let build = (indexes /*: Array */, args /*: Object */) => - configure(indexes, args).then(buildInternal); +let build = (indexes, args) => configure(indexes, args).then(buildInternal); /** * Documentation's formats are modular methods that take comments @@ -244,7 +234,7 @@ let build = (indexes /*: Array */, args /*: Object */) => var formats = { html: require('./output/html'), md: require('./output/markdown'), - remark: (comments /*: Array */, config /*: DocumentationConfig */) => + remark: (comments, config) => markdownAST(comments, config).then(res => JSON.stringify(res, null, 2)), json: require('./output/json') }; diff --git a/lib/infer/access.js b/src/infer/access.js similarity index 86% rename from lib/infer/access.js rename to src/infer/access.js index 1141fd501..5908b2a87 100644 --- a/lib/infer/access.js +++ b/src/infer/access.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ /** @@ -9,7 +8,7 @@ * @returns {Function} inference method * @private */ -function inferAccessWithPattern(pattern /*: ?string*/) { +function inferAccessWithPattern(pattern: ?string) { var re = pattern && new RegExp(pattern); /** @@ -19,7 +18,7 @@ function inferAccessWithPattern(pattern /*: ?string*/) { * @param {Object} comment parsed comment * @returns {Object} comment with access inferred */ - return function inferAccess(comment /*: Comment */) { + return function inferAccess(comment: Comment) { // This needs to run after inferName beacuse we infer the access based on // the name. if ( diff --git a/lib/infer/augments.js b/src/infer/augments.js similarity index 87% rename from lib/infer/augments.js rename to src/infer/augments.js index 988df7dbe..1801eefb5 100644 --- a/lib/infer/augments.js +++ b/src/infer/augments.js @@ -1,8 +1,7 @@ -'use strict'; /* @flow */ -var generate = require('babel-generator').default, - findTarget = require('./finders').findTarget; +import generate from 'babel-generator'; +var findTarget = require('./finders').findTarget; /** * Infers an `augments` tag from an ES6 class declaration @@ -10,7 +9,7 @@ var generate = require('babel-generator').default, * @param {Object} comment parsed comment * @returns {Object} comment with kind inferred */ -function inferAugments(comment /*: Comment */) { +function inferAugments(comment: Comment) { if (comment.augments.length) { return comment; } diff --git a/lib/infer/finders.js b/src/infer/finders.js similarity index 94% rename from lib/infer/finders.js rename to src/infer/finders.js index f3cd5d88d..645c22b86 100644 --- a/lib/infer/finders.js +++ b/src/infer/finders.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var t = require('babel-types'); @@ -11,7 +10,7 @@ var t = require('babel-types'); * @returns {?Object} ast path, if one is found. * @private */ -function findTarget(path /*: Object */) { +function findTarget(path: Object) { if (!path) { return path; } diff --git a/lib/infer/kind.js b/src/infer/kind.js similarity index 96% rename from lib/infer/kind.js rename to src/infer/kind.js index a92ac5746..be0310927 100644 --- a/lib/infer/kind.js +++ b/src/infer/kind.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var t = require('babel-types'); @@ -9,7 +8,7 @@ var t = require('babel-types'); * @param {Object} comment parsed comment * @returns {Object} comment with kind inferred */ -function inferKind(comment /*: Comment*/) { +function inferKind(comment: Comment) { if (comment.kind) { return comment; } diff --git a/lib/infer/membership.js b/src/infer/membership.js similarity index 96% rename from lib/infer/membership.js rename to src/infer/membership.js index ecf558374..2b2f852da 100644 --- a/lib/infer/membership.js +++ b/src/infer/membership.js @@ -1,14 +1,15 @@ -'use strict'; /* @flow */ var n = require('babel-types'), pathParse = require('parse-filepath'), - isJSDocComment = require('../../lib/is_jsdoc_comment'), - parse = require('../../lib/parse'); + isJSDocComment = require('../is_jsdoc_comment'), + parse = require('../parse'); function inferModuleName(comment) { - return (comment.kind === 'module' && comment.name) || - pathParse(comment.context.file).name; + return ( + (comment.kind === 'module' && comment.name) || + pathParse(comment.context.file).name + ); } /** @@ -155,7 +156,7 @@ function countModuleIdentifiers(comment, identifiers) { * @param comment parsed comment * @returns the normalized comment */ -function normalizeMemberof(comment /*: Comment*/) /*: Comment */ { +function normalizeMemberof(comment: Comment): Comment { if (typeof comment.memberof != 'string') { return comment; } @@ -240,7 +241,7 @@ module.exports = function() { return comment; } - function shouldSkipInference(comment /*: Comment */) /*: boolean */ { + function shouldSkipInference(comment: Comment): boolean { // If someone uses the @name tag, they explicitly ask for inference // to be skipped. if (comment.tags.some(tag => tag.title === 'name')) { @@ -262,7 +263,7 @@ module.exports = function() { return false; } - return function inferMembership(comment /*: Comment */) { + return function inferMembership(comment: Comment) { // First skip inference if the user indicates it or if it isn't possible. if (shouldSkipInference(comment)) { return comment; @@ -382,7 +383,8 @@ module.exports = function() { if (objectParent) { // The @lends comment is sometimes attached to the first property rather than // the object expression itself. - var lendsIdentifiers = findLendsIdentifiers(objectParent) || + var lendsIdentifiers = + findLendsIdentifiers(objectParent) || findLendsIdentifiers(objectParent.get('properties')[0]); if (lendsIdentifiers) { diff --git a/lib/infer/name.js b/src/infer/name.js similarity index 95% rename from lib/infer/name.js rename to src/infer/name.js index 17bba104d..99048ffe6 100644 --- a/lib/infer/name.js +++ b/src/infer/name.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var pathParse = require('parse-filepath'), t = require('babel-types'); @@ -10,7 +9,7 @@ var pathParse = require('parse-filepath'), t = require('babel-types'); * @param {Object} comment parsed comment * @returns {Object} comment with name inferred */ -function inferName(comment /*: Comment */) { +function inferName(comment: Comment) { if (comment.name) { return comment; } @@ -75,7 +74,8 @@ function inferName(comment /*: Comment */) { */ StringLiteral(path) { if ( - path.parent.type === 'ObjectProperty' && path.node === path.parent.key + path.parent.type === 'ObjectProperty' && + path.node === path.parent.key ) { if (inferName(path, path.node)) { path.stop(); diff --git a/lib/infer/params.js b/src/infer/params.js similarity index 94% rename from lib/infer/params.js rename to src/infer/params.js index cb655f56f..cb9791000 100644 --- a/lib/infer/params.js +++ b/src/infer/params.js @@ -1,11 +1,10 @@ -'use strict'; /* @flow */ -const t = require('babel-types'); -const generate = require('babel-generator').default; -const _ = require('lodash'); -const findTarget = require('./finders').findTarget; -const flowDoctrine = require('../flow_doctrine'); +import * as t from 'babel-types'; +import generate from 'babel-generator'; +import _ from 'lodash'; +import finders from './finders'; +import flowDoctrine from '../flow_doctrine'; /** * Infers param tags by reading function parameter names @@ -13,8 +12,8 @@ const flowDoctrine = require('../flow_doctrine'); * @param {Object} comment parsed comment * @returns {Object} comment with parameters */ -function inferParams(comment /*: Comment */) { - var path = findTarget(comment.context.ast); +function inferParams(comment: Comment) { + var path = finders.findTarget(comment.context.ast); // In case of `/** */ var x = function () {}` findTarget returns // the declarator. @@ -56,7 +55,7 @@ function inferAndCombineParams(params, comment) { // const PATH_SPLIT_CAPTURING = /(\[])?(\.)/g; const PATH_SPLIT = /(?:\[])?\./g; -function tagDepth(tag /*: CommentTag */) /*: number */ { +function tagDepth(tag: CommentTag): number { return (tag.name || '').split(PATH_SPLIT).length; } @@ -90,9 +89,9 @@ function mapTags(tags) { */ function paramToDoc( param, - prefix /*: string */, - i /*: ?number */ -) /*: CommentTag|Array */ { + prefix: string, + i: ?number +): CommentTag | Array { const autoName = '$' + String(i); const prefixedName = prefix + '.' + param.name; @@ -194,7 +193,7 @@ function paramToDoc( } case 'RestProperty': // (a, ...b) case 'RestElement': { - let type /*: DoctrineType */ = { + let type: DoctrineType = { type: 'RestType' }; if (param.typeAnnotation) { @@ -209,7 +208,7 @@ function paramToDoc( } default: { // (a) - var newParam /*: CommentTag*/ = { + var newParam: CommentTag = { title: 'param', name: prefix ? prefixedName : param.name, lineNumber: param.loc.start.line @@ -327,8 +326,8 @@ function combineTags(inferredTag, explicitTag) { defaultValue = inferredTag.default; } - const hasProperties = (inferredTag.properties && - inferredTag.properties.length) || + const hasProperties = + (inferredTag.properties && inferredTag.properties.length) || (explicitTag.properties && explicitTag.properties.length); return _.assign( diff --git a/lib/infer/properties.js b/src/infer/properties.js similarity index 92% rename from lib/infer/properties.js rename to src/infer/properties.js index 375c92c6a..19b63dd95 100644 --- a/lib/infer/properties.js +++ b/src/infer/properties.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var flowDoctrine = require('../flow_doctrine'), @@ -11,7 +10,7 @@ function prefixedName(name, prefix) { return name; } -function propertyToDoc(property, prefix) /*: CommentTag */ { +function propertyToDoc(property, prefix): CommentTag { var type = flowDoctrine(property.value); if (property.optional) { type = { @@ -33,7 +32,7 @@ function propertyToDoc(property, prefix) /*: CommentTag */ { * @param {Object} comment parsed comment * @returns {Object} comment with inferred properties */ -function inferProperties(comment /*: Comment */) /*: Comment */ { +function inferProperties(comment: Comment): Comment { let explicitProperties = new Set(); // Ensure that explicitly specified properties are not overridden // by inferred properties diff --git a/lib/infer/return.js b/src/infer/return.js similarity index 94% rename from lib/infer/return.js rename to src/infer/return.js index 5e257f16d..e1bc147e5 100644 --- a/lib/infer/return.js +++ b/src/infer/return.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var findTarget = require('./finders').findTarget, @@ -12,7 +11,7 @@ var findTarget = require('./finders').findTarget, * @param {Object} comment parsed comment * @returns {Object} comment with return tag inferred */ -function inferReturn(comment /*: Comment */) { +function inferReturn(comment: Comment) { if ( Array.isArray(comment.returns) && comment.returns.length && diff --git a/lib/infer/type.js b/src/infer/type.js similarity index 95% rename from lib/infer/type.js rename to src/infer/type.js index 32af6c8e2..9d4d2b03a 100644 --- a/lib/infer/type.js +++ b/src/infer/type.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var findTarget = require('./finders').findTarget, @@ -18,7 +17,7 @@ var constTypeMapping = { * @param {Object} comment parsed comment * @returns {Object} comment with type tag inferred */ -function inferType(comment /*: Comment */) { +function inferType(comment: Comment) { if (comment.type) { return comment; } diff --git a/lib/inline_tokenizer.js b/src/inline_tokenizer.js similarity index 99% rename from lib/inline_tokenizer.js rename to src/inline_tokenizer.js index adfb85f40..30006cded 100644 --- a/lib/inline_tokenizer.js +++ b/src/inline_tokenizer.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; /** * Create a tokenizer method for Remark, our Markdown processor, diff --git a/lib/input/dependency.js b/src/input/dependency.js similarity index 82% rename from lib/input/dependency.js rename to src/input/dependency.js index c1bb5f1e8..add94a8f8 100644 --- a/lib/input/dependency.js +++ b/src/input/dependency.js @@ -1,11 +1,10 @@ -'use strict'; /* @flow */ var mdeps = require('module-deps-sortable'); var path = require('path'); var babelify = require('babelify'); var concat = require('concat-stream'); -var moduleFilters = require('../../lib/module_filters'); +var moduleFilters = require('../module_filters'); var smartGlob = require('../smart_glob.js'); /** @@ -20,9 +19,9 @@ var smartGlob = require('../smart_glob.js'); * @returns results */ function dependencyStream( - indexes /*: Array*/, - config /*: DocumentationConfig */ -) /*: Promise>*/ { + indexes: Array, + config: DocumentationConfig +): Promise> { var md = mdeps({ /** * Determine whether a module should be included in documentation @@ -66,11 +65,11 @@ function dependencyStream( inputs .filter( input => - // At this point, we may have allowed a JSON file to be caught by - // module-deps, or anything else allowed by requireExtension. - // otherwise module-deps would complain about - // it not being found. But Babel can't parse JSON, so we filter non-JavaScript - // files away. + // At this point, we may have allowed a JSON file to be caught by + // module-deps, or anything else allowed by requireExtension. + // otherwise module-deps would complain about + // it not being found. But Babel can't parse JSON, so we filter non-JavaScript + // files away. config.parseExtension.indexOf( path.extname(input.file).replace(/^\./, '') ) > -1 diff --git a/lib/input/shallow.js b/src/input/shallow.js similarity index 90% rename from lib/input/shallow.js rename to src/input/shallow.js index ed42fbe30..4ebf2cfaf 100644 --- a/lib/input/shallow.js +++ b/src/input/shallow.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var smartGlob = require('../smart_glob.js'); @@ -20,9 +19,9 @@ var smartGlob = require('../smart_glob.js'); * @return promise with parsed files */ module.exports = function( - indexes /*: Array*/, - config /*: DocumentationConfig */ -) /*: Promise>*/ { + indexes: Array, + config: DocumentationConfig +): Promise> { var objects = []; var strings = []; for (var index of indexes) { diff --git a/lib/is_jsdoc_comment.js b/src/is_jsdoc_comment.js similarity index 79% rename from lib/is_jsdoc_comment.js rename to src/is_jsdoc_comment.js index f76d76b5c..d24fb7a2e 100644 --- a/lib/is_jsdoc_comment.js +++ b/src/is_jsdoc_comment.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ /** @@ -20,8 +19,10 @@ module.exports = function isJSDocComment( }*/ ) { var asterisks = comment.value.match(/^(\*+)/); - return (comment.type === 'CommentBlock' || // estree - comment.type === 'Block') && // get-comments / traditional + return ( + (comment.type === 'CommentBlock' || // estree + comment.type === 'Block') && // get-comments / traditional asterisks && - asterisks[1].length === 1; + asterisks[1].length === 1 + ); }; diff --git a/lib/lint.js b/src/lint.js similarity index 86% rename from lib/lint.js rename to src/lint.js index b2fa03b0d..448c201ff 100644 --- a/lib/lint.js +++ b/src/lint.js @@ -1,10 +1,9 @@ -'use strict'; /* @flow */ -var VFile = require('vfile'), - walk = require('../lib/walk'), - vfileSort = require('vfile-sort'), - reporter = require('vfile-reporter'); +var VFile = require('vfile'); +import { walk } from './walk'; +import vfileSort from 'vfile-sort'; +import reporter from 'vfile-reporter'; var CANONICAL = { String: 'string', @@ -23,7 +22,7 @@ var CANONICAL = { * @param {Object} comment parsed comment * @returns {Array} array of errors */ -function lintComments(comment /*: Comment*/) { +function lintComments(comment: Comment) { comment.tags.forEach(function(tag) { function nameInvariant(name) { if (name && typeof CANONICAL[name] === 'string') { @@ -70,12 +69,13 @@ function lintComments(comment /*: Comment*/) { * @param {Array} comments a list of comments * @return {string} user-readable output */ -function formatLint(comments /*: Array*/) /*: string */ { +function formatLint(comments: Array): string { var vFiles = {}; walk(comments, function(comment) { comment.errors.forEach(function(error) { var p = comment.context.file; - vFiles[p] = vFiles[p] || + vFiles[p] = + vFiles[p] || new VFile({ path: p }); diff --git a/lib/merge_config.js b/src/merge_config.js similarity index 87% rename from lib/merge_config.js rename to src/merge_config.js index ad2e9f2c3..7d4cd8726 100644 --- a/lib/merge_config.js +++ b/src/merge_config.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var yaml = require('js-yaml'), @@ -9,10 +8,7 @@ var yaml = require('js-yaml'), path = require('path'), stripComments = require('strip-json-comments'); -function processToc( - config /*: DocumentationConfig */, - absFilePath /*: string*/ -) { +function processToc(config: DocumentationConfig, absFilePath: string) { if (!config || !config.toc) { return config; } @@ -36,7 +32,7 @@ function processToc( * @returns {Object} configuration with inferred parameters * @throws {Error} if the file cannot be read. */ -function mergePackage(config /*: Object */) /*: Promise */ { +function mergePackage(config: Object): Promise { if (config.noPackage) { return Promise.resolve(config); } @@ -50,7 +46,8 @@ function mergePackage(config /*: Object */) /*: Promise */ { (val, key) => `project-${key}` ), config - )) + ) + ) // Allow this to fail: this inference is not required. .catch(() => config) ); @@ -64,7 +61,7 @@ function mergePackage(config /*: Object */) /*: Promise */ { * @returns {Promise} configuration, if it can be parsed * @throws {Error} if the file cannot be read. */ -function mergeConfigFile(config) /*: Promise */ { +function mergeConfigFile(config): Promise { if (config && typeof config.config === 'string') { var filePath = config.config; var ext = path.extname(filePath); @@ -88,7 +85,7 @@ function mergeConfigFile(config) /*: Promise */ { return Promise.resolve(config || {}); } -function mergeConfig(config /*: Object */) /*: Promise */ { +function mergeConfig(config: Object): Promise { config.parseExtension = (config.parseExtension || []) .concat(['js', 'jsx', 'es5', 'es6']); diff --git a/lib/module_filters.js b/src/module_filters.js similarity index 89% rename from lib/module_filters.js rename to src/module_filters.js index 9cb4de09c..a288fa30f 100644 --- a/lib/module_filters.js +++ b/src/module_filters.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var path = require('path'); var micromatch = require('micromatch'); @@ -29,8 +28,8 @@ module.exports = { * options. */ externals: function externalModuleFilter( - indexes /*: Array*/, - options /*: Object*/ + indexes: Array, + options: Object ) { var externalFilters = false; if (options.external) { @@ -57,10 +56,11 @@ module.exports = { }); } - return function(id /*: string*/, file /*: string*/, pkg /*: Object*/) { + return function(id: string, file: string, pkg: Object) { var internal = internalModuleRegexp.test(id); - return internal || - (externalFilters && externalFilters.some(f => f(file, pkg))); + return ( + internal || (externalFilters && externalFilters.some(f => f(file, pkg))) + ); }; } }; diff --git a/lib/nest.js b/src/nest.js similarity index 92% rename from lib/nest.js rename to src/nest.js index b776e93c7..bf760449d 100644 --- a/lib/nest.js +++ b/src/nest.js @@ -1,13 +1,10 @@ /* @flow */ -'use strict'; var _ = require('lodash'); const PATH_SPLIT = /(?:\[])?\./g; -function removeUnnamedTags( - tags /*: Array */ -) /*: Array */ { +function removeUnnamedTags(tags: Array): Array { return tags.filter(tag => typeof tag.name === 'string'); } @@ -36,7 +33,7 @@ var tagDepth = tag => tag.name.split(PATH_SPLIT).length; * @returns {Object} nested comment */ var nestTag = ( - tags /*: Array */ + tags: Array // Use lodash here both for brevity and also because, unlike JavaScript's // sort, it's stable. ) => @@ -54,7 +51,8 @@ var nestTag = ( } else { // The recursive case: try to find the child that owns // this tag. - let child = node.properties && + let child = + node.properties && node.properties.find( property => parts[0] === _.last(property.name.split(PATH_SPLIT)) ); @@ -92,7 +90,7 @@ var nestTag = ( * @param {Object} comment input comment * @return {Object} nested comment */ -var nest = (comment /*: Comment*/) => +var nest = (comment: Comment) => _.assign(comment, { params: nestTag(comment.params), properties: nestTag(comment.properties) diff --git a/lib/output/highlighter.js b/src/output/highlighter.js similarity index 82% rename from lib/output/highlighter.js rename to src/output/highlighter.js index 639043337..90ce41731 100644 --- a/lib/output/highlighter.js +++ b/src/output/highlighter.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var visit = require('unist-util-visit'); var hljs = require('highlight.js'); @@ -13,13 +12,14 @@ var hljs = require('highlight.js'); function visitor(node) { if (node.lang) { node.type = 'html'; - node.value = "
" +
+    node.value =
+      "
" +
       hljs.highlightAuto(node.value, [node.lang]).value +
       '
'; } } -module.exports = function(ast /*: Object*/) { +module.exports = function(ast: Object) { visit(ast, 'code', visitor); return ast; }; diff --git a/lib/output/html.js b/src/output/html.js similarity index 87% rename from lib/output/html.js rename to src/output/html.js index f4ca68228..16a5f6f81 100644 --- a/lib/output/html.js +++ b/src/output/html.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var path = require('path'); @@ -24,9 +23,9 @@ var mergeConfig = require('../merge_config'); * streamArray(output).pipe(vfs.dest('./output-directory')); * }); */ -function html(comments /*: Array*/, config /*: DocumentationConfig*/) { +function html(comments: Array, config: DocumentationConfig) { return mergeConfig(config).then(config => { - var themePath = '../../default_theme/'; + var themePath = '../default_theme/'; if (config.theme) { themePath = path.resolve(process.cwd(), config.theme); } diff --git a/lib/output/json.js b/src/output/json.js similarity index 85% rename from lib/output/json.js rename to src/output/json.js index 1e61b253b..a210c6362 100644 --- a/lib/output/json.js +++ b/src/output/json.js @@ -1,7 +1,6 @@ -'use strict'; /* @flow */ -var walk = require('../walk'); +import { walk } from '../walk'; /** * Formats documentation as a JSON string. @@ -20,7 +19,7 @@ var walk = require('../walk'); * fs.writeFileSync('./output.json', output); * }); */ -function json(comments /*: Array*/) /*: Promise*/ { +function json(comments: Array): Promise { walk(comments, comment => { delete comment.errors; if (comment.context) { diff --git a/lib/output/markdown.js b/src/output/markdown.js similarity index 87% rename from lib/output/markdown.js rename to src/output/markdown.js index 33f8456ef..29a3127e2 100644 --- a/lib/output/markdown.js +++ b/src/output/markdown.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var remark = require('remark'), markdownAST = require('./markdown_ast'); @@ -23,10 +22,7 @@ var remark = require('remark'), markdownAST = require('./markdown_ast'); * fs.writeFileSync('./output.md', output); * }); */ -function markdown( - comments /*: Array*/, - args /*: Object*/ -) /*: Promise */ { +function markdown(comments: Array, args: Object): Promise { return markdownAST(comments, args).then(ast => remark().stringify(ast)); } diff --git a/lib/output/markdown_ast.js b/src/output/markdown_ast.js similarity index 78% rename from lib/output/markdown_ast.js rename to src/output/markdown_ast.js index 2a7f10bec..ab1b1dae7 100644 --- a/lib/output/markdown_ast.js +++ b/src/output/markdown_ast.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var u = require('unist-builder'), remark = require('remark'), @@ -25,13 +24,13 @@ var DEFAULT_LANGUAGE = 'javascript'; * consult hljs.configure for the full list. * @returns {Promise} returns an eventual Markdown value */ -function markdownAST(comments /*: Array */, args /*: Object */) { +function markdownAST(comments: Array, args: Object) { return mergeConfig(args).then(config => buildMarkdownAST(comments, config)); } function buildMarkdownAST( - comments /*: Array */, - config /*: DocumentationConfig*/ + comments: Array, + config: DocumentationConfig ) { // Configure code highlighting var hljsOptions = config.hljs || {}; @@ -65,13 +64,15 @@ function buildMarkdownAST( * @param {Object} comment a single comment * @returns {Object} remark-compatible AST */ - function generate(depth /*: number */, comment /*: Comment */) { - function typeSection(comment /*: Comment */) { - return comment.type && - u('paragraph', [u('text', 'Type: ')].concat(formatType(comment.type))); + function generate(depth: number, comment: Comment) { + function typeSection(comment: Comment) { + return ( + comment.type && + u('paragraph', [u('text', 'Type: ')].concat(formatType(comment.type))) + ); } - function paramList(params /*: Array */) { + function paramList(params: Array) { if (params.length === 0) return []; return u( 'list', @@ -102,25 +103,30 @@ function buildMarkdownAST( ] .concat(param.properties && paramList(param.properties)) .filter(Boolean) - )) + ) + ) ); } - function paramSection(comment /*: Comment */) { - return comment.params.length > 0 && [ - u('strong', [u('text', 'Parameters')]), - paramList(comment.params) - ]; + function paramSection(comment: Comment) { + return ( + comment.params.length > 0 && [ + u('strong', [u('text', 'Parameters')]), + paramList(comment.params) + ] + ); } - function propertySection(comment /*: Comment */) { - return comment.properties.length > 0 && [ - u('strong', [u('text', 'Properties')]), - propertyList(comment.properties) - ]; + function propertySection(comment: Comment) { + return ( + comment.properties.length > 0 && [ + u('strong', [u('text', 'Properties')]), + propertyList(comment.properties) + ] + ); } - function propertyList(properties /*: Array */) { + function propertyList(properties: Array) { return u( 'list', { ordered: false }, @@ -143,33 +149,34 @@ function buildMarkdownAST( ), property.properties && propertyList(property.properties) ].filter(Boolean) - )) + ) + ) ); } - function examplesSection(comment /*: Comment */) { - return comment.examples.length > 0 && + function examplesSection(comment: Comment) { + return ( + comment.examples.length > 0 && [u('strong', [u('text', 'Examples')])].concat( - comment.examples.reduce( - function(memo, example) { - var language = hljsOptions.highlightAuto - ? hljs.highlightAuto(example.description).language - : DEFAULT_LANGUAGE; - return memo - .concat( - example.caption - ? [u('paragraph', [u('emphasis', example.caption)])] - : [] - ) - .concat([u('code', { lang: language }, example.description)]); - }, - [] - ) - ); + comment.examples.reduce(function(memo, example) { + var language = hljsOptions.highlightAuto + ? hljs.highlightAuto(example.description).language + : DEFAULT_LANGUAGE; + return memo + .concat( + example.caption + ? [u('paragraph', [u('emphasis', example.caption)])] + : [] + ) + .concat([u('code', { lang: language }, example.description)]); + }, []) + ) + ); } - function returnsSection(comment /*: Comment */) { - return comment.returns.length > 0 && + function returnsSection(comment: Comment) { + return ( + comment.returns.length > 0 && comment.returns.map(returns => u( 'paragraph', @@ -178,11 +185,14 @@ function buildMarkdownAST( u('strong', formatType(returns.type)), u('text', ' ') ].concat(returns.description ? returns.description.children : []) - )); + ) + ) + ); } - function throwsSection(comment /*: Comment */) { - return comment.throws.length > 0 && + function throwsSection(comment: Comment) { + return ( + comment.throws.length > 0 && u( 'list', { ordered: false }, @@ -198,34 +208,42 @@ function buildMarkdownAST( returns.description ? returns.description.children : [] ) ) - ])) - ); + ]) + ) + ) + ); } - function augmentsLink(comment /*: Comment */) { - return comment.augments.length > 0 && + function augmentsLink(comment: Comment) { + return ( + comment.augments.length > 0 && u('paragraph', [ u('strong', [ u('text', 'Extends '), u('text', comment.augments.map(tag => tag.name).join(', ')) ]) - ]); + ]) + ); } - function seeLink(comment /*: Comment */) { - return comment.sees.length > 0 && + function seeLink(comment: Comment) { + return ( + comment.sees.length > 0 && u( 'list', { ordered: false }, comment.sees.map(see => u('listItem', [ u('strong', [u('text', 'See: ')].concat(see.children)) - ])) - ); + ]) + ) + ) + ); } - function githubLink(comment /*: Comment */) { - return comment.context && + function githubLink(comment: Comment) { + return ( + comment.context && comment.context.github && u('paragraph', [ u( @@ -245,10 +263,11 @@ function buildMarkdownAST( ) ] ) - ]); + ]) + ); } - function metaSection(comment /*: Comment */) { + function metaSection(comment: Comment) { let meta = [ 'version', 'since', @@ -257,7 +276,8 @@ function buildMarkdownAST( 'license', 'deprecated' ].filter(tag => comment[tag]); - return !!meta.length && + return ( + !!meta.length && [u('strong', [u('text', 'Meta')])].concat( u( 'list', @@ -278,7 +298,8 @@ function buildMarkdownAST( ]); }) ) - ); + ) + ); } if (comment.kind === 'note') { diff --git a/lib/output/util/format_type.js b/src/output/util/format_type.js similarity index 98% rename from lib/output/util/format_type.js rename to src/output/util/format_type.js index 37d79b8b4..4e2ad406f 100644 --- a/lib/output/util/format_type.js +++ b/src/output/util/format_type.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var Syntax = require('doctrine-temporary-fork').Syntax, u = require('unist-builder'); @@ -101,7 +100,7 @@ function decorate(formatted, str, prefix) { * formatType({ type: 'NameExpression', name: 'String' })[0].url * // => 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String' */ -function formatType(getHref /*: Function*/, node /*: ?Object */) { +function formatType(getHref: Function, node: ?Object) { var result = []; if (!node) { diff --git a/lib/output/util/formatters.js b/src/output/util/formatters.js similarity index 88% rename from lib/output/util/formatters.js rename to src/output/util/formatters.js index f371894a1..a5c523afe 100644 --- a/lib/output/util/formatters.js +++ b/src/output/util/formatters.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var remark = require('remark'), html = require('remark-html'), Syntax = require('doctrine-temporary-fork').Syntax, @@ -15,7 +14,7 @@ var remark = require('remark'), * @param getHref linker method * @returns {formatters} formatter object */ -module.exports = function(getHref /*: Function*/) { +module.exports = function(getHref: Function) { var rerouteLinks = _rerouteLinks.bind(undefined, getHref); var formatters = {}; @@ -29,10 +28,7 @@ module.exports = function(getHref /*: Function*/) { * @param {boolean} short whether to cut the details and make it skimmable * @returns {string} formatted parameter representation. */ - formatters.parameter = function( - param /*: Object*/, - short /*: boolean */ - ) /*: string */ { + formatters.parameter = function(param: Object, short: boolean): string { if (short) { if (param.type && param.type.type == Syntax.OptionalType) { if (param.default) { @@ -63,7 +59,7 @@ module.exports = function(getHref /*: Function*/) { * @param {Object} type doctrine-format type * @returns {string} HTML */ - formatters.type = function(type /*: Object*/) { + formatters.type = function(type: Object) { return formatters .markdown(u('root', formatType(getHref, type))) .replace(/\n/g, ''); @@ -74,7 +70,7 @@ module.exports = function(getHref /*: Function*/) { * @param {string} text inner text of the link * @returns {string} potentially linked HTML */ - formatters.autolink = function(text /*: string*/) { + formatters.autolink = function(text: string) { var href = getHref(text); if (href) { // TODO: this is a temporary fix until we drop remark 3.x support, @@ -105,18 +101,17 @@ module.exports = function(getHref /*: Function*/) { * @param {boolean} short whether to cut the details and make it skimmable * @returns {string} formatted parameters */ - formatters.parameters = function( - section /*: Comment*/, - short /*: boolean */ - ) { + formatters.parameters = function(section: Comment, short: boolean) { if (section.params) { - return '(' + + return ( + '(' + section.params .map(function(param) { return formatters.parameter(param, short); }) .join(', ') + - ')'; + ')' + ); } return '()'; }; diff --git a/lib/output/util/linker_stack.js b/src/output/util/linker_stack.js similarity index 90% rename from lib/output/util/linker_stack.js rename to src/output/util/linker_stack.js index 1d9dd6b7e..49569fcce 100644 --- a/lib/output/util/linker_stack.js +++ b/src/output/util/linker_stack.js @@ -1,7 +1,6 @@ /* @flow */ -'use strict'; var globalsDocs = require('globals-docs'); -var walk = require('../../walk'); +import { walk } from '../../walk'; /** * Generate a linker method that links given hardcoded namepaths to URLs @@ -25,7 +24,7 @@ function pathsLinker(paths /* Object */) { * @param {*} input any input * @returns {*} any output */ -function firstPass(fns /*: Array */, input) { +function firstPass(fns: Array, input) { for (var i = 0; i < fns.length; i++) { var output = fns[i](input); if (output) { @@ -42,10 +41,10 @@ function firstPass(fns /*: Array */, input) { * @returns {Function} linker method */ class LinkerStack { - /* :: stack: Array */ - /* :: link: Function */ + stack: Array; + link: Function; - constructor(config /*: DocumentationConfig */) { + constructor(config: DocumentationConfig) { this.stack = []; if (config.defaultGlobals !== false) { @@ -85,7 +84,7 @@ class LinkerStack { * return '#' + slugger.slug(namespace); * }); */ - namespaceResolver(comments /*: Array */, resolver /*: Function */) { + namespaceResolver(comments: Array, resolver: Function) { var namespaces = {}; walk(comments, comment => { namespaces[comment.namespace] = true; @@ -107,7 +106,7 @@ class LinkerStack { * @returns {string?} URL target or maybe undefined * @private */ - _link(namepath /*: string */) { + _link(namepath: string) { return firstPass(this.stack, namepath); } } diff --git a/lib/output/util/reroute_links.js b/src/output/util/reroute_links.js similarity index 67% rename from lib/output/util/reroute_links.js rename to src/output/util/reroute_links.js index d8e902a3a..f5a189e37 100644 --- a/lib/output/util/reroute_links.js +++ b/src/output/util/reroute_links.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var visit = require('unist-util-visit'); /** @@ -9,13 +8,12 @@ var visit = require('unist-util-visit'); * @returns {Object} that ast with rerouted links * @private */ -module.exports = function rerouteLinks( - getHref /*: Function */, - ast /*: Object*/ -) { +module.exports = function rerouteLinks(getHref: Function, ast: Object) { visit(ast, 'link', function(node) { if ( - node.jsdoc && !node.url.match(/^(http|https|\.)/) && getHref(node.url) + node.jsdoc && + !node.url.match(/^(http|https|\.)/) && + getHref(node.url) ) { node.url = getHref(node.url); } diff --git a/lib/parse.js b/src/parse.js similarity index 98% rename from lib/parse.js rename to src/parse.js index d0d5f0a64..49b60d4de 100644 --- a/lib/parse.js +++ b/src/parse.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var doctrine = require('doctrine-temporary-fork'); @@ -115,7 +114,7 @@ var flatteners = { return; } - var example /*: CommentExample */ = { + var example: CommentExample = { description: tag.description }; @@ -236,7 +235,7 @@ var flatteners = { * @returns {undefined} has side-effects */ param(result, tag) { - var param /*: CommentTag */ = { + var param: CommentTag = { title: 'param', name: tag.name, lineNumber: tag.lineNumber // TODO: remove @@ -277,7 +276,7 @@ var flatteners = { * @returns {undefined} has side-effects */ property(result, tag) { - var property /*: CommentTag */ = { + var property: CommentTag = { title: 'property', name: tag.name, lineNumber: tag.lineNumber // TODO: remove @@ -322,7 +321,7 @@ var flatteners = { * @returns {undefined} has side-effects */ returns(result, tag) { - var returns /*: CommentTag */ = { + var returns: CommentTag = { description: parseMarkdown(tag.description), title: 'returns' }; @@ -567,11 +566,7 @@ function flattenKindShorthand(result, tag, key) { * @return {Comment} an object conforming to the * [documentation schema](https://github.com/documentationjs/api-json) */ -function parseJSDoc( - comment /*: string*/, - loc /*: ?Object*/, - context /*: ?Object*/ -) /*: Comment */ { +function parseJSDoc(comment: string, loc: ?Object, context: ?Object): Comment { var result = doctrine.parse(comment, { // have doctrine itself remove the comment asterisks from content unwrap: true, diff --git a/lib/parse_markdown.js b/src/parse_markdown.js similarity index 85% rename from lib/parse_markdown.js rename to src/parse_markdown.js index ae7dc5e6a..2e7d544f0 100644 --- a/lib/parse_markdown.js +++ b/src/parse_markdown.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var remark = require('remark'); var inlineTokenizer = require('./inline_tokenizer'); @@ -11,7 +10,7 @@ var inlineTokenizer = require('./inline_tokenizer'); * @returns {Object} abstract syntax tree * @private */ -function parseMarkdown(string /*: string */) { +function parseMarkdown(string: string) { return remark().use(inlineTokenizer).parse(string); } diff --git a/lib/parsers/README.md b/src/parsers/README.md similarity index 100% rename from lib/parsers/README.md rename to src/parsers/README.md diff --git a/lib/parsers/javascript.js b/src/parsers/javascript.js similarity index 89% rename from lib/parsers/javascript.js rename to src/parsers/javascript.js index f584cafc3..30690d1d3 100644 --- a/lib/parsers/javascript.js +++ b/src/parsers/javascript.js @@ -1,14 +1,14 @@ -'use strict'; /* @flow */ var _ = require('lodash'), t = require('babel-types'), - parse = require('../../lib/parse'), + parse = require('../parse'), walkComments = require('../extractors/comments'), walkExported = require('../extractors/exported'), util = require('util'), - debuglog = util.debuglog('documentation'), - parseToAst = require('./parse_to_ast'); + debuglog = util.debuglog('documentation'); + +import { parseToAst } from './parse_to_ast'; /** * Left-pad a string so that it can be sorted lexicographically. We sort @@ -34,7 +34,7 @@ function leftPad(str, width) { * @param {Object} config config * @return {Array} an array of parsed comments */ -function parseJavaScript(data /*: Object*/, config /*: DocumentationConfig */) { +function parseJavaScript(data: Object, config: DocumentationConfig) { var visited = new Set(); var ast = parseToAst(data.source, data.file); @@ -63,11 +63,8 @@ function _addComment( ) { // Avoid visiting the same comment twice as a leading // and trailing node - var key = data.file + - ':' + - commentLoc.start.line + - ':' + - commentLoc.start.column; + var key = + data.file + ':' + commentLoc.start.line + ':' + commentLoc.start.column; if (!visited.has(key)) { visited.add(key); diff --git a/lib/parsers/parse_to_ast.js b/src/parsers/parse_to_ast.js similarity index 84% rename from lib/parsers/parse_to_ast.js rename to src/parsers/parse_to_ast.js index eaa15821f..e9720e538 100644 --- a/lib/parsers/parse_to_ast.js +++ b/src/parsers/parse_to_ast.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var babylon = require('babylon'); @@ -24,8 +23,6 @@ var opts = { ] }; -function parseToAst(source /*: string*/) { +export function parseToAst(source: string) { return babylon.parse(source, opts); } - -module.exports = parseToAst; diff --git a/lib/parsers/polyglot.js b/src/parsers/polyglot.js similarity index 81% rename from lib/parsers/polyglot.js rename to src/parsers/polyglot.js index 8c55cfde7..a323972bc 100644 --- a/lib/parsers/polyglot.js +++ b/src/parsers/polyglot.js @@ -1,10 +1,9 @@ -'use strict'; /* @flow */ var getComments = require('get-comments'), _ = require('lodash'), - isJSDocComment = require('../../lib/is_jsdoc_comment'), - parse = require('../../lib/parse'); + isJSDocComment = require('../is_jsdoc_comment'), + parse = require('../parse'); /** * Documentation stream parser: this receives a module-dep item, @@ -13,7 +12,7 @@ var getComments = require('get-comments'), * @param sourceFile a chunk of data provided by module-deps * @return {Array} adds to memo */ -function parsePolyglot(sourceFile /*: SourceFile*/) { +function parsePolyglot(sourceFile: SourceFile) { return getComments(sourceFile.source, true) .filter(isJSDocComment) .map(comment => { diff --git a/lib/serve/error_page.js b/src/serve/error_page.js similarity index 90% rename from lib/serve/error_page.js rename to src/serve/error_page.js index 1b71b0299..0978561e8 100644 --- a/lib/serve/error_page.js +++ b/src/serve/error_page.js @@ -1,10 +1,10 @@ /* @flow */ /* eslint no-console: 0 */ -'use strict'; var File = require('vinyl'); var ansiHTML = require('ansi-html'); -var template = ''; @@ -26,7 +26,7 @@ ansiHTML.setColors({ * @param error parse or generation error * @returns {Object} vinyl file object */ -function errorPage(error /*: Error*/) { +function errorPage(error: Error) { var errorText = error.toString(); console.error(error); if (error.codeFrame) { diff --git a/lib/serve/server.js b/src/serve/server.js similarity index 76% rename from lib/serve/server.js rename to src/serve/server.js index 93915d8af..75efca443 100644 --- a/lib/serve/server.js +++ b/src/serve/server.js @@ -2,7 +2,6 @@ // This file triggers https://github.com/prettier/prettier/issues/1151 -'use strict'; var http = require('http'), mime = require('mime'), pify = require('pify'), @@ -10,12 +9,10 @@ var http = require('http'), liveReload = require('tiny-lr'), sep = require('path').sep; -/* :: declare type ServerFile = { relative: string, contents: string }; -*/ /** * A static file server designed to support documentation.js's --serve @@ -27,18 +24,20 @@ declare type ServerFile = { * @param port server port to serve on. */ class Server extends EventEmitter { - /* :: _lr: Object; */ - /* :: _port: number; */ - /* :: _files: Array; */ - /* :: _http: http.Server; */ + _lr: Object; + _disableLiveReload: boolean; + _port: number; + _files: Array; + _http: http.Server; - constructor(port /*: number*/) { + constructor(port: number, disableLiveReload?: boolean) { super(); if (typeof port !== 'number') { throw new Error('port argument required to initialize a server'); } this._port = port; this._files = []; + this._disableLiveReload = !!disableLiveReload; } /** @@ -48,7 +47,7 @@ class Server extends EventEmitter { * @param files new content. replaces any previously-set content. * @returns {Server} self */ - setFiles(files /*: Array */) { + setFiles(files: Array) { this._files = files; if (this._lr) { this._lr.changed({ body: { files: '*' } }); @@ -66,10 +65,7 @@ class Server extends EventEmitter { * @returns {undefined} nothing * @private */ - handler( - request /*: http.IncomingMessage */, - response /*: http.ServerResponse */ - ) { + handler(request: http.IncomingMessage, response: http.ServerResponse) { var path = request.url.substring(1); if (path === '') { path = 'index.html'; @@ -88,8 +84,7 @@ class Server extends EventEmitter { response.end('Not found'); } - // prettier-ignore - start()/*: Promise */ { + start(): Promise { /* * Boot up the server's HTTP & LiveReload endpoints. This method * can be called multiple times. @@ -98,41 +93,37 @@ class Server extends EventEmitter { */ return new Promise(resolve => { // idempotent - if (this._lr) { - return resolve(true); + if (this._http) { + return resolve(this); } - this._lr = liveReload(); + if (!this._disableLiveReload) { + this._lr = liveReload(); + } this._http = http.createServer(this.handler.bind(this)); return Promise.all([ - pify(this._lr.listen.bind(this._lr))(35729), + this._lr && pify(this._lr.listen.bind(this._lr))(35729), pify(this._http.listen.bind(this._http))(this._port) ]).then(() => { this.emit('listening'); - return resolve(true); + return resolve(this); }); }); } - // prettier-ignore - stop()/*: Promise */ { + stop(): Promise { /* * Shut down the server's HTTP & LiveReload endpoints. This method * can be called multiple times. */ - return new Promise(resolve => { - // idempotent - if (!this._lr) { - return resolve(true); - } - - this._http.close(() => { - this._lr.close(); - delete this._http; - delete this._lr; - resolve(true); - }); + return Promise.all([ + this._http && this._http.close(), + this._lr && this._lr.close() + ]).then(() => { + delete this._http; + delete this._lr; + return this; }); } } diff --git a/lib/smart_glob.js b/src/smart_glob.js similarity index 95% rename from lib/smart_glob.js rename to src/smart_glob.js index 2eab29320..8dc026b88 100644 --- a/lib/smart_glob.js +++ b/src/smart_glob.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; var fs = require('fs'); var path = require('path'); var glob = require('glob'); @@ -86,9 +85,7 @@ function resolveFileGlobPatterns(patterns, extensions) { * @param globPatterns Glob patterns. * @returns Resolved absolute filenames. */ -function listFilesToProcess( - globPatterns /*: Array*/ -) /*: Array */ { +function listFilesToProcess(globPatterns: Array): Array { var files = [], added = new Set(); var cwd = process.cwd(); @@ -127,10 +124,7 @@ function listFilesToProcess( return files; } -function smartGlob( - indexes /*: Array*/, - extensions /*: Array*/ -) { +function smartGlob(indexes: Array, extensions: Array) { return listFilesToProcess(resolveFileGlobPatterns(indexes, extensions)); } diff --git a/lib/sort.js b/src/sort.js similarity index 82% rename from lib/sort.js rename to src/sort.js index f6c85ae2a..2bc54bd51 100644 --- a/lib/sort.js +++ b/src/sort.js @@ -1,4 +1,3 @@ -'use strict'; /* @flow */ var parseMarkdown = require('./parse_markdown'); @@ -15,34 +14,25 @@ var fs = require('fs'); * @return {number} sorting value * @private */ -module.exports = function sortDocs( - comments /*: Array*/, - options /*: Object*/ -) { +module.exports = function sortDocs(comments: Array, options: Object) { if (!options || !options.toc) { return sortComments(comments, options && options.sortOrder); } - var indexes = options.toc.reduce( - function(memo, val, i) { - if (typeof val === 'object' && val.name) { - val.kind = 'note'; - memo[val.name] = i; - } else { - memo[val] = i; - } - return memo; - }, - Object.create(null) - ); - var toBeSorted = options.toc.reduce( - function(memo, val) { - if (typeof val === 'string') { - memo[val] = false; - } - return memo; - }, - Object.create(null) - ); + var indexes = options.toc.reduce(function(memo, val, i) { + if (typeof val === 'object' && val.name) { + val.kind = 'note'; + memo[val.name] = i; + } else { + memo[val] = i; + } + return memo; + }, Object.create(null)); + var toBeSorted = options.toc.reduce(function(memo, val) { + if (typeof val === 'string') { + memo[val] = false; + } + return memo; + }, Object.create(null)); // Table of contents 'theme' entries: defined as objects // in the YAML list var fixed = options.toc @@ -104,7 +94,7 @@ module.exports = function sortDocs( return fixed.concat(unfixed); }; -function compare(a /*: string */, b /*: string */) { +function compare(a: string, b: string) { return a.localeCompare(b, undefined, { caseFirst: 'upper' }); } diff --git a/lib/walk.js b/src/walk.js similarity index 79% rename from lib/walk.js rename to src/walk.js index c80bc2c10..28a3a2787 100644 --- a/lib/walk.js +++ b/src/walk.js @@ -1,5 +1,4 @@ /* @flow */ -'use strict'; /** * Apply a function to all comments within a hierarchy: this iterates @@ -10,11 +9,7 @@ * @param {Object} [options] options passed through to walker function * @returns {Array} comments */ -function walk( - comments /*: Array*/, - fn /*: Function*/, - options /*: ?Object*/ -) { +export function walk(comments: Array, fn: Function, options: ?Object) { comments.forEach(comment => { fn(comment, options); for (var scope in comment.members) { @@ -23,5 +18,3 @@ function walk( }); return comments; } - -module.exports = walk; diff --git a/test/bin-readme.js b/test/bin-readme.js deleted file mode 100644 index 8b082d9da..000000000 --- a/test/bin-readme.js +++ /dev/null @@ -1,166 +0,0 @@ -'use strict'; -var test = require('tap').test, - path = require('path'), - os = require('os'), - exec = require('child_process').exec, - tmp = require('tmp'), - fs = require('fs-extra'); - -function documentation(args, options, callback, parseJSON) { - if (!callback) { - callback = options; - options = {}; - } - - if (!options.cwd) { - options.cwd = __dirname; - } - - options.maxBuffer = 1024 * 1024; - - args.unshift('node ' + path.join(__dirname, '..', 'bin', 'documentation.js')); - - exec(args.join(' '), options, callback); -} - -var UPDATE = !!process.env.UPDATE; - -test('readme command', function(group) { - var fixtures = path.join(__dirname, 'fixture/readme'); - var sourceFile = path.join(fixtures, 'index.js'); - - tmp.dir({ unsafeCleanup: true }, function(err, d) { - group.error(err); - fs.copySync( - path.join(fixtures, 'README.input.md'), - path.join(d, 'README.md') - ); - fs.copySync(path.join(fixtures, 'index.js'), path.join(d, 'index.js')); - - // run tests after setting up temp dir - - group.test('--diff-only: changes needed', function(t) { - t.error(err); - var before = fs.readFileSync(path.join(d, 'README.md'), 'utf-8'); - documentation( - ['readme index.js --diff-only -s API'], - { cwd: d }, - function(err, stdout, stderr) { - var after = fs.readFileSync(path.join(d, 'README.md'), 'utf-8'); - t.ok(err); - t.notEqual(err.code, 0, 'exit nonzero'); - t.same(after, before, 'readme unchanged'); - t.end(); - } - ); - }); - - var expectedFile = path.join(fixtures, 'README.output.md'); - var expectedPath = path.join(fixtures, 'README.output.md'); - var expected = fs.readFileSync(expectedFile, 'utf-8'); - - group.test('updates README.md', function(t) { - documentation( - ['readme index.js -s API'], - { cwd: d }, - function(err, stdout) { - var outputPath = path.join(d, 'README.md'); - t.error(err); - - if (UPDATE) { - fs.writeFileSync( - expectedPath, - fs.readFileSync(outputPath, 'utf-8') - ); - } - - var actual = fs.readFileSync(outputPath, 'utf-8'); - t.same(actual, expected, 'generated readme output'); - t.end(); - } - ); - }); - - group.test('--readme-file', function(t) { - fs.copySync( - path.join(fixtures, 'README.input.md'), - path.join(d, 'other.md') - ); - documentation( - ['readme index.js -s API --readme-file other.md'], - { cwd: d }, - function(err, stdout) { - t.error(err); - var actualPath = path.join(d, 'other.md'); - if (UPDATE) { - fs.writeFileSync(actualPath, expected); - } - var actual = fs.readFileSync(actualPath, 'utf-8'); - t.same(actual, expected, 'generated readme output'); - t.end(); - } - ); - }); - - group.test('--diff-only: changes NOT needed', function(t) { - t.error(err); - fs.copySync( - path.join(fixtures, 'README.output.md'), - path.join(d, 'uptodate.md') - ); - documentation( - ['readme index.js --diff-only -s API --readme-file uptodate.md'], - { cwd: d }, - function(err, stdout, stderr) { - t.error(err); - t.match(stdout, 'is up to date.'); - t.end(); - } - ); - }); - - group.test('-s: not found', function(t) { - t.error(err); - fs.copySync( - path.join(fixtures, 'README.output.md'), - path.join(d, 'uptodate.md') - ); - documentation( - ['readme index.js --diff-only -s NOTFOUND --readme-file uptodate.md'], - { cwd: d }, - function(err, stdout, stderr) { - t.ok(err); - t.end(); - } - ); - }); - - group.test('requires -s option', function(t) { - documentation( - ['readme index.js'], - { cwd: d }, - function(err, stdout, stderr) { - t.ok(err); - t.ok(err.code !== 0, 'exit nonzero'); - t.match(stderr, 'Missing required argument: s'); - t.end(); - } - ); - }); - - var badFixturePath = path.join(__dirname, 'fixture/bad/syntax.input'); - group.test('errors on invalid syntax', function(t) { - documentation( - ['readme ' + badFixturePath + ' -s API --parseExtension input'], - { cwd: d }, - function(err, stdout, stderr) { - t.ok(err); - t.ok(err.code !== 0, 'exit nonzero'); - t.end(); - } - ); - }); - - group.end(); - }); -}); diff --git a/test/bin-watch-serve.js b/test/bin-watch-serve.js deleted file mode 100644 index 93036251f..000000000 --- a/test/bin-watch-serve.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; - -var test = require('tap').test, - path = require('path'), - os = require('os'), - get = require('./utils').get, - spawn = require('child_process').spawn, - fs = require('fs'); - -function documentation(args, options, callback, parseJSON) { - if (!callback) { - callback = options; - options = {}; - } - - if (!options.cwd) { - options.cwd = __dirname; - } - - options.maxBuffer = 1024 * 1024; - args.unshift(path.join(__dirname, '..', 'bin', 'documentation.js')); - - return spawn('node', args, options); -} - -function normalize(result) { - result.forEach(function(item) { - item.context.file = '[path]'; - }); - return result; -} - -var options = { timeout: 1000 * 120 }; - -test('harness', options, function(t) { - var docProcess = documentation(['fixture/simple.input.js', '--serve']); - t.ok(docProcess, 'creates a subprocess object'); - docProcess.kill(); - t.end(); -}); - -test('provides index.html', options, function(t) { - var docProcess = documentation(['serve', 'fixture/simple.input.js']); - docProcess.stdout.on('data', function(data) { - t.equal( - data.toString().trim(), - 'documentation.js serving on port 4001', - 'shows listening message' - ); - get('http://localhost:4001/', function(text) { - t.ok(text.match(//), 'sends an html index file'); - docProcess.kill(); - t.end(); - }); - }); -}); - -test('accepts port argument', options, function(t) { - var docProcess = documentation([ - 'serve', - 'fixture/simple.input.js', - '--port=4004' - ]); - docProcess.stdout.on('data', function(data) { - t.equal( - data.toString().trim(), - 'documentation.js serving on port 4004', - 'shows listening message' - ); - get('http://localhost:4004/', function(text) { - t.ok(text.match(//), 'sends an html index file'); - docProcess.kill(); - t.end(); - }); - }); -}); - -test('--watch', options, function(t) { - var tmpFile = path.join(os.tmpdir(), '/simple.js'); - fs.writeFileSync(tmpFile, '/** a function */function apples() {}'); - var docProcess = documentation(['serve', tmpFile, '--watch']); - docProcess.stdout.on('data', function(data) { - get('http://localhost:4001/', function(text) { - t.ok(text.match(/apples/), 'sends an html index file'); - fs.writeFileSync(tmpFile, '/** a function */function bananas() {}'); - function doGet() { - get('http://localhost:4001/', function(text) { - if (text.match(/bananas/)) { - docProcess.kill(); - t.end(); - } else { - setTimeout(doGet, 100); - } - }); - } - doGet(); - }); - }); -}); - -test('--watch', options, function(t) { - var tmpDir = os.tmpdir(); - var a = path.join(tmpDir, '/simple.js'); - var b = path.join(tmpDir, '/required.js'); - fs.writeFileSync(a, 'require("./required")'); - fs.writeFileSync(b, '/** soup */function soup() {}'); - var docProcess = documentation(['serve', a, '--watch']); - docProcess.stdout.on('data', function(data) { - get('http://localhost:4001/', function(text) { - t.ok(text.match(/soup/), 'sends an html index file'); - fs.writeFileSync(b, '/** nuts */function nuts() {}'); - function doGet() { - get('http://localhost:4001/', function(text) { - if (text.match(/nuts/)) { - docProcess.kill(); - t.end(); - } else { - setTimeout(doGet, 100); - } - }); - } - doGet(); - }); - }); -}); - -test('error page', options, function(t) { - var tmpDir = os.tmpdir(); - var a = path.join(tmpDir, '/simple.js'); - fs.writeFileSync(a, '**'); - var docProcess = documentation(['serve', a, '--watch']); - docProcess.stdout.on('data', function(data) { - get('http://localhost:4001/', function(text) { - t.ok(text.match(/Unexpected token/), 'emits an error page'); - docProcess.kill(); - t.end(); - }); - }); -}); diff --git a/test/bin.js b/test/bin.js deleted file mode 100644 index 9b412b493..000000000 --- a/test/bin.js +++ /dev/null @@ -1,593 +0,0 @@ -'use strict'; - -var test = require('tap').test, - path = require('path'), - os = require('os'), - exec = require('child_process').exec, - tmp = require('tmp'), - fs = require('fs-extra'); - -function documentation(args, options, callback, parseJSON) { - if (!callback) { - parseJSON = callback; - callback = options; - options = {}; - } - - if (!options.cwd) { - options.cwd = __dirname; - } - - options.maxBuffer = 1024 * 1024; - - args.unshift('node ' + path.join(__dirname, '..', 'bin', 'documentation.js')); - - exec(args.join(' '), options, function(err, stdout, stderr) { - if (err) { - return callback(err, stdout, stderr); - } - if (parseJSON === false) { - callback(err, stdout, stderr); - } else { - callback(err, JSON.parse(stdout), stderr); - } - }); -} - -function normalize(result) { - result.forEach(function(item) { - item.context.file = '[path]'; - }); - return result; -} - -var options = { timeout: 1000 * 120 }; - -test('documentation binary', options, function(t) { - documentation(['build fixture/simple.input.js'], function(err, data) { - t.error(err); - t.equal(data.length, 1, 'simple has no dependencies'); - t.end(); - }); -}); - -test('defaults to parsing package.json main', options, function(t) { - documentation( - ['build'], - { cwd: path.join(__dirname, '..') }, - function(err, data) { - t.error(err); - t.ok(data.length, 'we document ourself'); - t.end(); - } - ); -}); - -test('polyglot mode', options, function(t) { - documentation( - ['build fixture/polyglot/blend.cpp --polyglot'], - function(err, data) { - t.ifError(err); - if (process.env.UPDATE) { - fs.writeFileSync( - path.resolve(__dirname, 'fixture', 'polyglot/blend.json'), - JSON.stringify(normalize(data), null, 2), - 'utf8' - ); - } - var expected = fs.readFileSync( - path.resolve(__dirname, 'fixture', 'polyglot/blend.json'), - 'utf8' - ); - t.deepEqual(normalize(data), JSON.parse(expected), 'parsed C++ file'); - t.end(); - } - ); -}); - -test('accepts config file', options, function(t) { - documentation( - ['build fixture/sorting/input.js -c fixture/config.json'], - function(err, data) { - t.error(err); - if (process.env.UPDATE) { - fs.writeFileSync( - path.resolve(__dirname, 'fixture', 'sorting/output.json'), - JSON.stringify(normalize(data), null, 2), - 'utf8' - ); - } - var expected = fs.readFileSync( - path.resolve(__dirname, 'fixture', 'sorting/output.json'), - 'utf8' - ); - t.deepEqual( - normalize(data), - JSON.parse(expected), - 'respected sort order from config file' - ); - t.end(); - } - ); -}); - -test('accepts config file - reports failures', options, function(t) { - documentation( - ['build fixture/sorting/input.js -c fixture/config-bad.yml'], - {}, - function(err, data, stderr) { - t.error(err); - if (process.env.UPDATE) { - fs.writeFileSync( - path.resolve(__dirname, 'fixture', 'sorting/output-bad.txt'), - stderr, - 'utf8' - ); - } - var expected = fs.readFileSync( - path.resolve(__dirname, 'fixture', 'sorting/output-bad.txt'), - 'utf8' - ); - t.equal(stderr, expected, 'reported a missing toc entry'); - t.end(); - }, - false - ); -}); - -test('accepts config file - reports parse failures', options, function(t) { - documentation( - ['build fixture/sorting/input.js -c fixture/config-malformed.json'], - {}, - function(err, data, stderr) { - t.match(stderr, /SyntaxError/g, 'Reports a SyntaxError with bad config'); - t.end(); - }, - false - ); -}); - -test('--shallow option', function(t) { - documentation( - ['build --shallow fixture/internal.input.js'], - function(err, data) { - t.error(err); - t.equal(data.length, 0, 'should not check dependencies'); - t.end(); - } - ); -}); - -test('external modules option', function(t) { - documentation( - [ - 'build fixture/external.input.js ' + - '--external=external --external=external/node_modules' - ], - function(err, data) { - t.ifError(err); - t.equal(data.length, 2, 'Includes external file'); - t.end(); - } - ); -}); - -test('when a file is specified both in a glob and explicitly, it is only documented once', function(t) { - documentation( - ['build fixture/simple.input.js fixture/simple.input.*'], - function(err, data) { - t.ifError(err); - t.equal(data.length, 1, 'File is documented only once'); - t.end(); - } - ); -}); - -test('extension option', function(t) { - documentation( - [ - 'build fixture/extension/index.otherextension ' + - '--requireExtension=otherextension --parseExtension=otherextension' - ], - function(err, data) { - t.ifError(err); - t.equal(data.length, 1, 'includes a file with an arbitrary extension'); - t.end(); - } - ); -}); - -/* - * This tests that parseExtension adds extensions to smartGlob's - * look through directories. - */ -test('polyglot + parseExtension + smartGlob', function(t) { - documentation( - ['build fixture/polyglot ' + '--polyglot --parseExtension=cpp'], - function(err, data) { - t.ifError(err); - t.equal(data.length, 1, 'includes a file with an arbitrary extension'); - t.end(); - } - ); -}); - -test('extension option', function(t) { - documentation(['build fixture/extension.jsx'], function(err, data) { - t.ifError(err); - t.end(); - }); -}); - -test('invalid arguments', function(group) { - group.test('bad -f option', options, function(t) { - documentation( - ['build -f DOES-NOT-EXIST fixture/internal.input.js'], - {}, - function(err) { - t.ok(err, 'returns error'); - t.end(); - }, - false - ); - }); - - group.test('html with no destination', options, function(t) { - documentation(['build -f html fixture/internal.input.js'], function(err) { - t.ok( - err - .toString() - .match( - /The HTML output mode requires a destination directory set with -o/ - ), - 'needs dest for html' - ); - t.end(); - }); - }); - - group.test('bad command', function(t) { - documentation( - ['-f html fixture/internal.input.js'], - {}, - function(err, stdout, stderr) { - t.ok(err.code, 'exits nonzero'); - t.end(); - }, - false - ); - }); - - group.end(); -}); - -test('--config', options, function(t) { - var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); - fs.mkdirSync(dst); - var outputIndex = path.join(dst, 'index.html'); - var expectedOutputPath = path.join( - __dirname, - 'fixture/html/nested.config-output.html' - ); - documentation( - [ - 'build -c fixture/html/documentation.yml -f html fixture/html/nested.input.js -o ' + - dst - ], - function(err) { - t.notOk(err); - var output = fs.readFileSync(outputIndex, 'utf8'); - if (process.env.UPDATE) { - fs.writeFileSync(expectedOutputPath, output); - } - var expectedOutput = fs.readFileSync(expectedOutputPath, 'utf8'); - t.equal(expectedOutput, output, 'generates correct output'); - t.end(); - }, - false - ); -}); - -test('--version', options, function(t) { - documentation( - ['--version'], - {}, - function(err, output) { - t.ok(output, 'outputs version'); - t.end(); - }, - false - ); -}); - -test('lint command', function(group) { - group.test('generates lint output', options, function(t) { - documentation(['lint fixture/lint/lint.input.js'], function(err, data) { - var output = path.join(__dirname, 'fixture', 'lint', 'lint.output'); - data = data.toString().split('\n').slice(2).join('\n'); - if (process.env.UPDATE) { - fs.writeFileSync(output, data); - } - t.equal(err.code, 1); - if (os.type() === 'Windows_NT') { - data = data.replace('‼', '⚠'); - } - t.equal(data, fs.readFileSync(output, 'utf8'), 'outputs lint'); - t.end(); - }); - }); - - group.test('generates no output on a good file', options, function(t) { - documentation( - ['lint fixture/simple.input.js'], - {}, - function(err, data) { - t.equal(err, null); - t.equal(data, '', 'no output'); - t.end(); - }, - false - ); - }); - - group.test('exposes syntax error on a bad file', options, function(t) { - documentation( - ['lint fixture/bad/syntax.input', '--parseExtension input'], - {}, - function(err, data) { - t.ok(err.code > 0, 'exits with a > 0 exit code'); - t.end(); - }, - false - ); - }); - - group.test('lint with no inputs', options, function(t) { - documentation( - ['lint'], - { - cwd: path.join(__dirname, 'fixture/bad') - }, - function(err, data) { - t.ok(err.code > 0, 'exits with a > 0 exit code'); - t.end(); - }, - false - ); - }); - - group.end(); -}); - -test('given no files', options, function(t) { - documentation(['build'], function(err) { - t.ok( - err - .toString() - .match( - /documentation was given no files and was not run in a module directory/ - ), - 'no files given' - ); - t.end(); - }); -}); - -test('with an invalid command', options, function(t) { - documentation( - ['invalid'], - {}, - function(err) { - t.ok(err, 'returns error'); - t.end(); - }, - false - ); -}); - -test('--access flag', function(t) { - documentation( - ['build --shallow fixture/internal.input.js -a public'], - {}, - function(err, data) { - t.error(err); - t.equal(data, '[]'); - t.end(); - }, - false - ); -}); - -test('--private flag', function(t) { - documentation( - ['build fixture/internal.input.js --private'], - {}, - function(err, data) { - t.error(err); - t.ok(data.length > 2, 'outputs docs'); - t.end(); - }, - false - ); -}); - -test('--infer-private flag', function(t) { - documentation( - ['build fixture/infer-private.input.js --infer-private ^_'], - {}, - function(err, data) { - t.error(err); - - // This uses JSON.parse with a reviver used as a visitor. - JSON.parse(data, function(n, v) { - // Make sure we do not see any names that match `^_`. - if (n === 'name') { - t.equal(typeof v, 'string'); - t.ok(!/_$/.test(v)); - } - return v; - }); - t.end(); - }, - false - ); -}); - -test('write to file', options, function(t) { - var dst = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); - - documentation( - ['build --shallow fixture/internal.input.js -o ' + dst], - {}, - function(err, data) { - t.error(err); - t.equal(data, ''); - t.ok(fs.existsSync(dst), 'created file'); - t.end(); - }, - false - ); -}); - -test('write to html', options, function(t) { - var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); - fs.mkdirSync(dstDir); - - documentation( - ['build --shallow fixture/internal.input.js -f html -o ' + dstDir], - {}, - function(err, data) { - t.error(err); - t.equal(data, ''); - t.ok( - fs.existsSync(path.join(dstDir, 'index.html')), - 'created index.html' - ); - t.end(); - }, - false - ); -}); - -test('write to html with custom theme', options, function(t) { - var dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); - fs.mkdirSync(dstDir); - - documentation( - [ - 'build -t fixture/custom_theme --shallow fixture/internal.input.js -f html -o ' + - dstDir - ], - {}, - function(err, data) { - t.error(err); - t.equal(data, ''); - t.ok( - fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8'), - 'Hello world' - ); - t.end(); - }, - false - ); -}); - -test('write to html, highlightAuto', options, function(t) { - var fixture = 'fixture/auto_lang_hljs/multilanguage.input.js', - config = 'fixture/auto_lang_hljs/config.yml', - dstDir = path.join(os.tmpdir(), (Date.now() + Math.random()).toString()); - - fs.mkdirSync(dstDir); - - documentation( - ['build --shallow ' + fixture + ' -c ' + config + ' -f html -o ' + dstDir], - {}, - function(err) { - t.ifErr(err); - var result = fs.readFileSync(path.join(dstDir, 'index.html'), 'utf8'); - t.ok( - result.indexOf('42') > 0, - 'javascript is recognized by highlightjs' - ); - t.ok( - result.indexOf('[data-foo]') > - 0, - 'css is recognized by highlightjs' - ); - t.ok( - result.indexOf('data-foo') > 0, - 'html is recognized by highlightjs' - ); - t.end(); - }, - false - ); -}); - -test('fatal error', options, function(t) { - documentation( - ['build --shallow fixture/bad/syntax.input --parseExtension input'], - {}, - function(err) { - t.ok(err.toString().match(/Unexpected token/), 'reports syntax error'); - t.end(); - }, - false - ); -}); - -test( - 'build --document-exported', - function(t) { - documentation( - ['build fixture/document-exported.input.js --document-exported -f md'], - {}, - function(err, data) { - t.error(err); - - var outputfile = path.join( - __dirname, - 'fixture', - 'document-exported.output.md' - ); - if (process.env.UPDATE) { - fs.writeFileSync(outputfile, data, 'utf8'); - } - - var expect = fs.readFileSync(outputfile, 'utf-8'); - t.equal(data, expect); - t.end(); - }, - false - ); - }, - options -); - -test( - 'build large file without error (no deoptimized styling error)', - function(t) { - var dstFile = path.join( - os.tmpdir(), - (Date.now() + Math.random()).toString() - ) + '.js'; - var contents = ''; - for (var i = 0; i < 4e4; i++) { - contents += '/* - */\n'; - } - fs.writeFileSync(dstFile, contents, 'utf8'); - - documentation( - ['build ' + dstFile], - {}, - function(err, data, stderr) { - t.error(err); - t.equal(stderr, ''); - fs.unlinkSync(dstFile); - t.end(); - }, - false - ); - }, - options -); diff --git a/test/fixture/boolean-literal-type.output.json b/test/fixture/boolean-literal-type.output.json deleted file mode 100644 index fb5f85589..000000000 --- a/test/fixture/boolean-literal-type.output.json +++ /dev/null @@ -1,89 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "t", - "lineNumber": 2, - "type": { - "type": "BooleanLiteralType", - "value": true - } - }, - { - "title": "param", - "name": "f", - "lineNumber": 2, - "type": { - "type": "BooleanLiteralType", - "value": false - } - } - ], - "properties": [], - "returns": [ - { - "title": "returns", - "type": { - "type": "ArrayType", - "elements": [ - { - "type": "BooleanLiteralType", - "value": true - }, - { - "type": "BooleanLiteralType", - "value": false - } - ] - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "f", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f", - "kind": "function" - } - ], - "namespace": "f" - } -] \ No newline at end of file diff --git a/test/fixture/boolean-literal-type.output.md b/test/fixture/boolean-literal-type.output.md deleted file mode 100644 index da400ec81..000000000 --- a/test/fixture/boolean-literal-type.output.md +++ /dev/null @@ -1,14 +0,0 @@ - - -### Table of Contents - -- [f](#f) - -## f - -**Parameters** - -- `t` **`true`** -- `f` **`false`** - -Returns **\[`true`, `false`]** diff --git a/test/fixture/boolean-literal-type.output.md.json b/test/fixture/boolean-literal-type.output.md.json deleted file mode 100644 index c6e85d7d4..000000000 --- a/test/fixture/boolean-literal-type.output.md.json +++ /dev/null @@ -1,134 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "t" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "inlineCode", - "value": "true" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "f" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "inlineCode", - "value": "false" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "[" - }, - { - "type": "inlineCode", - "value": "true" - }, - { - "type": "text", - "value": ", " - }, - { - "type": "inlineCode", - "value": "false" - }, - { - "type": "text", - "value": "]" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/class.config.output.md b/test/fixture/class.config.output.md deleted file mode 100644 index ff4da14ba..000000000 --- a/test/fixture/class.config.output.md +++ /dev/null @@ -1,30 +0,0 @@ - - -## MyClass - -This is my class, a demo thing. - -**Properties** - -- `howMany` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how many things it contains - -### getFoo - -Get the number 42 - -**Parameters** - -- `getIt` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to get the number - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two - -### getUndefined - -Get undefined - -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything. - -## Hello - -World - diff --git a/test/fixture/class.output.json b/test/fixture/class.output.json deleted file mode 100644 index 37f1d9b70..000000000 --- a/test/fixture/class.output.json +++ /dev/null @@ -1,613 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my class, a demo thing.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 2, - "type": null, - "name": "MyClass" - }, - { - "title": "property", - "description": "how many things it contains", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "howMany" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [ - { - "title": "property", - "name": "howMany", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "how many things it contains", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "MyClass", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the number 42", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - } - } - }, - "tags": [ - { - "title": "param", - "description": "whether to get the number", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "boolean" - }, - "name": "getIt" - }, - { - "title": "returns", - "description": "forty-two", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 14, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 17, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "getIt", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "whether to get the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "forty-two", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getFoo", - "kind": "function", - "memberof": "MyClass", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - }, - { - "name": "getFoo", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "MyClass#getFoo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get undefined", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "does not return anything.", - "lineNumber": 2, - "type": { - "type": "UndefinedLiteral" - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 0 - }, - "end": { - "line": 22, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 23, - "column": 47 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "does not return anything.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "title": "returns", - "type": { - "type": "UndefinedLiteral" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getUndefined", - "kind": "function", - "memberof": "MyClass", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - }, - { - "name": "getUndefined", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "MyClass#getUndefined" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - } - ], - "namespace": "MyClass" - } -] \ No newline at end of file diff --git a/test/fixture/class.output.md b/test/fixture/class.output.md deleted file mode 100644 index 0c88fe44d..000000000 --- a/test/fixture/class.output.md +++ /dev/null @@ -1,31 +0,0 @@ - - -### Table of Contents - -- [MyClass](#myclass) - - [getFoo](#getfoo) - - [getUndefined](#getundefined) - -## MyClass - -This is my class, a demo thing. - -**Properties** - -- `howMany` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how many things it contains - -### getFoo - -Get the number 42 - -**Parameters** - -- `getIt` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to get the number - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two - -### getUndefined - -Get undefined - -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything. diff --git a/test/fixture/class.output.md.json b/test/fixture/class.output.md.json deleted file mode 100644 index 4292255b6..000000000 --- a/test/fixture/class.output.md.json +++ /dev/null @@ -1,448 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "MyClass" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my class, a demo thing.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "howMany" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "how many things it contains", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getFoo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the number 42", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "getIt" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "whether to get the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "forty-two", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getUndefined" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get undefined", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "type": "link", - "children": [ - { - "type": "text", - "value": "undefined" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "does not return anything.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/default-export-function.output.json b/test/fixture/default-export-function.output.json deleted file mode 100644 index 41c8774b9..000000000 --- a/test/fixture/default-export-function.output.json +++ /dev/null @@ -1,214 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "i am foo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "context": { - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "default-export-function.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "default-export-function.input", - "kind": "function" - } - ], - "namespace": "default-export-function.input" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "i am foo's son", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 23 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 22 - } - } - }, - "augments": [], - "errors": [ - { - "message": "@memberof reference to default-export-function.input not found", - "commentLineNumber": 0 - } - ], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "bar", - "kind": "function", - "memberof": "default-export-function.input", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "bar", - "kind": "function", - "scope": "static" - } - ], - "namespace": ".bar" - } -] \ No newline at end of file diff --git a/test/fixture/default-export-function.output.md b/test/fixture/default-export-function.output.md deleted file mode 100644 index f5751264f..000000000 --- a/test/fixture/default-export-function.output.md +++ /dev/null @@ -1,14 +0,0 @@ - - -### Table of Contents - -- [default-export-function.input](#default-export-functioninput) -- [bar](#bar) - -## default-export-function.input - -i am foo - -## bar - -i am foo's son diff --git a/test/fixture/default-export-function.output.md.json b/test/fixture/default-export-function.output.md.json deleted file mode 100644 index bebb70b41..000000000 --- a/test/fixture/default-export-function.output.md.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "default-export-function.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "i am foo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "bar" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "i am foo's son", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/document-exported-export-default-object.output.json b/test/fixture/document-exported-export-default-object.output.json deleted file mode 100644 index 891d8bc4c..000000000 --- a/test/fixture/document-exported-export-default-object.output.json +++ /dev/null @@ -1,108 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, - "context": { - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "document-exported-export-default-object.input", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "document-exported-export-default-object.input" - } - ], - "namespace": "document-exported-export-default-object.input" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - } - } - }, - "augments": [], - "errors": [ - { - "message": "@memberof reference to document-exported-export-default-object.input not found", - "commentLineNumber": 0 - } - ], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "x", - "memberof": "document-exported-export-default-object.input", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "x", - "scope": "static" - } - ], - "namespace": ".x" - } -] \ No newline at end of file diff --git a/test/fixture/document-exported-export-default-object.output.md b/test/fixture/document-exported-export-default-object.output.md deleted file mode 100644 index b2ffbf9a7..000000000 --- a/test/fixture/document-exported-export-default-object.output.md +++ /dev/null @@ -1,10 +0,0 @@ - - -### Table of Contents - -- [document-exported-export-default-object.input](#document-exported-export-default-objectinput) -- [x](#x) - -## document-exported-export-default-object.input - -## x diff --git a/test/fixture/document-exported-export-default-object.output.md.json b/test/fixture/document-exported-export-default-object.output.md.json deleted file mode 100644 index c79cb8e64..000000000 --- a/test/fixture/document-exported-export-default-object.output.md.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "document-exported-export-default-object.input" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "x" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/document-exported-export-default-value.output.json b/test/fixture/document-exported-export-default-value.output.json deleted file mode 100644 index 78ffad1f7..000000000 --- a/test/fixture/document-exported-export-default-value.output.json +++ /dev/null @@ -1,51 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, - "context": { - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "document-exported-export-default-value.input", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "document-exported-export-default-value.input" - } - ], - "namespace": "document-exported-export-default-value.input" - } -] \ No newline at end of file diff --git a/test/fixture/document-exported-export-default-value.output.md b/test/fixture/document-exported-export-default-value.output.md deleted file mode 100644 index f003118a1..000000000 --- a/test/fixture/document-exported-export-default-value.output.md +++ /dev/null @@ -1,7 +0,0 @@ - - -### Table of Contents - -- [document-exported-export-default-value.input](#document-exported-export-default-valueinput) - -## document-exported-export-default-value.input diff --git a/test/fixture/document-exported-export-default-value.output.md.json b/test/fixture/document-exported-export-default-value.output.md.json deleted file mode 100644 index 686f080df..000000000 --- a/test/fixture/document-exported-export-default-value.output.md.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "document-exported-export-default-value.input" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/document-exported.output.json b/test/fixture/document-exported.output.json deleted file mode 100644 index a5fbd453b..000000000 --- a/test/fixture/document-exported.output.json +++ /dev/null @@ -1,1808 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "z", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, - "context": { - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "zMethod", - "kind": "function", - "memberof": "z", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "z", - "kind": "class" - }, - { - "name": "zMethod", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "z#zMethod" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "z", - "kind": "class" - } - ], - "namespace": "z" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "yparam", - "lineNumber": 1 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "x", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "x", - "kind": "function" - } - ], - "namespace": "x" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, - "context": { - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Class", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 18 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "classMethod", - "kind": "function", - "memberof": "Class", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "classMethod", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Class#classMethod" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 22 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 22 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "classGetter", - "kind": "member", - "memberof": "Class", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "classGetter", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Class#classGetter" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 23 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 23 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "v", - "lineNumber": 7 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "classSetter", - "kind": "member", - "memberof": "Class", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "classSetter", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Class#classSetter" - } - ], - "events": [], - "static": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 26 - } - }, - "context": { - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 26 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "staticMethod", - "kind": "function", - "memberof": "Class", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "staticMethod", - "kind": "function", - "scope": "static" - } - ], - "namespace": "Class.staticMethod" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 30 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 30 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "staticGetter", - "kind": "member", - "memberof": "Class", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "staticGetter", - "kind": "member", - "scope": "static" - } - ], - "namespace": "Class.staticGetter" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 31 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 31 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "v", - "lineNumber": 10 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "staticSetter", - "kind": "member", - "memberof": "Class", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Class", - "kind": "class" - }, - { - "name": "staticSetter", - "kind": "member", - "scope": "static" - } - ], - "namespace": "Class.staticSetter" - } - ] - }, - "path": [ - { - "name": "Class", - "kind": "class" - } - ], - "namespace": "Class" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, - "context": { - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T5", - "kind": "typedef", - "type": { - "type": "NameExpression", - "name": "boolean" - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T5", - "kind": "typedef" - } - ], - "namespace": "T5" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 18 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "y2Default", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "y2Default" - } - ], - "namespace": "y2Default" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Description of y3", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 24 - } - }, - "context": { - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 31 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "p", - "lineNumber": 8, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [ - { - "title": "returns", - "type": { - "type": "VoidLiteral" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "y4", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "y4", - "kind": "function" - } - ], - "namespace": "y4" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 19, - "column": 2 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 19, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "object", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 13 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 13 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "method", - "kind": "function", - "memberof": "object", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "object" - }, - { - "name": "method", - "kind": "function", - "scope": "static" - } - ], - "namespace": "object.method" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 17 - } - }, - "context": { - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 17 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "getter", - "kind": "member", - "memberof": "object", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "object" - }, - { - "name": "getter", - "kind": "member", - "scope": "static" - } - ], - "namespace": "object.getter" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 16, - "column": 18 - } - }, - "context": { - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 16, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "v", - "lineNumber": 16 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "setter", - "kind": "member", - "memberof": "object", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "object" - }, - { - "name": "setter", - "kind": "member", - "scope": "static" - } - ], - "namespace": "object.setter" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 17, - "column": 2 - }, - "end": { - "line": 17, - "column": 10 - } - }, - "context": { - "loc": { - "start": { - "line": 17, - "column": 2 - }, - "end": { - "line": 17, - "column": 10 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "prop", - "memberof": "object", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "object" - }, - { - "name": "prop", - "scope": "static" - } - ], - "namespace": "object.prop" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 21 - } - }, - "context": { - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 21 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "func", - "kind": "function", - "memberof": "object", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "object" - }, - { - "name": "func", - "kind": "function", - "scope": "static" - } - ], - "namespace": "object.func" - } - ] - }, - "path": [ - { - "name": "object" - } - ], - "namespace": "object" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 55, - "column": 0 - }, - "end": { - "line": 55, - "column": 16 - } - }, - "context": { - "loc": { - "start": { - "line": 55, - "column": 0 - }, - "end": { - "line": 55, - "column": 16 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "f1", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f1", - "kind": "function" - } - ], - "namespace": "f1" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 56, - "column": 0 - }, - "end": { - "line": 56, - "column": 16 - } - }, - "context": { - "loc": { - "start": { - "line": 56, - "column": 0 - }, - "end": { - "line": 56, - "column": 16 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "f3", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f3", - "kind": "function" - } - ], - "namespace": "f3" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 60, - "column": 0 - }, - "end": { - "line": 60, - "column": 23 - } - }, - "context": { - "loc": { - "start": { - "line": 60, - "column": 0 - }, - "end": { - "line": 60, - "column": 23 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T", - "kind": "typedef", - "type": { - "type": "NameExpression", - "name": "number" - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T", - "kind": "typedef" - } - ], - "namespace": "T" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 61, - "column": 0 - }, - "end": { - "line": 61, - "column": 17 - } - }, - "context": { - "loc": { - "start": { - "line": 61, - "column": 0 - }, - "end": { - "line": 61, - "column": 17 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T2", - "kind": "typedef", - "type": { - "type": "NameExpression", - "name": "string" - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T2", - "kind": "typedef" - } - ], - "namespace": "T2" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 62, - "column": 0 - }, - "end": { - "line": 62, - "column": 17 - } - }, - "context": { - "loc": { - "start": { - "line": 62, - "column": 0 - }, - "end": { - "line": 62, - "column": 17 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T4", - "kind": "typedef", - "type": { - "type": "NameExpression", - "name": "string" - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T4", - "kind": "typedef" - } - ], - "namespace": "T4" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 68, - "column": 0 - }, - "end": { - "line": 68, - "column": 34 - } - }, - "context": { - "loc": { - "start": { - "line": 68, - "column": 0 - }, - "end": { - "line": 68, - "column": 34 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 68, - "type": { - "type": "NameExpression", - "name": "X" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "f4", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f4", - "kind": "function" - } - ], - "namespace": "f4" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 72, - "column": 0 - }, - "end": { - "line": 74, - "column": 2 - } - }, - "context": { - "loc": { - "start": { - "line": 72, - "column": 0 - }, - "end": { - "line": 74, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "o1", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 10 - } - }, - "context": { - "loc": { - "start": { - "line": 73, - "column": 2 - }, - "end": { - "line": 73, - "column": 10 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "om1", - "kind": "function", - "memberof": "o1", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "o1" - }, - { - "name": "om1", - "kind": "function", - "scope": "static" - } - ], - "namespace": "o1.om1" - } - ] - }, - "path": [ - { - "name": "o1" - } - ], - "namespace": "o1" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "f5 comment", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 76, - "column": 0 - }, - "end": { - "line": 76, - "column": 17 - } - }, - "context": { - "loc": { - "start": { - "line": 77, - "column": 0 - }, - "end": { - "line": 80, - "column": 4 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "y", - "lineNumber": 77, - "type": { - "type": "NameExpression", - "name": "Y" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "f5", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f5", - "kind": "function" - } - ], - "namespace": "f5" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 78, - "column": 2 - }, - "end": { - "line": 80, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 78, - "column": 2 - }, - "end": { - "line": 80, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "o2", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 79, - "column": 4 - }, - "end": { - "line": 79, - "column": 12 - } - }, - "context": { - "loc": { - "start": { - "line": 79, - "column": 4 - }, - "end": { - "line": 79, - "column": 12 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "om2", - "kind": "function", - "memberof": "o2", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "o2" - }, - { - "name": "om2", - "kind": "function", - "scope": "static" - } - ], - "namespace": "o2.om2" - } - ] - }, - "path": [ - { - "name": "o2" - } - ], - "namespace": "o2" - } -] \ No newline at end of file diff --git a/test/fixture/document-exported.output.md b/test/fixture/document-exported.output.md deleted file mode 100644 index a75a60be3..000000000 --- a/test/fixture/document-exported.output.md +++ /dev/null @@ -1,140 +0,0 @@ - - -### Table of Contents - -- [z](#z) - - [zMethod](#zmethod) -- [x](#x) -- [Class](#class) - - [classMethod](#classmethod) - - [classGetter](#classgetter) - - [classSetter](#classsetter) - - [staticMethod](#staticmethod) - - [staticGetter](#staticgetter) - - [staticSetter](#staticsetter) -- [T5](#t5) -- [y2Default](#y2default) -- [y4](#y4) -- [object](#object) - - [method](#method) - - [getter](#getter) - - [setter](#setter) - - [prop](#prop) - - [func](#func) -- [f1](#f1) -- [f3](#f3) -- [T](#t) -- [T2](#t2) -- [T4](#t4) -- [f4](#f4) -- [o1](#o1) - - [om1](#om1) -- [f5](#f5) -- [o2](#o2) - - [om2](#om2) - -## z - -### zMethod - -## x - -**Parameters** - -- `yparam` - -## Class - -**Parameters** - -- `a` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** - -### classMethod - -### classGetter - -### classSetter - -**Parameters** - -- `v` - -### staticMethod - -### staticGetter - -### staticSetter - -**Parameters** - -- `v` - -## T5 - -Type: [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) - -## y2Default - -## y4 - -Description of y3 - -**Parameters** - -- `p` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -Returns **void** - -## object - -### method - -### getter - -### setter - -**Parameters** - -- `v` - -### prop - -### func - -## f1 - -## f3 - -## T - -Type: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) - -## T2 - -Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - -## T4 - -Type: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - -## f4 - -**Parameters** - -- `x` **X** - -## o1 - -### om1 - -## f5 - -f5 comment - -**Parameters** - -- `y` **Y** - -## o2 - -### om2 diff --git a/test/fixture/document-exported.output.md.json b/test/fixture/document-exported.output.md.json deleted file mode 100644 index f2c9224c7..000000000 --- a/test/fixture/document-exported.output.md.json +++ /dev/null @@ -1,827 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "z" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "zMethod" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "x" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "yparam" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Class" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "classMethod" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "classGetter" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "classSetter" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "v" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "staticMethod" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "staticGetter" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "staticSetter" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "v" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T5" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "y2Default" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "y4" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Description of y3", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "p" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "void" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "object" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "method" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getter" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "setter" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "v" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "prop" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "func" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f1" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f3" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T2" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T4" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f4" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "X" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "o1" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "om1" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f5" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "f5 comment", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "y" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Y" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "o2" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "om2" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/es6-class.output.json b/test/fixture/es6-class.output.json deleted file mode 100644 index 946da68c4..000000000 --- a/test/fixture/es6-class.output.json +++ /dev/null @@ -1,480 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my component. This is from issue #458", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 46, - "offset": 45 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 46, - "offset": 45 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 46, - "offset": 45 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 36 - } - } - }, - "augments": [ - { - "title": "augments", - "name": "React.Component" - } - ], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Foo", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Foo", - "kind": "class" - } - ], - "namespace": "Foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Does nothing. This is from issue #556", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "str" - } - ], - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 9, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 18, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "str", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Bar", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A useless property", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - } - } - }, - "tags": [ - { - "title": "type", - "description": null, - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "loc": { - "start": { - "line": 12, - "column": 4 - }, - "end": { - "line": 15, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 16, - "column": 4 - }, - "end": { - "line": 16, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "bar", - "memberof": "Bar", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Bar", - "kind": "class" - }, - { - "name": "bar", - "scope": "instance" - } - ], - "namespace": "Bar#bar" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Bar", - "kind": "class" - } - ], - "namespace": "Bar" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This class has fully inferred constructor parameters.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 54, - "offset": 53 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 54, - "offset": 53 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 54, - "offset": 53 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 20, - "column": 0 - }, - "end": { - "line": 22, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 25, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "n", - "lineNumber": 24, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "param", - "name": "l", - "lineNumber": 24, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Baz", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Baz", - "kind": "class" - } - ], - "namespace": "Baz" - } -] \ No newline at end of file diff --git a/test/fixture/es6-class.output.md b/test/fixture/es6-class.output.md deleted file mode 100644 index 2d128e772..000000000 --- a/test/fixture/es6-class.output.md +++ /dev/null @@ -1,35 +0,0 @@ - - -### Table of Contents - -- [Foo](#foo) -- [Bar](#bar) - - [bar](#bar-1) -- [Baz](#baz) - -## Foo - -**Extends React.Component** - -This is my component. This is from issue #458 - -## Bar - -Does nothing. This is from issue #556 - -**Parameters** - -- `str` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** - -### bar - -A useless property - -## Baz - -This class has fully inferred constructor parameters. - -**Parameters** - -- `n` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** -- `l` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** diff --git a/test/fixture/es6-class.output.md.json b/test/fixture/es6-class.output.md.json deleted file mode 100644 index 7b9f040a4..000000000 --- a/test/fixture/es6-class.output.md.json +++ /dev/null @@ -1,370 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Extends " - }, - { - "type": "text", - "value": "React.Component" - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my component. This is from issue #458", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 46, - "offset": 45 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 46, - "offset": 45 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Bar" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Does nothing. This is from issue #556", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "str" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "bar" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A useless property", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Baz" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This class has fully inferred constructor parameters.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 54, - "offset": 53 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 54, - "offset": 53 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "n" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "l" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/es6-default2.output.json b/test/fixture/es6-default2.output.json deleted file mode 100644 index 148b861ea..000000000 --- a/test/fixture/es6-default2.output.json +++ /dev/null @@ -1,66 +0,0 @@ -[ - { - "description": "", - "tags": [ - { - "title": "public", - "description": null, - "lineNumber": 1 - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 39 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "thisIsTheArgument", - "lineNumber": 4 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "access": "public", - "name": "es6-default2.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "es6-default2.input", - "kind": "function" - } - ], - "namespace": "es6-default2.input" - } -] \ No newline at end of file diff --git a/test/fixture/es6-default2.output.md b/test/fixture/es6-default2.output.md deleted file mode 100644 index 9cb89de6e..000000000 --- a/test/fixture/es6-default2.output.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### Table of Contents - -- [es6-default2.input](#es6-default2input) - -## es6-default2.input - -**Parameters** - -- `thisIsTheArgument` diff --git a/test/fixture/es6-default2.output.md.json b/test/fixture/es6-default2.output.md.json deleted file mode 100644 index 3e6561ebd..000000000 --- a/test/fixture/es6-default2.output.md.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "es6-default2.input" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "thisIsTheArgument" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/es6-import.output.json b/test/fixture/es6-import.output.json deleted file mode 100644 index 30eeb9928..000000000 --- a/test/fixture/es6-import.output.json +++ /dev/null @@ -1,452 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 8, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 41 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 9 - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "multiplyTwice", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "multiplyTwice", - "kind": "function" - } - ], - "namespace": "multiplyTwice" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is the default export frogs!", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "es6-ext", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "es6-ext" - } - ], - "namespace": "es6-ext" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 8, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "simple.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "simple.input", - "kind": "function" - } - ], - "namespace": "simple.input" - } -] \ No newline at end of file diff --git a/test/fixture/es6-import.output.md b/test/fixture/es6-import.output.md deleted file mode 100644 index 9ca299da6..000000000 --- a/test/fixture/es6-import.output.md +++ /dev/null @@ -1,27 +0,0 @@ - - -### Table of Contents - -- [multiplyTwice](#multiplytwice) -- [es6-ext](#es6-ext) -- [simple.input](#simpleinput) - -## multiplyTwice - -This function returns the number one. - -**Parameters** - -- `a` - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -## es6-ext - -This is the default export frogs! - -## simple.input - -This function returns the number one. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/es6-import.output.md.json b/test/fixture/es6-import.output.md.json deleted file mode 100644 index a07e50523..000000000 --- a/test/fixture/es6-import.output.md.json +++ /dev/null @@ -1,309 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "multiplyTwice" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "es6-ext" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is the default export frogs!", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "simple.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/es6.output.json b/test/fixture/es6.output.json deleted file mode 100644 index d90207223..000000000 --- a/test/fixture/es6.output.json +++ /dev/null @@ -1,2892 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 7, - "column": 4 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "$0", - "anonymous": true, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "name": "$0.phoneNumbers", - "lineNumber": 6, - "default": "[]" - }, - { - "title": "param", - "name": "$0.emailAddresses", - "lineNumber": 6, - "default": "[]" - }, - { - "title": "param", - "name": "$0.params", - "lineNumber": 6, - "type": { - "type": "RestType" - } - } - ], - "default": "{}" - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "destructure", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "destructure", - "kind": "function" - } - ], - "namespace": "destructure" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Similar, but with an array", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - } - } - }, - "tags": [ - { - "title": "example", - "description": "destructure([1, 2, 3])", - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 13, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 34 - } - } - }, - "augments": [], - "errors": [], - "examples": [ - { - "description": "destructure([1, 2, 3])" - } - ], - "params": [ - { - "title": "param", - "name": "$0", - "anonymous": true, - "type": { - "type": "NameExpression", - "name": "Array" - }, - "properties": [ - { - "title": "param", - "name": "$0.0", - "lineNumber": 14 - }, - { - "title": "param", - "name": "$0.1", - "lineNumber": 14 - }, - { - "title": "param", - "name": "$0.2", - "lineNumber": 14 - } - ] - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "destructure", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "destructure", - "kind": "function" - } - ], - "namespace": "destructure" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "param", - "description": "an array of numbers", - "lineNumber": 2, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - }, - "name": "a" - }, - { - "title": "returns", - "description": "numberone", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 20, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 31 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an array of numbers", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - } - } - }, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Number" - } - ] - } - }, - { - "title": "param", - "name": "b", - "lineNumber": 21 - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "multiply", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "multiply", - "kind": "function" - } - ], - "namespace": "multiply" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the height of the thing", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "height" - }, - { - "title": "param", - "description": "the width of the thing", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "width" - } - ], - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 27, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 28, - "column": 0 - }, - "end": { - "line": 60, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "height", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the height of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "param", - "name": "width", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the width of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Sink", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a property of the sink.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 34, - "column": 2 - }, - "end": { - "line": 36, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 37, - "column": 2 - }, - "end": { - "line": 37, - "column": 18 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "staticProp", - "kind": "member", - "memberof": "Sink", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "staticProp", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Sink#staticProp" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Is it empty", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 39, - "column": 2 - }, - "end": { - "line": 41, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 42, - "column": 2 - }, - "end": { - "line": 44, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "empty", - "kind": "function", - "memberof": "Sink", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "empty", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Sink#empty" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a getter method: it should be documented\nas a property.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 53, - "column": 2 - }, - "end": { - "line": 56, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 57, - "column": 2 - }, - "end": { - "line": 59, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "aGetter", - "kind": "member", - "memberof": "Sink", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "aGetter", - "kind": "member", - "scope": "instance" - } - ], - "namespace": "Sink#aGetter" - } - ], - "events": [], - "static": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method says hello", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 46, - "column": 2 - }, - "end": { - "line": 48, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 49, - "column": 2 - }, - "end": { - "line": 51, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "hello", - "kind": "function", - "memberof": "Sink", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - }, - { - "name": "hello", - "kind": "function", - "scope": "static" - } - ], - "namespace": "Sink.hello" - } - ] - }, - "path": [ - { - "name": "Sink", - "kind": "class" - } - ], - "namespace": "Sink" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method returns a basket. The type should not be linked.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 61, - "offset": 60 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 61, - "offset": 60 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 61, - "offset": 60 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "a basket", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "Basket" - } - } - ], - "loc": { - "start": { - "line": 62, - "column": 0 - }, - "end": { - "line": 66, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 67, - "column": 0 - }, - "end": { - "line": 67, - "column": 25 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "a basket", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Basket" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "makeABasket", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "makeABasket", - "kind": "function" - } - ], - "namespace": "makeABasket" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method returns a ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - }, - { - "type": "link", - "url": "Sink", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "sink" - } - ], - "position": { - "start": { - "line": 1, - "column": 23, - "offset": 22 - }, - "end": { - "line": 1, - "column": 40, - "offset": 39 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ". The type should be linked.\nIt takes a ", - "position": { - "start": { - "line": 1, - "column": 40, - "offset": 39 - }, - "end": { - "line": 2, - "column": 12, - "offset": 79 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "number", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "number" - } - ], - "position": { - "start": { - "line": 2, - "column": 12, - "offset": 79 - }, - "end": { - "line": 2, - "column": 26, - "offset": 93 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " which should also be linked.", - "position": { - "start": { - "line": 2, - "column": 26, - "offset": 93 - }, - "end": { - "line": 2, - "column": 55, - "offset": 122 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 55, - "offset": 122 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 55, - "offset": 122 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "a sink", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Sink" - } - } - ], - "loc": { - "start": { - "line": 69, - "column": 0 - }, - "end": { - "line": 74, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 75, - "column": 0 - }, - "end": { - "line": 75, - "column": 23 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Sink" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "makeASink", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "makeASink", - "kind": "function" - } - ], - "namespace": "makeASink" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function takes rest params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 77, - "column": 0 - }, - "end": { - "line": 79, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 80, - "column": 0 - }, - "end": { - "line": 80, - "column": 43 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "someParams", - "lineNumber": 80, - "type": { - "type": "RestType" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "functionWithRest", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "functionWithRest", - "kind": "function" - } - ], - "namespace": "functionWithRest" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "So does this one, with types", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 82, - "column": 0 - }, - "end": { - "line": 84, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 85, - "column": 0 - }, - "end": { - "line": 92, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "someParams", - "lineNumber": 85, - "type": { - "type": "RestType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "functionWithRestAndType", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "functionWithRestAndType", - "kind": "function" - } - ], - "namespace": "functionWithRestAndType" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is an async method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 96, - "column": 0 - }, - "end": { - "line": 98, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 99, - "column": 0 - }, - "end": { - "line": 99, - "column": 23 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "loc": { - "start": { - "line": 103, - "column": 0 - }, - "end": { - "line": 106, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 107, - "column": 0 - }, - "end": { - "line": 107, - "column": 36 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "es6.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "es6.input", - "kind": "function" - } - ], - "namespace": "es6.input" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters in ES6", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 109, - "column": 0 - }, - "end": { - "line": 111, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 112, - "column": 0 - }, - "end": { - "line": 114, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "foo", - "lineNumber": 112, - "default": "'bar'" - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "veryImportantTransform", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "veryImportantTransform", - "kind": "function" - } - ], - "namespace": "veryImportantTransform" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A protected function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "tags": [ - { - "title": "protected", - "description": null, - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 124, - "column": 0 - }, - "end": { - "line": 127, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 128, - "column": 0 - }, - "end": { - "line": 128, - "column": 26 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "access": "protected", - "name": "iAmProtected", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "iAmProtected", - "kind": "function" - } - ], - "namespace": "iAmProtected" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A public function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - } - } - }, - "tags": [ - { - "title": "public", - "description": null, - "lineNumber": 2 - } - ], - "loc": { - "start": { - "line": 130, - "column": 0 - }, - "end": { - "line": 133, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 134, - "column": 0 - }, - "end": { - "line": 134, - "column": 23 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "access": "public", - "name": "iAmPublic", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "iAmPublic", - "kind": "function" - } - ], - "namespace": "iAmPublic" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is re-exported", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 142, - "column": 0 - }, - "end": { - "line": 144, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 145, - "column": 0 - }, - "end": { - "line": 145, - "column": 42 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "execute", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "execute" - } - ], - "namespace": "execute" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #498", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 147, - "column": 0 - }, - "end": { - "line": 147, - "column": 32 - } - }, - "context": { - "loc": { - "start": { - "line": 148, - "column": 0 - }, - "end": { - "line": 154, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "array1", - "lineNumber": 149, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "T" - } - ] - } - }, - { - "title": "param", - "name": "array2", - "lineNumber": 150, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "T" - } - ] - } - }, - { - "title": "param", - "name": "compareFunction", - "lineNumber": 151, - "type": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "NameExpression", - "name": "T" - } - }, - { - "type": "ParameterType", - "name": "b", - "expression": { - "type": "NameExpression", - "name": "T" - } - } - ], - "result": { - "type": "NameExpression", - "name": "boolean" - } - }, - "default": "(a:T,b:T):boolean=>a===b" - } - ], - "properties": [], - "returns": [ - { - "title": "returns", - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "isArrayEqualWith", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "isArrayEqualWith", - "kind": "function" - } - ], - "namespace": "isArrayEqualWith" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #749", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 156, - "column": 0 - }, - "end": { - "line": 156, - "column": 32 - } - }, - "context": { - "loc": { - "start": { - "line": 157, - "column": 0 - }, - "end": { - "line": 159, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 157, - "type": { - "type": "NameExpression", - "name": "atype.property" - } - } - ], - "properties": [], - "returns": [ - { - "title": "returns", - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "paramWithMemberType", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "paramWithMemberType", - "kind": "function" - } - ], - "namespace": "paramWithMemberType" - } -] \ No newline at end of file diff --git a/test/fixture/es6.output.md b/test/fixture/es6.output.md deleted file mode 100644 index f43d25dd4..000000000 --- a/test/fixture/es6.output.md +++ /dev/null @@ -1,171 +0,0 @@ - - -### Table of Contents - -- [destructure](#destructure) -- [destructure](#destructure-1) -- [multiply](#multiply) -- [Sink](#sink) - - [staticProp](#staticprop) - - [empty](#empty) - - [aGetter](#agetter) - - [hello](#hello) -- [makeABasket](#makeabasket) -- [makeASink](#makeasink) -- [functionWithRest](#functionwithrest) -- [functionWithRestAndType](#functionwithrestandtype) -- [foo](#foo) -- [es6.input](#es6input) -- [veryImportantTransform](#veryimportanttransform) -- [iAmProtected](#iamprotected) -- [iAmPublic](#iampublic) -- [execute](#execute) -- [isArrayEqualWith](#isarrayequalwith) -- [paramWithMemberType](#paramwithmembertype) - -## destructure - -This function destructures with defaults. It should not -have any parameter descriptions. - -**Parameters** - -- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`) - - `$0.phoneNumbers` (optional, default `[]`) - - `$0.emailAddresses` (optional, default `[]`) - - `$0.params` **...any** - -## destructure - -Similar, but with an array - -**Parameters** - -- `$0` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** - - `$0.0` - - `$0.1` - - `$0.2` - -**Examples** - -```javascript -destructure([1, 2, 3]) -``` - -## multiply - -This function returns the number one. - -**Parameters** - -- `a` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>** an array of numbers -- `b` - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -## Sink - -This is a sink - -**Parameters** - -- `height` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the height of the thing -- `width` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the width of the thing - -### staticProp - -This is a property of the sink. - -### empty - -Is it empty - -### aGetter - -This is a getter method: it should be documented -as a property. - -### hello - -This method says hello - -## makeABasket - -This method returns a basket. The type should not be linked. - -Returns **Basket** a basket - -## makeASink - -This method returns a [sink](#sink). The type should be linked. -It takes a [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number) which should also be linked. - -Returns **[Sink](#sink)** a sink - -## functionWithRest - -This function takes rest params - -**Parameters** - -- `someParams` **...any** - -## functionWithRestAndType - -So does this one, with types - -**Parameters** - -- `someParams` **...[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -## foo - -This is an async method - -## es6.input - -This function returns the number one. - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -## veryImportantTransform - -This tests our support of optional parameters in ES6 - -**Parameters** - -- `foo` (optional, default `'bar'`) - -## iAmProtected - -A protected function - -## iAmPublic - -A public function - -## execute - -This is re-exported - -## isArrayEqualWith - -Regression check for #498 - -**Parameters** - -- `array1` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `array2` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<T>** -- `compareFunction` **function (a: T, b: T): [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** (optional, default `(a:T,b:T):boolean=>a===b`) - -Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** - -## paramWithMemberType - -Regression check for #749 - -**Parameters** - -- `a` **atype.property** - -Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** diff --git a/test/fixture/es6.output.md.json b/test/fixture/es6.output.md.json deleted file mode 100644 index da94047e3..000000000 --- a/test/fixture/es6.output.md.json +++ /dev/null @@ -1,2339 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "destructure" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function destructures with defaults. It should not\nhave any parameter descriptions.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 33, - "offset": 88 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "{}" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.phoneNumbers" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "[]" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.emailAddresses" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "[]" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.params" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "destructure" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Similar, but with an array", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.1" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.2" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "lang": "javascript", - "type": "code", - "value": "destructure([1, 2, 3])" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "multiply" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an array of numbers", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Sink" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "height" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the height of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "width" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the width of the thing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "staticProp" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a property of the sink.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "empty" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Is it empty", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "aGetter" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is a getter method: it should be documented\nas a property.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 15, - "offset": 63 - }, - "indent": [ - 1 - ] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "hello" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method says hello", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "makeABasket" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method returns a basket. The type should not be linked.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 61, - "offset": 60 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 61, - "offset": 60 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Basket" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "a basket", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "makeASink" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method returns a ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - }, - { - "type": "link", - "url": "#sink", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "sink" - } - ], - "position": { - "start": { - "line": 1, - "column": 23, - "offset": 22 - }, - "end": { - "line": 1, - "column": 40, - "offset": 39 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ". The type should be linked.\nIt takes a ", - "position": { - "start": { - "line": 1, - "column": 40, - "offset": 39 - }, - "end": { - "line": 2, - "column": 12, - "offset": 79 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "number" - } - ], - "position": { - "start": { - "line": 2, - "column": 12, - "offset": 79 - }, - "end": { - "line": 2, - "column": 26, - "offset": 93 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " which should also be linked.", - "position": { - "start": { - "line": 2, - "column": 26, - "offset": 93 - }, - "end": { - "line": 2, - "column": 55, - "offset": 122 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 55, - "offset": 122 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "#sink", - "url": "#sink", - "type": "link", - "children": [ - { - "type": "text", - "value": "Sink" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "a sink", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "functionWithRest" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function takes rest params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "someParams" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "functionWithRestAndType" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "So does this one, with types", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "someParams" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is an async method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "es6.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "veryImportantTransform" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters in ES6", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 53, - "offset": 52 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "foo" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "'bar'" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "iAmProtected" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A protected function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "iAmPublic" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A public function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "execute" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is re-exported", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 20, - "offset": 19 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "isArrayEqualWith" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #498", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "array1" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "array2" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "compareFunction" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "function (" - }, - { - "type": "text", - "value": "a: " - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ", " - }, - { - "type": "text", - "value": "b: " - }, - { - "type": "text", - "value": "T" - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "(a:T,b:T):boolean=>a===b" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "paramWithMemberType" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Regression check for #749", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "atype.property" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/event.output.json b/test/fixture/event.output.json deleted file mode 100644 index 5db9fa967..000000000 --- a/test/fixture/event.output.json +++ /dev/null @@ -1,262 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Mouse event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - } - } - }, - "tags": [ - { - "title": "event", - "description": "Map#mousemove", - "lineNumber": 3 - }, - { - "title": "type", - "description": null, - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Object" - } - }, - { - "title": "property", - "description": "the pixel location of the event", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "Point" - }, - "name": "point" - }, - { - "title": "property", - "description": "the original DOM event", - "lineNumber": 6, - "type": { - "type": "NameExpression", - "name": "Event" - }, - "name": "originalEvent" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 0 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [ - { - "title": "property", - "name": "point", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the pixel location of the event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Point" - } - }, - { - "title": "property", - "name": "originalEvent", - "lineNumber": 6, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the original DOM event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Event" - } - } - ], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "event", - "name": "Map#mousemove", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Map#mousemove", - "kind": "event" - } - ], - "namespace": ".event:Map#mousemove" - } -] \ No newline at end of file diff --git a/test/fixture/event.output.md b/test/fixture/event.output.md deleted file mode 100644 index 5ce6a3127..000000000 --- a/test/fixture/event.output.md +++ /dev/null @@ -1,14 +0,0 @@ - - -### Table of Contents - -- [Map#mousemove](#mapmousemove) - -## Map#mousemove - -Mouse event - -**Properties** - -- `point` **Point** the pixel location of the event -- `originalEvent` **[Event](https://developer.mozilla.org/en-US/docs/Web/API/Event)** the original DOM event diff --git a/test/fixture/event.output.md.json b/test/fixture/event.output.md.json deleted file mode 100644 index 4d7dc7416..000000000 --- a/test/fixture/event.output.md.json +++ /dev/null @@ -1,208 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Map#mousemove" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Mouse event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "point" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Point" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the pixel location of the event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "originalEvent" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/API/Event", - "url": "https://developer.mozilla.org/en-US/docs/Web/API/Event", - "type": "link", - "children": [ - { - "type": "text", - "value": "Event" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the original DOM event", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/example-caption.output.json b/test/fixture/example-caption.output.json deleted file mode 100644 index fbe9d6d85..000000000 --- a/test/fixture/example-caption.output.json +++ /dev/null @@ -1,236 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - } - }, - { - "title": "example", - "description": "foo(1);", - "lineNumber": 3, - "caption": "demonstrates how to run foo" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [ - { - "description": "foo(1);", - "caption": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "demonstrates how to run foo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - } - } - } - } - ], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - } -] \ No newline at end of file diff --git a/test/fixture/example-caption.output.md b/test/fixture/example-caption.output.md deleted file mode 100644 index 6d7d56769..000000000 --- a/test/fixture/example-caption.output.md +++ /dev/null @@ -1,19 +0,0 @@ - - -### Table of Contents - -- [foo](#foo) - -## foo - -This function returns the number one. - -**Examples** - -_demonstrates how to run foo_ - -```javascript -foo(1); -``` - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/example-caption.output.md.json b/test/fixture/example-caption.output.md.json deleted file mode 100644 index fa77489fc..000000000 --- a/test/fixture/example-caption.output.md.json +++ /dev/null @@ -1,189 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "emphasis", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "demonstrates how to run foo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - } - } - } - ] - }, - { - "lang": "javascript", - "type": "code", - "value": "foo(1);" - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/external.output.json b/test/fixture/external.output.json deleted file mode 100644 index 92a116ccc..000000000 --- a/test/fixture/external.output.json +++ /dev/null @@ -1,138 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "I am in ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "external.input.js", - "position": { - "start": { - "line": 1, - "column": 9, - "offset": 8 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 28, - "offset": 27 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 9, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 13, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - } -] \ No newline at end of file diff --git a/test/fixture/external.output.md b/test/fixture/external.output.md deleted file mode 100644 index d037ab42c..000000000 --- a/test/fixture/external.output.md +++ /dev/null @@ -1,9 +0,0 @@ - - -### Table of Contents - -- [foo](#foo) - -## foo - -I am in `external.input.js`. diff --git a/test/fixture/external.output.md.json b/test/fixture/external.output.md.json deleted file mode 100644 index fcd4812e8..000000000 --- a/test/fixture/external.output.md.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "I am in ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "external.input.js", - "position": { - "start": { - "line": 1, - "column": 9, - "offset": 8 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 28, - "offset": 27 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/factory.output.json b/test/fixture/factory.output.json deleted file mode 100644 index 9930019b0..000000000 --- a/test/fixture/factory.output.json +++ /dev/null @@ -1,362 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an area chart generator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "chart", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "area" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 18, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "chart", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 6, - "offset": 5 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 6, - "offset": 5 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 6, - "offset": 5 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "area" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "area", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "area", - "kind": "function" - } - ], - "namespace": "area" - }, - { - "description": "", - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 1, - "type": null, - "name": "area" - } - ], - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 8, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 37 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "selection", - "lineNumber": 9 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "area", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "area", - "kind": "class" - } - ], - "namespace": "area" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Sets the chart data.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "tags": [ - { - "title": "function", - "description": null, - "lineNumber": 2, - "name": null - } - ], - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 14, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 30 - } - } - }, - "augments": [], - "errors": [ - { - "message": "@memberof reference to chart not found", - "commentLineNumber": 0 - } - ], - "examples": [], - "params": [ - { - "title": "param", - "name": "_", - "lineNumber": 15 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "function", - "name": "data", - "memberof": "chart", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "data", - "kind": "function", - "scope": "static" - } - ], - "namespace": ".data" - } -] \ No newline at end of file diff --git a/test/fixture/factory.output.md b/test/fixture/factory.output.md deleted file mode 100644 index b403983f3..000000000 --- a/test/fixture/factory.output.md +++ /dev/null @@ -1,27 +0,0 @@ - - -### Table of Contents - -- [area](#area) -- [area](#area-1) -- [data](#data) - -## area - -an area chart generator - -Returns **[area](#area)** chart - -## area - -**Parameters** - -- `selection` - -## data - -Sets the chart data. - -**Parameters** - -- `_` diff --git a/test/fixture/factory.output.md.json b/test/fixture/factory.output.md.json deleted file mode 100644 index a4ac3c232..000000000 --- a/test/fixture/factory.output.md.json +++ /dev/null @@ -1,247 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "area" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an area chart generator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "#area", - "url": "#area", - "type": "link", - "children": [ - { - "type": "text", - "value": "area" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "chart", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 6, - "offset": 5 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 6, - "offset": 5 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "area" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "selection" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "data" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Sets the chart data.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "_" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/flow-unnamed-params.output.json b/test/fixture/flow-unnamed-params.output.json deleted file mode 100644 index bf5cf80cd..000000000 --- a/test/fixture/flow-unnamed-params.output.json +++ /dev/null @@ -1,510 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 21 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "x", - "type": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "", - "expression": { - "type": "NameExpression", - "name": "T" - } - } - ], - "result": { - "type": "NameExpression", - "name": "string" - } - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "x" - } - ], - "namespace": "x" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x2", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 9 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 25 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "x2", - "type": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "NameExpression", - "name": "T" - } - } - ], - "result": { - "type": "NameExpression", - "name": "string" - } - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "x2" - } - ], - "namespace": "x2" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "T", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 39 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T", - "kind": "typedef", - "type": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "", - "expression": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - } - } - ], - "result": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "num", - "value": { - "type": "NameExpression", - "name": "number" - } - } - ] - } - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T", - "kind": "typedef" - } - ], - "namespace": "T" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "T2", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 9 - } - }, - "context": { - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 15, - "column": 43 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "T2", - "kind": "typedef", - "type": { - "type": "FunctionType", - "params": [ - { - "type": "ParameterType", - "name": "a", - "expression": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - } - } - ], - "result": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "num", - "value": { - "type": "NameExpression", - "name": "number" - } - } - ] - } - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "T2", - "kind": "typedef" - } - ], - "namespace": "T2" - } -] \ No newline at end of file diff --git a/test/fixture/flow-unnamed-params.output.md b/test/fixture/flow-unnamed-params.output.md deleted file mode 100644 index 44c844114..000000000 --- a/test/fixture/flow-unnamed-params.output.md +++ /dev/null @@ -1,32 +0,0 @@ - - -### Table of Contents - -- [x](#x) -- [x2](#x2) -- [T](#t) -- [T2](#t2) - -## x - -x - -Type: function ([T](#t)): [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - -## x2 - -x2 - -Type: function (a: [T](#t)): [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) - -## T - -T - -Type: function ([Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>): {num: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)} - -## T2 - -T2 - -Type: function (a: [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>): {num: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)} diff --git a/test/fixture/flow-unnamed-params.output.md.json b/test/fixture/flow-unnamed-params.output.md.json deleted file mode 100644 index a21691184..000000000 --- a/test/fixture/flow-unnamed-params.output.md.json +++ /dev/null @@ -1,431 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "x" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "function (" - }, - { - "href": "#t", - "url": "#t", - "type": "link", - "children": [ - { - "type": "text", - "value": "T" - } - ] - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "x2" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x2", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "function (" - }, - { - "type": "text", - "value": "a: " - }, - { - "href": "#t", - "url": "#t", - "type": "link", - "children": [ - { - "type": "text", - "value": "T" - } - ] - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "T", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 2, - "offset": 1 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "function (" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ">" - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "num: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "}" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "T2" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "T2", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 3, - "offset": 2 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "function (" - }, - { - "type": "text", - "value": "a: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ">" - }, - { - "type": "text", - "value": ")" - }, - { - "type": "text", - "value": ": " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "num: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "}" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/infer-params.output.json b/test/fixture/infer-params.output.json deleted file mode 100644 index c17a42800..000000000 --- a/test/fixture/infer-params.output.json +++ /dev/null @@ -1,345 +0,0 @@ -[ - { - "description": "This function returns the number one.", - "tags": [ - { - "title": "param", - "description": "the second param", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "b" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, - "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n" - }, - "errors": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 5 - }, - { - "title": "param", - "description": "the second param", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "b" - }, - { - "title": "param", - "name": "c", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3", - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "name": "$3.d", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3.e", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3.f", - "lineNumber": 5 - } - ] - } - ], - "name": "addThem", - "kind": "function", - "members": { - "events": [], - "instance": [], - "static": [] - }, - "path": [ - "addThem" - ] - }, - { - "description": "This method has partially inferred params", - "tags": [ - { - "title": "param", - "description": "number of kinds of fish", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "String" - }, - "name": "$0.fishes" - } - ], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 15, - "column": 1 - } - }, - "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n" - }, - "errors": [], - "params": [ - { - "title": "param", - "name": "$0", - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "description": "number of kinds of fish", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "String" - }, - "name": "$0.fishes" - }, - { - "title": "param", - "name": "$0.foxes", - "lineNumber": 13 - } - ] - } - ], - "name": "fishesAndFoxes", - "kind": "function", - "members": { - "events": [], - "instance": [], - "static": [] - }, - "path": [ - "fishesAndFoxes" - ] - }, - { - "description": "This is foo's documentation", - "tags": [], - "loc": { - "start": { - "line": 25, - "column": 0 - }, - "end": { - "line": 27, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 28, - "column": 0 - }, - "end": { - "line": 35, - "column": 1 - } - }, - "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n" - }, - "errors": [], - "name": "Foo", - "kind": "class", - "members": { - "instance": [ - { - "description": "The method", - "tags": [ - { - "title": "param", - "description": "Param to method", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "x" - } - ], - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 32, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 33, - "column": 2 - }, - "end": { - "line": 34, - "column": 3 - } - }, - "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n" - }, - "errors": [], - "params": [ - { - "title": "param", - "description": "Param to method", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "x" - } - ], - "name": "method", - "kind": "function", - "memberof": "Foo", - "scope": "instance", - "members": { - "events": [], - "instance": [], - "static": [] - }, - "path": [ - "Foo", - "method" - ] - } - ], - "static": [] - }, - "path": [ - "Foo" - ] - }, - { - "description": "This method has a type in the description and a default in the code", - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - }, - "default": "2" - }, - "name": "x" - } - ], - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 20, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 23, - "column": 1 - } - }, - "code": "/**\n * This function returns the number one.\n * @param {number} b the second param\n */\nfunction addThem(a, b, c, { d, e, f }) {\n return a + b + c + d + e + f;\n}\n\n/**\n * This method has partially inferred params\n * @param {String} $0.fishes number of kinds of fish\n */\nfunction fishesAndFoxes({ fishes, foxes }) {\n return fishes + foxes;\n}\n\n/**\n * This method has a type in the description and a default in the code\n * @param {number} x\n */\nfunction withDefault(x = 2) {\n return x;\n}\n\n/**\n * This is foo's documentation\n */\nclass Foo {\n /**\n * The method\n * @param {number} x Param to method\n */\n method(x) {\n }\n}\n" - }, - "errors": [], - "params": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - }, - "default": "2" - }, - "name": "x" - } - ], - "name": "withDefault", - "kind": "function", - "members": { - "events": [], - "instance": [], - "static": [] - }, - "path": [ - "withDefault" - ] - } -] diff --git a/test/fixture/infer-params.output.md b/test/fixture/infer-params.output.md deleted file mode 100644 index 6ae10e7ff..000000000 --- a/test/fixture/infer-params.output.md +++ /dev/null @@ -1,43 +0,0 @@ -# addThem - -This function returns the number one. - -**Parameters** - -- `a` -- `b` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the second param -- `c` -- `$3` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - - `$3.d` - - `$3.e` - - `$3.f` - -# fishesAndFoxes - -This method has partially inferred params - -**Parameters** - -- `$0` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - - `$0.fishes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** number of kinds of fish - - `$0.foxes` - -# Foo - -This is foo's documentation - -## method - -The method - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Param to method - -# withDefault - -This method has a type in the description and a default in the code - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)=(default 2)** diff --git a/test/fixture/infer-params.output.md.json b/test/fixture/infer-params.output.md.json deleted file mode 100644 index 1147857d1..000000000 --- a/test/fixture/infer-params.output.md.json +++ /dev/null @@ -1,737 +0,0 @@ -{ - "type": "root", - "children": [ - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addThem" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the second param", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "c" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.d" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.e" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.f" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "fishesAndFoxes" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has partially inferred params", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.fishes" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "String" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "number of kinds of fish", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$0.foxes" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is foo's documentation", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 28 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "method" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The method", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Param to method", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 16 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 1, - "type": "heading", - "children": [ - { - "type": "text", - "value": "withDefault" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has a type in the description and a default in the code", - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 68 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 68 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "=" - }, - { - "type": "text", - "value": "(default 2)" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/infer-private.output.json b/test/fixture/infer-private.output.json deleted file mode 100644 index 431535636..000000000 --- a/test/fixture/infer-private.output.json +++ /dev/null @@ -1,214 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "C description", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 20 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 14, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "C", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "m description", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 22 - } - }, - "context": { - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "m", - "kind": "function", - "memberof": "C", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - }, - { - "name": "m", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "C#m" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - } - ], - "namespace": "C" - } -] \ No newline at end of file diff --git a/test/fixture/infer-private.output.md b/test/fixture/infer-private.output.md deleted file mode 100644 index be8571cd7..000000000 --- a/test/fixture/infer-private.output.md +++ /dev/null @@ -1,14 +0,0 @@ - - -### Table of Contents - -- [C](#c) - - [m](#m) - -## C - -C description - -### m - -m description diff --git a/test/fixture/infer-private.output.md.json b/test/fixture/infer-private.output.md.json deleted file mode 100644 index 38cfecf2a..000000000 --- a/test/fixture/infer-private.output.md.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "C" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "C description", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "m" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "m description", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/inheritance.output.json b/test/fixture/inheritance.output.json deleted file mode 100644 index cce7001ba..000000000 --- a/test/fixture/inheritance.output.json +++ /dev/null @@ -1,181 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "With ES6, built-in types are extensible!", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - } - }, - "augments": [ - { - "title": "augments", - "name": "Array" - } - ], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "SpecialArray", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "SpecialArray", - "kind": "class" - } - ], - "namespace": "SpecialArray" - }, - { - "description": "", - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 0, - "type": null, - "name": "Foo" - } - ], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 17 - } - }, - "context": { - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 42 - } - } - }, - "augments": [ - { - "title": "augments", - "name": "Bar" - } - ], - "errors": [ - { - "message": "@memberof reference to module not found", - "commentLineNumber": 0 - } - ], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "Foo", - "memberof": "module", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Foo", - "kind": "class", - "scope": "static" - } - ], - "namespace": ".Foo" - } -] \ No newline at end of file diff --git a/test/fixture/inheritance.output.md b/test/fixture/inheritance.output.md deleted file mode 100644 index 897dad182..000000000 --- a/test/fixture/inheritance.output.md +++ /dev/null @@ -1,16 +0,0 @@ - - -### Table of Contents - -- [SpecialArray](#specialarray) -- [Foo](#foo) - -## SpecialArray - -**Extends Array** - -With ES6, built-in types are extensible! - -## Foo - -**Extends Bar** diff --git a/test/fixture/inheritance.output.md.json b/test/fixture/inheritance.output.md.json deleted file mode 100644 index 944577a5f..000000000 --- a/test/fixture/inheritance.output.md.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "SpecialArray" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Extends " - }, - { - "type": "text", - "value": "Array" - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "With ES6, built-in types are extensible!", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Extends " - }, - { - "type": "text", - "value": "Bar" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/inline-link.output.json b/test/fixture/inline-link.output.json deleted file mode 100644 index 95ae461d5..000000000 --- a/test/fixture/inline-link.output.json +++ /dev/null @@ -1,669 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Adds one to a number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the input", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "a" - }, - { - "title": "returns", - "description": "the output", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the input", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the output", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "addOne", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "addOne", - "kind": "function" - } - ], - "namespace": "addOne" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one. Internally, this uses\n", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 1, - "offset": 60 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "addOne", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "addOne" - } - ], - "position": { - "start": { - "line": 2, - "column": 1, - "offset": 60 - }, - "end": { - "line": 2, - "column": 15, - "offset": 74 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " to do the math. This demonstrates\n", - "position": { - "start": { - "line": 2, - "column": 15, - "offset": 74 - }, - "end": { - "line": 3, - "column": 1, - "offset": 109 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "https://en.wikipedia.org/wiki/Addition", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "Addition" - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 109 - }, - "end": { - "line": 3, - "column": 56, - "offset": 164 - }, - "indent": [] - } - }, - { - "type": "text", - "value": "\nand ", - "position": { - "start": { - "line": 3, - "column": 56, - "offset": 164 - }, - "end": { - "line": 4, - "column": 5, - "offset": 169 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "https://en.wikipedia.org/wiki/Addition", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "https://en.wikipedia.org/wiki/Addition" - } - ], - "position": { - "start": { - "line": 4, - "column": 5, - "offset": 169 - }, - "end": { - "line": 4, - "column": 51, - "offset": 215 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 4, - "column": 51, - "offset": 215 - }, - "indent": [ - 1, - 1, - 1 - ] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This link refers to nothing: ", - "position": { - "start": { - "line": 6, - "column": 1, - "offset": 217 - }, - "end": { - "line": 6, - "column": 30, - "offset": 246 - }, - "indent": [] - } - }, - { - "type": "link", - "url": "nothing", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "nothing" - } - ], - "position": { - "start": { - "line": 6, - "column": 30, - "offset": 246 - }, - "end": { - "line": 6, - "column": 45, - "offset": 261 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 6, - "column": 1, - "offset": 217 - }, - "end": { - "line": 6, - "column": 45, - "offset": 261 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 6, - "column": 45, - "offset": 261 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the input", - "lineNumber": 8, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "a" - }, - { - "title": "returns", - "description": "numberone", - "lineNumber": 9, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 20, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 23, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 8, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the input", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "inline-link.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "inline-link.input", - "kind": "function" - } - ], - "namespace": "inline-link.input" - } -] \ No newline at end of file diff --git a/test/fixture/inline-link.output.md b/test/fixture/inline-link.output.md deleted file mode 100644 index 86d415599..000000000 --- a/test/fixture/inline-link.output.md +++ /dev/null @@ -1,31 +0,0 @@ - - -### Table of Contents - -- [addOne](#addone) -- [inline-link.input](#inline-linkinput) - -## addOne - -Adds one to a number - -**Parameters** - -- `a` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the input - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the output - -## inline-link.input - -This function returns the number one. Internally, this uses -[addOne](#addone) to do the math. This demonstrates -[Addition](https://en.wikipedia.org/wiki/Addition) -and - -This link refers to nothing: [nothing](nothing) - -**Parameters** - -- `a` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the input - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/inline-link.output.md.json b/test/fixture/inline-link.output.md.json deleted file mode 100644 index 4d2f11ca5..000000000 --- a/test/fixture/inline-link.output.md.json +++ /dev/null @@ -1,582 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addOne" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Adds one to a number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the input", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the output", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "inline-link.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one. Internally, this uses\n", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 1, - "offset": 60 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "#addone", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "addOne" - } - ], - "position": { - "start": { - "line": 2, - "column": 1, - "offset": 60 - }, - "end": { - "line": 2, - "column": 15, - "offset": 74 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " to do the math. This demonstrates\n", - "position": { - "start": { - "line": 2, - "column": 15, - "offset": 74 - }, - "end": { - "line": 3, - "column": 1, - "offset": 109 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "https://en.wikipedia.org/wiki/Addition", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "Addition" - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 109 - }, - "end": { - "line": 3, - "column": 56, - "offset": 164 - }, - "indent": [] - } - }, - { - "type": "text", - "value": "\nand ", - "position": { - "start": { - "line": 3, - "column": 56, - "offset": 164 - }, - "end": { - "line": 4, - "column": 5, - "offset": 169 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "link", - "url": "https://en.wikipedia.org/wiki/Addition", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "https://en.wikipedia.org/wiki/Addition" - } - ], - "position": { - "start": { - "line": 4, - "column": 5, - "offset": 169 - }, - "end": { - "line": 4, - "column": 51, - "offset": 215 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 4, - "column": 51, - "offset": 215 - }, - "indent": [ - 1, - 1, - 1 - ] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This link refers to nothing: ", - "position": { - "start": { - "line": 6, - "column": 1, - "offset": 217 - }, - "end": { - "line": 6, - "column": 30, - "offset": 246 - }, - "indent": [] - } - }, - { - "type": "link", - "url": "nothing", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "nothing" - } - ], - "position": { - "start": { - "line": 6, - "column": 30, - "offset": 246 - }, - "end": { - "line": 6, - "column": 45, - "offset": 261 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 6, - "column": 1, - "offset": 217 - }, - "end": { - "line": 6, - "column": 45, - "offset": 261 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the input", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/interface.output.json b/test/fixture/interface.output.json deleted file mode 100644 index 013e347e5..000000000 --- a/test/fixture/interface.output.json +++ /dev/null @@ -1,132 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my interface.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - } - }, - "augments": [ - { - "title": "extends", - "name": "Bar" - }, - { - "title": "extends", - "name": "Baz" - } - ], - "errors": [], - "examples": [], - "params": [], - "properties": [ - { - "title": "property", - "name": "prop1", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "property", - "name": "prop2", - "lineNumber": 6, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Foo", - "kind": "interface", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Foo", - "kind": "interface" - } - ], - "namespace": "Foo" - } -] \ No newline at end of file diff --git a/test/fixture/interface.output.md b/test/fixture/interface.output.md deleted file mode 100644 index 7ef9cf99d..000000000 --- a/test/fixture/interface.output.md +++ /dev/null @@ -1,16 +0,0 @@ - - -### Table of Contents - -- [Foo](#foo) - -## Foo - -**Extends Bar, Baz** - -This is my interface. - -**Properties** - -- `prop1` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** -- `prop2` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** diff --git a/test/fixture/interface.output.md.json b/test/fixture/interface.output.md.json deleted file mode 100644 index 96610ee59..000000000 --- a/test/fixture/interface.output.md.json +++ /dev/null @@ -1,163 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Extends " - }, - { - "type": "text", - "value": "Bar, Baz" - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my interface.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "prop1" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "prop2" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/internal.output.json b/test/fixture/internal.output.json deleted file mode 100644 index 92a116ccc..000000000 --- a/test/fixture/internal.output.json +++ /dev/null @@ -1,138 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "I am in ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "external.input.js", - "position": { - "start": { - "line": 1, - "column": 9, - "offset": 8 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 28, - "offset": 27 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 9, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 13, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - } -] \ No newline at end of file diff --git a/test/fixture/internal.output.md b/test/fixture/internal.output.md deleted file mode 100644 index d037ab42c..000000000 --- a/test/fixture/internal.output.md +++ /dev/null @@ -1,9 +0,0 @@ - - -### Table of Contents - -- [foo](#foo) - -## foo - -I am in `external.input.js`. diff --git a/test/fixture/internal.output.md.json b/test/fixture/internal.output.md.json deleted file mode 100644 index fcd4812e8..000000000 --- a/test/fixture/internal.output.md.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "I am in ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "external.input.js", - "position": { - "start": { - "line": 1, - "column": 9, - "offset": 8 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 28, - "offset": 27 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 29, - "offset": 28 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/lends.output.json b/test/fixture/lends.output.json deleted file mode 100644 index 4a231651f..000000000 --- a/test/fixture/lends.output.json +++ /dev/null @@ -1,630 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A neat layout view", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 2, - "type": null, - "name": "TheClass" - }, - { - "title": "augments", - "description": null, - "lineNumber": 3, - "type": null, - "name": "Augmented" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 26, - "column": 2 - } - } - }, - "augments": [ - { - "title": "augments", - "description": null, - "lineNumber": 3, - "type": null, - "name": "Augmented" - } - ], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "TheClass", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "My neat function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "tags": [ - { - "title": "param", - "description": "your word", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "word" - }, - { - "title": "returns", - "description": "your word but one better", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 13, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 4 - }, - "end": { - "line": 16, - "column": 5 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "word", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word but one better", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "memberof": "TheClass", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "TheClass", - "kind": "class" - }, - { - "name": "foo", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "TheClass#foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "My neat function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "tags": [ - { - "title": "param", - "description": "your word", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "word" - }, - { - "title": "returns", - "description": "your word but one better", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 4 - }, - "end": { - "line": 21, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 22, - "column": 4 - }, - "end": { - "line": 24, - "column": 5 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "word", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word but one better", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "bar", - "kind": "function", - "memberof": "TheClass", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "TheClass", - "kind": "class" - }, - { - "name": "bar", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "TheClass#bar" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "TheClass", - "kind": "class" - } - ], - "namespace": "TheClass" - } -] \ No newline at end of file diff --git a/test/fixture/lends.output.md b/test/fixture/lends.output.md deleted file mode 100644 index 23ccc043c..000000000 --- a/test/fixture/lends.output.md +++ /dev/null @@ -1,33 +0,0 @@ - - -### Table of Contents - -- [TheClass](#theclass) - - [foo](#foo) - - [bar](#bar) - -## TheClass - -**Extends Augmented** - -A neat layout view - -### foo - -My neat function - -**Parameters** - -- `word` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word - -Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word but one better - -### bar - -My neat function - -**Parameters** - -- `word` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word - -Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** your word but one better diff --git a/test/fixture/lends.output.md.json b/test/fixture/lends.output.md.json deleted file mode 100644 index 03620a2fe..000000000 --- a/test/fixture/lends.output.md.json +++ /dev/null @@ -1,466 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "TheClass" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Extends " - }, - { - "type": "text", - "value": "Augmented" - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A neat layout view", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "My neat function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "word" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word but one better", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "bar" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "My neat function", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "word" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "your word but one better", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/literal_types.output.json b/test/fixture/literal_types.output.json deleted file mode 100644 index 858b92501..000000000 --- a/test/fixture/literal_types.output.json +++ /dev/null @@ -1,210 +0,0 @@ -[ - { - "description": "", - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 1, - "type": { - "type": "UnionType", - "elements": [ - { - "type": "StringLiteralType", - "value": "a" - }, - { - "type": "StringLiteralType", - "value": "b" - }, - { - "type": "StringLiteralType", - "value": "" - }, - { - "type": "NumericLiteralType", - "value": 0 - }, - { - "type": "NumericLiteralType", - "value": -42 - }, - { - "type": "NumericLiteralType", - "value": 3.14 - } - ] - }, - "name": "x" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 16 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 1, - "type": { - "type": "UnionType", - "elements": [ - { - "type": "StringLiteralType", - "value": "a" - }, - { - "type": "StringLiteralType", - "value": "b" - }, - { - "type": "StringLiteralType", - "value": "" - }, - { - "type": "NumericLiteralType", - "value": 0 - }, - { - "type": "NumericLiteralType", - "value": -42 - }, - { - "type": "NumericLiteralType", - "value": 3.14 - } - ] - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "f", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f", - "kind": "function" - } - ], - "namespace": "f" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 49 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 7, - "type": { - "type": "UnionType", - "elements": [ - { - "type": "StringLiteralType", - "value": "a" - }, - { - "type": "StringLiteralType", - "value": "b" - }, - { - "type": "StringLiteralType", - "value": "" - }, - { - "type": "NumericLiteralType", - "value": 0 - }, - { - "type": "NumericLiteralType", - "value": -42 - }, - { - "type": "NumericLiteralType", - "value": 3.14 - } - ] - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "g", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "g", - "kind": "function" - } - ], - "namespace": "g" - } -] \ No newline at end of file diff --git a/test/fixture/literal_types.output.md b/test/fixture/literal_types.output.md deleted file mode 100644 index 57190ea7f..000000000 --- a/test/fixture/literal_types.output.md +++ /dev/null @@ -1,18 +0,0 @@ - - -### Table of Contents - -- [f](#f) -- [g](#g) - -## f - -**Parameters** - -- `x` **(`"a"` \| `"b"` \| `""` \| `0` \| `-42` \| `3.14`)** - -## g - -**Parameters** - -- `x` **(`"a"` \| `"b"` \| `""` \| `0` \| `-42` \| `3.14`)** diff --git a/test/fixture/literal_types.output.md.json b/test/fixture/literal_types.output.md.json deleted file mode 100644 index 623c139b3..000000000 --- a/test/fixture/literal_types.output.md.json +++ /dev/null @@ -1,217 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "(" - }, - { - "type": "inlineCode", - "value": "\"a\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "\"b\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "\"\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "0" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "-42" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "3.14" - }, - { - "type": "text", - "value": ")" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "g" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "(" - }, - { - "type": "inlineCode", - "value": "\"a\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "\"b\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "\"\"" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "0" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "-42" - }, - { - "type": "text", - "value": " | " - }, - { - "type": "inlineCode", - "value": "3.14" - }, - { - "type": "text", - "value": ")" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/memberedclass.output.json b/test/fixture/memberedclass.output.json deleted file mode 100644 index a817352c9..000000000 --- a/test/fixture/memberedclass.output.json +++ /dev/null @@ -1,553 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my class, a demo thing.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 3, - "type": null, - "name": "MyClass" - }, - { - "title": "memberof", - "description": "com.Test", - "lineNumber": 4 - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 28, - "column": 2 - } - } - }, - "augments": [], - "errors": [ - { - "message": "@memberof reference to com.Test not found", - "commentLineNumber": 4 - } - ], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "MyClass", - "memberof": "com.Test", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the number 42", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - } - } - }, - "tags": [ - { - "title": "param", - "description": "whether to get the number", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "boolean" - }, - "name": "getIt" - }, - { - "title": "returns", - "description": "forty-two", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 17, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 20, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "getIt", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "whether to get the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "forty-two", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getFoo", - "kind": "function", - "memberof": "com.Test.MyClass", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - }, - { - "name": "getFoo", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "MyClass#getFoo" - } - ], - "events": [], - "static": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get undefined", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "does not return anything.", - "lineNumber": 3, - "type": { - "type": "UndefinedLiteral" - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 2 - }, - "end": { - "line": 26, - "column": 7 - } - }, - "context": { - "loc": { - "start": { - "line": 27, - "column": 2 - }, - "end": { - "line": 27, - "column": 26 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "does not return anything.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "title": "returns", - "type": { - "type": "UndefinedLiteral" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getUndefined", - "kind": "function", - "memberof": "com.Test.MyClass", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - }, - { - "name": "getUndefined", - "kind": "function", - "scope": "static" - } - ], - "namespace": "MyClass.getUndefined" - } - ] - }, - "path": [ - { - "name": "MyClass", - "kind": "class" - } - ], - "namespace": "MyClass" - } -] \ No newline at end of file diff --git a/test/fixture/memberedclass.output.md b/test/fixture/memberedclass.output.md deleted file mode 100644 index 1b0ad3188..000000000 --- a/test/fixture/memberedclass.output.md +++ /dev/null @@ -1,27 +0,0 @@ - - -### Table of Contents - -- [MyClass](#myclass) - - [getFoo](#getfoo) - - [getUndefined](#getundefined) - -## MyClass - -This is my class, a demo thing. - -### getFoo - -Get the number 42 - -**Parameters** - -- `getIt` **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** whether to get the number - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** forty-two - -### getUndefined - -Get undefined - -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** does not return anything. diff --git a/test/fixture/memberedclass.output.md.json b/test/fixture/memberedclass.output.md.json deleted file mode 100644 index 6f4748b88..000000000 --- a/test/fixture/memberedclass.output.md.json +++ /dev/null @@ -1,360 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "MyClass" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is my class, a demo thing.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 32, - "offset": 31 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getFoo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the number 42", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 18, - "offset": 17 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "getIt" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "whether to get the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "forty-two", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getUndefined" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get undefined", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "type": "link", - "children": [ - { - "type": "text", - "value": "undefined" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "does not return anything.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/merge-infered-type.output.json b/test/fixture/merge-infered-type.output.json deleted file mode 100644 index 61f6b15c2..000000000 --- a/test/fixture/merge-infered-type.output.json +++ /dev/null @@ -1,274 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Add five to ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "x", - "position": { - "start": { - "line": 1, - "column": 13, - "offset": 12 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 16, - "offset": 15 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "tags": [ - { - "title": "param", - "description": "The number to add five to.", - "lineNumber": 3, - "type": null, - "name": "x" - }, - { - "title": "returns", - "description": "x plus five.", - "lineNumber": 4, - "type": null - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The number to add five to.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x plus five.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "addFive", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "addFive", - "kind": "function" - } - ], - "namespace": "addFive" - } -] \ No newline at end of file diff --git a/test/fixture/merge-infered-type.output.md b/test/fixture/merge-infered-type.output.md deleted file mode 100644 index 1a497d63a..000000000 --- a/test/fixture/merge-infered-type.output.md +++ /dev/null @@ -1,15 +0,0 @@ - - -### Table of Contents - -- [addFive](#addfive) - -## addFive - -Add five to `x`. - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The number to add five to. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** x plus five. diff --git a/test/fixture/merge-infered-type.output.md.json b/test/fixture/merge-infered-type.output.md.json deleted file mode 100644 index ae3c81fa8..000000000 --- a/test/fixture/merge-infered-type.output.md.json +++ /dev/null @@ -1,240 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addFive" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Add five to ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "x", - "position": { - "start": { - "line": 1, - "column": 13, - "offset": 12 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 16, - "offset": 15 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The number to add five to.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "x plus five.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/meta.output.json b/test/fixture/meta.output.json deleted file mode 100644 index 9eb923915..000000000 --- a/test/fixture/meta.output.json +++ /dev/null @@ -1,454 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "description", - "description": "This function returns the number one.", - "lineNumber": 3 - }, - { - "title": "see", - "description": "{@link http://github.com/|github}", - "lineNumber": 4 - }, - { - "title": "see", - "description": "TestCase", - "lineNumber": 5 - }, - { - "title": "see", - "description": "[markdown link](http://foo.com/)", - "lineNumber": 6 - }, - { - "title": "version", - "description": "1.0.0", - "lineNumber": 7 - }, - { - "title": "since", - "description": "2.0.0", - "lineNumber": 8 - }, - { - "title": "copyright", - "description": "Tom MacWright", - "lineNumber": 9 - }, - { - "title": "license", - "description": "BSD", - "lineNumber": 10 - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 16, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [ - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "link", - "url": "http://github.com/", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "github" - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - } - } - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "TestCase", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - } - } - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "link", - "title": null, - "url": "http://foo.com/", - "children": [ - { - "type": "text", - "value": "markdown link", - "position": { - "start": { - "line": 1, - "column": 2, - "offset": 1 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 33, - "offset": 32 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 33, - "offset": 32 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 33, - "offset": 32 - } - } - } - ], - "throws": [], - "todos": [], - "version": "1.0.0", - "since": "2.0.0", - "copyright": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Tom MacWright", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - }, - "license": "BSD", - "name": "meta.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "meta.input", - "kind": "function" - } - ], - "namespace": "meta.input" - } -] \ No newline at end of file diff --git a/test/fixture/meta.output.md b/test/fixture/meta.output.md deleted file mode 100644 index d45e106d4..000000000 --- a/test/fixture/meta.output.md +++ /dev/null @@ -1,23 +0,0 @@ - - -### Table of Contents - -- [meta.input](#metainput) - -## meta.input - -- **See: [github](http://github.com/)** -- **See: TestCase** -- **See: [markdown link](http://foo.com/)** - -This function returns the number one. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone - -**Meta** - -- **version**: 1.0.0 -- **since**: 2.0.0 -- **copyright**: Tom MacWright - -- **license**: BSD diff --git a/test/fixture/meta.output.md.json b/test/fixture/meta.output.md.json deleted file mode 100644 index d8cdaee45..000000000 --- a/test/fixture/meta.output.md.json +++ /dev/null @@ -1,470 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "meta.input" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "See: " - }, - { - "type": "paragraph", - "children": [ - { - "type": "link", - "url": "http://github.com/", - "title": null, - "jsdoc": true, - "children": [ - { - "type": "text", - "value": "github" - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "See: " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "TestCase", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "See: " - }, - { - "type": "paragraph", - "children": [ - { - "type": "link", - "title": null, - "url": "http://foo.com/", - "children": [ - { - "type": "text", - "value": "markdown link", - "position": { - "start": { - "line": 1, - "column": 2, - "offset": 1 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 33, - "offset": 32 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 33, - "offset": 32 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Meta" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "version" - } - ] - }, - { - "type": "text", - "value": ": " - }, - { - "type": "text", - "value": "1.0.0" - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "since" - } - ] - }, - { - "type": "text", - "value": ": " - }, - { - "type": "text", - "value": "2.0.0" - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "copyright" - } - ] - }, - { - "type": "text", - "value": ": " - }, - { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Tom MacWright", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 14, - "offset": 13 - } - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "license" - } - ] - }, - { - "type": "text", - "value": ": " - }, - { - "type": "text", - "value": "BSD" - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/multisignature.output.json b/test/fixture/multisignature.output.json deleted file mode 100644 index ba7426e9a..000000000 --- a/test/fixture/multisignature.output.json +++ /dev/null @@ -1,422 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "the current date", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Date" - } - } - ], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 19, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "time", - "lineNumber": 13 - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current date", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Date" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getTheTime", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "getTheTime", - "kind": "function" - } - ], - "namespace": "getTheTime" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Set the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the current time", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Date" - }, - "name": "time" - }, - { - "title": "returns", - "description": "nothing", - "lineNumber": 3, - "type": { - "type": "UndefinedLiteral" - } - } - ], - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 19, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "time", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Date" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "nothing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - } - } - }, - "title": "returns", - "type": { - "type": "UndefinedLiteral" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "getTheTime", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "getTheTime", - "kind": "function" - } - ], - "namespace": "getTheTime" - } -] \ No newline at end of file diff --git a/test/fixture/multisignature.output.md b/test/fixture/multisignature.output.md deleted file mode 100644 index 70cc5c797..000000000 --- a/test/fixture/multisignature.output.md +++ /dev/null @@ -1,26 +0,0 @@ - - -### Table of Contents - -- [getTheTime](#getthetime) -- [getTheTime](#getthetime-1) - -## getTheTime - -Get the time - -**Parameters** - -- `time` - -Returns **[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** the current date - -## getTheTime - -Set the time - -**Parameters** - -- `time` **[Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date)** the current time - -Returns **[undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)** nothing diff --git a/test/fixture/multisignature.output.md.json b/test/fixture/multisignature.output.md.json deleted file mode 100644 index a6c7ccbc2..000000000 --- a/test/fixture/multisignature.output.md.json +++ /dev/null @@ -1,352 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getTheTime" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Get the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "time" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", - "type": "link", - "children": [ - { - "type": "text", - "value": "Date" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current date", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "getTheTime" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Set the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "time" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", - "type": "link", - "children": [ - { - "type": "text", - "value": "Date" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", - "type": "link", - "children": [ - { - "type": "text", - "value": "undefined" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "nothing", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 8, - "offset": 7 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/nearby_params.output.json b/test/fixture/nearby_params.output.json deleted file mode 100644 index cbb783fe5..000000000 --- a/test/fixture/nearby_params.output.json +++ /dev/null @@ -1,529 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Attempt to establish a cookie-based session in exchange for credentials.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 73, - "offset": 72 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 73, - "offset": 72 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 73, - "offset": 72 - } - } - }, - "tags": [ - { - "title": "function", - "description": null, - "lineNumber": 1, - "name": null - }, - { - "title": "name", - "description": null, - "lineNumber": 2, - "name": "sessions.create" - }, - { - "title": "param", - "description": null, - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "object" - }, - "name": "credentials" - }, - { - "title": "param", - "description": "Login username. Also accepted as `username` or `email`.", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "credentials.name" - }, - { - "title": "param", - "description": "Login password", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "credentials.password" - }, - { - "title": "param", - "description": "Gets passed `(err, { success:Boolean })`.", - "lineNumber": 6, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "function" - } - }, - "name": "callback" - }, - { - "title": "returns", - "description": "promise, to be resolved on success or rejected on failure", - "lineNumber": 7, - "type": { - "type": "NameExpression", - "name": "Promise" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 13, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "credentials", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "object" - }, - "properties": [ - { - "title": "param", - "name": "credentials.name", - "lineNumber": 4, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Login username. Also accepted as ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "username", - "position": { - "start": { - "line": 1, - "column": 34, - "offset": 33 - }, - "end": { - "line": 1, - "column": 44, - "offset": 43 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " or ", - "position": { - "start": { - "line": 1, - "column": 44, - "offset": 43 - }, - "end": { - "line": 1, - "column": 48, - "offset": 47 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "email", - "position": { - "start": { - "line": 1, - "column": 48, - "offset": 47 - }, - "end": { - "line": 1, - "column": 55, - "offset": 54 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 55, - "offset": 54 - }, - "end": { - "line": 1, - "column": 56, - "offset": 55 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 56, - "offset": 55 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 56, - "offset": 55 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - }, - { - "title": "param", - "name": "credentials.password", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Login password", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ] - }, - { - "title": "param", - "name": "callback", - "lineNumber": 6, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Gets passed ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "(err, { success:Boolean })", - "position": { - "start": { - "line": 1, - "column": 13, - "offset": 12 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 41, - "offset": 40 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "function" - } - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "promise, to be resolved on success or rejected on failure", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 58, - "offset": 57 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 58, - "offset": 57 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 58, - "offset": 57 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Promise" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "kind": "function", - "name": "sessions.create", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "sessions.create", - "kind": "function" - } - ], - "namespace": "sessions.create" - } -] \ No newline at end of file diff --git a/test/fixture/nearby_params.output.md b/test/fixture/nearby_params.output.md deleted file mode 100644 index 2b01f3bab..000000000 --- a/test/fixture/nearby_params.output.md +++ /dev/null @@ -1,18 +0,0 @@ - - -### Table of Contents - -- [sessions.create](#sessionscreate) - -## sessions.create - -Attempt to establish a cookie-based session in exchange for credentials. - -**Parameters** - -- `credentials` **[object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - - `credentials.name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Login username. Also accepted as `username` or `email`. - - `credentials.password` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** Login password -- `callback` **[function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)?** Gets passed `(err, { success:Boolean })`. - -Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** promise, to be resolved on success or rejected on failure diff --git a/test/fixture/nearby_params.output.md.json b/test/fixture/nearby_params.output.md.json deleted file mode 100644 index 72fa32537..000000000 --- a/test/fixture/nearby_params.output.md.json +++ /dev/null @@ -1,502 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "sessions.create" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Attempt to establish a cookie-based session in exchange for credentials.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 73, - "offset": 72 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 73, - "offset": 72 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "credentials" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "credentials.name" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Login username. Also accepted as ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 34, - "offset": 33 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "username", - "position": { - "start": { - "line": 1, - "column": 34, - "offset": 33 - }, - "end": { - "line": 1, - "column": 44, - "offset": 43 - }, - "indent": [] - } - }, - { - "type": "text", - "value": " or ", - "position": { - "start": { - "line": 1, - "column": 44, - "offset": 43 - }, - "end": { - "line": 1, - "column": 48, - "offset": 47 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "email", - "position": { - "start": { - "line": 1, - "column": 48, - "offset": 47 - }, - "end": { - "line": 1, - "column": 55, - "offset": 54 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 55, - "offset": 54 - }, - "end": { - "line": 1, - "column": 56, - "offset": 55 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 56, - "offset": 55 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "credentials.password" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Login password", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "callback" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function", - "type": "link", - "children": [ - { - "type": "text", - "value": "function" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Gets passed ", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "inlineCode", - "value": "(err, { success:Boolean })", - "position": { - "start": { - "line": 1, - "column": 13, - "offset": 12 - }, - "end": { - "line": 1, - "column": 41, - "offset": 40 - }, - "indent": [] - } - }, - { - "type": "text", - "value": ".", - "position": { - "start": { - "line": 1, - "column": 41, - "offset": 40 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", - "type": "link", - "children": [ - { - "type": "text", - "value": "Promise" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "promise, to be resolved on success or rejected on failure", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 58, - "offset": 57 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 58, - "offset": 57 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/nest_params.output.json b/test/fixture/nest_params.output.json deleted file mode 100644 index 4cea2bfd1..000000000 --- a/test/fixture/nest_params.output.json +++ /dev/null @@ -1,836 +0,0 @@ -[ - { - "description": "", - "tags": [ - { - "title": "param", - "description": "The employees who are responsible for the project.", - "lineNumber": 1, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Object" - } - ] - }, - "name": "employees" - }, - { - "title": "param", - "description": "The name of an employee.", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "employees[].name" - }, - { - "title": "param", - "description": "The employee's department.", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "employees[].department" - }, - { - "title": "param", - "description": "The employee's type.", - "lineNumber": 4, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "string" - } - }, - "name": "type", - "default": "minion" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 32 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "employees", - "lineNumber": 1, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employees who are responsible for the project.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 51, - "offset": 50 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 51, - "offset": 50 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 51, - "offset": 50 - } - } - }, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "Object" - } - ] - }, - "properties": [ - { - "title": "param", - "name": "employees[].name", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The name of an employee.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - }, - { - "title": "param", - "name": "employees[].department", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employee's department.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ] - }, - { - "title": "param", - "name": "type", - "lineNumber": 4, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employee's type.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - }, - "default": "minion" - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - }, - { - "description": "", - "tags": [ - { - "title": "name", - "description": null, - "lineNumber": 1, - "name": "foo" - }, - { - "title": "param", - "description": "some options", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "name": "options" - }, - { - "title": "param", - "description": "how much", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "options.much" - }, - { - "title": "param", - "description": "something else", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "bar" - }, - { - "title": "property", - "description": "the current time", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "name": "theTime" - }, - { - "title": "property", - "description": null, - "lineNumber": 6, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "theTime.hours" - }, - { - "title": "property", - "description": null, - "lineNumber": 7, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "theTime.minutes" - }, - { - "title": "property", - "description": null, - "lineNumber": 8, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "theTime.seconds" - }, - { - "title": "returns", - "description": "foo something else", - "lineNumber": 9, - "type": { - "type": "NameExpression", - "name": "Object" - } - } - ], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 19, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 32 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "options", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "some options", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "name": "options.much", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "how much", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ] - }, - { - "title": "param", - "name": "bar", - "lineNumber": 4, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "something else", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [ - { - "title": "property", - "name": "theTime", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "property", - "name": "theTime.hours", - "lineNumber": 6, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "property", - "name": "theTime.minutes", - "lineNumber": 7, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "property", - "name": "theTime.seconds", - "lineNumber": 8, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ] - } - ], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "foo something else", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Object" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo" - } - ], - "namespace": "foo" - } -] \ No newline at end of file diff --git a/test/fixture/nest_params.output.md b/test/fixture/nest_params.output.md deleted file mode 100644 index 54ef3e622..000000000 --- a/test/fixture/nest_params.output.md +++ /dev/null @@ -1,32 +0,0 @@ - - -### Table of Contents - -- [foo](#foo) -- [foo](#foo-1) - -## foo - -**Parameters** - -- `employees` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)>** The employees who are responsible for the project. - - `employees[].name` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The name of an employee. - - `employees[].department` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The employee's department. -- `type` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The employee's type. (optional, default `minion`) - -## foo - -**Parameters** - -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** some options - - `options.much` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** how much -- `bar` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** something else - -**Properties** - -- `theTime` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the current time - - `theTime.hours` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - - `theTime.minutes` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - - `theTime.seconds` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -Returns **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** foo something else diff --git a/test/fixture/nest_params.output.md.json b/test/fixture/nest_params.output.md.json deleted file mode 100644 index b03188cd0..000000000 --- a/test/fixture/nest_params.output.md.json +++ /dev/null @@ -1,890 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "employees" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employees who are responsible for the project.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 51, - "offset": 50 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 51, - "offset": 50 - }, - "indent": [] - } - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "employees[].name" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The name of an employee.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "employees[].department" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employee's department.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "type" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The employee's type.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 21, - "offset": 20 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "minion" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "some options", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.much" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "how much", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 9, - "offset": 8 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "bar" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "something else", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 15, - "offset": 14 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "theTime" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the current time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "theTime.hours" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "theTime.minutes" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "theTime.seconds" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "foo something else", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/newline-in-description.output.json b/test/fixture/newline-in-description.output.json deleted file mode 100644 index 11dac1a0d..000000000 --- a/test/fixture/newline-in-description.output.json +++ /dev/null @@ -1,180 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A function.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - } - } - }, - "tags": [ - { - "title": "param", - "description": "The input to the function.\nI should be able to continue the description on a new line, and have it\nstill work in the markdown table.", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - }, - "name": "a" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 0 - } - } - }, - "augments": [], - "errors": [ - { - "message": "could not determine @name for hierarchy" - } - ], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The input to the function.\nI should be able to continue the description on a new line, and have it\nstill work in the markdown table.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 34, - "offset": 132 - }, - "indent": [ - 1, - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 34, - "offset": 132 - }, - "indent": [ - 1, - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 34, - "offset": 132 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [], - "namespace": "" - } -] \ No newline at end of file diff --git a/test/fixture/newline-in-description.output.md b/test/fixture/newline-in-description.output.md deleted file mode 100644 index 6b7dc0a64..000000000 --- a/test/fixture/newline-in-description.output.md +++ /dev/null @@ -1,13 +0,0 @@ - - -### Table of Contents - -## - -A function. - -**Parameters** - -- `a` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** The input to the function. - I should be able to continue the description on a new line, and have it - still work in the markdown table. diff --git a/test/fixture/newline-in-description.output.md.json b/test/fixture/newline-in-description.output.md.json deleted file mode 100644 index 8d79efda6..000000000 --- a/test/fixture/newline-in-description.output.md.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A function.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The input to the function.\nI should be able to continue the description on a new line, and have it\nstill work in the markdown table.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 34, - "offset": 132 - }, - "indent": [ - 1, - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 34, - "offset": 132 - }, - "indent": [ - 1, - 1 - ] - } - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/no-name.output.json b/test/fixture/no-name.output.json deleted file mode 100644 index 79026c20e..000000000 --- a/test/fixture/no-name.output.json +++ /dev/null @@ -1,122 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Set the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - } - } - }, - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "bar" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 0 - } - } - }, - "augments": [], - "errors": [ - { - "message": "could not determine @name for hierarchy" - } - ], - "examples": [], - "params": [ - { - "title": "param", - "name": "bar", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [], - "namespace": "" - } -] \ No newline at end of file diff --git a/test/fixture/no-name.output.md b/test/fixture/no-name.output.md deleted file mode 100644 index 6bfd3fb28..000000000 --- a/test/fixture/no-name.output.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### Table of Contents - -## - -Set the time - -**Parameters** - -- `bar` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** diff --git a/test/fixture/no-name.output.md.json b/test/fixture/no-name.output.md.json deleted file mode 100644 index fb1772a02..000000000 --- a/test/fixture/no-name.output.md.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Set the time", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 13, - "offset": 12 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "bar" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/optional-record-field-type.output.json b/test/fixture/optional-record-field-type.output.json deleted file mode 100644 index 2f633ef1e..000000000 --- a/test/fixture/optional-record-field-type.output.json +++ /dev/null @@ -1,99 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [ - { - "title": "property", - "name": "opt", - "lineNumber": 3, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - }, - { - "title": "property", - "name": "req", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "string" - } - } - ], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Record", - "kind": "typedef", - "type": { - "type": "RecordType", - "fields": [ - { - "type": "FieldType", - "key": "opt", - "value": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - }, - { - "type": "FieldType", - "key": "req", - "value": { - "type": "NameExpression", - "name": "string" - } - } - ] - }, - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Record", - "kind": "typedef" - } - ], - "namespace": "Record" - } -] \ No newline at end of file diff --git a/test/fixture/optional-record-field-type.output.md b/test/fixture/optional-record-field-type.output.md deleted file mode 100644 index b3a410e63..000000000 --- a/test/fixture/optional-record-field-type.output.md +++ /dev/null @@ -1,14 +0,0 @@ - - -### Table of Contents - -- [Record](#record) - -## Record - -Type: {opt: [number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?, req: [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)} - -**Properties** - -- `opt` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** -- `req` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** diff --git a/test/fixture/optional-record-field-type.output.md.json b/test/fixture/optional-record-field-type.output.md.json deleted file mode 100644 index bb20925b8..000000000 --- a/test/fixture/optional-record-field-type.output.md.json +++ /dev/null @@ -1,169 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Record" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Type: " - }, - { - "type": "text", - "value": "{" - }, - { - "type": "text", - "value": "opt: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - }, - { - "type": "text", - "value": ", " - }, - { - "type": "text", - "value": "req: " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": "}" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Properties" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "opt" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "req" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/params.output.json b/test/fixture/params.output.json deleted file mode 100644 index 5d298de82..000000000 --- a/test/fixture/params.output.json +++ /dev/null @@ -1,2845 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the second param", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "b" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 5 - }, - { - "title": "param", - "name": "b", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the second param", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - }, - { - "title": "param", - "name": "c", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3", - "anonymous": true, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "name": "$3.d", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3.e", - "lineNumber": 5 - }, - { - "title": "param", - "name": "$3.f", - "lineNumber": 5 - } - ] - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "addThem", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "addThem", - "kind": "function" - } - ], - "namespace": "addThem" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has partially inferred params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - } - } - }, - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "name": "options" - }, - { - "title": "param", - "description": "number of kinds of fish", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "String" - }, - "name": "options.fishes" - } - ], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 13, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 16, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "options", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Object" - }, - "properties": [ - { - "title": "param", - "name": "options.fishes", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "number of kinds of fish", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - } - } - }, - "type": { - "type": "NameExpression", - "name": "String" - } - }, - { - "title": "param", - "name": "options.foxes", - "lineNumber": 14 - } - ] - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "fishesAndFoxes", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "fishesAndFoxes", - "kind": "function" - } - ], - "namespace": "fishesAndFoxes" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has a type in the description and a default in the code", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 68, - "offset": 67 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 68, - "offset": 67 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 68, - "offset": 67 - } - } - }, - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "x" - } - ], - "loc": { - "start": { - "line": 18, - "column": 0 - }, - "end": { - "line": 21, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 22, - "column": 0 - }, - "end": { - "line": 24, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "default": "2" - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "withDefault", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "withDefault", - "kind": "function" - } - ], - "namespace": "withDefault" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is foo's documentation", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 26, - "column": 0 - }, - "end": { - "line": 28, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 29, - "column": 0 - }, - "end": { - "line": 35, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "Foo", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - } - } - }, - "tags": [ - { - "title": "param", - "description": "Param to method", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "x" - } - ], - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 33, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 34, - "column": 2 - }, - "end": { - "line": 34, - "column": 14 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 2, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Param to method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "method", - "kind": "function", - "memberof": "Foo", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Foo", - "kind": "class" - }, - { - "name": "method", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "Foo#method" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Foo", - "kind": "class" - } - ], - "namespace": "Foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Traditional object", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 37, - "column": 0 - }, - "end": { - "line": 39, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 40, - "column": 0 - }, - "end": { - "line": 47, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "TraditionalObject", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method should acquire the param x", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 39, - "offset": 38 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 39, - "offset": 38 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 39, - "offset": 38 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 41, - "column": 2 - }, - "end": { - "line": 43, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 44, - "column": 2 - }, - "end": { - "line": 46, - "column": 3 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 44 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "traditionalMethod", - "kind": "function", - "memberof": "TraditionalObject", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "TraditionalObject" - }, - { - "name": "traditionalMethod", - "kind": "function", - "scope": "static" - } - ], - "namespace": "TraditionalObject.traditionalMethod" - } - ] - }, - "path": [ - { - "name": "TraditionalObject" - } - ], - "namespace": "TraditionalObject" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Represents an IPv6 address", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters", - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 28 - }, - "end": { - "line": 3, - "column": 47, - "offset": 74 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 28 - }, - "end": { - "line": 3, - "column": 47, - "offset": 74 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 47, - "offset": 74 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 4, - "type": null, - "name": "Address6" - }, - { - "title": "param", - "description": "An IPv6 address string", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "string" - }, - "name": "address" - }, - { - "title": "param", - "description": "How many octets to parse", - "lineNumber": 6, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - }, - "name": "groups", - "default": "8" - }, - { - "title": "param", - "description": "A third argument", - "lineNumber": 7, - "type": { - "type": "NullableType", - "expression": { - "type": "NameExpression", - "name": "number" - }, - "prefix": true - }, - "name": "third" - }, - { - "title": "param", - "description": "to properly be parsed", - "lineNumber": 8, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Array" - } - }, - "name": "foo", - "default": "[1]" - }, - { - "title": "example", - "description": "var address = new Address6('2001::/32');", - "lineNumber": 9 - } - ], - "loc": { - "start": { - "line": 49, - "column": 0 - }, - "end": { - "line": 60, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 61, - "column": 0 - }, - "end": { - "line": 61, - "column": 22 - } - } - }, - "augments": [], - "errors": [ - { - "message": "An explicit parameter named address was specified but didn't match inferred information ", - "commentLineNumber": 5 - }, - { - "message": "An explicit parameter named groups was specified but didn't match inferred information ", - "commentLineNumber": 6 - }, - { - "message": "An explicit parameter named third was specified but didn't match inferred information ", - "commentLineNumber": 7 - }, - { - "message": "An explicit parameter named foo was specified but didn't match inferred information ", - "commentLineNumber": 8 - } - ], - "examples": [ - { - "description": "var address = new Address6('2001::/32');" - } - ], - "params": [ - { - "title": "param", - "name": "address", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "type": { - "type": "NameExpression", - "name": "string" - } - }, - { - "title": "param", - "name": "groups", - "lineNumber": 6, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "How many octets to parse", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - }, - "default": "8" - }, - { - "title": "param", - "name": "third", - "lineNumber": 7, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A third argument", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "NullableType", - "expression": { - "type": "NameExpression", - "name": "number" - }, - "prefix": true - } - }, - { - "title": "param", - "name": "foo", - "lineNumber": 8, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "to properly be parsed", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Array" - }, - "default": "[1]" - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "Address6", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Address6", - "kind": "class" - } - ], - "namespace": "Address6" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Create a GeoJSON data source instance given an options object", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 62, - "offset": 61 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 62, - "offset": 61 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of nested parameters", - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 63 - }, - "end": { - "line": 3, - "column": 44, - "offset": 106 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 63 - }, - "end": { - "line": 3, - "column": 44, - "offset": 106 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 3, - "column": 44, - "offset": 106 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 4, - "type": null, - "name": "GeoJSONSource" - }, - { - "title": "param", - "description": "optional options", - "lineNumber": 5, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Object" - } - }, - "name": "options" - }, - { - "title": "param", - "description": "A GeoJSON data object or URL to it.\nThe latter is preferable in case of large GeoJSON files.", - "lineNumber": 6, - "type": { - "type": "UnionType", - "elements": [ - { - "type": "NameExpression", - "name": "Object" - }, - { - "type": "NameExpression", - "name": "string" - } - ] - }, - "name": "options.data" - }, - { - "title": "param", - "description": "Maximum zoom to preserve detail at.", - "lineNumber": 8, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - }, - "name": "options.maxzoom", - "default": "14" - }, - { - "title": "param", - "description": "Tile buffer on each side.", - "lineNumber": 9, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - }, - "name": "options.buffer" - }, - { - "title": "param", - "description": "Simplification tolerance (higher means simpler).", - "lineNumber": 10, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - }, - "name": "options.tolerance" - } - ], - "loc": { - "start": { - "line": 63, - "column": 0 - }, - "end": { - "line": 74, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 75, - "column": 0 - }, - "end": { - "line": 77, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "options", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "optional options", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "Object" - } - }, - "properties": [ - { - "title": "param", - "name": "options.data", - "lineNumber": 6, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A GeoJSON data object or URL to it.\nThe latter is preferable in case of large GeoJSON files.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 92 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 92 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 92 - } - } - }, - "type": { - "type": "UnionType", - "elements": [ - { - "type": "NameExpression", - "name": "Object" - }, - { - "type": "NameExpression", - "name": "string" - } - ] - } - }, - { - "title": "param", - "name": "options.maxzoom", - "lineNumber": 8, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Maximum zoom to preserve detail at.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - }, - "default": "14" - }, - { - "title": "param", - "name": "options.buffer", - "lineNumber": 9, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Tile buffer on each side.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - }, - { - "title": "param", - "name": "options.tolerance", - "lineNumber": 10, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Simplification tolerance (higher means simpler).", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - } - } - }, - "type": { - "type": "OptionalType", - "expression": { - "type": "NameExpression", - "name": "number" - } - } - } - ] - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "GeoJSONSource", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "GeoJSONSource", - "kind": "class" - } - ], - "namespace": "GeoJSONSource" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support for parameters with explicit types but with default\nvalues specified in code.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 26, - "offset": 100 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 26, - "offset": 100 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 26, - "offset": 100 - } - } - }, - "tags": [ - { - "title": "param", - "description": "an argument", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "number" - }, - "name": "x" - }, - { - "title": "returns", - "description": "some", - "lineNumber": 6, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 79, - "column": 0 - }, - "end": { - "line": 86, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 87, - "column": 0 - }, - "end": { - "line": 87, - "column": 37 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 4, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an argument", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - } - } - }, - "type": { - "type": "NameExpression", - "name": "number" - }, - "default": "123" - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "some", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 5, - "offset": 4 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 5, - "offset": 4 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 5, - "offset": 4 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "myfunc", - "kind": "constant", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "myfunc", - "kind": "constant" - } - ], - "namespace": "myfunc" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of JSDoc param tags without type information,\nor any type information we could infer from annotations.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 125 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 125 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 125 - } - } - }, - "tags": [ - { - "title": "param", - "description": "An IPv6 address string", - "lineNumber": 4, - "type": null, - "name": "address" - } - ], - "loc": { - "start": { - "line": 89, - "column": 0 - }, - "end": { - "line": 94, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 95, - "column": 0 - }, - "end": { - "line": 97, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "address", - "lineNumber": 4, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "kind": "function" - } - ], - "namespace": "foo" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support for iterator rest inside an\niterator destructure (RestElement)", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 35, - "offset": 85 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 35, - "offset": 85 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 35, - "offset": 85 - } - } - }, - "tags": [ - { - "title": "param", - "description": null, - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Array" - }, - "name": "input" - }, - { - "title": "param", - "description": "head of iterator", - "lineNumber": 5, - "type": { - "type": "NameExpression", - "name": "any" - }, - "name": "input.0" - }, - { - "title": "param", - "description": "body of iterator", - "lineNumber": 6, - "type": { - "type": "RestType", - "expression": { - "type": "NameExpression", - "name": "any" - } - }, - "name": "input.xs" - }, - { - "title": "returns", - "description": "rotated such that the last element was the first", - "lineNumber": 8, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "any" - } - ] - } - } - ], - "loc": { - "start": { - "line": 99, - "column": 0 - }, - "end": { - "line": 108, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 109, - "column": 0 - }, - "end": { - "line": 111, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "input", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Array" - }, - "properties": [ - { - "title": "param", - "name": "input.0", - "lineNumber": 5, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "head of iterator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "NameExpression", - "name": "any" - } - }, - { - "title": "param", - "name": "input.xs", - "lineNumber": 6, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "body of iterator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "type": { - "type": "RestType", - "expression": { - "type": "NameExpression", - "name": "any" - } - } - } - ] - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "rotated such that the last element was the first", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - } - } - }, - "title": "returns", - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "any" - } - ] - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "rotate", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "rotate", - "kind": "function" - } - ], - "namespace": "rotate" - } -] \ No newline at end of file diff --git a/test/fixture/params.output.md b/test/fixture/params.output.md deleted file mode 100644 index 8178ac3ad..000000000 --- a/test/fixture/params.output.md +++ /dev/null @@ -1,139 +0,0 @@ - - -### Table of Contents - -- [addThem](#addthem) -- [fishesAndFoxes](#fishesandfoxes) -- [withDefault](#withdefault) -- [Foo](#foo) - - [method](#method) -- [TraditionalObject](#traditionalobject) - - [traditionalMethod](#traditionalmethod) -- [Address6](#address6) -- [GeoJSONSource](#geojsonsource) -- [myfunc](#myfunc) -- [foo](#foo-1) -- [rotate](#rotate) - -## addThem - -This function returns the number one. - -**Parameters** - -- `a` -- `b` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the second param -- `c` -- `$3` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - - `$3.d` - - `$3.e` - - `$3.f` - -## fishesAndFoxes - -This method has partially inferred params - -**Parameters** - -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** - - `options.fishes` **[String](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** number of kinds of fish - - `options.foxes` - -## withDefault - -This method has a type in the description and a default in the code - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** (optional, default `2`) - -## Foo - -This is foo's documentation - -### method - -The method - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Param to method - -## TraditionalObject - -Traditional object - -### traditionalMethod - -This method should acquire the param x - -**Parameters** - -- `x` - -## Address6 - -Represents an IPv6 address - -This tests our support of optional parameters - -**Parameters** - -- `address` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** An IPv6 address string -- `groups` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** How many octets to parse (optional, default `8`) -- `third` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** A third argument -- `foo` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** to properly be parsed (optional, default `[1]`) - -**Examples** - -```javascript -var address = new Address6('2001::/32'); -``` - -## GeoJSONSource - -Create a GeoJSON data source instance given an options object - -This tests our support of nested parameters - -**Parameters** - -- `options` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)?** optional options - - `options.data` **([Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) \| [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String))** A GeoJSON data object or URL to it. - The latter is preferable in case of large GeoJSON files. - - `options.maxzoom` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** Maximum zoom to preserve detail at. (optional, default `14`) - - `options.buffer` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Tile buffer on each side. - - `options.tolerance` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)?** Simplification tolerance (higher means simpler). - -## myfunc - -This tests our support for parameters with explicit types but with default -values specified in code. - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** an argument (optional, default `123`) - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** some - -## foo - -This tests our support of JSDoc param tags without type information, -or any type information we could infer from annotations. - -**Parameters** - -- `address` An IPv6 address string - -## rotate - -This tests our support for iterator rest inside an -iterator destructure (RestElement) - -**Parameters** - -- `input` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)** - - `input.0` **any** head of iterator - - `input.xs` **...any** body of iterator - -Returns **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<any>** rotated such that the last element was the first diff --git a/test/fixture/params.output.md.json b/test/fixture/params.output.md.json deleted file mode 100644 index 234d9481d..000000000 --- a/test/fixture/params.output.md.json +++ /dev/null @@ -1,2535 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "addThem" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "b" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the second param", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "c" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.d" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.e" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "$3.f" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "fishesAndFoxes" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has partially inferred params", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 42, - "offset": 41 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.fishes" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "String" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "number of kinds of fish", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 24, - "offset": 23 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.foxes" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "withDefault" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method has a type in the description and a default in the code", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 68, - "offset": 67 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 68, - "offset": 67 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "2" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This is foo's documentation", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "method" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Param to method", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 16, - "offset": 15 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "TraditionalObject" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Traditional object", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 19, - "offset": 18 - }, - "indent": [] - } - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "traditionalMethod" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This method should acquire the param x", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 39, - "offset": 38 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 39, - "offset": 38 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Address6" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Represents an IPv6 address", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of optional parameters", - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 28 - }, - "end": { - "line": 3, - "column": 47, - "offset": 74 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 28 - }, - "end": { - "line": 3, - "column": 47, - "offset": 74 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "address" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "groups" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "How many octets to parse", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 25, - "offset": 24 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "8" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "third" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A third argument", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "foo" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "to properly be parsed", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 22, - "offset": 21 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "[1]" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "lang": "javascript", - "type": "code", - "value": "var address = new Address6('2001::/32');" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "GeoJSONSource" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Create a GeoJSON data source instance given an options object", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 62, - "offset": 61 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 62, - "offset": 61 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of nested parameters", - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 63 - }, - "end": { - "line": 3, - "column": 44, - "offset": 106 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 3, - "column": 1, - "offset": 63 - }, - "end": { - "line": 3, - "column": 44, - "offset": 106 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "optional options", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.data" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "(" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", - "type": "link", - "children": [ - { - "type": "text", - "value": "Object" - } - ] - }, - { - "type": "text", - "value": " | " - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ")" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "A GeoJSON data object or URL to it.\nThe latter is preferable in case of large GeoJSON files.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 92 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 92 - }, - "indent": [ - 1 - ] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.maxzoom" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Maximum zoom to preserve detail at.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 36, - "offset": 35 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "14" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.buffer" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Tile buffer on each side.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 26, - "offset": 25 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "options.tolerance" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - }, - { - "type": "text", - "value": "?" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Simplification tolerance (higher means simpler).", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "myfunc" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support for parameters with explicit types but with default\nvalues specified in code.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 26, - "offset": 100 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 26, - "offset": 100 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "an argument", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 12, - "offset": 11 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": " (optional, default " - }, - { - "type": "inlineCode", - "value": "123" - }, - { - "type": "text", - "value": ")" - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "some", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 5, - "offset": 4 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 5, - "offset": 4 - }, - "indent": [] - } - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support of JSDoc param tags without type information,\nor any type information we could infer from annotations.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 125 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 57, - "offset": 125 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "address" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "rotate" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This tests our support for iterator rest inside an\niterator destructure (RestElement)", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 35, - "offset": 85 - }, - "indent": [ - 1 - ] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 2, - "column": 35, - "offset": 85 - }, - "indent": [ - 1 - ] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "input" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "input.0" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "head of iterator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - } - ] - }, - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "input.xs" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "..." - }, - { - "type": "text", - "value": "any" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "body of iterator", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "type": "text", - "value": "any" - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "rotated such that the last element was the first", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 49, - "offset": 48 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/react-jsx.output.json b/test/fixture/react-jsx.output.json deleted file mode 100644 index 1ffc1ba8f..000000000 --- a/test/fixture/react-jsx.output.json +++ /dev/null @@ -1,104 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "apples", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 20 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "apples", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "apples", - "kind": "function" - } - ], - "namespace": "apples" - } -] \ No newline at end of file diff --git a/test/fixture/react-jsx.output.md b/test/fixture/react-jsx.output.md deleted file mode 100644 index 96878014b..000000000 --- a/test/fixture/react-jsx.output.md +++ /dev/null @@ -1,9 +0,0 @@ - - -### Table of Contents - -- [apples](#apples) - -## apples - -apples diff --git a/test/fixture/react-jsx.output.md.json b/test/fixture/react-jsx.output.md.json deleted file mode 100644 index 7ebe87a39..000000000 --- a/test/fixture/react-jsx.output.md.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "apples" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "apples", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 7, - "offset": 6 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/require-json-no-extension.output.json b/test/fixture/require-json-no-extension.output.json deleted file mode 100644 index 0637a088a..000000000 --- a/test/fixture/require-json-no-extension.output.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/test/fixture/require-json-no-extension.output.md b/test/fixture/require-json-no-extension.output.md deleted file mode 100644 index aedd5447d..000000000 --- a/test/fixture/require-json-no-extension.output.md +++ /dev/null @@ -1,3 +0,0 @@ - - -### Table of Contents diff --git a/test/fixture/require-json-no-extension.output.md.json b/test/fixture/require-json-no-extension.output.md.json deleted file mode 100644 index c4109240d..000000000 --- a/test/fixture/require-json-no-extension.output.md.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - } - ] -} \ No newline at end of file diff --git a/test/fixture/require-json.output.json b/test/fixture/require-json.output.json deleted file mode 100644 index 0637a088a..000000000 --- a/test/fixture/require-json.output.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/test/fixture/require-json.output.md b/test/fixture/require-json.output.md deleted file mode 100644 index aedd5447d..000000000 --- a/test/fixture/require-json.output.md +++ /dev/null @@ -1,3 +0,0 @@ - - -### Table of Contents diff --git a/test/fixture/require-json.output.md.json b/test/fixture/require-json.output.md.json deleted file mode 100644 index c4109240d..000000000 --- a/test/fixture/require-json.output.md.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple-hashbang.output.json b/test/fixture/simple-hashbang.output.json deleted file mode 100644 index f03bd9afb..000000000 --- a/test/fixture/simple-hashbang.output.json +++ /dev/null @@ -1,174 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 10, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "simple-hashbang.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "simple-hashbang.input", - "kind": "function" - } - ], - "namespace": "simple-hashbang.input" - } -] \ No newline at end of file diff --git a/test/fixture/simple-hashbang.output.md b/test/fixture/simple-hashbang.output.md deleted file mode 100644 index 362645dc1..000000000 --- a/test/fixture/simple-hashbang.output.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### Table of Contents - -- [simple-hashbang.input](#simple-hashbanginput) - -## simple-hashbang.input - -This function returns the number one. - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/simple-hashbang.output.md.json b/test/fixture/simple-hashbang.output.md.json deleted file mode 100644 index eea85db79..000000000 --- a/test/fixture/simple-hashbang.output.md.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "simple-hashbang.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple-private.output.json b/test/fixture/simple-private.output.json deleted file mode 100644 index 0637a088a..000000000 --- a/test/fixture/simple-private.output.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/test/fixture/simple-private.output.md b/test/fixture/simple-private.output.md deleted file mode 100644 index aedd5447d..000000000 --- a/test/fixture/simple-private.output.md +++ /dev/null @@ -1,3 +0,0 @@ - - -### Table of Contents diff --git a/test/fixture/simple-private.output.md.json b/test/fixture/simple-private.output.md.json deleted file mode 100644 index c4109240d..000000000 --- a/test/fixture/simple-private.output.md.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple-singlestar.output.json b/test/fixture/simple-singlestar.output.json deleted file mode 100644 index 0637a088a..000000000 --- a/test/fixture/simple-singlestar.output.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/test/fixture/simple-singlestar.output.md b/test/fixture/simple-singlestar.output.md deleted file mode 100644 index aedd5447d..000000000 --- a/test/fixture/simple-singlestar.output.md +++ /dev/null @@ -1,3 +0,0 @@ - - -### Table of Contents diff --git a/test/fixture/simple-singlestar.output.md.json b/test/fixture/simple-singlestar.output.md.json deleted file mode 100644 index c4109240d..000000000 --- a/test/fixture/simple-singlestar.output.md.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple-triplestar.output.json b/test/fixture/simple-triplestar.output.json deleted file mode 100644 index 0637a088a..000000000 --- a/test/fixture/simple-triplestar.output.json +++ /dev/null @@ -1 +0,0 @@ -[] \ No newline at end of file diff --git a/test/fixture/simple-triplestar.output.md b/test/fixture/simple-triplestar.output.md deleted file mode 100644 index aedd5447d..000000000 --- a/test/fixture/simple-triplestar.output.md +++ /dev/null @@ -1,3 +0,0 @@ - - -### Table of Contents diff --git a/test/fixture/simple-triplestar.output.md.json b/test/fixture/simple-triplestar.output.md.json deleted file mode 100644 index c4109240d..000000000 --- a/test/fixture/simple-triplestar.output.md.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple-two.output.json b/test/fixture/simple-two.output.json deleted file mode 100644 index a6d86ceea..000000000 --- a/test/fixture/simple-two.output.json +++ /dev/null @@ -1,255 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number plus two.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - } - } - }, - "tags": [ - { - "title": "param", - "description": "the number", - "lineNumber": 3, - "type": { - "type": "NameExpression", - "name": "Number" - }, - "name": "a" - }, - { - "title": "returns", - "description": "numbertwo", - "lineNumber": 4, - "type": { - "type": "NameExpression", - "name": "Number" - } - }, - { - "title": "example", - "description": "var result = returnTwo(4);\n// result is 6", - "lineNumber": 5 - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 13, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [ - { - "description": "var result = returnTwo(4);\n// result is 6" - } - ], - "params": [ - { - "title": "param", - "name": "a", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - } - } - }, - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numbertwo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "Number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "returnTwo", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "returnTwo", - "kind": "function" - } - ], - "namespace": "returnTwo" - } -] \ No newline at end of file diff --git a/test/fixture/simple-two.output.md b/test/fixture/simple-two.output.md deleted file mode 100644 index 31f744ae3..000000000 --- a/test/fixture/simple-two.output.md +++ /dev/null @@ -1,22 +0,0 @@ - - -### Table of Contents - -- [returnTwo](#returntwo) - -## returnTwo - -This function returns the number plus two. - -**Parameters** - -- `a` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number - -**Examples** - -```javascript -var result = returnTwo(4); -// result is 6 -``` - -Returns **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numbertwo diff --git a/test/fixture/simple-two.output.md.json b/test/fixture/simple-two.output.md.json deleted file mode 100644 index 87999cf26..000000000 --- a/test/fixture/simple-two.output.md.json +++ /dev/null @@ -1,220 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "returnTwo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number plus two.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 43, - "offset": 42 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "a" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "the number", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 11, - "offset": 10 - }, - "indent": [] - } - } - ] - } - ] - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Examples" - } - ] - }, - { - "lang": "javascript", - "type": "code", - "value": "var result = returnTwo(4);\n// result is 6" - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "Number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numbertwo", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/simple.output.github.json b/test/fixture/simple.output.github.json deleted file mode 100644 index fee8d21ce..000000000 --- a/test/fixture/simple.output.github.json +++ /dev/null @@ -1,175 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 8, - "column": 2 - } - }, - "github": "[github]" - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "simple.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "simple.input", - "kind": "function" - } - ], - "namespace": "simple.input" - } -] \ No newline at end of file diff --git a/test/fixture/simple.output.github.md b/test/fixture/simple.output.github.md deleted file mode 100644 index dd84d129c..000000000 --- a/test/fixture/simple.output.github.md +++ /dev/null @@ -1,9 +0,0 @@ - - -## simple.input - -[undefined:5-8](<> "Source code on GitHub") - -This function returns the number one. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/simple.output.json b/test/fixture/simple.output.json deleted file mode 100644 index 94432e345..000000000 --- a/test/fixture/simple.output.json +++ /dev/null @@ -1,174 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 8, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "simple.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "simple.input", - "kind": "function" - } - ], - "namespace": "simple.input" - } -] \ No newline at end of file diff --git a/test/fixture/simple.output.md b/test/fixture/simple.output.md deleted file mode 100644 index c2c8c1ec9..000000000 --- a/test/fixture/simple.output.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### Table of Contents - -- [simple.input](#simpleinput) - -## simple.input - -This function returns the number one. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/simple.output.md.json b/test/fixture/simple.output.md.json deleted file mode 100644 index 6ef343f9a..000000000 --- a/test/fixture/simple.output.md.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "simple.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/sort-order-alpha.output.json b/test/fixture/sort-order-alpha.output.json deleted file mode 100644 index c2ae8e8f9..000000000 --- a/test/fixture/sort-order-alpha.output.json +++ /dev/null @@ -1,672 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 15 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "a", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "a", - "kind": "function" - } - ], - "namespace": "a" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 15 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "b", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "b", - "kind": "function" - } - ], - "namespace": "b" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 19, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "C", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "b", - "kind": "function", - "memberof": "C", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - }, - { - "name": "b", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "C#b" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "B", - "kind": "function", - "memberof": "C", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - }, - { - "name": "B", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "C#B" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 16, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "a", - "kind": "function", - "memberof": "C", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - }, - { - "name": "a", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "C#a" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 17, - "column": 2 - }, - "end": { - "line": 17, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "A", - "kind": "function", - "memberof": "C", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - }, - { - "name": "A", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "C#A" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "C", - "kind": "class" - } - ], - "namespace": "C" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 22, - "column": 0 - }, - "end": { - "line": 31, - "column": 1 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "D", - "kind": "class", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 23, - "column": 2 - }, - "end": { - "line": 23, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 24, - "column": 2 - }, - "end": { - "line": 24, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "b", - "kind": "function", - "memberof": "D", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "D", - "kind": "class" - }, - { - "name": "b", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "D#b" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 25, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 26, - "column": 2 - }, - "end": { - "line": 26, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "B", - "kind": "function", - "memberof": "D", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "D", - "kind": "class" - }, - { - "name": "B", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "D#B" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 27, - "column": 2 - }, - "end": { - "line": 27, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 28, - "column": 2 - }, - "end": { - "line": 28, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "a", - "kind": "function", - "memberof": "D", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "D", - "kind": "class" - }, - { - "name": "a", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "D#a" - }, - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 29, - "column": 8 - } - }, - "context": { - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 8 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "A", - "kind": "function", - "memberof": "D", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "D", - "kind": "class" - }, - { - "name": "A", - "kind": "function", - "scope": "instance" - } - ], - "namespace": "D#A" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "D", - "kind": "class" - } - ], - "namespace": "D" - } -] \ No newline at end of file diff --git a/test/fixture/sort-order-alpha.output.md b/test/fixture/sort-order-alpha.output.md deleted file mode 100644 index 4b6e8d21c..000000000 --- a/test/fixture/sort-order-alpha.output.md +++ /dev/null @@ -1,40 +0,0 @@ - - -### Table of Contents - -- [a](#a) -- [b](#b) -- [C](#c) - - [b](#b-1) - - [B](#b-2) - - [a](#a-1) - - [A](#a-2) -- [D](#d) - - [b](#b-3) - - [B](#b-4) - - [a](#a-3) - - [A](#a-4) - -## a - -## b - -## C - -### b - -### B - -### a - -### A - -## D - -### b - -### B - -### a - -### A diff --git a/test/fixture/sort-order-alpha.output.md.json b/test/fixture/sort-order-alpha.output.md.json deleted file mode 100644 index 31d018194..000000000 --- a/test/fixture/sort-order-alpha.output.md.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "a" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "b" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "C" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "b" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "B" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "a" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "A" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "D" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "b" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "B" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "a" - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "A" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/string-literal-key.output.json b/test/fixture/string-literal-key.output.json deleted file mode 100644 index e8faeec6f..000000000 --- a/test/fixture/string-literal-key.output.json +++ /dev/null @@ -1,169 +0,0 @@ -[ - { - "description": "", - "tags": [ - { - "title": "alias", - "description": null, - "lineNumber": 1, - "name": "MyContainerObject" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 11, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "alias": "MyContainerObject", - "name": "MyContainerObject", - "kind": "constant", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "MyContainerObject", - "kind": "constant" - } - ], - "namespace": "MyContainerObject" - }, - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The foo property", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 7, - "column": 5 - } - }, - "context": { - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 10, - "column": 3 - } - } - }, - "augments": [], - "errors": [ - { - "message": "@memberof reference to obj not found", - "commentLineNumber": 0 - } - ], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "foo", - "memberof": "obj", - "scope": "static", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "foo", - "scope": "static" - } - ], - "namespace": ".foo" - } -] \ No newline at end of file diff --git a/test/fixture/string-literal-key.output.md b/test/fixture/string-literal-key.output.md deleted file mode 100644 index a704fb0f8..000000000 --- a/test/fixture/string-literal-key.output.md +++ /dev/null @@ -1,12 +0,0 @@ - - -### Table of Contents - -- [MyContainerObject](#mycontainerobject) -- [foo](#foo) - -## MyContainerObject - -## foo - -The foo property diff --git a/test/fixture/string-literal-key.output.md.json b/test/fixture/string-literal-key.output.md.json deleted file mode 100644 index c0bd30afe..000000000 --- a/test/fixture/string-literal-key.output.md.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "MyContainerObject" - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "foo" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The foo property", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 17, - "offset": 16 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/system-import.output.json b/test/fixture/system-import.output.json deleted file mode 100644 index 94432e345..000000000 --- a/test/fixture/system-import.output.json +++ /dev/null @@ -1,174 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - } - } - }, - "tags": [ - { - "title": "returns", - "description": "numberone", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 8, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - } - } - }, - "title": "returns", - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "simple.input", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "simple.input", - "kind": "function" - } - ], - "namespace": "simple.input" - } -] \ No newline at end of file diff --git a/test/fixture/system-import.output.md b/test/fixture/system-import.output.md deleted file mode 100644 index c2c8c1ec9..000000000 --- a/test/fixture/system-import.output.md +++ /dev/null @@ -1,11 +0,0 @@ - - -### Table of Contents - -- [simple.input](#simpleinput) - -## simple.input - -This function returns the number one. - -Returns **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** numberone diff --git a/test/fixture/system-import.output.md.json b/test/fixture/system-import.output.md.json deleted file mode 100644 index 6ef343f9a..000000000 --- a/test/fixture/system-import.output.md.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "simple.input" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "This function returns the number one.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 38, - "offset": 37 - }, - "indent": [] - } - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "numberone", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 10, - "offset": 9 - }, - "indent": [] - } - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/this-class.output.json b/test/fixture/this-class.output.json deleted file mode 100644 index 8e6091b02..000000000 --- a/test/fixture/this-class.output.json +++ /dev/null @@ -1,411 +0,0 @@ -[ - { - "description": "", - "tags": [ - { - "title": "module", - "description": null, - "lineNumber": 0, - "type": null, - "name": "bookshelf" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "title", - "lineNumber": 4 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "module", - "name": "bookshelf", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "bookshelf", - "kind": "module" - } - ], - "namespace": "bookshelf" - }, - { - "description": "", - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 0, - "name": null - } - ], - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, - "context": { - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "title", - "lineNumber": 4 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "Book", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The title of the book.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 31 - } - }, - "context": { - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 21 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "title", - "memberof": "Book", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Book", - "kind": "class" - }, - { - "name": "title", - "scope": "instance" - } - ], - "namespace": "Book#title" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Book", - "kind": "class" - } - ], - "namespace": "Book" - }, - { - "description": "", - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 0, - "name": null - } - ], - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 13 - } - }, - "context": { - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 13, - "column": 2 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "title", - "lineNumber": 10 - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "BookShelf", - "members": { - "global": [], - "inner": [], - "instance": [ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The title of the bookshelf.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - } - } - }, - "tags": [], - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 36 - } - }, - "context": { - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 21 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "name": "title", - "memberof": "BookShelf", - "scope": "instance", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "BookShelf", - "kind": "class" - }, - { - "name": "title", - "scope": "instance" - } - ], - "namespace": "BookShelf#title" - } - ], - "events": [], - "static": [] - }, - "path": [ - { - "name": "BookShelf", - "kind": "class" - } - ], - "namespace": "BookShelf" - } -] \ No newline at end of file diff --git a/test/fixture/this-class.output.md b/test/fixture/this-class.output.md deleted file mode 100644 index ea20b2510..000000000 --- a/test/fixture/this-class.output.md +++ /dev/null @@ -1,35 +0,0 @@ - - -### Table of Contents - -- [bookshelf](#bookshelf) -- [Book](#book) - - [title](#title) -- [BookShelf](#bookshelf-1) - - [title](#title-1) - -## bookshelf - -**Parameters** - -- `title` - -## Book - -**Parameters** - -- `title` - -### title - -The title of the book. - -## BookShelf - -**Parameters** - -- `title` - -### title - -The title of the bookshelf. diff --git a/test/fixture/this-class.output.md.json b/test/fixture/this-class.output.md.json deleted file mode 100644 index e7b15ff40..000000000 --- a/test/fixture/this-class.output.md.json +++ /dev/null @@ -1,240 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "bookshelf" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "title" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Book" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "title" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "title" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The title of the book.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "BookShelf" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "title" - }, - { - "type": "text", - "value": " " - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "depth": 3, - "type": "heading", - "children": [ - { - "type": "text", - "value": "title" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "The title of the bookshelf.", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 28, - "offset": 27 - }, - "indent": [] - } - } - ] -} \ No newline at end of file diff --git a/test/fixture/type_application.output.json b/test/fixture/type_application.output.json deleted file mode 100644 index d2c81ef6a..000000000 --- a/test/fixture/type_application.output.json +++ /dev/null @@ -1,202 +0,0 @@ -[ - { - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Represents an IPv6 address", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - } - } - }, - "tags": [ - { - "title": "class", - "description": null, - "lineNumber": 2, - "type": null, - "name": "Address6" - }, - { - "title": "param", - "description": "An IPv6 address string", - "lineNumber": 3, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - }, - "name": "address" - } - ], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, - "context": { - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 0 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "address", - "lineNumber": 3, - "description": { - "type": "root", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - } - } - }, - "type": { - "type": "TypeApplication", - "expression": { - "type": "NameExpression", - "name": "Array" - }, - "applications": [ - { - "type": "NameExpression", - "name": "string" - } - ] - } - } - ], - "properties": [], - "returns": [], - "sees": [], - "throws": [], - "todos": [], - "kind": "class", - "name": "Address6", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "Address6", - "kind": "class" - } - ], - "namespace": "Address6" - } -] \ No newline at end of file diff --git a/test/fixture/type_application.output.md b/test/fixture/type_application.output.md deleted file mode 100644 index 15b47e757..000000000 --- a/test/fixture/type_application.output.md +++ /dev/null @@ -1,13 +0,0 @@ - - -### Table of Contents - -- [Address6](#address6) - -## Address6 - -Represents an IPv6 address - -**Parameters** - -- `address` **[Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)>** An IPv6 address string diff --git a/test/fixture/type_application.output.md.json b/test/fixture/type_application.output.md.json deleted file mode 100644 index a77cd28e9..000000000 --- a/test/fixture/type_application.output.md.json +++ /dev/null @@ -1,161 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "Address6" - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Represents an IPv6 address", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 27, - "offset": 26 - }, - "indent": [] - } - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "address" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", - "type": "link", - "children": [ - { - "type": "text", - "value": "Array" - } - ] - }, - { - "type": "text", - "value": "<" - }, - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", - "type": "link", - "children": [ - { - "type": "text", - "value": "string" - } - ] - }, - { - "type": "text", - "value": ">" - } - ] - }, - { - "type": "text", - "value": " " - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "An IPv6 address string", - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ], - "position": { - "start": { - "line": 1, - "column": 1, - "offset": 0 - }, - "end": { - "line": 1, - "column": 23, - "offset": 22 - }, - "indent": [] - } - } - ] - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixture/var-function-param-return.output.json b/test/fixture/var-function-param-return.output.json deleted file mode 100644 index 3cd6a3c86..000000000 --- a/test/fixture/var-function-param-return.output.json +++ /dev/null @@ -1,71 +0,0 @@ -[ - { - "description": "", - "tags": [], - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - } - }, - "context": { - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 40 - } - } - }, - "augments": [], - "errors": [], - "examples": [], - "params": [ - { - "title": "param", - "name": "x", - "lineNumber": 2, - "type": { - "type": "NameExpression", - "name": "number" - } - } - ], - "properties": [], - "returns": [ - { - "title": "returns", - "type": { - "type": "NameExpression", - "name": "boolean" - } - } - ], - "sees": [], - "throws": [], - "todos": [], - "name": "f", - "kind": "function", - "members": { - "global": [], - "inner": [], - "instance": [], - "events": [], - "static": [] - }, - "path": [ - { - "name": "f", - "kind": "function" - } - ], - "namespace": "f" - } -] \ No newline at end of file diff --git a/test/fixture/var-function-param-return.output.md b/test/fixture/var-function-param-return.output.md deleted file mode 100644 index 5373d639c..000000000 --- a/test/fixture/var-function-param-return.output.md +++ /dev/null @@ -1,13 +0,0 @@ - - -### Table of Contents - -- [f](#f) - -## f - -**Parameters** - -- `x` **[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** - -Returns **[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** diff --git a/test/fixture/var-function-param-return.output.md.json b/test/fixture/var-function-param-return.output.md.json deleted file mode 100644 index cc30bcd50..000000000 --- a/test/fixture/var-function-param-return.output.md.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "type": "root", - "children": [ - { - "type": "html", - "value": "" - }, - { - "depth": 2, - "type": "heading", - "children": [ - { - "type": "text", - "value": "f" - } - ] - }, - { - "type": "strong", - "children": [ - { - "type": "text", - "value": "Parameters" - } - ] - }, - { - "ordered": false, - "type": "list", - "children": [ - { - "type": "listItem", - "children": [ - { - "type": "paragraph", - "children": [ - { - "type": "inlineCode", - "value": "x" - }, - { - "type": "text", - "value": " " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", - "type": "link", - "children": [ - { - "type": "text", - "value": "number" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] - } - ] - }, - { - "type": "paragraph", - "children": [ - { - "type": "text", - "value": "Returns " - }, - { - "type": "strong", - "children": [ - { - "href": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "url": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", - "type": "link", - "children": [ - { - "type": "text", - "value": "boolean" - } - ] - } - ] - }, - { - "type": "text", - "value": " " - } - ] - } - ] -} \ No newline at end of file diff --git a/test/lib/flow_doctrine.js b/test/lib/flow_doctrine.js deleted file mode 100644 index da9d62bb7..000000000 --- a/test/lib/flow_doctrine.js +++ /dev/null @@ -1,430 +0,0 @@ -'use strict'; - -var flowDoctrine = require('../../lib/flow_doctrine.js'), - parse = require('../../lib/parsers/javascript'), - FLOW_TYPES = require('babel-types').FLOW_TYPES, - test = require('tap').test; - -function toComment(fn, filename) { - return parse( - { - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, - {} - )[0]; -} - -test('flowDoctrine', function(t) { - var types = FLOW_TYPES.filter(function(type) { - return type.match(/\wTypeAnnotation$/); - }); - - function toDoctrineType(flowType) { - var annotation = toComment( - '/** add */function add(a: ' + flowType + ' ) { }' - ).context.ast.node.params[0].typeAnnotation.typeAnnotation; - if (types.indexOf(annotation.type) !== -1) { - types.splice(types.indexOf(annotation.type), 1); - } - return flowDoctrine(annotation); - } - - t.deepEqual( - toDoctrineType('number'), - { - type: 'NameExpression', - name: 'number' - }, - 'number' - ); - - t.deepEqual( - toDoctrineType('string'), - { - type: 'NameExpression', - name: 'string' - }, - 'string' - ); - - t.deepEqual( - toDoctrineType('any'), - { - type: 'AllLiteral' - }, - 'all' - ); - - t.deepEqual( - toDoctrineType('(y:Foo) => Bar'), - { - type: 'FunctionType', - params: [ - { - type: 'ParameterType', - name: 'y', - expression: { - type: 'NameExpression', - name: 'Foo' - } - } - ], - result: { - type: 'NameExpression', - name: 'Bar' - } - }, - 'function type' - ); - - t.deepEqual( - toDoctrineType('?number'), - { - type: 'NullableType', - expression: { - type: 'NameExpression', - name: 'number' - } - }, - 'nullable' - ); - - t.deepEqual( - toDoctrineType('number | string'), - { - type: 'UnionType', - elements: [ - { - type: 'NameExpression', - name: 'number' - }, - { - type: 'NameExpression', - name: 'string' - } - ] - }, - 'union' - ); - - t.deepEqual( - toDoctrineType('Object'), - { - type: 'NameExpression', - name: 'Object' - }, - 'object' - ); - - t.deepEqual( - toDoctrineType('namedType.propertyOfType'), - { - type: 'NameExpression', - name: 'namedType.propertyOfType' - }, - 'named type with property' - ); - - t.deepEqual( - toDoctrineType('Array'), - { - applications: [ - { - type: 'NameExpression', - name: 'namedType.propertyOfType' - } - ], - expression: { - name: 'Array', - type: 'NameExpression' - }, - type: 'TypeApplication' - }, - 'typeapplication of named type with property' - ); - - t.deepEqual( - toDoctrineType('Array>'), - { - applications: [ - { - applications: [ - { - name: 'boolean', - type: 'NameExpression' - } - ], - expression: { - type: 'NameExpression', - name: 'namedType.propertyOfType' - }, - type: 'TypeApplication' - } - ], - expression: { - name: 'Array', - type: 'NameExpression' - }, - type: 'TypeApplication' - }, - 'nested type application' - ); - - t.deepEqual( - toDoctrineType('{ a: foo.bar }'), - { - fields: [ - { - key: 'a', - type: 'FieldType', - value: { - name: 'foo.bar', - type: 'NameExpression' - } - } - ], - type: 'RecordType' - }, - 'object type expression with subtype' - ); - - t.deepEqual( - toDoctrineType('{ a: { b: foo.bar } }'), - { - fields: [ - { - key: 'a', - type: 'FieldType', - value: { - type: 'RecordType', - fields: [ - { - key: 'b', - type: 'FieldType', - value: { - name: 'foo.bar', - type: 'NameExpression' - } - } - ] - } - } - ], - type: 'RecordType' - }, - 'nested fieldtype' - ); - - t.deepEqual( - toDoctrineType('{ a: 1 }'), - { - type: 'RecordType', - fields: [ - { - type: 'FieldType', - key: 'a', - value: { - type: 'NumericLiteralType', - value: 1 - } - } - ] - }, - 'object with properties' - ); - - t.deepEqual( - toDoctrineType('mixed'), - { - type: 'AllLiteral' - }, - 'alias mixed to any for now' - ); - - t.deepEqual( - toDoctrineType('Array'), - { - type: 'NameExpression', - name: 'Array' - }, - 'array' - ); - - t.deepEqual( - toDoctrineType('Array'), - { - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Array' - }, - applications: [ - { - type: 'NameExpression', - name: 'number' - } - ] - }, - 'Array' - ); - - t.deepEqual( - toDoctrineType('number[]'), - { - type: 'TypeApplication', - expression: { - type: 'NameExpression', - name: 'Array' - }, - applications: [ - { - type: 'NameExpression', - name: 'number' - } - ] - }, - 'number[]' - ); - - t.deepEqual( - toDoctrineType('[]'), - { - type: 'ArrayType', - elements: [] - }, - '[]' - ); - - t.deepEqual( - toDoctrineType('[number]'), - { - type: 'ArrayType', - elements: [ - { - type: 'NameExpression', - name: 'number' - } - ] - }, - '[number]' - ); - - t.deepEqual( - toDoctrineType('[string, boolean]'), - { - type: 'ArrayType', - elements: [ - { - type: 'NameExpression', - name: 'string' - }, - { - type: 'NameExpression', - name: 'boolean' - } - ] - }, - '[string, boolean]' - ); - - t.deepEqual( - toDoctrineType('boolean'), - { - type: 'NameExpression', - name: 'boolean' - }, - 'boolean' - ); - - t.deepEqual( - toDoctrineType('any => any'), - { - type: 'FunctionType', - params: [ - { - expression: { type: 'AllLiteral' }, - name: '', - type: 'ParameterType' - } - ], - result: { type: 'AllLiteral' } - }, - '' - ); - - t.deepEqual( - toDoctrineType('undefined'), - { - type: 'NameExpression', - name: 'undefined' - }, - 'undefined' - ); - - t.deepEqual( - toDoctrineType('"value"'), - { - type: 'StringLiteralType', - value: 'value' - }, - 'StringLiteralType' - ); - - t.deepEqual( - toDoctrineType('1'), - { - type: 'NumericLiteralType', - value: '1' - }, - 'NumericLiteralType' - ); - - t.deepEqual( - toDoctrineType('true'), - { - type: 'BooleanLiteralType', - value: true - }, - 'BooleanLiteralType' - ); - - t.deepEqual( - toDoctrineType('false'), - { - type: 'BooleanLiteralType', - value: false - }, - 'BooleanLiteralType' - ); - - t.deepEqual( - toDoctrineType('null'), - { - type: 'NullLiteral' - }, - 'NullLiteral' - ); - - t.deepEqual( - toDoctrineType('void'), - { - type: 'VoidLiteral' - }, - 'VoidLiteral' - ); - - // TODO: remove all these types - t.deepEqual( - types, - [ - 'IntersectionTypeAnnotation', - 'EmptyTypeAnnotation', - 'ThisTypeAnnotation', - 'TypeofTypeAnnotation' - ], - 'Type coverage' - ); - - t.end(); -}); diff --git a/test/lib/git/find_git.js b/test/lib/git/find_git.js deleted file mode 100644 index 9e4578a92..000000000 --- a/test/lib/git/find_git.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -var test = require('tap').test, - mock = require('mock-fs'), - mockRepo = require('./mock_repo'), - path = require('path'), - findGit = require('../../../lib/git/find_git'); - -test('findGit', function(t) { - mock(mockRepo.master); - - const root = path.parse(__dirname).root; - - t.equal( - findGit(root + path.join('my', 'repository', 'path', 'index.js')), - root + path.join('my', 'repository', 'path', '.git'), - 'finds git path' - ); - - mock.restore(); - - t.end(); -}); diff --git a/test/lib/git/url_prefix.js b/test/lib/git/url_prefix.js deleted file mode 100644 index b49f33635..000000000 --- a/test/lib/git/url_prefix.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -var test = require('tap').test, - mock = require('mock-fs'), - mockRepo = require('./mock_repo'), - getGithubURLPrefix = require('../../../lib/git/url_prefix'), - parsePackedRefs = getGithubURLPrefix.parsePackedRefs; - -test('getGithubURLPrefix', function(t) { - mock(mockRepo.master); - - t.equal( - getGithubURLPrefix('/my/repository/path/'), - 'https://github.com/foo/bar/blob/this_is_the_sha/', - 'finds git path on master branch' - ); - - mock.restore(); - - mock(mockRepo.detached); - - t.equal( - getGithubURLPrefix('/my/repository/path/'), - 'https://github.com/foo/bar/blob/e4cb2ffe677571d0503e659e4e64e01f45639c62/', - 'finds git path with a detached head' - ); - - mock.restore(); - - t.end(); -}); - -test('parsePackedRefs', function(t) { - var input = '# pack-refs with: peeled fully-peeled\n' + - '4acd658617928bd17ae7364ef2512630d97c007a refs/heads/babel-6\n' + - '11826ad98c6c08d00f4af77f64d3e2687e0f7dba refs/remotes/origin/flow-types'; - t.equal( - parsePackedRefs(input, 'refs/heads/babel-6'), - '4acd658617928bd17ae7364ef2512630d97c007a', - 'Finds babel 6 ref' - ); - t.end(); -}); diff --git a/test/lib/github.js b/test/lib/github.js deleted file mode 100644 index 34f362e75..000000000 --- a/test/lib/github.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict'; - -/* eslint no-unused-vars: 0 */ - -var test = require('tap').test, - mock = require('mock-fs'), - path = require('path'), - mockRepo = require('./git/mock_repo'), - parse = require('../../lib/parsers/javascript'), - github = require('../../lib/github'); - -function toComment(fn, filename) { - return parse( - { - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, - {} - ).map(github); -} - -const root = path.parse(__dirname).root; - -function evaluate(fn) { - return toComment( - fn, - root + path.join('my', 'repository', 'path', 'index.js') - ); -} - -test('github', function(t) { - mock(mockRepo.master); - - t.deepEqual( - evaluate(function() { - /** - * get one - * @returns {number} one - */ - function getOne() { - return 1; - } - })[0].context.github, - { - path: 'index.js', - url: 'https://github.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' - }, - 'gets github url' - ); - - mock.restore(); - - t.end(); -}); - -test('malformed repository', function(t) { - mock(mockRepo.malformed); - - t.equal( - evaluate(function() { - /** - * get one - * @returns {number} one - */ - function getOne() { - return 1; - } - })[0].context.github, - undefined, - 'does not crash' - ); - - mock.restore(); - - t.end(); -}); - -test('enterprise repository', function(t) { - mock(mockRepo.enterprise); - - t.deepEqual( - evaluate(function() { - /** - * get one - * @returns {number} one - */ - function getOne() { - return 1; - } - })[0].context.github, - { - path: 'index.js', - url: 'https://github.enterprise.com/foo/bar/blob/this_is_the_sha/index.js#L6-L8' - }, - 'gets github enterprise url' - ); - - mock.restore(); - - t.end(); -}); diff --git a/test/lib/infer/access.js b/test/lib/infer/access.js deleted file mode 100644 index 21355671c..000000000 --- a/test/lib/infer/access.js +++ /dev/null @@ -1,67 +0,0 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - inferName = require('../../../lib/infer/name'), - inferAccess = require('../../../lib/infer/access'); - -function toComment(fn) { - return parse( - { - source: '(' + fn.toString() + ')' - }, - {} - )[0]; -} - -function evaluate(fn, re) { - return inferAccess(re)(inferName(toComment(fn))); -} - -test('inferAccess', function(t) { - t.equal( - evaluate( - function() { - /** Test */ - function _name() {} - }, - '^_' - ).access, - 'private' - ); - - t.equal( - evaluate( - function() { - /** @private */ - function name() {} - }, - '^_' - ).access, - 'private' - ); - - t.equal( - evaluate( - function() { - /** @public */ - function _name() {} - }, - '^_' - ).access, - 'public' - ); - - t.equal( - evaluate( - function() { - /** Test */ - function name_() {} - }, - '_$' - ).access, - 'private' - ); - - t.end(); -}); diff --git a/test/lib/infer/params.js b/test/lib/infer/params.js deleted file mode 100644 index 65edac6bf..000000000 --- a/test/lib/infer/params.js +++ /dev/null @@ -1,379 +0,0 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../../lib/parsers/javascript'), - inferParams = require('../../../lib/infer/params'); - -function toComment(fn, file) { - return parse( - { - file, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, - {} - )[0]; -} - -function evaluate(fn, file) { - return inferParams(toComment(fn, file)); -} - -test('mergeTrees', function(t) { - t.deepEqual( - inferParams.mergeTrees( - [], - [ - { - title: 'param', - description: 'First arg!', - name: 'a', - type: { - type: 'NameExpression', - name: 'string' - } - } - ] - ), - { - errors: [ - { - commentLineNumber: null, - message: "An explicit parameter named a was specified but didn't match inferred information " - } - ], - mergedParams: [ - { - title: 'param', - description: 'First arg!', - name: 'a', - type: { - type: 'NameExpression', - name: 'string' - } - } - ] - } - ); - - t.deepEqual( - inferParams.mergeTrees( - [ - { - title: 'param', - name: '$0', - anonymous: true, - parameterIndex: 0, - type: { - type: 'NameExpression', - name: 'object' - }, - properties: [ - { - title: 'param', - name: '$0.a', - parameterIndex: 0, - type: { - type: 'NameExpression', - name: 'string' - }, - properties: [] - } - ] - } - ], - [ - { - title: 'param', - description: 'First arg!', - name: 'a', - type: { - type: 'NameExpression', - name: 'object' - } - } - ] - ), - { - errors: [], - mergedParams: [ - { - title: 'param', - description: 'First arg!', - name: 'a', - type: { - type: 'NameExpression', - name: 'object' - }, - properties: [ - { - title: 'param', - name: 'a.a', - parameterIndex: 0, - type: { - type: 'NameExpression', - name: 'string' - }, - properties: [] - } - ] - } - ] - } - ); - - t.end(); -}); - -test('inferParams', function(t) { - t.deepEqual( - evaluate(function() { - /** Test */ - function f(x) {} - }).params, - [{ lineNumber: 3, name: 'x', title: 'param' }] - ); - - t.deepEqual( - evaluate(function() { - /** Test */ - var f = function(x) {}; - }).params, - [{ lineNumber: 3, name: 'x', title: 'param' }] - ); - - t.deepEqual( - evaluate(`/** Test */function f({ x, ...xs }) {};`).params, - [ - { - title: 'param', - name: '$0', - anonymous: true, - type: { - type: 'NameExpression', - name: 'Object' - }, - properties: [ - { - title: 'param', - name: '$0.x', - lineNumber: 1 - }, - { - title: 'param', - name: '$0.xs', - lineNumber: 1, - type: { - type: 'RestType' - } - } - ] - } - ], - 'object spread property' - ); - - t.deepEqual( - evaluate( - ` - /** - * Test - * @param {Object} a renamed destructuring param - */ - var f = function({ x }) {}; - ` - ).params, - [ - { - description: { - children: [ - { - children: [ - { - position: { - end: { - column: 28, - line: 1, - offset: 27 - }, - indent: [], - start: { - column: 1, - line: 1, - offset: 0 - } - }, - type: 'text', - value: 'renamed destructuring param' - } - ], - position: { - end: { - column: 28, - line: 1, - offset: 27 - }, - indent: [], - start: { - column: 1, - line: 1, - offset: 0 - } - }, - type: 'paragraph' - } - ], - position: { - end: { - column: 28, - line: 1, - offset: 27 - }, - start: { - column: 1, - line: 1, - offset: 0 - } - }, - type: 'root' - }, - lineNumber: 2, - name: 'a', - properties: [ - { - lineNumber: 6, - name: 'a.x', - title: 'param' - } - ], - title: 'param', - type: { - name: 'Object', - type: 'NameExpression' - } - } - ] - ); - - t.deepEqual(evaluate('/** Test */ var f = (x) => {}').params, [ - { lineNumber: 1, name: 'x', title: 'param' } - ]); - - t.deepEqual( - evaluate(function() { - var x = 1, - g = function(y) {}, - /** Test */ - f = function(x) {}; - }).params, - [{ lineNumber: 5, name: 'x', title: 'param' }] - ); - - t.deepEqual( - evaluate( - ` - /** Test */ - function f(x = 4) {} - ` - ).params, - [ - { - default: '4', - name: 'x', - title: 'param', - lineNumber: 3, - type: null - } - ], - 'default params' - ); - - t.deepEqual( - evaluate( - ` - /** Test - * @param {number} x - */ - function f(x = 4) {} - ` - ).params, - [ - { - default: '4', - name: 'x', - title: 'param', - lineNumber: 1, - type: { - type: 'NameExpression', - name: 'number' - } - } - ], - 'default params with type' - ); - - t.deepEqual( - evaluate( - ` - /** Test */ - function f({ x: y }) {} - ` - ).params, - [ - { - anonymous: true, - name: '$0', - properties: [ - { - lineNumber: 3, - name: '$0.x', - title: 'param' - } - ], - title: 'param', - type: { - name: 'Object', - type: 'NameExpression' - } - } - ], - 'renaming' - ); - - t.deepEqual( - evaluate( - ` - /** Test */ - function f({ x: { y: { z } } }) {} - ` - ).params, - [ - { - anonymous: true, - name: '$0', - properties: [ - { - lineNumber: 3, - name: '$0.x.y.z', - title: 'param' - } - ], - title: 'param', - type: { - name: 'Object', - type: 'NameExpression' - } - } - ], - 'renaming' - ); - - t.deepEqual(evaluate('/** Test */ export function f(x) {}').params, [ - { lineNumber: 1, name: 'x', title: 'param' } - ]); - - t.deepEqual(evaluate('/** Test */ export default function f(x) {}').params, [ - { lineNumber: 1, name: 'x', title: 'param' } - ]); - - t.end(); -}); diff --git a/test/lib/input/shallow.js b/test/lib/input/shallow.js deleted file mode 100644 index e770cc75d..000000000 --- a/test/lib/input/shallow.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; - -var test = require('tap').test, - path = require('path'), - shallow = require('../../../lib/input/shallow'); - -test('shallow deps', function(t) { - shallow([path.resolve(path.join(__dirname, '../../fixture/es6.input.js'))], { - }).then(deps => { - t.equal(deps.length, 1); - t.ok(deps[0], 'has path'); - t.end(); - }); -}); - -test('shallow deps multi', function(t) { - shallow( - [ - path.resolve(path.join(__dirname, '../../fixture/es6.input.js')), - path.resolve(path.join(__dirname, '../../fixture/es6.output.json')) - ], - {} - ).then(deps => { - t.equal(deps.length, 2); - t.ok(deps[0], 'has path'); - t.end(); - }); -}); - -test('shallow deps directory', function(t) { - shallow([path.resolve(path.join(__dirname, '../../fixture/html'))], {}) - .then(deps => { - t.equal(deps.length, 1); - t.ok(deps[0].file.match(/input.js/), 'is the input file'); - t.end(); - }) - .catch(err => { - t.fail(err); - t.end(); - }); -}); - -test('throws on non-string or object input', function(t) { - shallow([true], {}).catch(err => { - t.equal(err.message, 'Indexes should be either strings or objects'); - t.end(); - }); -}); - -test('shallow deps literal', function(t) { - var obj = { - file: 'foo.js', - source: '//bar' - }; - shallow([obj], {}).then(deps => { - t.equal(deps[0], obj); - t.end(); - }); -}); diff --git a/test/lib/lint.js b/test/lib/lint.js deleted file mode 100644 index f64514ebd..000000000 --- a/test/lib/lint.js +++ /dev/null @@ -1,87 +0,0 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../lib/parsers/javascript'), - lintComments = require('../../lib/lint').lintComments, - formatLint = require('../../lib/lint').formatLint; - -function toComment(fn, filename) { - return parse( - { - file: filename, - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, - {} - )[0]; -} - -function evaluate(fn) { - return lintComments(toComment(fn, 'input.js')); -} - -test('lintComments', function(t) { - t.deepEqual( - evaluate(function() { - /** - * @param {foo - */ - }).errors, - [ - { message: 'Braces are not balanced' }, - { message: 'Missing or invalid tag name' } - ], - 'doctrine error' - ); - - t.deepEqual( - evaluate(function() { - /** - * @param {String} foo - * @param {array} bar - */ - }).errors, - [ - { - commentLineNumber: 1, - message: 'type String found, string is standard' - }, - { commentLineNumber: 2, message: 'type array found, Array is standard' } - ], - 'non-canonical' - ); - - t.deepEqual( - evaluate(function() { - /** - * @param {string} foo - */ - }).errors, - [], - 'no errors' - ); - - t.end(); -}); - -test('formatLint', function(t) { - var comment = evaluate(function() { - // 2 - // 3 - /** 4 - * @param {String} foo - * @param {array} bar - * @param {foo - */ - }); - - var formatted = formatLint([comment]); - - t.contains(formatted, 'input.js'); - t.contains(formatted, /4:1[^\n]+Braces are not balanced/); - t.contains(formatted, /4:1[^\n]+Missing or invalid tag name/); - t.contains(formatted, /5:1[^\n]+type String found, string is standard/); - t.contains(formatted, /6:1[^\n]+type array found, Array is standard/); - t.contains(formatted, '4 warnings'); - - t.end(); -}); diff --git a/test/lib/output/util/formatters.js b/test/lib/output/util/formatters.js deleted file mode 100644 index 26babb131..000000000 --- a/test/lib/output/util/formatters.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; -var test = require('tap').test; -var formatters = require('../../../../lib/output/util/formatters')(getHref); - -test('formatters.parameters -- long form', function(t) { - t.deepEqual(formatters.parameters({}), '()'); - t.deepEqual(formatters.parameters({ params: [] }), '()'); - t.deepEqual( - formatters.parameters({ params: [{ name: 'foo' }] }), - '(foo: any)' - ); - t.deepEqual( - formatters.parameters({ - params: [{ name: 'foo', type: { type: 'OptionalType' } }] - }), - '(foo: any?)' - ); - t.done(); -}); - -test('formatters.parameters -- short form', function(t) { - t.deepEqual(formatters.parameters({}, true), '()'); - t.deepEqual(formatters.parameters({ params: [] }, true), '()'); - t.deepEqual( - formatters.parameters({ params: [{ name: 'foo' }] }, true), - '(foo)' - ); - t.deepEqual( - formatters.parameters( - { - params: [{ name: 'foo', type: { type: 'OptionalType' } }] - }, - true - ), - '(foo?)' - ); - t.deepEqual( - formatters.parameters( - { - params: [ - { - title: 'param', - description: 'param', - type: { - type: 'OptionalType', - expression: { - type: 'NameExpression', - name: 'number' - } - }, - name: 'bar', - default: '1' - } - ] - }, - true - ), - '(bar = 1)' - ); - t.done(); -}); - -function getHref(x) { - return x; -} diff --git a/test/lib/parse.js b/test/lib/parse.js deleted file mode 100644 index ebc18d566..000000000 --- a/test/lib/parse.js +++ /dev/null @@ -1,1452 +0,0 @@ -'use strict'; - -var test = require('tap').test, - parse = require('../../lib/parsers/javascript'), - remark = require('remark'), - visit = require('unist-util-visit'); - -function pick(obj, props) { - if (Array.isArray(props)) { - return props.reduce( - function(memo, prop) { - if (obj[prop] !== undefined) { - memo[prop] = obj[prop]; - } - return memo; - }, - {} - ); - } - return obj[props]; -} - -function evaluate(fn, filename) { - return parse( - { - file: filename || 'test.js', - source: fn instanceof Function ? '(' + fn.toString() + ')' : fn - }, - {} - ); -} - -function addJSDocTag(tree) { - visit(tree, 'link', function(node) { - node.jsdoc = true; - }); - return tree; -} - -function removePosition(tree) { - visit(tree, function(node) { - delete node.position; - }); - return tree; -} - -test('parse - @abstract', function(t) { - t.equal( - evaluate(function() { - /** @abstract */ - })[0].abstract, - true - ); - - t.end(); -}); - -test('parse - @access', function(t) { - t.equal( - evaluate(function() { - /** @access public */ - })[0].access, - 'public', - 'access public' - ); - - t.equal( - evaluate(function() { - /** @access protected */ - })[0].access, - 'protected', - 'access protected' - ); - - t.equal( - evaluate(function() { - /** @access private */ - })[0].access, - 'private', - 'access private' - ); - - t.end(); -}); - -test('parse - @alias', function(t) { - t.end(); -}); - -test('parse - @arg', function(t) { - t.end(); -}); - -test('parse - @argument', function(t) { - t.end(); -}); - -test('parse - @augments', function(t) { - t.equal( - evaluate(function() { - /** @augments Foo */ - })[0].augments[0].name, - 'Foo', - 'augments' - ); - - t.end(); -}); - -test('parse - @description', function(t) { - t.deepEqual( - evaluate(function() { - /** - * This is a free-form description - * @description This tagged description wins, and [is markdown](http://markdown.com). - */ - })[0].description, - remark().parse( - 'This tagged description wins, and [is markdown](http://markdown.com).' - ), - 'description' - ); - - t.end(); -}); - -/* - * Dossier-style augments tag - * https://github.com/google/closure-library/issues/746 - */ -test('parse - @augments in dossier style', function(t) { - t.equal( - evaluate(function() { - /** @augments {Foo} */ - })[0].augments[0].name, - 'Foo', - 'augments' - ); - - t.end(); -}); - -test('parse - @augments of complex passes through', function(t) { - t.deepEqual( - evaluate(function() { - /** @augments {function()} */ - })[0].augments, - [] - ); - - t.end(); -}); - -test('parse - @author', function(t) { - t.end(); -}); - -test('parse - @borrows', function(t) { - t.end(); -}); - -test('parse - @callback', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @callback name */ - })[0], - ['kind', 'name', 'type'] - ), - { - name: 'name', - kind: 'typedef', - type: { - type: 'NameExpression', - name: 'Function' - } - } - ); - - t.end(); -}); - -test('parse - @class', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @class */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'class' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @class name */ - })[0], - ['kind', 'name', 'type'] - ), - { - name: 'name', - kind: 'class' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @class {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - name: 'name', - kind: 'class', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @classdesc', function(t) { - t.deepEqual( - evaluate(function() { - /** @classdesc test */ - })[0].classdesc, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @const', function(t) { - t.end(); -}); - -test('parse - @constant', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @constant */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'constant' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @constant name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'constant', - name: 'name' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @constant {Object} */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'constant', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @constant {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'constant', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @constructor', function(t) { - t.end(); -}); - -test('parse - @constructs', function(t) { - t.end(); -}); - -test('parse - @copyright', function(t) { - t.deepEqual( - evaluate(function() { - /** @copyright test */ - })[0].copyright, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @default', function(t) { - t.end(); -}); - -test('parse - @defaultvalue', function(t) { - t.end(); -}); - -test('parse - @deprecated', function(t) { - t.deepEqual( - evaluate(function() { - /** @deprecated test */ - })[0].deprecated, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @desc', function(t) { - t.deepEqual( - evaluate(function() { - /** @desc test */ - })[0].description, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @description', function(t) { - t.deepEqual( - evaluate(function() { - /** @description test */ - })[0].description, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - description', function(t) { - t.deepEqual( - evaluate(function() { - /** test */ - })[0].description, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @emits', function(t) { - t.end(); -}); - -test('parse - @enum', function(t) { - t.end(); -}); - -test('parse - @event', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @event name */ - })[0], - ['kind', 'name'] - ), - { - kind: 'event', - name: 'name' - } - ); - - t.end(); -}); - -test('parse - @example', function(t) { - t.deepEqual( - evaluate(function() { - /** @example test */ - })[0].examples[0], - { - description: 'test' - }, - 'single line' - ); - - t.deepEqual( - evaluate(function() { - /** - * @example - * a - * b - */ - })[0].examples[0], - { - description: 'a\nb' - }, - 'multiline' - ); - - t.deepEqual( - evaluate(function() { - /** - * @example caption - * a - * b - */ - })[0].examples[0], - { - description: 'a\nb', - caption: remark().parse('caption') - }, - 'with caption' - ); - - t.deepEqual( - evaluate(function() { - /** @example */ - })[0].errors[0], - { - message: '@example without code', - commentLineNumber: 0 - }, - 'missing description' - ); - - t.end(); -}); - -test('parse - @exception', function(t) { - t.end(); -}); - -test('parse - @exports', function(t) { - t.end(); -}); - -test('parse - @extends', function(t) { - t.deepEqual( - evaluate(function() { - /** @extends Foo */ - })[0].augments[0].name, - 'Foo', - 'extends' - ); - - t.end(); -}); - -test('parse - @external', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @external name */ - })[0], - ['kind', 'name'] - ), - { - kind: 'external', - name: 'name' - } - ); - - t.end(); -}); - -test('parse - @file', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @file */ - })[0], - ['kind'] - ), - { - kind: 'file' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @file desc */ - })[0], - ['kind', 'description'] - ), - { - kind: 'file', - description: remark().parse('desc') - } - ); - - t.end(); -}); - -test('parse - @fileoverview', function(t) { - t.end(); -}); - -test('parse - @fires', function(t) { - t.end(); -}); - -test('parse - @func', function(t) { - t.end(); -}); - -test('parse - @function', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @function */ - })[0], - ['kind', 'name'] - ), - { - kind: 'function' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @function name */ - })[0], - ['kind', 'name'] - ), - { - kind: 'function', - name: 'name' - } - ); - - t.end(); -}); - -test('parse - @global', function(t) { - t.equal( - evaluate(function() { - /** @global */ - })[0].scope, - 'global', - 'global' - ); - - t.end(); -}); - -test('parse - @host', function(t) { - t.end(); -}); - -test('parse - @ignore', function(t) { - t.equal( - evaluate(function() { - /** @ignore */ - })[0].ignore, - true - ); - - t.end(); -}); - -test('parse - @implements', function(t) { - t.end(); -}); - -test('parse - @inheritdoc', function(t) { - t.end(); -}); - -test('parse - @inner', function(t) { - t.equal( - evaluate(function() { - /** @inner*/ - })[0].scope, - 'inner', - 'inner' - ); - - t.end(); -}); - -test('parse - @instance', function(t) { - t.equal( - evaluate(function() { - /** @instance*/ - })[0].scope, - 'instance', - 'instance' - ); - - t.end(); -}); - -test('parse - @interface', function(t) { - t.deepEqual( - evaluate(function() { - /** @interface */ - })[0].interface, - true, - 'anonymous' - ); - - t.deepEqual( - evaluate(function() { - /** @interface Foo */ - })[0].name, - 'Foo', - 'named' - ); - - t.end(); -}); - -test('parse - @kind', function(t) { - t.equal( - evaluate(function() { - /** @kind class */ - })[0].kind, - 'class', - 'kind' - ); - - t.end(); -}); - -test('parse - @license', function(t) { - t.end(); -}); - -test('parse - @listens', function(t) { - t.end(); -}); - -test('parse - @member', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @member */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'member' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @member name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'member', - name: 'name' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @member {Object} */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'member', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @member {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'member', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @memberof', function(t) { - t.equal( - evaluate(function() { - /** @memberof test */ - })[0].memberof, - 'test', - 'memberof' - ); - - t.end(); -}); - -test('parse - @method', function(t) { - t.end(); -}); - -test('parse - @mixes', function(t) { - t.end(); -}); - -test('parse - @mixin', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @mixin */ - })[0], - ['kind', 'name'] - ), - { - kind: 'mixin' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @mixin name */ - })[0], - ['kind', 'name'] - ), - { - kind: 'mixin', - name: 'name' - } - ); - - t.end(); -}); - -test('parse - @module', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @module */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'module' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @module name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'module', - name: 'name' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @module {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'module', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @name', function(t) { - t.equal( - evaluate(function() { - /** @name test */ - })[0].name, - 'test', - 'name' - ); - - t.end(); -}); - -test('parse - @namespace', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @namespace */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'namespace' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @namespace name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'namespace', - name: 'name' - } - ); - - t.deepEqual( - pick( - evaluate(function() { - /** @namespace {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'namespace', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @override', function(t) { - t.equal( - evaluate(function() { - /** @override */ - })[0].override, - true - ); - - t.end(); -}); - -test('parse - @overview', function(t) { - t.end(); -}); - -test('parse - @param', function(t) { - t.deepEqual( - evaluate(function() { - /** @param test */ - })[0].params[0], - { - name: 'test', - title: 'param', - lineNumber: 0 - }, - 'name' - ); - - t.deepEqual( - evaluate(function() { - /** @param {number} test */ - })[0].params[0], - { - name: 'test', - title: 'param', - type: { - name: 'number', - type: 'NameExpression' - }, - lineNumber: 0 - }, - 'name and type' - ); - - t.deepEqual( - evaluate(function() { - /** @param {number} test - desc */ - })[0].params[0], - { - name: 'test', - title: 'param', - type: { - name: 'number', - type: 'NameExpression' - }, - description: remark().parse('desc'), - lineNumber: 0 - }, - 'complete' - ); - - t.end(); -}); - -test('parse - @private', function(t) { - t.equal( - evaluate(function() { - /** @private */ - })[0].access, - 'private', - 'private' - ); - - t.end(); -}); - -test('parse - @prop', function(t) { - t.deepEqual( - evaluate(function() { - /** @prop {number} test */ - })[0].properties[0], - { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' - }, - lineNumber: 0 - }, - 'name and type' - ); - - t.deepEqual( - evaluate(function() { - /** @prop {number} test - desc */ - })[0].properties[0], - { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' - }, - description: remark().parse('desc'), - lineNumber: 0 - }, - 'complete' - ); - - t.end(); -}); - -test('parse - @property', function(t) { - t.deepEqual( - evaluate(function() { - /** @property {number} test */ - })[0].properties[0], - { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' - }, - lineNumber: 0 - }, - 'name and type' - ); - - t.deepEqual( - evaluate(function() { - /** @property {number} test - desc */ - })[0].properties[0], - { - name: 'test', - title: 'property', - type: { - name: 'number', - type: 'NameExpression' - }, - description: remark().parse('desc'), - lineNumber: 0 - }, - 'complete' - ); - - t.end(); -}); - -test('parse - @protected', function(t) { - t.equal( - evaluate(function() { - /** @protected */ - })[0].access, - 'protected', - 'protected' - ); - - t.end(); -}); - -test('parse - @public', function(t) { - t.end(); -}); - -test('parse - @readonly', function(t) { - t.equal( - evaluate(function() { - /** @readonly */ - })[0].readonly, - true - ); - - t.end(); -}); - -test('parse - @requires', function(t) { - t.end(); -}); - -test('parse - @return', function(t) { - t.deepEqual( - evaluate(function() { - /** @return test */ - })[0].returns[0], - { - title: 'returns', - description: remark().parse('test') - }, - 'description' - ); - - t.deepEqual( - evaluate(function() { - /** @return {number} test */ - })[0].returns[0], - { - description: remark().parse('test'), - title: 'returns', - type: { - name: 'number', - type: 'NameExpression' - } - }, - 'description and type' - ); - - t.end(); -}); - -test('parse - @returns', function(t) { - t.deepEqual( - evaluate(function() { - /** @returns test */ - })[0].returns[0], - { - title: 'returns', - description: remark().parse('test') - }, - 'description' - ); - - t.deepEqual( - evaluate(function() { - /** @returns {number} test */ - })[0].returns[0], - { - description: remark().parse('test'), - title: 'returns', - type: { - name: 'number', - type: 'NameExpression' - } - }, - 'description and type' - ); - - t.end(); -}); - -test('parse - @see', function(t) { - t.deepEqual( - evaluate(function() { - /** @see test */ - })[0].sees, - [remark().parse('test')], - 'single' - ); - - t.deepEqual( - evaluate(function() { - /** - * @see a - * @see b - */ - })[0].sees, - [remark().parse('a'), remark().parse('b')], - 'multiple' - ); - - t.end(); -}); - -test('parse - @since', function(t) { - t.end(); -}); - -test('parse - @static', function(t) { - t.equal( - evaluate(function() { - /** @static */ - })[0].scope, - 'static', - 'static' - ); - - t.end(); -}); - -test('parse - @summary', function(t) { - t.deepEqual( - evaluate(function() { - /** @summary test */ - })[0].summary, - remark().parse('test') - ); - - t.end(); -}); - -test('parse - @this', function(t) { - t.end(); -}); - -test('parse - @throws', function(t) { - t.deepEqual( - evaluate(function() { - /** @throws desc */ - })[0].throws[0], - { - description: remark().parse('desc') - }, - 'description' - ); - - t.deepEqual( - evaluate(function() { - /** @throws {Error} */ - })[0].throws[0], - { - type: { - name: 'Error', - type: 'NameExpression' - } - }, - 'type' - ); - - t.deepEqual( - evaluate(function() { - /** @throws {Error} desc */ - })[0].throws[0], - { - type: { - name: 'Error', - type: 'NameExpression' - }, - description: remark().parse('desc') - }, - 'type and description' - ); - - t.deepEqual( - evaluate(function() { - /** - * @throws a - * @throws b - */ - })[0].throws, - [ - { - description: remark().parse('a') - }, - { - description: remark().parse('b') - } - ], - 'multiple' - ); - - t.end(); -}); - -test('parse - @todo', function(t) { - t.deepEqual( - evaluate(function() { - /** @todo test */ - })[0].todos, - [remark().parse('test')], - 'single' - ); - - t.deepEqual( - evaluate(function() { - /** - * @todo a - * @todo b - */ - })[0].todos, - [remark().parse('a'), remark().parse('b')], - 'multiple' - ); - - t.end(); -}); - -test('parse - @tutorial', function(t) { - t.end(); -}); - -test('parse - @type', function(t) { - t.end(); -}); - -test('parse - @typedef', function(t) { - t.deepEqual( - pick( - evaluate(function() { - /** @typedef {Object} name */ - })[0], - ['kind', 'name', 'type'] - ), - { - kind: 'typedef', - name: 'name', - type: { - type: 'NameExpression', - name: 'Object' - } - } - ); - - t.end(); -}); - -test('parse - @var', function(t) { - t.end(); -}); - -test('parse - @variation', function(t) { - t.equal( - evaluate(function() { - /** @variation 1 */ - })[0].variation, - 1, - 'variation' - ); - - t.end(); -}); - -test('parse - @version', function(t) { - t.end(); -}); - -test('parse - @virtual', function(t) { - t.end(); -}); - -test('parse - unknown tag', function(t) { - t.deepEqual( - evaluate(function() { - /** @unknown */ - })[0].errors[0], - { - message: 'unknown tag @unknown', - commentLineNumber: 0 - } - ); - - t.end(); -}); - -test('parse - {@link}', function(t) { - t.deepEqual( - removePosition( - evaluate(function() { - /** {@link Foo} */ - })[0].description - ), - addJSDocTag(removePosition(remark().parse('[Foo](Foo)'))) - ); - - t.deepEqual( - removePosition( - evaluate(function() { - /** {@link Foo|text} */ - })[0].description - ), - addJSDocTag(removePosition(remark().parse('[text](Foo)'))) - ); - - t.deepEqual( - removePosition( - evaluate(function() { - /** {@link Foo text} */ - })[0].description - ), - addJSDocTag(removePosition(remark().parse('[text](Foo)'))) - ); - - t.done(); -}); - -test('parse - {@linkcode}', function(t) { - t.end(); -}); - -test('parse - {@linkplain}', function(t) { - t.end(); -}); - -test('parse - {@tutorial}', function(t) { - t.deepEqual( - removePosition( - evaluate(function() { - /** {@tutorial id} */ - })[0].description - ), - { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'tutorial', - url: 'id', - jsdoc: true, - title: null, - children: [ - { - type: 'text', - value: 'id' - } - ] - } - ] - } - ] - } - ); - - t.deepEqual( - removePosition( - evaluate(function() { - /** {@tutorial id|text} */ - })[0].description - ), - { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'tutorial', - url: 'id', - jsdoc: true, - title: null, - children: [ - { - type: 'text', - value: 'text' - } - ] - } - ] - } - ] - } - ); - - t.deepEqual( - removePosition( - evaluate(function() { - /** {@tutorial id text} */ - })[0].description - ), - { - type: 'root', - children: [ - { - type: 'paragraph', - children: [ - { - type: 'tutorial', - url: 'id', - jsdoc: true, - title: null, - children: [ - { - type: 'text', - value: 'text' - } - ] - } - ] - } - ] - } - ); - - t.done(); -}); diff --git a/test/lib/parsers/javascript.js b/test/lib/parsers/javascript.js deleted file mode 100644 index 022506bee..000000000 --- a/test/lib/parsers/javascript.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict'; - -var test = require('tap').test, - remark = require('remark'), - parse = require('../../../lib/parsers/javascript'); - -function toComments(source, filename, opts) { - source = typeof source === 'string' ? source : '(' + source.toString() + ')'; - return parse( - { - file: filename || 'test.js', - source - }, - opts || {} - ); -} - -test('parse - leading comment', function(t) { - t.deepEqual( - toComments(function() { - /** one */ - /** two */ - function two() {} - }).map(function(c) { - return c.description; - }), - [remark().parse('one'), remark().parse('two')] - ); - t.end(); -}); - -test('parse - trailing comment', function(t) { - t.deepEqual( - toComments(function() { - /** one */ - function one() {} - /** two */ - }).map(function(c) { - return c.description; - }), - [remark().parse('one'), remark().parse('two')] - ); - t.end(); -}); - -test('parse - unknown tag', function(t) { - t.equal( - toComments(function() { - /** @unknown */ - })[0].tags[0].title, - 'unknown' - ); - t.end(); -}); - -test('parse - error', function(t) { - t.deepEqual( - toComments(function() { - /** @param {foo */ - })[0].errors, - [ - { message: 'Braces are not balanced' }, - { message: 'Missing or invalid tag name' } - ] - ); - t.end(); -}); - -test('parse - document exported', function(t) { - t.equal( - toComments( - ` - export class C {} - ` - ).length, - 0 - ); - t.equal( - toComments( - ` - export class C {} - `, - 'test.js', - { documentExported: true } - ).length, - 1 - ); - t.equal( - toComments( - ` - export class C { - method() {} - } - `, - 'test.js', - { documentExported: true } - ).length, - 2 - ); - t.end(); -}); diff --git a/test/lib/parsers/polyglot.js b/test/lib/parsers/polyglot.js deleted file mode 100644 index 9025fac35..000000000 --- a/test/lib/parsers/polyglot.js +++ /dev/null @@ -1,89 +0,0 @@ -'use strict'; - -var test = require('tap').test, - fs = require('fs'), - path = require('path'), - remark = require('remark'), - polyglot = require('../../../lib/parsers/polyglot'); - -test('polyglot', function(t) { - var file = path.resolve( - path.join(__dirname, '../../fixture/polyglot/blend.cpp') - ); - var result = polyglot({ - file, - source: fs.readFileSync(file, 'utf8') - }); - delete result[0].context.file; - delete result[0].context.sortKey; - t.deepEqual( - result, - [ - { - errors: [], - augments: [], - examples: [], - properties: [], - throws: [], - todos: [], - sees: [], - context: { - loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } } - }, - description: remark().parse('This method moves a hex to a color'), - loc: { end: { column: 3, line: 40 }, start: { column: 1, line: 35 } }, - name: 'hexToUInt32Color', - params: [ - { - lineNumber: 3, - title: 'param', - name: 'hex', - type: { - name: 'string', - type: 'NameExpression' - } - } - ], - returns: [ - { - title: 'returns', - description: remark().parse('color'), - type: { - name: 'number', - type: 'NameExpression' - } - } - ], - tags: [ - { - description: null, - lineNumber: 2, - name: 'hexToUInt32Color', - title: 'name' - }, - { - description: null, - lineNumber: 3, - name: 'hex', - title: 'param', - type: { - name: 'string', - type: 'NameExpression' - } - }, - { - description: 'color', - lineNumber: 4, - title: 'returns', - type: { - name: 'number', - type: 'NameExpression' - } - } - ] - } - ], - 'polyglot parser' - ); - t.end(); -}); diff --git a/test/lib/server.js b/test/lib/server.js deleted file mode 100644 index ab2fbc3e6..000000000 --- a/test/lib/server.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -var test = require('tap').test, - get = require('../utils').get, - File = require('vinyl'), - Server = require('../../lib/serve/server'); - -var jsFile = new File({ - cwd: '/', - base: '/test/', - path: '/test/file.js', - contents: new Buffer('var test = 123;') -}); - -var coffeeFile = new File({ - cwd: '/', - base: '/test/', - path: '/test/file.coffee', - contents: new Buffer('test = 123') -}); - -var indexFile = new File({ - cwd: '/', - base: '/test/', - path: '/test/index.html', - contents: new Buffer('') -}); - -test('server - throws on bad port', function(t) { - t.throws( - function() { - var server = new Server('4001'); - }, - 'port must be a number' - ); - t.throws( - function() { - var server = new Server(); - }, - 'port must be provided' - ); - t.end(); -}); - -test('server', function(t) { - var server = new Server(4001); - t.ok(server, 'server is initialized'); - server.start().then(function() { - t.test( - 'start can be called more than once, without a callback', - function(tt) { - server.start(); - tt.end(); - } - ); - - t.test('base path', function(tt) { - get('http://localhost:4001/file.coffee', function(code) { - tt.equal(code, 404, 'does not have a file, emits 404'); - tt.end(); - }); - }); - - t.test('base path', function(tt) { - server.setFiles([coffeeFile]); - get('http://localhost:4001/file.coffee', function(text) { - tt.equal(text, 'test = 123', 'emits response'); - tt.end(); - }); - }); - - t.test('reset files', function(tt) { - server.setFiles([coffeeFile, jsFile]); - get('http://localhost:4001/file.js', function(text) { - tt.equal(text, 'var test = 123;', 'emits response'); - tt.end(); - }); - }); - - t.test('index.html special case', function(tt) { - server.setFiles([coffeeFile, indexFile, jsFile]); - get('http://localhost:4001/', function(text) { - tt.equal(text, '', 'sends index.html when / is requested'); - tt.end(); - }); - }); - - t.test('cleanup', function(tt) { - server.stop().then(function() { - tt.end(); - }); - }); - - t.test( - 'stop can be called more than once, without a callback', - function(tt) { - server.stop(); - tt.end(); - } - ); - - t.end(); - }); -}); diff --git a/test/lib/walk.js b/test/lib/walk.js deleted file mode 100644 index 10d9645e8..000000000 --- a/test/lib/walk.js +++ /dev/null @@ -1,90 +0,0 @@ -'use strict'; - -var test = require('tap').test, walk = require('../../lib/walk'); - -test('walk', function(group) { - group.test('flat comments', function(t) { - var comments = [{ name: 'Tom' }]; - - function renamer(comment, options) { - if (options) { - comment.name = options.name; - } else { - comment.name = 'Tim'; - } - } - - t.deepEqual(walk(comments, renamer), [{ name: 'Tim' }], 'no-option case'); - - t.deepEqual( - walk(comments, renamer, { name: 'John' }), - [{ name: 'John' }], - 'with options' - ); - - t.end(); - }); - - group.test('nested comments', function(t) { - var comments = [ - { - name: 'Tom', - members: { - static: [ - { - name: 'Billy' - } - ] - } - } - ]; - - function renamer(comment, options) { - if (options) { - comment.name = options.name; - } else { - comment.name = 'Tim'; - } - } - - t.deepEqual( - walk(comments, renamer), - [ - { - name: 'Tim', - members: { - static: [ - { - name: 'Tim' - } - ] - } - } - ], - 'no-option case' - ); - - t.deepEqual( - walk(comments, renamer, { - name: 'Bob' - }), - [ - { - name: 'Bob', - members: { - static: [ - { - name: 'Bob' - } - ] - } - } - ], - 'with options' - ); - - t.end(); - }); - - group.end(); -}); diff --git a/test/linker.js b/test/linker.js deleted file mode 100644 index 2a4192e82..000000000 --- a/test/linker.js +++ /dev/null @@ -1,54 +0,0 @@ -'use strict'; -var LinkerStack = require('../lib/output/util/linker_stack'), - test = require('tap').test; - -test('linkerStack', function(t) { - var linkerStack = new LinkerStack({}); - - t.equal( - linkerStack.link('string'), - 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String', - 'Default global resolution of string' - ); - - t.equal( - new LinkerStack({ - paths: { - Point: 'http://geojson.org/geojson-spec.html#point' - } - }).link('Point'), - 'http://geojson.org/geojson-spec.html#point', - 'Custom hardcoded path for a GeoJSON type' - ); - - t.equal( - new LinkerStack({ - paths: { - Image: 'http://custom.com/' - } - }).link('Image'), - 'http://custom.com/', - 'Prefers config link to native.' - ); - - var linker = new LinkerStack({ - paths: { - Image: 'http://custom.com/' - } - }); - - linker.namespaceResolver( - [ - { - namespace: 'Image' - } - ], - function(namespace) { - return '#' + namespace; - } - ); - - t.equal(linker.link('Image'), '#Image', 'Prefers local link over all.'); - - t.end(); -}); diff --git a/test/normalize.js b/test/normalize.js deleted file mode 100644 index fe457040c..000000000 --- a/test/normalize.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; -var walk = require('../lib/walk'); - -module.exports = function(comments) { - return walk(comments, function(comment) { - var hasGithub = !!comment.context.github; - var path = comment.context.path; - comment.context = { - loc: comment.context.loc - }; - if (hasGithub) { - comment.context.github = '[github]'; - } - if (path) { - comment.context.path = path; - } - }); -}; diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 71bc9faf3..000000000 --- a/test/test.js +++ /dev/null @@ -1,337 +0,0 @@ -'use strict'; - -var test = require('tap').test, - documentationSchema = require('documentation-schema'), - validate = require('json-schema'), - documentation = require('../'), - outputMarkdown = require('../lib/output/markdown.js'), - outputMarkdownAST = require('../lib/output/markdown_ast.js'), - outputHtml = require('../lib/output/html.js'), - normalize = require('./normalize'), - glob = require('glob'), - path = require('path'), - fs = require('fs'), - _ = require('lodash'), - chdir = require('chdir'); - -var UPDATE = !!process.env.UPDATE; - -function makePOJO(ast) { - return JSON.parse(JSON.stringify(ast)); -} - -function readOptionsFromFile(file) { - var s = fs.readFileSync(file, 'utf-8'); - var lines = s.split(/\n/, 20); - for (var i = 0; i < lines.length; i++) { - var m = lines[i].match(/^\/\/\s+Options:\s*(.+)$/); - if (m) { - return JSON.parse(m[1]); - } - } - return {}; -} - -if (fs.existsSync(path.join(__dirname, '../.git'))) { - test('git option', function(t) { - var file = path.join(__dirname, './fixture/simple.input.js'); - documentation.build([file], { github: true }).then(result => { - normalize(result); - var outputfile = file.replace('.input.js', '.output.github.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); - } - var expect = require(outputfile); - t.deepEqual(result, expect, 'produces correct JSON'); - - outputMarkdown(result, {}).then(result => { - var outputfile = file.replace('.input.js', '.output.github.md'); - if (UPDATE) { - fs.writeFileSync(outputfile, result, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal(result.toString(), expect, 'markdown output correct'); - t.end(); - }); - }); - }); -} - -test('document-exported error', function(t) { - var file = path.join(__dirname, 'fixture', 'document-exported-bad', 'x.js'); - documentation.build([file], { documentExported: true }).then( - result => {}, - err => { - t.match( - err.message, - /Unable to find the value x/g, - 'Produces a descriptive error' - ); - t.end(); - } - ); -}); - -test('external modules option', function(t) { - documentation - .build([path.join(__dirname, 'fixture', 'external.input.js')], { - external: '(external|external/node_modules/*)' - }) - .then(result => { - normalize(result); - var outputfile = path.join( - __dirname, - 'fixture', - '_external-deps-included.json' - ); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); - } - var expect = require(outputfile); - t.deepEqual(result, expect); - t.end(); - }); -}); - -test('bad input', function(tt) { - glob - .sync(path.join(__dirname, 'fixture/bad', '*.input.js')) - .forEach(function(file) { - tt.test(path.basename(file), function(t) { - documentation - .build([file], readOptionsFromFile(file)) - .then(res => { - t.equal(res, undefined); - }) - .catch(error => { - // make error a serializable object - error = JSON.parse(JSON.stringify(error)); - // remove system-specific path - delete error.filename; - delete error.codeFrame; - var outputfile = file.replace('.input.js', '.output.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(error, null, 2)); - } - var expect = JSON.parse(fs.readFileSync(outputfile)); - t.deepEqual(error, expect); - t.end(); - }); - }); - }); - tt.end(); -}); - -test('html', function(tt) { - glob - .sync(path.join(__dirname, 'fixture/html', '*.input.js')) - .forEach(function(file) { - tt.test(path.basename(file), function(t) { - documentation - .build([file], readOptionsFromFile(file)) - .then(result => outputHtml(result, {})) - .then(result => { - var clean = result - .sort((a, b) => a.path > b.path) - .filter(r => r.path.match(/(html)$/)) - .map(r => r.contents) - .join('\n'); - var outputfile = file.replace('.input.js', '.output.files'); - if (UPDATE) { - fs.writeFileSync(outputfile, clean, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.deepEqual(clean, expect); - t.end(); - }) - .catch(err => { - t.fail(err); - }); - }); - }); - tt.end(); -}); - -test('outputs', function(ttt) { - glob - .sync(path.join(__dirname, 'fixture', '*.input.js')) - .forEach(function(file) { - ttt.test(path.basename(file), function(tt) { - documentation.build([file], readOptionsFromFile(file)).then(result => { - tt.test('markdown', function(t) { - outputMarkdown(_.cloneDeep(result), { markdownToc: true }) - .then(result => { - var outputfile = file.replace('.input.js', '.output.md'); - if (UPDATE) { - fs.writeFileSync(outputfile, result, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal(result.toString(), expect, 'markdown output correct'); - t.end(); - }) - .catch(error => t.ifError(error)); - }); - - if (file.match(/es6.input.js/)) { - tt.test('no markdown TOC', function(t) { - outputMarkdown(_.cloneDeep(result), { markdownToc: false }) - .then(result => { - var outputfile = file.replace('.input.js', '.output-toc.md'); - if (UPDATE) { - fs.writeFileSync(outputfile, result, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal(result.toString(), expect, 'markdown output correct'); - t.end(); - }) - .catch(error => t.ifError(error)); - }); - } - - tt.test('markdown AST', function(t) { - outputMarkdownAST(_.cloneDeep(result), {}) - .then(result => { - var outputfile = file.replace('.input.js', '.output.md.json'); - if (UPDATE) { - fs.writeFileSync( - outputfile, - JSON.stringify(result, null, 2), - 'utf8' - ); - } - var expect = JSON.parse(fs.readFileSync(outputfile, 'utf8')); - t.deepEqual(result, expect, 'markdown AST output correct'); - t.end(); - }) - .catch(error => t.ifError(error)); - }); - - tt.test('JSON', function(t) { - normalize(result); - result.forEach(function(comment) { - validate( - comment, - documentationSchema.jsonSchema - ).errors.forEach(function(error) { - t.ifError(error); - }); - }); - var outputfile = file.replace('.input.js', '.output.json'); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); - } - var expect = require(outputfile); - t.deepEqual(makePOJO(result), expect); - t.end(); - }); - - tt.end(); - }); - }); - }); - ttt.end(); -}); - -test('highlightAuto md output', function(t) { - var file = path.join( - __dirname, - 'fixture/auto_lang_hljs/multilanguage.input.js' - ), - hljsConfig = { - hljs: { highlightAuto: true, languages: ['js', 'css', 'html'] } - }; - - documentation.build(file, {}).then(result => { - outputMarkdown(result, hljsConfig).then(result => { - var outputfile = file.replace('.input.js', '.output.md'); - if (UPDATE) { - fs.writeFileSync(outputfile, result, 'utf8'); - } - var expect = fs.readFileSync(outputfile, 'utf8'); - t.equal( - result.toString(), - expect, - 'recognizes examples in html, css and js' - ); - t.end(); - }); - }); -}); - -test('config', function(t) { - var file = path.join(__dirname, 'fixture', 'class.input.js'); - var outputfile = path.join(__dirname, 'fixture', 'class.config.output.md'); - documentation - .build([file], { - config: path.join(__dirname, 'fixture', 'simple.config.yml') - }) - .then(out => outputMarkdown(out, {})) - .then(md => { - if (UPDATE) { - fs.writeFileSync(outputfile, md); - } - var result = fs.readFileSync(outputfile, 'utf8'); - - t.equal(md, result, 'rendered markdown is equal'); - t.end(); - }) - .catch(err => { - t.fail(err); - }); -}); - -test('multi-file input', function(t) { - documentation - .build( - [ - path.join(__dirname, 'fixture', 'simple.input.js'), - path.join(__dirname, 'fixture', 'simple-two.input.js') - ], - {} - ) - .then(result => { - normalize(result); - var outputfile = path.join( - __dirname, - 'fixture', - '_multi-file-input.json' - ); - if (UPDATE) { - fs.writeFileSync(outputfile, JSON.stringify(result, null, 2)); - } - var expect = require(outputfile); - t.deepEqual(result, expect); - t.end(); - }); -}); - -test('accepts simple relative paths', function(t) { - chdir(__dirname, function() { - documentation.build('test/fixture/simple.input.js', {}).then(data => { - t.equal(data.length, 1, 'simple has no dependencies'); - t.end(); - }); - }); -}); - -test('.lint', function(t) { - chdir(__dirname, function() { - documentation.lint('test/fixture/simple.input.js', {}).then(data => { - t.equal(data, '', 'outputs lint information'); - t.end(); - }); - }); -}); - -test('.lint with bad input', function(t) { - chdir(__dirname, function() { - documentation - .lint('test/fixture/bad/syntax.input', { - parseExtension: ['input'] - }) - .catch(err => { - t.ok(err, 'returns an error when syntax is incorrect'); - t.end(); - }); - }); -}); diff --git a/test/utils.js b/test/utils.js deleted file mode 100644 index ad1614cd0..000000000 --- a/test/utils.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; -var http = require('http'), concat = require('concat-stream'); - -function get(url, callback) { - http.get(url, function(res) { - res.pipe( - concat(function(text) { - if (res.statusCode >= 400) { - return callback(res.statusCode); - } - callback(text.toString()); - }) - ); - }); -} - -module.exports.get = get; diff --git a/yarn.lock b/yarn.lock index b70657610..4bf77782a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,10 +9,20 @@ JSONStream@^1.0.3, JSONStream@^1.0.4: jsonparse "^1.2.0" through ">=2.2.7 <3" +abab@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" + abbrev@1: version "1.1.0" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" +acorn-globals@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" + dependencies: + acorn "^4.0.4" + acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" @@ -23,7 +33,7 @@ acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" -acorn@^4.0.3: +acorn@^4.0.3, acorn@^4.0.4: version "4.0.11" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" @@ -54,7 +64,7 @@ amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" -ansi-escapes@^1.0.0, ansi-escapes@^1.1.0: +ansi-escapes@^1.0.0, ansi-escapes@^1.1.0, ansi-escapes@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" @@ -97,10 +107,6 @@ aproba@^1.0.3: version "1.1.1" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.1.tgz#95d3600f07710aa0e9298c726ad5ecf2eacbabab" -archy@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" - are-we-flow-yet@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/are-we-flow-yet/-/are-we-flow-yet-1.0.0.tgz#951dd9ea78cc9e4f00b47b4cd1d53d7ddf220908" @@ -130,6 +136,10 @@ arr-flatten@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -174,13 +184,9 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" -ast-types@0.8.18: - version "0.8.18" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.8.18.tgz#c8b98574898e8914e9d8de74b947564a9fe929af" - -ast-types@0.9.4: - version "0.9.4" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.4.tgz#410d1f81890aeb8e0a38621558ba5869ae53c91b" +ast-types@0.9.8: + version "0.9.8" + resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.8.tgz#6cb6a40beba31f49f20928e28439fc14a3dab078" async-each@^1.0.0: version "1.0.1" @@ -190,6 +196,12 @@ async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" +async@^2.1.4: + version "2.4.0" + resolved "https://registry.yarnpkg.com/async/-/async-2.4.0.tgz#4990200f18ea5b837c2cc4f8c031a6985c385611" + dependencies: + lodash "^4.14.0" + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -202,6 +214,27 @@ aws4@^1.2.1: version "1.6.0" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" +babel-cli@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.24.1.tgz#207cd705bba61489b2ea41b5312341cf6aca2283" + dependencies: + babel-core "^6.24.1" + babel-polyfill "^6.23.0" + babel-register "^6.24.1" + babel-runtime "^6.22.0" + commander "^2.8.1" + convert-source-map "^1.1.0" + fs-readdir-recursive "^1.0.0" + glob "^7.0.0" + lodash "^4.2.0" + output-file-sync "^1.1.0" + path-is-absolute "^1.0.0" + slash "^1.0.0" + source-map "^0.5.0" + v8flags "^2.0.10" + optionalDependencies: + chokidar "^1.6.1" + babel-code-frame@6.22.0, babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" @@ -210,7 +243,7 @@ babel-code-frame@6.22.0, babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" -babel-core@^6.0.14, babel-core@^6.17.0, babel-core@^6.24.1: +babel-core@^6.0.0, babel-core@^6.0.14, babel-core@^6.17.0, babel-core@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83" dependencies: @@ -382,6 +415,14 @@ babel-helpers@^6.24.1: babel-runtime "^6.22.0" babel-template "^6.24.1" +babel-jest@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-19.0.0.tgz#59323ced99a3a84d359da219ca881074ffc6ce3f" + dependencies: + babel-core "^6.0.0" + babel-plugin-istanbul "^4.0.0" + babel-preset-jest "^19.0.0" + babel-messages@^6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" @@ -394,6 +435,18 @@ babel-plugin-check-es2015-constants@^6.22.0: dependencies: babel-runtime "^6.22.0" +babel-plugin-istanbul@^4.0.0: + version "4.1.3" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.3.tgz#6ee6280410dcf59c7747518c3dfd98680958f102" + dependencies: + find-up "^2.1.0" + istanbul-lib-instrument "^1.7.1" + test-exclude "^4.1.0" + +babel-plugin-jest-hoist@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-19.0.0.tgz#4ae2a04ea612a6e73651f3fde52c178991304bea" + babel-plugin-syntax-async-functions@^6.8.0: version "6.13.0" resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" @@ -759,6 +812,14 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" +babel-polyfill@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" + dependencies: + babel-runtime "^6.22.0" + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + babel-preset-es2015@^6.16.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" @@ -794,6 +855,12 @@ babel-preset-flow@^6.23.0: dependencies: babel-plugin-transform-flow-strip-types "^6.22.0" +babel-preset-jest@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-19.0.0.tgz#22d67201d02324a195811288eb38294bb3cac396" + dependencies: + babel-plugin-jest-hoist "^19.0.0" + babel-preset-react@^6.16.0: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-preset-react/-/babel-preset-react-6.24.1.tgz#ba69dfaea45fc3ec639b6a4ecea6e17702c91380" @@ -899,9 +966,9 @@ babelify@^7.3.0: babel-core "^6.0.14" object-assign "^4.0.0" -babylon@6.15.0: - version "6.15.0" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.15.0.tgz#ba65cfa1a80e1759b0e89fb562e27dccae70348e" +babylon@7.0.0-beta.8: + version "7.0.0-beta.8" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.8.tgz#2bdc5ae366041442c27e068cce6f0d7c06ea9949" babylon@^6.11.0, babylon@^6.11.4, babylon@^6.13.0, babylon@^6.15.0, babylon@^6.17.0: version "6.17.0" @@ -925,20 +992,12 @@ binary-extensions@^1.0.0: version "1.8.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.8.0.tgz#48ec8d16df4377eae5fa5884682480af4d95c774" -bind-obj-methods@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/bind-obj-methods/-/bind-obj-methods-1.0.0.tgz#4f5979cac15793adf70e488161e463e209ca509c" - block-stream@*: version "0.0.9" resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" dependencies: inherits "~2.0.0" -bluebird@^3.3.1: - version "3.5.0" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" - body@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/body/-/body-5.1.0.tgz#e4ba0ce410a46936323367609ecb4e6553125069" @@ -969,12 +1028,24 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" -browser-resolve@^1.7.0: +browser-resolve@^1.11.2, browser-resolve@^1.7.0: version "1.11.2" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" dependencies: resolve "1.1.7" +bser@1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bser/-/bser-1.0.2.tgz#381116970b2a6deea5646dd15dd7278444b56169" + dependencies: + node-int64 "^0.4.0" + +bser@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.0.0.tgz#9ac78d3ed5d915804fd87acb158bc797147a1719" + dependencies: + node-int64 "^0.4.0" + buffer-shims@^1.0.0, buffer-shims@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-shims/-/buffer-shims-1.0.0.tgz#9978ce317388c649ad8793028c3477ef044a8b51" @@ -987,14 +1058,6 @@ bytes@1: version "1.0.0" resolved "https://registry.yarnpkg.com/bytes/-/bytes-1.0.0.tgz#3569ede8ba34315fab99c3e92cb04c7220de1fa8" -caching-transform@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" - dependencies: - md5-hex "^1.2.0" - mkdirp "^0.5.1" - write-file-atomic "^1.1.4" - caller-path@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/caller-path/-/caller-path-0.1.0.tgz#94085ef63581ecd3daa92444a8fe94e82577751f" @@ -1005,6 +1068,10 @@ callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" +callsites@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50" + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -1073,7 +1140,7 @@ chdir@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/chdir/-/chdir-0.0.0.tgz#c29bdb85f391834c83ddbf090f18a11b0ed96bee" -chokidar@^1.2.0: +chokidar@^1.2.0, chokidar@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.6.1.tgz#2f4447ab5e96e50fb3d789fd90d4c72e0e4c70c2" dependencies: @@ -1096,10 +1163,6 @@ circular-json@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.1.tgz#be8b36aefccde8b3ca7aa2d6afc07a37242c0d2d" -clean-yaml-object@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz#63fb110dc2ce1a84dc21f6d9334876d010ae8b68" - cli-cursor@^1.0.1, cli-cursor@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" @@ -1183,14 +1246,6 @@ color-name@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" -color-support@^1.1.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.2.tgz#49cc99b89d1bdef1292e9d9323c66971a33eb89d" - -colors@>=0.6.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" - combined-stream@^1.0.5, combined-stream@~1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009" @@ -1203,16 +1258,12 @@ comma-separated-tokens@^1.0.1: dependencies: trim "0.0.1" -commander@^2.9.0: +commander@^2.8.1, commander@^2.9.0: version "2.9.0" resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" dependencies: graceful-readlink ">= 1.0.0" -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - compare-func@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.2.tgz#99dd0ba457e1f9bc722b12c08ec33eeab31fa648" @@ -1244,6 +1295,10 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" +content-type-parser@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94" + continuable-cache@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/continuable-cache/-/continuable-cache-0.3.1.tgz#bd727a7faed77e71ff3985ac93351a912733ad0f" @@ -1388,7 +1443,7 @@ conventional-recommended-bump@^0.3.0: meow "^3.3.0" object-assign "^4.0.1" -convert-source-map@^1.1.0, convert-source-map@^1.1.1, convert-source-map@^1.3.0: +convert-source-map@^1.1.0, convert-source-map@^1.1.1: version "1.5.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" @@ -1413,9 +1468,9 @@ cosmiconfig@^1.1.0: pinkie-promise "^2.0.0" require-from-string "^1.1.0" -coveralls@^2.11.2: - version "2.13.0" - resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-2.13.0.tgz#df933876e8c6f478efb04f4d3ab70dc96b7e5a8e" +coveralls@^2.13.1: + version "2.13.1" + resolved "https://registry.yarnpkg.com/coveralls/-/coveralls-2.13.1.tgz#d70bb9acc1835ec4f063ff9dac5423c17b11f178" dependencies: js-yaml "3.6.1" lcov-parse "0.0.10" @@ -1423,13 +1478,6 @@ coveralls@^2.11.2: minimist "1.2.0" request "2.79.0" -cross-spawn@^4: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" - dependencies: - lru-cache "^4.0.1" - which "^1.2.9" - cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -1444,6 +1492,16 @@ cryptiles@2.x.x: dependencies: boom "2.x.x" +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.2" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.2.tgz#b8036170c79f07a90ff2f16e22284027a243848b" + +"cssstyle@>= 0.2.37 < 0.3.0": + version "0.2.37" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-0.2.37.tgz#541097234cb2513c83ceed3acddc27ff27987d54" + dependencies: + cssom "0.3.x" + currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -1490,11 +1548,7 @@ dateformat@^1.0.11, dateformat@^1.0.12: get-stdin "^4.0.1" meow "^3.3.0" -debug-log@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" - -debug@^2.1.1, debug@^2.1.3, debug@^2.2.0: +debug@^2.1.1, debug@^2.2.0, debug@^2.6.3: version "2.6.4" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.4.tgz#7586a9b3c39741c0282ae33445c4e8ac74734fe0" dependencies: @@ -1518,10 +1572,6 @@ deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" -deeper@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/deeper/-/deeper-2.1.0.tgz#bc564e5f73174fdf201e08b00030e8a14da74368" - default-require-extensions@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" @@ -1575,6 +1625,10 @@ diff@^1.3.2: version "1.4.0" resolved "https://registry.yarnpkg.com/diff/-/diff-1.4.0.tgz#7f28d2eb9ee7b15a97efd89ce63dcfdaa3ccbabf" +diff@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" + disparity@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/disparity/-/disparity-2.0.0.tgz#57ddacb47324ae5f58d2cc0da886db4ce9eeb718" @@ -1641,6 +1695,12 @@ end-of-stream@1.0.0: dependencies: once "~1.3.0" +"errno@>=0.1.1 <0.2.0-0": + version "0.1.4" + resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.4.tgz#b896e23a9e5e8ba33871fc996abd3635fc9a1c7d" + dependencies: + prr "~0.0.0" + error-ex@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" @@ -1706,10 +1766,21 @@ es6-weak-map@^2.0.1: es6-iterator "^2.0.1" es6-symbol "^3.1.1" -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +escodegen@^1.6.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.8.1.tgz#5a5b53af4693110bebb0867aa3430dd3b70a1018" + dependencies: + esprima "^2.7.1" + estraverse "^1.9.1" + esutils "^2.0.2" + optionator "^0.8.1" + optionalDependencies: + source-map "~0.2.0" + escope@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/escope/-/escope-3.6.0.tgz#e01975e812781a163a6dadfdd80398dc64c889c3" @@ -1719,6 +1790,12 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" +eslint-config-prettier@^1.7.0: + version "1.7.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-1.7.0.tgz#cda3ce22df1e852daa9370f1f3446e8b8a02ce44" + dependencies: + get-stdin "^5.0.1" + eslint-plugin-flowtype@^2.32.1: version "2.32.1" resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.32.1.tgz#bbee185dedf97e5f63ec975cdcddd199bd2a2501" @@ -1772,7 +1849,7 @@ espree@^3.4.0: acorn "^5.0.1" acorn-jsx "^3.0.0" -esprima@^2.6.0: +esprima@^2.6.0, esprima@^2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" @@ -1793,6 +1870,10 @@ esrecurse@^4.1.0: estraverse "~4.1.0" object-assign "^4.0.1" +estraverse@^1.9.1: + version "1.9.3" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-1.9.3.tgz#af67f2dc922582415950926091a4005d29c9bb44" + estraverse@^4.0.0, estraverse@^4.1.1, estraverse@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.2.0.tgz#0dee3fed31fcd469618ce7342099fc1afa0bdb13" @@ -1812,9 +1893,11 @@ event-emitter@~0.3.5: d "1" es5-ext "~0.10.14" -events-to-array@^1.0.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/events-to-array/-/events-to-array-1.1.2.tgz#2d41f563e1fe400ed4962fe1a4d5c6a7539df7f6" +exec-sh@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/exec-sh/-/exec-sh-0.2.0.tgz#14f75de3f20d286ef933099b2ce50a90359cef10" + dependencies: + merge "^1.1.3" execa@^0.6.0: version "0.6.3" @@ -1874,6 +1957,18 @@ faye-websocket@~0.10.0: dependencies: websocket-driver ">=0.5.1" +fb-watchman@^1.8.0: + version "1.9.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-1.9.2.tgz#a24cf47827f82d38fb59a69ad70b76e3b6ae7383" + dependencies: + bser "1.0.2" + +fb-watchman@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.0.tgz#54e9abf7dfa2f26cd9b1636c588c1afc05de5d58" + dependencies: + bser "^2.0.0" + figures@^1.3.5, figures@^1.5.0, figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" @@ -1892,6 +1987,13 @@ filename-regex@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.0.tgz#996e3e80479b98b9897f15a8a58b3d084e926775" +fileset@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/fileset/-/fileset-2.0.3.tgz#8e7548a96d3cc2327ee5e674168723a333bba2a0" + dependencies: + glob "^7.0.3" + minimatch "^3.0.3" + fill-range@^2.1.0: version "2.2.3" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" @@ -1902,26 +2004,18 @@ fill-range@^2.1.0: repeat-element "^1.1.2" repeat-string "^1.5.2" -find-cache-dir@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" - dependencies: - commondir "^1.0.1" - mkdirp "^0.5.1" - pkg-dir "^1.0.0" - find-parent-dir@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" -find-up@^1.0.0, find-up@^1.1.2: +find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" dependencies: path-exists "^2.0.0" pinkie-promise "^2.0.0" -find-up@^2.0.0: +find-up@^2.0.0, find-up@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" dependencies: @@ -1940,17 +2034,13 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.44.0: - version "0.44.2" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.44.2.tgz#3893c7db5de043ed82674f327a04b1309db208b5" +flow-bin@^0.45.0: + version "0.45.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.45.0.tgz#009dd0f577a3f665c74ca8be827ae8c2dd8fd6b5" -flow-parser@0.40.0: - version "0.40.0" - resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.40.0.tgz#b3444742189093323c4319c4fe9d35391f46bcbc" - dependencies: - ast-types "0.8.18" - colors ">=0.6.2" - minimist ">=0.2.0" +flow-parser@0.43.0: + version "0.43.0" + resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.43.0.tgz#e2b8eb1ac83dd53f7b6b04a7c35b6a52c33479b7" for-in@^1.0.1: version "1.0.2" @@ -1962,13 +2052,6 @@ for-own@^0.1.4: dependencies: for-in "^1.0.1" -foreground-child@^1.3.3, foreground-child@^1.5.3: - version "1.5.6" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" - dependencies: - cross-spawn "^4" - signal-exit "^3.0.0" - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -1987,10 +2070,6 @@ fs-access@^1.0.0: dependencies: null-check "^1.0.0" -fs-exists-cached@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs-exists-cached/-/fs-exists-cached-1.0.0.tgz#cf25554ca050dc49ae6656b41de42258989dcbce" - fs-extra@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.0.tgz#244e0c4b0b8818f54040ec049d8a2bddc1202861" @@ -1999,6 +2078,10 @@ fs-extra@^3.0.0: jsonfile "^3.0.0" universalify "^0.1.0" +fs-readdir-recursive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.0.0.tgz#8cd1745c8b4f8a29c8caec392476921ba195f560" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2031,10 +2114,6 @@ function-bind@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" -function-loop@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/function-loop/-/function-loop-1.0.1.tgz#8076bb305e8e6a3cceee2920765f330d190f340c" - gauge@~2.7.1: version "2.7.3" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.3.tgz#1c23855f962f17b3ad3d0dc7443f304542edfe09" @@ -2076,7 +2155,11 @@ get-pkg-repo@^1.0.0: parse-github-repo-url "^1.3.0" through2 "^2.0.0" -get-stdin@5.0.1: +get-port@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.1.0.tgz#ef01b18a84ca6486970ff99e54446141a73ffd3e" + +get-stdin@5.0.1, get-stdin@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" @@ -2187,7 +2270,7 @@ glob-stream@^5.3.2: to-absolute-glob "^0.1.1" unique-stream "^2.0.2" -glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6: +glob@7.1.1, glob@^7.0.0, glob@^7.0.3, glob@^7.0.5: version "7.1.1" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" dependencies: @@ -2237,7 +2320,7 @@ globby@^5.0.0: pify "^2.0.0" pinkie-promise "^2.0.0" -graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: +graceful-fs@^4.0.0, graceful-fs@^4.1.2, graceful-fs@^4.1.4, graceful-fs@^4.1.6: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" @@ -2245,6 +2328,10 @@ graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, graceful-fs@^4.1.6: version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" +growly@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" + gulp-sourcemaps@1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz#b86ff349d801ceb56e1d9e7dc7bbcb4b7dee600c" @@ -2365,6 +2452,12 @@ hosted-git-info@^2.1.4: version "2.4.2" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" +html-encoding-sniffer@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.1.tgz#79bf7a785ea495fe66165e734153f363ff5437da" + dependencies: + whatwg-encoding "^1.0.1" + html-void-elements@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-1.0.1.tgz#f929bea267a19e3535950502ca12c159f1b559af" @@ -2386,6 +2479,10 @@ husky@^0.13.3: is-ci "^1.0.9" normalize-path "^1.0.0" +iconv-lite@0.4.13: + version "0.4.13" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" + ignore@^3.2.0: version "3.2.7" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.2.7.tgz#4810ca5f1d8eca5595213a34b94f2eb4ed926bbd" @@ -2690,10 +2787,6 @@ isarray@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.1.tgz#a37d94ed9cda2d59865c9f76fe596ee1f338741e" -isexe@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-1.1.2.tgz#36f3e22e60750920f5e7241a476a8c6a42275ad0" - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -2708,52 +2801,166 @@ isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" -istanbul-lib-coverage@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.0.2.tgz#87a0c015b6910651cb3b184814dfb339337e25e1" +istanbul-api@^1.1.0-alpha.1: + version "1.1.8" + resolved "https://registry.yarnpkg.com/istanbul-api/-/istanbul-api-1.1.8.tgz#a844e55c6f9aeee292e7f42942196f60b23dc93e" + dependencies: + async "^2.1.4" + fileset "^2.0.2" + istanbul-lib-coverage "^1.1.0" + istanbul-lib-hook "^1.0.6" + istanbul-lib-instrument "^1.7.1" + istanbul-lib-report "^1.1.0" + istanbul-lib-source-maps "^1.2.0" + istanbul-reports "^1.1.0" + js-yaml "^3.7.0" + mkdirp "^0.5.1" + once "^1.4.0" -istanbul-lib-hook@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.5.tgz#6ca3d16d60c5f4082da39f7c5cd38ea8a772b88e" +istanbul-lib-coverage@^1.0.0, istanbul-lib-coverage@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.0.tgz#caca19decaef3525b5d6331d701f3f3b7ad48528" + +istanbul-lib-hook@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.6.tgz#c0866d1e81cf2d5319249510131fc16dee49231f" dependencies: append-transform "^0.4.0" -istanbul-lib-instrument@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.0.tgz#b8e0dc25709bb44e17336ab47b7bb5c97c23f659" +istanbul-lib-instrument@^1.1.1, istanbul-lib-instrument@^1.7.1: + version "1.7.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.1.tgz#169e31bc62c778851a99439dd99c3cc12184d360" dependencies: babel-generator "^6.18.0" babel-template "^6.16.0" babel-traverse "^6.18.0" babel-types "^6.18.0" babylon "^6.13.0" - istanbul-lib-coverage "^1.0.2" + istanbul-lib-coverage "^1.1.0" semver "^5.3.0" -istanbul-lib-report@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.0.0.tgz#d83dac7f26566b521585569367fe84ccfc7aaecb" +istanbul-lib-report@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.0.tgz#444c4ecca9afa93cf584f56b10f195bf768c0770" dependencies: - istanbul-lib-coverage "^1.0.2" + istanbul-lib-coverage "^1.1.0" mkdirp "^0.5.1" path-parse "^1.0.5" supports-color "^3.1.2" -istanbul-lib-source-maps@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.1.1.tgz#f8c8c2e8f2160d1d91526d97e5bd63b2079af71c" +istanbul-lib-source-maps@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.0.tgz#8c7706d497e26feeb6af3e0c28fd5b0669598d0e" dependencies: - istanbul-lib-coverage "^1.0.2" + debug "^2.6.3" + istanbul-lib-coverage "^1.1.0" mkdirp "^0.5.1" - rimraf "^2.4.4" + rimraf "^2.6.1" source-map "^0.5.3" -istanbul-reports@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.0.2.tgz#4e8366abe6fa746cc1cd6633f108de12cc6ac6fa" +istanbul-reports@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.0.tgz#1ef3b795889219cfb5fad16365f6ce108d5f8c66" dependencies: handlebars "^4.0.3" +jest-changed-files@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-19.0.2.tgz#16c54c84c3270be408e06d2e8af3f3e37a885824" + +jest-cli@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-19.0.2.tgz#cc3620b62acac5f2d93a548cb6ef697d4ec85443" + dependencies: + ansi-escapes "^1.4.0" + callsites "^2.0.0" + chalk "^1.1.1" + graceful-fs "^4.1.6" + is-ci "^1.0.9" + istanbul-api "^1.1.0-alpha.1" + istanbul-lib-coverage "^1.0.0" + istanbul-lib-instrument "^1.1.1" + jest-changed-files "^19.0.2" + jest-config "^19.0.2" + jest-environment-jsdom "^19.0.2" + jest-haste-map "^19.0.0" + jest-jasmine2 "^19.0.2" + jest-message-util "^19.0.0" + jest-regex-util "^19.0.0" + jest-resolve-dependencies "^19.0.0" + jest-runtime "^19.0.2" + jest-snapshot "^19.0.2" + jest-util "^19.0.2" + micromatch "^2.3.11" + node-notifier "^5.0.1" + slash "^1.0.0" + string-length "^1.0.1" + throat "^3.0.0" + which "^1.1.1" + worker-farm "^1.3.1" + yargs "^6.3.0" + +jest-config@^19.0.2: + version "19.0.4" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-19.0.4.tgz#42980211d46417e91ca7abffd086c270234f73fd" + dependencies: + chalk "^1.1.1" + jest-environment-jsdom "^19.0.2" + jest-environment-node "^19.0.2" + jest-jasmine2 "^19.0.2" + jest-regex-util "^19.0.0" + jest-resolve "^19.0.2" + jest-validate "^19.0.2" + pretty-format "^19.0.0" + +jest-diff@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-19.0.0.tgz#d1563cfc56c8b60232988fbc05d4d16ed90f063c" + dependencies: + chalk "^1.1.3" + diff "^3.0.0" + jest-matcher-utils "^19.0.0" + pretty-format "^19.0.0" + +jest-environment-jsdom@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-19.0.2.tgz#ceda859c4a4b94ab35e4de7dab54b926f293e4a3" + dependencies: + jest-mock "^19.0.0" + jest-util "^19.0.2" + jsdom "^9.11.0" + +jest-environment-node@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-19.0.2.tgz#6e84079db87ed21d0c05e1f9669f207b116fe99b" + dependencies: + jest-mock "^19.0.0" + jest-util "^19.0.2" + +jest-file-exists@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-file-exists/-/jest-file-exists-19.0.0.tgz#cca2e587a11ec92e24cfeab3f8a94d657f3fceb8" + +jest-haste-map@^19.0.0: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-19.0.2.tgz#286484c3a16e86da7872b0877c35dce30c3d6f07" + dependencies: + fb-watchman "^2.0.0" + graceful-fs "^4.1.6" + micromatch "^2.3.11" + sane "~1.5.0" + worker-farm "^1.3.1" + +jest-jasmine2@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-jasmine2/-/jest-jasmine2-19.0.2.tgz#167991ac825981fb1a800af126e83afcca832c73" + dependencies: + graceful-fs "^4.1.6" + jest-matcher-utils "^19.0.0" + jest-matchers "^19.0.0" + jest-message-util "^19.0.0" + jest-snapshot "^19.0.2" + jest-matcher-utils@^19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-19.0.0.tgz#5ecd9b63565d2b001f61fbf7ec4c7f537964564d" @@ -2761,6 +2968,89 @@ jest-matcher-utils@^19.0.0: chalk "^1.1.3" pretty-format "^19.0.0" +jest-matchers@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-matchers/-/jest-matchers-19.0.0.tgz#c74ecc6ebfec06f384767ba4d6fa4a42d6755754" + dependencies: + jest-diff "^19.0.0" + jest-matcher-utils "^19.0.0" + jest-message-util "^19.0.0" + jest-regex-util "^19.0.0" + +jest-message-util@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-19.0.0.tgz#721796b89c0e4d761606f9ba8cb828a3b6246416" + dependencies: + chalk "^1.1.1" + micromatch "^2.3.11" + +jest-mock@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-19.0.0.tgz#67038641e9607ab2ce08ec4a8cb83aabbc899d01" + +jest-regex-util@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-19.0.0.tgz#b7754587112aede1456510bb1f6afe74ef598691" + +jest-resolve-dependencies@^19.0.0: + version "19.0.0" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-19.0.0.tgz#a741ad1fa094140e64ecf2642a504f834ece22ee" + dependencies: + jest-file-exists "^19.0.0" + +jest-resolve@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-19.0.2.tgz#5793575de4f07aec32f7d7ff0c6c181963eefb3c" + dependencies: + browser-resolve "^1.11.2" + jest-haste-map "^19.0.0" + resolve "^1.2.0" + +jest-runtime@^19.0.2: + version "19.0.3" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-19.0.3.tgz#a163354ace46910ee33f0282b6bff6b0b87d4330" + dependencies: + babel-core "^6.0.0" + babel-jest "^19.0.0" + babel-plugin-istanbul "^4.0.0" + chalk "^1.1.3" + graceful-fs "^4.1.6" + jest-config "^19.0.2" + jest-file-exists "^19.0.0" + jest-haste-map "^19.0.0" + jest-regex-util "^19.0.0" + jest-resolve "^19.0.2" + jest-util "^19.0.2" + json-stable-stringify "^1.0.1" + micromatch "^2.3.11" + strip-bom "3.0.0" + yargs "^6.3.0" + +jest-snapshot@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-19.0.2.tgz#9c1b216214f7187c38bfd5c70b1efab16b0ff50b" + dependencies: + chalk "^1.1.3" + jest-diff "^19.0.0" + jest-file-exists "^19.0.0" + jest-matcher-utils "^19.0.0" + jest-util "^19.0.2" + natural-compare "^1.4.0" + pretty-format "^19.0.0" + +jest-util@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-19.0.2.tgz#e0a0232a2ab9e6b2b53668bdb3534c2b5977ed41" + dependencies: + chalk "^1.1.1" + graceful-fs "^4.1.6" + jest-file-exists "^19.0.0" + jest-message-util "^19.0.0" + jest-mock "^19.0.0" + jest-validate "^19.0.2" + leven "^2.0.0" + mkdirp "^0.5.1" + jest-validate@19.0.0: version "19.0.0" resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.0.tgz#8c6318a20ecfeaba0ba5378bfbb8277abded4173" @@ -2770,6 +3060,21 @@ jest-validate@19.0.0: leven "^2.0.0" pretty-format "^19.0.0" +jest-validate@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-19.0.2.tgz#dc534df5f1278d5b63df32b14241d4dbf7244c0c" + dependencies: + chalk "^1.1.1" + jest-matcher-utils "^19.0.0" + leven "^2.0.0" + pretty-format "^19.0.0" + +jest@^19.0.2: + version "19.0.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-19.0.2.tgz#b794faaf8ff461e7388f28beef559a54f20b2c10" + dependencies: + jest-cli "^19.0.2" + jodid25519@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/jodid25519/-/jodid25519-1.0.2.tgz#06d4912255093419477d425633606e0e90782967" @@ -2787,7 +3092,7 @@ js-yaml@3.6.1: argparse "^1.0.7" esprima "^2.6.0" -js-yaml@^3.2.7, js-yaml@^3.3.1, js-yaml@^3.4.3, js-yaml@^3.5.1: +js-yaml@^3.3.1, js-yaml@^3.4.3, js-yaml@^3.5.1, js-yaml@^3.7.0: version "3.8.3" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.3.tgz#33a05ec481c850c8875929166fe1beb61c728766" dependencies: @@ -2798,6 +3103,30 @@ jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" +jsdom@^9.11.0: + version "9.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-9.12.0.tgz#e8c546fffcb06c00d4833ca84410fed7f8a097d4" + dependencies: + abab "^1.0.3" + acorn "^4.0.4" + acorn-globals "^3.1.0" + array-equal "^1.0.0" + content-type-parser "^1.0.1" + cssom ">= 0.3.2 < 0.4.0" + cssstyle ">= 0.2.37 < 0.3.0" + escodegen "^1.6.1" + html-encoding-sniffer "^1.0.1" + nwmatcher ">= 1.3.9 < 2.0.0" + parse5 "^1.5.1" + request "^2.79.0" + sax "^1.2.1" + symbol-tree "^3.2.1" + tough-cookie "^2.3.2" + webidl-conversions "^4.0.0" + whatwg-encoding "^1.0.1" + whatwg-url "^4.3.0" + xml-name-validator "^2.0.1" + jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -3005,7 +3334,7 @@ lodash.templatesettings@^4.0.0: dependencies: lodash._reinterpolate "~3.0.0" -lodash@^4.0.0, lodash@^4.11.1, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.11.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" @@ -3054,6 +3383,12 @@ lru-cache@^4.0.1: pseudomap "^1.0.1" yallist "^2.0.0" +makeerror@1.0.x: + version "1.0.11" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c" + dependencies: + tmpl "1.0.x" + map-cache@^0.2.0: version "0.2.2" resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" @@ -3070,16 +3405,6 @@ markdown-table@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.0.tgz#1f5ae61659ced8808d882554c32e8b3f38dd1143" -md5-hex@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" - dependencies: - md5-o-matic "^0.1.1" - -md5-o-matic@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" - mdast-util-compact@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.0.tgz#4c94dedfe35932d5457f29b650b330fdc73e994a" @@ -3144,18 +3469,16 @@ meow@^3.3.0: redent "^1.0.0" trim-newlines "^1.0.0" -merge-source-map@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.0.3.tgz#da1415f2722a5119db07b14c4f973410863a2abf" - dependencies: - source-map "^0.5.3" - merge-stream@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1" dependencies: readable-stream "^2.0.1" +merge@^1.1.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/merge/-/merge-1.2.0.tgz#7531e39d4949c281a66b8c5a6e0265e8b05894da" + micromatch@^2.1.5, micromatch@^2.1.6, micromatch@^2.3.11, micromatch@^2.3.7: version "2.3.11" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" @@ -3188,7 +3511,7 @@ mime@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/mime/-/mime-1.3.4.tgz#115f9e3b6b3daf2959983cb38f149a2d40eb5d53" -"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2: +"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.3.tgz#2a4e4090b96b2db06a9d7df01055a62a77c9b774" dependencies: @@ -3198,7 +3521,7 @@ minimist@0.0.8, minimist@~0.0.1: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" -minimist@1.2.0, minimist@>=0.2.0, minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0: +minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" @@ -3255,6 +3578,19 @@ natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + +node-notifier@^5.0.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-5.1.2.tgz#2fa9e12605fa10009d44549d6fcd8a63dde0e4ff" + dependencies: + growly "^1.3.0" + semver "^5.3.0" + shellwords "^0.1.0" + which "^1.2.12" + node-pre-gyp@^0.6.29: version "0.6.34" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.34.tgz#94ad1c798a11d7fc67381b50d47f8cc18d9799f7" @@ -3336,37 +3672,9 @@ number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" -nyc@^10.0.0: - version "10.2.2" - resolved "https://registry.yarnpkg.com/nyc/-/nyc-10.2.2.tgz#1b1c8ca4636d810cb3e281558dc9fcb08389f204" - dependencies: - archy "^1.0.0" - arrify "^1.0.1" - caching-transform "^1.0.0" - convert-source-map "^1.3.0" - debug-log "^1.0.1" - default-require-extensions "^1.0.0" - find-cache-dir "^0.1.1" - find-up "^1.1.2" - foreground-child "^1.5.3" - glob "^7.0.6" - istanbul-lib-coverage "^1.0.2" - istanbul-lib-hook "^1.0.5" - istanbul-lib-instrument "^1.7.0" - istanbul-lib-report "^1.0.0" - istanbul-lib-source-maps "^1.1.1" - istanbul-reports "^1.0.2" - md5-hex "^1.2.0" - merge-source-map "^1.0.2" - micromatch "^2.3.11" - mkdirp "^0.5.0" - resolve-from "^2.0.0" - rimraf "^2.5.4" - signal-exit "^3.0.1" - spawn-wrap "1.2.4" - test-exclude "^4.0.0" - yargs "^7.0.2" - yargs-parser "^4.0.2" +"nwmatcher@>= 1.3.9 < 2.0.0": + version "1.3.9" + resolved "https://registry.yarnpkg.com/nwmatcher/-/nwmatcher-1.3.9.tgz#8bab486ff7fa3dfd086656bbe8b17116d3692d2a" oauth-sign@~0.8.1: version "0.8.2" @@ -3383,7 +3691,7 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" -once@^1.3.0, once@^1.3.3: +once@^1.3.0, once@^1.3.3, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -3399,14 +3707,6 @@ onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" -only-shallow@^1.0.2: - version "1.2.0" - resolved "https://registry.yarnpkg.com/only-shallow/-/only-shallow-1.2.0.tgz#71cecedba9324bc0518aef10ec080d3249dc2465" - -opener@^1.4.1: - version "1.4.3" - resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8" - optimist@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" @@ -3414,7 +3714,7 @@ optimist@^0.6.1: minimist "~0.0.1" wordwrap "~0.0.2" -optionator@^0.8.2: +optionator@^0.8.1, optionator@^0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" dependencies: @@ -3441,7 +3741,7 @@ ordered-read-streams@^0.3.0: is-stream "^1.0.1" readable-stream "^2.0.1" -os-homedir@1.0.1, os-homedir@^1.0.0, os-homedir@^1.0.1: +os-homedir@^1.0.0, os-homedir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.1.tgz#0d62bdf44b916fd3bbdcf2cab191948fb094f007" @@ -3462,13 +3762,17 @@ osenv@^0.1.4: os-homedir "^1.0.0" os-tmpdir "^1.0.0" -own-or-env@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/own-or-env/-/own-or-env-1.0.0.tgz#9ef920fc81e2e63cf59d41101258368cf4fca4fb" +output-file-sync@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" + dependencies: + graceful-fs "^4.1.4" + mkdirp "^0.5.1" + object-assign "^4.1.0" -own-or@^1.0.0: +p-event@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/own-or/-/own-or-1.0.0.tgz#4e877fbeda9a2ec8000fbc0bcae39645ee8bf8dc" + resolved "https://registry.yarnpkg.com/p-event/-/p-event-1.0.0.tgz#f3e5ea67c501cc34c12cc68715c214948142c46f" p-finally@^1.0.0: version "1.0.0" @@ -3548,6 +3852,10 @@ parse-url@^1.3.0: is-ssh "^1.3.0" protocols "^1.4.0" +parse5@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-1.5.1.tgz#9b7f3b0de32be78dc2401b17573ccaf0f6f59d94" + path-dirname@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0" @@ -3624,12 +3932,6 @@ pinkie@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - dependencies: - find-up "^1.0.0" - plur@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/plur/-/plur-2.1.2.tgz#7482452c1a0f508e3e344eaec312c91c29dc655a" @@ -3648,16 +3950,16 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" -prettier@^0.22.0: - version "0.22.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-0.22.0.tgz#7b37c4480d0858180407e5a8e13f0f47da7385d2" +prettier@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.2.2.tgz#22d17c1132faaaea1f1d4faea31f19f7a1959f3e" dependencies: - ast-types "0.9.4" + ast-types "0.9.8" babel-code-frame "6.22.0" - babylon "6.15.0" + babylon "7.0.0-beta.8" chalk "1.1.3" esutils "2.0.2" - flow-parser "0.40.0" + flow-parser "0.43.0" get-stdin "5.0.1" glob "7.1.1" jest-validate "19.0.0" @@ -3689,11 +3991,15 @@ protocols@^1.1.0, protocols@^1.4.0: version "1.4.5" resolved "https://registry.yarnpkg.com/protocols/-/protocols-1.4.5.tgz#21de1f441c4ef7094408ed9f1c94f7a114b87557" +prr@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" + pseudomap@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" -punycode@^1.3.2, punycode@^1.4.1: +punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -3771,7 +4077,7 @@ read-pkg@^2.0.0: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^2, readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: +readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.4, readable-stream@^2.0.5, readable-stream@^2.0.6, readable-stream@^2.1.4, readable-stream@^2.1.5, readable-stream@^2.2.2: version "2.2.9" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" dependencies: @@ -4006,7 +4312,7 @@ request@2.79.0: tunnel-agent "~0.4.1" uuid "^3.0.0" -request@^2.81.0: +request@^2.79.0, request@^2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: @@ -4056,15 +4362,11 @@ resolve-from@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-1.0.1.tgz#26cbfe935d1aeeeabb29bc3fe5aeb01e93d44226" -resolve-from@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" - resolve@1.1.7: version "1.1.7" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" -resolve@^1.1.3, resolve@^1.1.6: +resolve@^1.1.3, resolve@^1.1.6, resolve@^1.2.0: version "1.3.3" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" dependencies: @@ -4087,7 +4389,7 @@ right-pad@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/right-pad/-/right-pad-1.0.1.tgz#8ca08c2cbb5b55e74dafa96bf7fd1a27d568c8d0" -rimraf@2, rimraf@^2.2.8, rimraf@^2.3.3, rimraf@^2.4.4, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: +rimraf@2, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: @@ -4117,6 +4419,22 @@ safe-json-parse@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-json-parse/-/safe-json-parse-1.0.1.tgz#3e76723e38dfdda13c9b1d29a1e07ffee4b30b57" +sane@~1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/sane/-/sane-1.5.0.tgz#a4adeae764d048621ecb27d5f9ecf513101939f3" + dependencies: + anymatch "^1.3.0" + exec-sh "^0.2.0" + fb-watchman "^1.8.0" + minimatch "^3.0.2" + minimist "^1.1.1" + walker "~1.0.5" + watch "~0.10.0" + +sax@^1.2.1: + version "1.2.2" + resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.2.tgz#fd8631a23bc7826bef5d871bdb87378c95647828" + "semver@2 || 3 || 4 || 5", semver@^5.0.1, semver@^5.1.0, semver@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" @@ -4147,11 +4465,11 @@ shelljs@^0.7.5: interpret "^1.0.0" rechoir "^0.6.2" -signal-exit@^2.0.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-2.1.2.tgz#375879b1f92ebc3b334480d038dc546a6d558564" +shellwords@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.0.tgz#66afd47b6a12932d9071cbfd98a52e785cd0ba14" -signal-exit@^3.0.0, signal-exit@^3.0.1: +signal-exit@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -4163,17 +4481,13 @@ slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" -slide@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" - sntp@1.x.x: version "1.0.9" resolved "https://registry.yarnpkg.com/sntp/-/sntp-1.0.9.tgz#6541184cc90aeea6c6e7b35e2659082443c66198" dependencies: hoek "2.x.x" -source-map-support@^0.4.2, source-map-support@^0.4.3: +source-map-support@^0.4.2: version "0.4.14" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.14.tgz#9d4463772598b86271b4f523f6c1f4e02a7d6aef" dependencies: @@ -4189,23 +4503,18 @@ source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: version "0.5.6" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" +source-map@~0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.2.0.tgz#dab73fbcfc2ba819b4de03bd6f6eaa48164b3f9d" + dependencies: + amdefine ">=0.0.4" + space-separated-tokens@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.0.tgz#9e8c60407aa527742cd9eaee2541dec639f1269b" dependencies: trim "0.0.1" -spawn-wrap@1.2.4: - version "1.2.4" - resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.2.4.tgz#920eb211a769c093eebfbd5b0e7a5d2e68ab2e40" - dependencies: - foreground-child "^1.3.3" - mkdirp "^0.5.0" - os-homedir "^1.0.1" - rimraf "^2.3.3" - signal-exit "^2.0.0" - which "^1.2.4" - spdx-correct@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" @@ -4251,10 +4560,6 @@ sshpk@^1.7.0: jsbn "~0.1.0" tweetnacl "~0.14.0" -stack-utils@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-1.0.0.tgz#2392cd8ddbd222492ed6c047960f7414b46c0f83" - staged-git-files@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/staged-git-files/-/staged-git-files-0.0.4.tgz#d797e1b551ca7a639dec0237dc6eb4bb9be17d35" @@ -4297,6 +4602,12 @@ stream-to-observable@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/stream-to-observable/-/stream-to-observable-0.1.0.tgz#45bf1d9f2d7dc09bed81f1c307c430e68b84cffe" +string-length@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/string-length/-/string-length-1.0.1.tgz#56970fb1c38558e9e70b728bf3de269ac45adfac" + dependencies: + strip-ansi "^3.0.0" + string-template@~0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add" @@ -4353,16 +4664,16 @@ strip-bom-stream@^1.0.0: first-chunk-stream "^1.0.0" strip-bom "^2.0.0" +strip-bom@3.0.0, strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" dependencies: is-utf8 "^0.2.0" -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - strip-eof@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" @@ -4397,6 +4708,10 @@ symbol-observable@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d" +symbol-tree@^3.2.1: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + table@^3.7.8: version "3.8.3" resolved "https://registry.yarnpkg.com/table/-/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" @@ -4408,62 +4723,6 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" -tap-mocha-reporter@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/tap-mocha-reporter/-/tap-mocha-reporter-3.0.3.tgz#e5917fad3d9a70957f9b7c736e793beb87d7daf1" - dependencies: - color-support "^1.1.0" - debug "^2.1.3" - diff "^1.3.2" - escape-string-regexp "^1.0.3" - glob "^7.0.5" - js-yaml "^3.3.1" - tap-parser "^5.1.0" - unicode-length "^1.0.0" - optionalDependencies: - readable-stream "^2.1.5" - -tap-parser@^5.1.0, tap-parser@^5.3.1: - version "5.3.3" - resolved "https://registry.yarnpkg.com/tap-parser/-/tap-parser-5.3.3.tgz#53ec8a90f275d6fff43f169e56a679502a741185" - dependencies: - events-to-array "^1.0.1" - js-yaml "^3.2.7" - optionalDependencies: - readable-stream "^2" - -tap@^10.3.2: - version "10.3.2" - resolved "https://registry.yarnpkg.com/tap/-/tap-10.3.2.tgz#77982f08368d8b1803a3b0ab5fc300e1817f31e7" - dependencies: - bind-obj-methods "^1.0.0" - bluebird "^3.3.1" - clean-yaml-object "^0.1.0" - color-support "^1.1.0" - coveralls "^2.11.2" - deeper "^2.1.0" - foreground-child "^1.3.3" - fs-exists-cached "^1.0.0" - function-loop "^1.0.1" - glob "^7.0.0" - isexe "^1.0.0" - js-yaml "^3.3.1" - nyc "^10.0.0" - only-shallow "^1.0.2" - opener "^1.4.1" - os-homedir "1.0.1" - own-or "^1.0.0" - own-or-env "^1.0.0" - readable-stream "^2.0.2" - signal-exit "^3.0.0" - source-map-support "^0.4.3" - stack-utils "^1.0.0" - tap-mocha-reporter "^3.0.1" - tap-parser "^5.3.1" - tmatch "^3.0.0" - trivial-deferred "^1.0.1" - yapool "^1.0.0" - tar-pack@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984" @@ -4485,9 +4744,9 @@ tar@^2.2.1: fstream "^1.0.2" inherits "2" -test-exclude@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.0.3.tgz#86a13ce3effcc60e6c90403cf31a27a60ac6c4e7" +test-exclude@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.0.tgz#04ca70b7390dd38c98d4a003a173806ca7991c91" dependencies: arrify "^1.0.1" micromatch "^2.3.11" @@ -4503,6 +4762,10 @@ text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" +throat@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/throat/-/throat-3.0.0.tgz#e7c64c867cbb3845f10877642f7b60055b8ec0d6" + through2-filter@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/through2-filter/-/through2-filter-2.0.0.tgz#60bc55a0dacb76085db1f9dae99ab43f83d622ec" @@ -4539,16 +4802,16 @@ tiny-lr@^1.0.3: object-assign "^4.1.0" qs "^6.2.0" -tmatch@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/tmatch/-/tmatch-3.0.0.tgz#7d2071dedbbc587f194acda3067bd0747b670991" - tmp@^0.0.31: version "0.0.31" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.31.tgz#8f38ab9438e17315e5dbd8b3657e8bfb277ae4a7" dependencies: os-tmpdir "~1.0.1" +tmpl@1.0.x: + version "1.0.4" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" + to-absolute-glob@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz#1cdfa472a9ef50c239ee66999b662ca0eb39937f" @@ -4559,12 +4822,16 @@ to-fast-properties@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.2.tgz#f3f5c0c3ba7299a7ef99427e44633257ade43320" -tough-cookie@~2.3.0: +tough-cookie@^2.3.2, tough-cookie@~2.3.0: version "2.3.2" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.2.tgz#f081f76e4c85720e6c37a5faced737150d84072a" dependencies: punycode "^1.4.1" +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + trim-lines@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-1.1.0.tgz#9926d03ede13ba18f7d42222631fb04c79ff26fe" @@ -4589,10 +4856,6 @@ trim@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/trim/-/trim-0.0.1.tgz#5858547f6b290757ee95cccc666fb50084c460dd" -trivial-deferred@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trivial-deferred/-/trivial-deferred-1.0.1.tgz#376d4d29d951d6368a6f7a0ae85c2f4d5e0658f3" - trough@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.0.tgz#6bdedfe7f2aa49a6f3c432257687555957f342fd" @@ -4653,13 +4916,6 @@ unherit@^1.0.4: inherits "^2.0.1" xtend "^4.0.1" -unicode-length@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/unicode-length/-/unicode-length-1.0.3.tgz#5ada7a7fed51841a418a328cf149478ac8358abb" - dependencies: - punycode "^1.3.2" - strip-ansi "^3.0.1" - unified@^6.0.0: version "6.1.2" resolved "https://registry.yarnpkg.com/unified/-/unified-6.1.2.tgz#b3904c3254ffbea7ff6d806c5d5b6248838cecb6" @@ -4725,6 +4981,10 @@ universalify@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.0.tgz#9eb1c4651debcc670cc94f1a75762332bb967778" +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + user-home@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" @@ -4739,6 +4999,12 @@ uuid@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" +v8flags@^2.0.10: + version "2.1.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" + dependencies: + user-home "^1.1.1" + vali-date@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6" @@ -4829,6 +5095,24 @@ vinyl@^2.0.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" +walker@~1.0.5: + version "1.0.7" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb" + dependencies: + makeerror "1.0.x" + +watch@~0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + +webidl-conversions@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.1.tgz#8015a17ab83e7e1b311638486ace81da6ce206a0" + websocket-driver@>=0.5.1: version "0.6.5" resolved "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.6.5.tgz#5cb2556ceb85f4373c6d8238aa691c8454e13a36" @@ -4839,11 +5123,24 @@ websocket-extensions@>=0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.1.tgz#76899499c184b6ef754377c2dbb0cd6cb55d29e7" +whatwg-encoding@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.1.tgz#3c6c451a198ee7aec55b1ec61d0920c67801a5f4" + dependencies: + iconv-lite "0.4.13" + +whatwg-url@^4.3.0: + version "4.7.1" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-4.7.1.tgz#df4dc2e3f25a63b1fa5b32ed6d6c139577d690de" + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" -which@^1.2.10, which@^1.2.4, which@^1.2.9: +which@^1.1.1, which@^1.2.10, which@^1.2.12, which@^1.2.9: version "1.2.14" resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" dependencies: @@ -4875,6 +5172,13 @@ wordwrap@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" +worker-farm@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.3.1.tgz#4333112bb49b17aa050b87895ca6b2cacf40e5ff" + dependencies: + errno ">=0.1.1 <0.2.0-0" + xtend ">=4.0.0 <4.1.0-0" + wrap-ansi@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" @@ -4886,14 +5190,6 @@ wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" -write-file-atomic@^1.1.4: - version "1.3.2" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.2.tgz#f80ac5e06d3a38996ab51b5d310db57102deb902" - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - slide "^1.1.5" - write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757" @@ -4908,6 +5204,10 @@ x-is-string@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/x-is-string/-/x-is-string-0.1.0.tgz#474b50865af3a49a9c4657f05acd145458f77d82" +xml-name-validator@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" + "xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.0, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af" @@ -4920,23 +5220,13 @@ yallist@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" -yapool@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/yapool/-/yapool-1.0.0.tgz#f693f29a315b50d9a9da2646a7a6645c96985b6a" - -yargs-parser@^4.0.2, yargs-parser@^4.2.0: +yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c" dependencies: camelcase "^3.0.0" -yargs-parser@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" - dependencies: - camelcase "^3.0.0" - -yargs@^6.0.0: +yargs@^6.0.0, yargs@^6.3.0: version "6.6.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208" dependencies: @@ -4954,24 +5244,6 @@ yargs@^6.0.0: y18n "^3.2.1" yargs-parser "^4.2.0" -yargs@^7.0.2: - version "7.1.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" - dependencies: - camelcase "^3.0.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^1.4.0" - read-pkg-up "^1.0.1" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^1.0.2" - which-module "^1.0.0" - y18n "^3.2.1" - yargs-parser "^5.0.0" - yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" From 9b1c41ba4cb5931fb730985df3bdd250ed53bdc4 Mon Sep 17 00:00:00 2001 From: Tom Macwright Date: Mon, 8 May 2017 20:36:04 -0400 Subject: [PATCH 2/2] Report in a post task --- circle.yml | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 656373967..3569827f5 100644 --- a/circle.yml +++ b/circle.yml @@ -4,3 +4,5 @@ machine: test: override: - npm run test-ci + post: + - ./node_modules/.bin/coveralls < coverage/lcov.info diff --git a/package.json b/package.json index 758daa124..1282ab71c 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,7 @@ "changelog": "standard-changelog -i CHANGELOG.md -w", "self-lint": "node ./bin/documentation.js lint src", "test": "npm run build && eslint . && are-we-flow-yet src && flow check && jest", - "test-ci": "npm run build && eslint . && are-we-flow-yet src && flow check && jest --runInBand && coveralls < coverage/lcov.info" + "test-ci": "npm run build && eslint . && are-we-flow-yet src && flow check && jest --runInBand" }, "jest": { "testPathIgnorePatterns": [