From dc4c8786e3eeef1402a65f86e8946fe38ff666c8 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Mon, 2 Oct 2017 15:14:57 -0700 Subject: [PATCH] chore(doclint): fix doclint tests (#941) Last commit 017429eef1f1fbb83bb2df4817845a233314ee88 broke doclint tests. Try bots didn't catch this because they were not running doclint tests. This patch: - fixes doclint tests - starts running doclint tests on travis --- .travis.yml | 1 + utils/doclint/check_public_api/test/check-sorting/doc.md | 2 -- .../check_public_api/test/check-sorting/result.txt | 3 +-- utils/doclint/check_public_api/test/diff-arguments/doc.md | 8 ++++---- utils/doclint/check_public_api/test/diff-arguments/foo.js | 2 +- .../check_public_api/test/diff-arguments/result.txt | 2 +- .../check_public_api/test/diff-properties/result.txt | 1 - 7 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index b700f5fd052..f8def67146c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ install: script: - 'if [ "$NODE7" = "true" ]; then yarn run lint; fi' - 'if [ "$NODE7" = "true" ]; then yarn run coverage; fi' + - 'if [ "$NODE7" = "true" ]; then yarn run test-doclint; fi' - 'if [ "$NODE6" = "true" ]; then yarn run test-node6-transformer; fi' - 'if [ "$NODE6" = "true" ]; then yarn run build; fi' - 'if [ "$NODE6" = "true" ]; then yarn run unit-node6; fi' diff --git a/utils/doclint/check_public_api/test/check-sorting/doc.md b/utils/doclint/check_public_api/test/check-sorting/doc.md index 2cc2ad57c3d..9b3162824a6 100644 --- a/utils/doclint/check_public_api/test/check-sorting/doc.md +++ b/utils/doclint/check_public_api/test/check-sorting/doc.md @@ -10,8 +10,6 @@ #### foo.ddd -#### new Foo() - #### foo.ccc() #### foo.bbb() diff --git a/utils/doclint/check_public_api/test/check-sorting/result.txt b/utils/doclint/check_public_api/test/check-sorting/result.txt index 39af4c61e75..fee39688e69 100644 --- a/utils/doclint/check_public_api/test/check-sorting/result.txt +++ b/utils/doclint/check_public_api/test/check-sorting/result.txt @@ -1,5 +1,4 @@ [MarkDown] Events should go first. Event 'b' in class Foo breaks order -[MarkDown] Constructor of Foo should go before other methods [MarkDown] Event 'c' in class Foo breaks alphabetic ordering of events -[MarkDown] Bad alphabetic ordering of Foo members: Foo.ddd should go after Foo.constructor() +[MarkDown] Bad alphabetic ordering of Foo members: Foo.ddd should go after Foo.ccc() [MarkDown] Bad alphabetic ordering of Foo members: Foo.ccc() should go after Foo.bbb() \ No newline at end of file diff --git a/utils/doclint/check_public_api/test/diff-arguments/doc.md b/utils/doclint/check_public_api/test/diff-arguments/doc.md index 0754b4b1cc3..618febfdc98 100644 --- a/utils/doclint/check_public_api/test/diff-arguments/doc.md +++ b/utils/doclint/check_public_api/test/diff-arguments/doc.md @@ -1,11 +1,11 @@ ### class: Foo -#### new Foo(arg1, arg2) -- `arg1` <[string]> -- `arg2` <[string]> - #### foo.bar(options) - `options` <[Object]> +#### foo.foo(arg1, arg2) +- `arg1` <[string]> +- `arg2` <[string]> + #### foo.test(...files) - `...filePaths` <[string]> diff --git a/utils/doclint/check_public_api/test/diff-arguments/foo.js b/utils/doclint/check_public_api/test/diff-arguments/foo.js index aa29960c940..84e64504660 100644 --- a/utils/doclint/check_public_api/test/diff-arguments/foo.js +++ b/utils/doclint/check_public_api/test/diff-arguments/foo.js @@ -1,5 +1,5 @@ class Foo { - constructor(arg1, arg3 = {}) { + foo(arg1, arg3 = {}) { } test(...filePaths) { diff --git a/utils/doclint/check_public_api/test/diff-arguments/result.txt b/utils/doclint/check_public_api/test/diff-arguments/result.txt index 07e6e28cfa0..bd6b1f0eb10 100644 --- a/utils/doclint/check_public_api/test/diff-arguments/result.txt +++ b/utils/doclint/check_public_api/test/diff-arguments/result.txt @@ -1,4 +1,4 @@ [MarkDown] Heading arguments for "foo.test(...files)" do not match described ones, i.e. "...files" != "...filePaths" -[MarkDown] Method Foo.constructor() fails to describe its parameters: +[MarkDown] Method Foo.foo() fails to describe its parameters: - Argument not found: arg3 - Non-existing argument found: arg2 \ No newline at end of file diff --git a/utils/doclint/check_public_api/test/diff-properties/result.txt b/utils/doclint/check_public_api/test/diff-properties/result.txt index 785e9904b76..382a4d41b8f 100644 --- a/utils/doclint/check_public_api/test/diff-properties/result.txt +++ b/utils/doclint/check_public_api/test/diff-properties/result.txt @@ -1,3 +1,2 @@ -[MarkDown] Method not found: Foo.constructor() [MarkDown] Non-existing property found: Foo.c [MarkDown] Property not found: Foo.b \ No newline at end of file