From db5fe5659f260f63cc777ea7c42575fd0e44bcde Mon Sep 17 00:00:00 2001 From: Donnie West Date: Fri, 18 Oct 2019 12:44:47 -0500 Subject: Allow the user to remove warnings from completions --- .../test_tsserver_completion_parsing.vader | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'test/completion/test_tsserver_completion_parsing.vader') diff --git a/test/completion/test_tsserver_completion_parsing.vader b/test/completion/test_tsserver_completion_parsing.vader index dbb8de32..5dfef531 100644 --- a/test/completion/test_tsserver_completion_parsing.vader +++ b/test/completion/test_tsserver_completion_parsing.vader @@ -29,6 +29,51 @@ Execute(TypeScript completions responses should be parsed correctly): \ ], \}) +Execute(TypeScript completions responses should include warnings): + AssertEqual + \ [ + \ { + \ 'word': 'foo', + \ 'source': '/path/to/foo.ts', + \ }, + \ { + \ 'word': 'bar', + \ 'source': '', + \ }, + \ { + \ 'word': 'baz', + \ 'source': '', + \ } + \ ], + \ ale#completion#ParseTSServerCompletions({ + \ 'body': [ + \ {'name': 'foo', 'source': '/path/to/foo.ts'}, + \ {'name': 'bar', 'kind': 'warning'}, + \ {'name': 'baz'}, + \ ], + \}) + +Execute(TypeScript completions responses should not include warnings if excluded): + let g:ale_completion_tsserver_remove_warnings = 1 + AssertEqual + \ [ + \ { + \ 'word': 'foo', + \ 'source': '/path/to/foo.ts', + \ }, + \ { + \ 'word': 'baz', + \ 'source': '', + \ } + \ ], + \ ale#completion#ParseTSServerCompletions({ + \ 'body': [ + \ {'name': 'foo', 'source': '/path/to/foo.ts'}, + \ {'name': 'bar', 'kind': 'warning'}, + \ {'name': 'baz'}, + \ ], + \}) + Execute(TypeScript completion details responses should be parsed correctly): AssertEqual \ [ -- cgit v1.2.3