diff options
author | Adrian <bardzusny@users.noreply.github.com> | 2017-04-07 16:38:50 +0200 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2017-04-07 15:38:50 +0100 |
commit | d28d7f732ae5c5017c7e4c2497a744a781e48dab (patch) | |
tree | 14039f15233099ed5b178fd75975e2fe20b7d06c /test | |
parent | 4caf273d53e7d90e845cb79d0293b1b410f22138 (diff) | |
download | ale-d28d7f732ae5c5017c7e4c2497a744a781e48dab.zip |
Add support for linting Handlebars templates with ember-template-lint (#452)
* Ember-template-lint Handlebars template linter: initial handler, test.
* Handlebars support with ember-template-lint: basic documentation entries.
Diffstat (limited to 'test')
-rw-r--r-- | test/handler/test_embertemplatelint_handler.vader | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/handler/test_embertemplatelint_handler.vader b/test/handler/test_embertemplatelint_handler.vader new file mode 100644 index 00000000..5261bbe5 --- /dev/null +++ b/test/handler/test_embertemplatelint_handler.vader @@ -0,0 +1,56 @@ +" Author: Adrian Zalewski <aazalewski@hotmail.com> + +Before: + runtime ale_linters/handlebars/embertemplatelint.vim + +Execute(The ember-template-lint handler should parse lines correctly): + let input_lines = split('{ + \ "/ember-project/app/templates/application.hbs": [ + \ { + \ "moduleId": "app/templates/application", + \ "rule": "bare-strings", + \ "severity": 2, + \ "message": "Non-translated string used", + \ "line": 1, + \ "column": 10, + \ "source": " Bare String\n" + \ }, + \ { + \ "moduleId": "app/templates/application", + \ "rule": "invalid-interactive", + \ "severity": 1, + \ "message": "Interaction added to non-interactive element", + \ "line": 3, + \ "column": 6, + \ "source": "<span {{action someAction}}></span>" + \ } + \ ] + \ }', '\n') + + AssertEqual + \ [ + \ { + \ 'bufnr': 347, + \ 'lnum': 1, + \ 'col': 10, + \ 'text': 'bare-strings: Non-translated string used', + \ 'type': 'E', + \ }, + \ { + \ 'bufnr': 347, + \ 'lnum': 3, + \ 'col': 6, + \ 'text': 'invalid-interactive: Interaction added to non-interactive element', + \ 'type': 'W', + \ }, + \ ], + \ ale_linters#handlebars#embertemplatelint#Handle(347, input_lines) + +Execute(The ember-template-lint handler should handle no lint errors/warnings): + AssertEqual + \ [ + \ ], + \ ale_linters#handlebars#embertemplatelint#Handle(347, []) + +After: + call ale#linter#Reset() |