diff options
author | w0rp <devw0rp@gmail.com> | 2019-05-13 21:57:44 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2019-05-13 21:57:44 +0100 |
commit | 07b596efb52ef56dda212777c30bad58269ce6d9 (patch) | |
tree | a0941f64f6d156ce3a58cac1a1bb6e83a4ee8623 /test/handler | |
parent | 70604828fa8a6713f1e7db2e4e58d44f9099ac87 (diff) | |
download | ale-07b596efb52ef56dda212777c30bad58269ce6d9.zip |
Close #791 - Handle exceptions for puglint
Diffstat (limited to 'test/handler')
-rw-r--r-- | test/handler/test_puglint_handler.vader | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/handler/test_puglint_handler.vader b/test/handler/test_puglint_handler.vader new file mode 100644 index 00000000..f37518bb --- /dev/null +++ b/test/handler/test_puglint_handler.vader @@ -0,0 +1,45 @@ +Before: + runtime ale_linters/pug/puglint.vim + +After: + call ale#linter#Reset() + +Execute(Regular errors should be handled): + AssertEqual + \ [ + \ { + \ 'lnum': 1, + \ 'col': 5, + \ 'type': 'E', + \ 'text': 'Static attribute "class" must be written as class literal', + \ }, + \ ], + \ ale_linters#pug#puglint#Handle(0, [ + \ '/tmp/vwYwsJA/233/test.pug:1:5 Static attribute "class" must be written as class literal', + \ ]) + +Execute(syntax errors in the configuration file should be handled): + AssertEqual + \ [ + \ { + \ 'lnum': 1, + \ 'text': 'puglint configuration error (type :ALEDetail for more information)', + \ 'detail': join( + \ [ + \ 'undefined:2', + \ ' disallowClassAttributeWithStaticValue: true', + \ ' ^', + \ 'SyntaxError: Unexpected token d in JSON at position 4', + \ ' at JSON.parse (<anonymous>)', + \ ], + \ "\n" + \ ), + \ }, + \ ], + \ ale_linters#pug#puglint#Handle(0, [ + \ 'undefined:2', + \ ' disallowClassAttributeWithStaticValue: true', + \ ' ^', + \ 'SyntaxError: Unexpected token d in JSON at position 4', + \ ' at JSON.parse (<anonymous>)', + \ ]) |