]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/handler/test_stylelint_handler.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit 'd49e95aa7ba744f0a7f544aca43afdb6aab41f24' as '.vim/bundle/asyncomplete...
[etc/vim.git] / .vim / bundle / ale / test / handler / test_stylelint_handler.vader
1 After:
2   unlet! g:error_lines
3
4 Execute (stylelint errors should be handled correctly):
5   " Stylelint includes trailing spaces for output. This needs to be taken into
6   " account for parsing errors.
7   AssertEqual
8   \ [
9   \   {
10   \     'lnum': 108,
11   \     'col': 10,
12   \     'type': 'E',
13   \     'text': 'Unexpected leading zero',
14   \     'code': 'number-leading-zero',
15   \   },
16   \   {
17   \     'lnum': 116,
18   \     'col': 20,
19   \     'type': 'E',
20   \     'text': 'Expected a trailing semicolon',
21   \     'code': 'declaration-block-trailing-semicolon',
22   \   },
23   \ ],
24   \ ale#handlers#css#HandleStyleLintFormat(42, [
25   \   'src/main.css',
26   \   ' 108:10  ✖  Unexpected leading zero         number-leading-zero                 ',
27   \   ' 116:20  ✖  Expected a trailing semicolon   declaration-block-trailing-semicolon',
28   \ ])
29
30 Execute (stylelint should complain when no configuration file is used):
31   let g:error_lines = [
32   \ 'Error: No configuration provided for /home/w0rp/.vim/bundle/ale/test.stylus',
33   \ '    at module.exports (/home/w0rp/.vim/bundle/ale/node_modules/stylelint/lib/utils/configurationError.js:8:27)',
34   \ '    at stylelint._fullExplorer.load.then.then.config (/home/w0rp/.vim/bundle/ale/node_modules/stylelint/lib/getConfigForFile.js:39:13)',
35   \]
36
37   AssertEqual
38   \ [{
39   \   'lnum': 1,
40   \   'text': 'stylelint exception thrown (type :ALEDetail for more information)',
41   \   'detail': join(g:error_lines, "\n"),
42   \ }],
43   \ ale#handlers#css#HandleStyleLintFormat(347, g:error_lines[:])