From 80bd2e18d65e335492cc4f6ba3fe15cc98740ef3 Mon Sep 17 00:00:00 2001 From: Sorin Iclanzan Date: Fri, 28 Aug 2020 03:14:50 -0400 Subject: Set prettier working directory to where .prettierignore is (#3101) Prettier does not use `.prettierignore` unless the current directory is the root where the `.prettierignore` file resides. * Update Prettier tests * Look for prettierignore to determine project root --- test/fixers/test_prettier_fixer_callback.vader | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/fixers/test_prettier_fixer_callback.vader') diff --git a/test/fixers/test_prettier_fixer_callback.vader b/test/fixers/test_prettier_fixer_callback.vader index 1087a160..fdd97df3 100644 --- a/test/fixers/test_prettier_fixer_callback.vader +++ b/test/fixers/test_prettier_fixer_callback.vader @@ -297,6 +297,17 @@ Execute(Should set --parser for experimental language, Handlebars): \ . ' --stdin-filepath %s --stdin', \ } +Execute(Changes to directory where .prettierignore is found): + call ale#test#SetFilename('../prettier-test-files/with_prettierignore/src/testfile.js') + + GivenCommandOutput ['1.6.0'] + AssertFixer + \ { + \ 'command': ale#path#CdString(expand('%:p:h:h')) + \ . ale#Escape(g:ale_javascript_prettier_executable) + \ . ' --stdin-filepath %s --stdin', + \ } + Execute(The prettier_d post-processor should permit regular JavaScript content): AssertEqual \ [ -- cgit v1.2.3