46 lines
1.5 KiB
Text
46 lines
1.5 KiB
Text
Before:
|
|
call ale#assert#SetUpFixerTest('javascript', 'xo')
|
|
runtime autoload/ale/handlers/xo.vim
|
|
set filetype=javascript
|
|
|
|
After:
|
|
call ale#assert#TearDownFixerTest()
|
|
|
|
Execute(The xo callback should return the correct default values):
|
|
call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.js')
|
|
|
|
AssertFixer
|
|
\ {
|
|
\ 'read_temporary_file': 1,
|
|
\ 'command': (has('win32') ? 'node.exe ' : '')
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo/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('../xo-test-files/monorepo/packages/a/index.js')
|
|
|
|
AssertFixer
|
|
\ {
|
|
\ 'read_temporary_file': 1,
|
|
\ 'command': (has('win32') ? 'node.exe ' : '')
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo/node_modules/xo/cli.js'))
|
|
\ . ' --fix %t'
|
|
\ . ' --space',
|
|
\ }
|
|
|
|
Execute(--stdin should be used when xo is new enough):
|
|
let g:ale_javascript_xo_options = '--space'
|
|
call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.js')
|
|
|
|
GivenCommandOutput ['0.30.0']
|
|
AssertFixer
|
|
\ {
|
|
\ 'command': ale#path#CdString(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo'))
|
|
\ . (has('win32') ? 'node.exe ' : '')
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo/node_modules/xo/cli.js'))
|
|
\ . ' --stdin --stdin-filename %s'
|
|
\ . ' --fix'
|
|
\ . ' --space',
|
|
\ }
|