diff options
author | w0rp <devw0rp@gmail.com> | 2018-03-02 20:33:45 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-03-02 20:33:45 +0000 |
commit | 2c2c7ceb1d2f3de97ba8a40dd7858e83b6755fcd (patch) | |
tree | ba0c0f405f56eb9694e0877a9fa45c09a1f276fe /test/lsp | |
parent | acbe527e15f1f388b8dbc9889216e9368d98e6c6 (diff) | |
download | ale-2c2c7ceb1d2f3de97ba8a40dd7858e83b6755fcd.zip |
Fix #1384 - Handle warnings and suggestions for tsserver
Diffstat (limited to 'test/lsp')
-rw-r--r-- | test/lsp/test_read_lsp_diagnostics.vader | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/test/lsp/test_read_lsp_diagnostics.vader b/test/lsp/test_read_lsp_diagnostics.vader index 3e637418..444272aa 100644 --- a/test/lsp/test_read_lsp_diagnostics.vader +++ b/test/lsp/test_read_lsp_diagnostics.vader @@ -121,7 +121,8 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle multiple messages): \ ]}}) Execute(ale#lsp#response#ReadTSServerDiagnostics() should handle tsserver responses): - AssertEqual [ + AssertEqual + \ [ \ { \ 'type': 'E', \ 'nr': 2365, @@ -131,5 +132,35 @@ Execute(ale#lsp#response#ReadTSServerDiagnostics() should handle tsserver respon \ 'end_lnum': 1, \ 'end_col': 17, \ }, - \], + \ ], \ ale#lsp#response#ReadTSServerDiagnostics({"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/bar/foo.ts","diagnostics":[{"start":{"line":1,"offset":11},"end":{"line":1,"offset":17},"text":"Operator ''+'' cannot be applied to types ''3'' and ''{}''.","code":2365}]}}) + +Execute(ale#lsp#response#ReadTSServerDiagnostics() should handle warnings from tsserver): + AssertEqual + \ [ + \ { + \ 'lnum': 27, + \ 'col': 3, + \ 'nr': 2515, + \ 'end_lnum': 27, + \ 'type': 'W', + \ 'end_col': 14, + \ 'text': 'Calls to ''console.log'' are not allowed. (no-console)', + \ } + \ ], + \ ale#lsp#response#ReadTSServerDiagnostics({"seq":0,"type":"event","event":"semanticDiag","body":{"file":"<removed>","diagnostics":[{"start":{"line":27,"offset":3},"end":{"line":27,"offset":14},"text":"Calls to 'console.log' are not allowed. (no-console)","code":2515,"category":"warning","source":"tslint"}]}}) + +Execute(ale#lsp#response#ReadTSServerDiagnostics() should handle suggestions from tsserver): + AssertEqual + \ [ + \ { + \ 'lnum': 27, + \ 'col': 3, + \ 'nr': 2515, + \ 'end_lnum': 27, + \ 'type': 'I', + \ 'end_col': 14, + \ 'text': 'Some info', + \ } + \ ], + \ ale#lsp#response#ReadTSServerDiagnostics({"seq":0,"type":"event","event":"semanticDiag","body":{"file":"<removed>","diagnostics":[{"start":{"line":27,"offset":3},"end":{"line":27,"offset":14},"text":"Some info","code":2515,"category":"suggestion","source":"tslint"}]}}) |