summaryrefslogtreecommitdiff
path: root/test/fixers/test_standard_fixer_callback.vader
blob: db9f20f69bee54116203d941cb702bf91758ef8c (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
Before:
  call ale#test#SetDirectory('/testplugin/test/fixers')

  unlet! b:ale_javascript_standard_executable
  unlet! b:ale_javascript_standard_options

After:
  call ale#test#RestoreDirectory()

Execute(The executable path should be correct):
  call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.js')

  AssertEqual
  \ {
  \   'read_temporary_file': 1,
  \   'command': (has('win32') ? 'node.exe ' : '')
  \     . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/standard/bin/cmd.js'))
  \     . ' --fix %t',
  \ },
  \ ale#fixers#standard#Fix(bufnr(''))

Execute(Custom options should be supported):
  let b:ale_javascript_standard_use_global = 1
  let b:ale_javascript_standard_options = '--foo-bar'

  AssertEqual
  \ {
  \   'read_temporary_file': 1,
  \   'command': ale#Escape('standard') . ' --foo-bar --fix %t',
  \ },
  \ ale#fixers#standard#Fix(bufnr(''))