summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_stylelint_fixer_callback.vader32
1 files changed, 24 insertions, 8 deletions
diff --git a/test/fixers/test_stylelint_fixer_callback.vader b/test/fixers/test_stylelint_fixer_callback.vader
index 90a9dc1f..f677cdf7 100644
--- a/test/fixers/test_stylelint_fixer_callback.vader
+++ b/test/fixers/test_stylelint_fixer_callback.vader
@@ -1,17 +1,33 @@
Before:
- call ale#test#SetDirectory('/testplugin/test/fixers')
+ call ale#assert#SetUpFixerTest('css', 'stylelint')
After:
- call ale#test#RestoreDirectory()
+ call ale#assert#TearDownFixerTest()
-Execute(The executable path should be correct):
+Execute(The stylelint callback should return the correct default values):
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.css')
- AssertEqual
+ AssertFixer
\ {
\ 'read_temporary_file': 1,
- \ 'command': (has('win32') ? 'node.exe ' : '')
+ \ 'command': ale#path#CdString(expand('%:p:h'))
+ \ . (has('win32') ? 'node.exe ' : '')
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
- \ . ' --fix %t',
- \ },
- \ ale#fixers#stylelint#Fix(bufnr(''))
+ \ . ' %t'
+ \ . ' --fix',
+ \ }
+
+Execute(The stylelint callback should include custom stylelint options):
+ let g:ale_stylelint_options = '--cache'
+ call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.css')
+
+ AssertFixer
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#path#CdString(expand('%:p:h'))
+ \ . (has('win32') ? 'node.exe ' : '')
+ \ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
+ \ . ' %t'
+ \ . ' --cache'
+ \ . ' --fix',
+ \ }