summaryrefslogtreecommitdiff
path: root/test/fixers/test_xo_fixer_callback.vader
blob: 8bccd05e92d22b42de4c0333e1db9c9afd371948 (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
Before:
  call ale#assert#SetUpFixerTest('javascript', 'xo')

After:
  call ale#assert#TearDownFixerTest()

Execute(The xo callback should return the correct default values):
  call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.js')

  AssertFixer
  \ {
  \   'read_temporary_file': 1,
  \   'command': (has('win32') ? 'node.exe ' : '')
  \     . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/xo/cli.js'))
  \     . ' --fix %t',
  \ }

Execute(The xo callback should include custom xo options):
  let g:ale_javascript_xo_options = '--space'
  call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.js')

  AssertFixer
  \ {
  \   'read_temporary_file': 1,
  \   'command': (has('win32') ? 'node.exe ' : '')
  \     . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/xo/cli.js'))
  \     . ' --fix %t'
  \     . ' --space',
  \ }