This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/fixers/test_xots_fixer_callback.vader

46 lines
1.4 KiB
Text
Raw Permalink Normal View History

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):
2020-06-29 23:40:43 +00:00
call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.ts')
2020-04-08 23:52:53 +00:00
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '')
2020-06-29 23:40:43 +00:00
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/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'
2020-06-29 23:40:43 +00:00
call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.ts')
2020-04-08 23:52:53 +00:00
AssertFixer
\ {
\ 'read_temporary_file': 1,
\ 'command': (has('win32') ? 'node.exe ' : '')
2020-06-29 23:40:43 +00:00
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo/node_modules/xo/cli.js'))
2020-04-08 23:52:53 +00:00
\ . ' --fix %t'
\ . ' --space',
\ }
Execute(--stdin should be used when xo is new enough):
let g:ale_typescript_xo_options = '--space'
2020-06-29 23:40:43 +00:00
call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.ts')
GivenCommandOutput ['0.30.0']
AssertFixer
\ {
\ 'command': (has('win32') ? 'node.exe ' : '')
2020-06-29 23:40:43 +00:00
\ . ale#Escape(ale#path#Simplify(g:dir . '/../xo-test-files/monorepo/node_modules/xo/cli.js'))
\ . ' --stdin --stdin-filename %s'
\ . ' --fix'
\ . ' --space',
\ }