summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Reimer <paulreimer@users.noreply.github.com>2018-08-02 12:20:19 -0700
committerw0rp <w0rp@users.noreply.github.com>2018-08-02 20:20:19 +0100
commitcb8ad9fbd82df92993e526a8e48d4400ba08936b (patch)
treecfd921f3daa66ead4c7612041eea5e2f7d431e20 /test
parent649934230bf9e10d3597814986cffca955b2fe05 (diff)
downloadale-cb8ad9fbd82df92993e526a8e48d4400ba08936b.zip
Javascript prettier filetype detect fix (#1769)
Support fixing YAML and HTML files with prettier for files without file extensions.
Diffstat (limited to 'test')
-rw-r--r--test/fixers/test_prettier_fixer_callback.vader14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/fixers/test_prettier_fixer_callback.vader b/test/fixers/test_prettier_fixer_callback.vader
index 2018c3a6..130941d1 100644
--- a/test/fixers/test_prettier_fixer_callback.vader
+++ b/test/fixers/test_prettier_fixer_callback.vader
@@ -222,6 +222,20 @@ Execute(Should set --parser based on filetype, Vue):
\ },
\ ale#fixers#prettier#ApplyFixForVersion(bufnr(''), ['1.6.0'])
+Execute(Should set --parser based on filetype, YAML):
+ call ale#test#SetFilename('../prettier-test-files/testfile')
+
+ set filetype=yaml
+
+ AssertEqual
+ \ {
+ \ 'command': 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ . ale#Escape(g:ale_javascript_prettier_executable)
+ \ . ' --parser yaml'
+ \ . ' --stdin-filepath %s --stdin',
+ \ },
+ \ ale#fixers#prettier#ApplyFixForVersion(bufnr(''), ['1.6.0'])
+
Execute(Should set --parser based on first filetype of multiple filetypes):
call ale#test#SetFilename('../prettier-test-files/testfile')