From cb8ad9fbd82df92993e526a8e48d4400ba08936b Mon Sep 17 00:00:00 2001 From: Paul Reimer Date: Thu, 2 Aug 2018 12:20:19 -0700 Subject: Javascript prettier filetype detect fix (#1769) Support fixing YAML and HTML files with prettier for files without file extensions. --- test/fixers/test_prettier_fixer_callback.vader | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') 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') -- cgit v1.2.3