2020-04-08 23:52:53 +00:00
|
|
|
Before:
|
|
|
|
call ale#assert#SetUpFixerTest('typescript', 'xo')
|
|
|
|
runtime autoload/ale/handlers/xo.vim
|
|
|
|
set filetype=typescript
|
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#assert#TearDownFixerTest()
|
|
|
|
|
|
|
|
Execute(The xo callback should return the correct default values):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.ts')
|
2020-04-08 23:52:53 +00:00
|
|
|
|
|
|
|
AssertFixer
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command': (has('win32') ? 'node.exe ' : '')
|
2021-03-20 22:11:22 +00:00
|
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
|
2020-04-08 23:52:53 +00:00
|
|
|
\ . ' --fix %t',
|
|
|
|
\ }
|
|
|
|
|
|
|
|
Execute(The xo callback should include custom xo options):
|
|
|
|
let g:ale_typescript_xo_options = '--space'
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.ts')
|
2020-04-08 23:52:53 +00:00
|
|
|
|
|
|
|
AssertFixer
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command': (has('win32') ? 'node.exe ' : '')
|
2021-03-20 22:11:22 +00:00
|
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
|
2020-04-08 23:52:53 +00:00
|
|
|
\ . ' --fix %t'
|
|
|
|
\ . ' --space',
|
|
|
|
\ }
|
2020-04-09 03:59:54 +00:00
|
|
|
|
|
|
|
Execute(--stdin should be used when xo is new enough):
|
|
|
|
let g:ale_typescript_xo_options = '--space'
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/xo/monorepo/packages/a/index.ts')
|
2020-04-09 03:59:54 +00:00
|
|
|
|
|
|
|
GivenCommandOutput ['0.30.0']
|
|
|
|
AssertFixer
|
|
|
|
\ {
|
2020-07-04 19:12:14 +00:00
|
|
|
\ 'command': (has('win32') ? 'node.exe ' : '')
|
2021-03-20 22:11:22 +00:00
|
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/xo/monorepo/node_modules/xo/cli.js'))
|
2020-04-09 03:59:54 +00:00
|
|
|
\ . ' --stdin --stdin-filename %s'
|
|
|
|
\ . ' --fix'
|
|
|
|
\ . ' --space',
|
|
|
|
\ }
|