diff options
author | Charles B Johnson <mail@cbjohnson.info> | 2020-04-08 18:20:10 -0500 |
---|---|---|
committer | Charles B Johnson <mail@cbjohnson.info> | 2021-01-22 09:23:53 -0600 |
commit | 4a6136c27ec2430a1ef5481e0ca10dee03ba178f (patch) | |
tree | 440ec6ab24d08f14071ef3a5d15f98e9e39a42dc /test/fixers/test_xo_fixer_callback.vader | |
parent | 6bfcb9cdffb86bf1a3e6d26cd1964858ff4bc3dd (diff) | |
download | ale-4a6136c27ec2430a1ef5481e0ca10dee03ba178f.zip |
fixers/xo: add tests
Diffstat (limited to 'test/fixers/test_xo_fixer_callback.vader')
-rw-r--r-- | test/fixers/test_xo_fixer_callback.vader | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/fixers/test_xo_fixer_callback.vader b/test/fixers/test_xo_fixer_callback.vader new file mode 100644 index 00000000..8bccd05e --- /dev/null +++ b/test/fixers/test_xo_fixer_callback.vader @@ -0,0 +1,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', + \ } |