summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_xo_fixer_callback.vader1
-rw-r--r--test/fixers/test_xots_fixer_callback.vader31
2 files changed, 32 insertions, 0 deletions
diff --git a/test/fixers/test_xo_fixer_callback.vader b/test/fixers/test_xo_fixer_callback.vader
index 0bb3108a..d36fe74c 100644
--- a/test/fixers/test_xo_fixer_callback.vader
+++ b/test/fixers/test_xo_fixer_callback.vader
@@ -1,6 +1,7 @@
Before:
call ale#assert#SetUpFixerTest('javascript', 'xo')
runtime autoload/ale/handlers/xo.vim
+ set filetype=javascript
After:
call ale#assert#TearDownFixerTest()
diff --git a/test/fixers/test_xots_fixer_callback.vader b/test/fixers/test_xots_fixer_callback.vader
new file mode 100644
index 00000000..1ef6a6dd
--- /dev/null
+++ b/test/fixers/test_xots_fixer_callback.vader
@@ -0,0 +1,31 @@
+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('../eslint-test-files/react-app/subdir/testfile.ts')
+
+ 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_typescript_xo_options = '--space'
+ call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.ts')
+
+ 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',
+ \ }