diff options
author | Pierre-Nicolas Clauss <pinicarus@protonmail.com> | 2021-01-23 19:06:59 +0100 |
---|---|---|
committer | Pierre-Nicolas Clauss <pinicarus@protonmail.com> | 2021-01-23 19:06:59 +0100 |
commit | 0ac7595fe97607ae99757787eba19cf0870be00d (patch) | |
tree | 43bebcf52c3caf7a22d26b9309d0beb58aa144a9 /test/fixers/test_xots_fixer_callback.vader | |
parent | db96b007209f7ea0983c58cb1d18771f5a45a543 (diff) | |
parent | 9fd9435cd525b1d3c4470db0d514f72ed31cfece (diff) | |
download | ale-0ac7595fe97607ae99757787eba19cf0870be00d.zip |
Merge remote-tracking branch 'upstream/master'
Signed-off-by: Pierre-Nicolas Clauss <pinicarus@protonmail.com>
Diffstat (limited to 'test/fixers/test_xots_fixer_callback.vader')
-rw-r--r-- | test/fixers/test_xots_fixer_callback.vader | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/test/fixers/test_xots_fixer_callback.vader b/test/fixers/test_xots_fixer_callback.vader new file mode 100644 index 00000000..5c7fa1d1 --- /dev/null +++ b/test/fixers/test_xots_fixer_callback.vader @@ -0,0 +1,45 @@ +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): + call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.ts') + + 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_typescript_xo_options = '--space' + call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.ts') + + 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_typescript_xo_options = '--space' + call ale#test#SetFilename('../xo-test-files/monorepo/packages/a/index.ts') + + GivenCommandOutput ['0.30.0'] + AssertFixer + \ { + \ 'command': (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', + \ } |