af8c8516d1
* Refactor stylelint fixer test * Support additional stylelint fixer options * Support changing working directory for stylelint fixer * Force css syntax for stylelint fixer
33 lines
1.1 KiB
Text
33 lines
1.1 KiB
Text
Before:
|
|
call ale#assert#SetUpFixerTest('css', 'stylelint')
|
|
|
|
After:
|
|
call ale#assert#TearDownFixerTest()
|
|
|
|
Execute(The stylelint callback should return the correct default values):
|
|
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'
|
|
\ . ' --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',
|
|
\ }
|