summaryrefslogtreecommitdiff
path: root/test/command_callback/test_puglint_command_callback.vader
blob: 69c86b25931ab0c81ac14ece96db9d5edf65f459 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Before:
  call ale#assert#SetUpLinterTest('pug', 'puglint')

After:
  call ale#assert#TearDownLinterTest()

Execute(puglint should detect local executables and package.json):
  call ale#test#SetFilename('puglint_project/test.pug')

  AssertLinter
  \ ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
  \ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
  \   . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/package.json'))
  \   . ' -r inline %t'

Execute(puglint should use global executables if configured):
  let g:ale_pug_puglint_use_global = 1

  call ale#test#SetFilename('puglint_project/test.pug')

  AssertLinter 'pug-lint',
  \ ale#Escape('pug-lint')
  \   . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/package.json'))
  \   . ' -r inline %t'

Execute(puglint should detect .pug-lintrc):
  call ale#test#SetFilename('puglint_project/puglint_rc_dir/subdir/test.pug')

  AssertLinter ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
  \ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
  \   . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/puglint_rc_dir/.pug-lintrc'))
  \   . ' -r inline %t'

Execute(puglint should detect .pug-lintrc.js):
  call ale#test#SetFilename('puglint_project/puglint_rc_js_dir/subdir/test.pug')

  AssertLinter ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
  \ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
  \   . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/puglint_rc_js_dir/.pug-lintrc.js'))
  \   . ' -r inline %t'

Execute(puglint should detect .pug-lintrc.json):
  call ale#test#SetFilename('puglint_project/puglint_rc_json_dir/subdir/test.pug')

  AssertLinter ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'),
  \ ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/node_modules/.bin/pug-lint'))
  \   . ' -c ' . ale#Escape(ale#path#Simplify(g:dir . '/puglint_project/puglint_rc_json_dir/.pug-lintrc.json'))
  \   . ' -r inline %t'