9fe7b1fe6a
Working directories are now set seperately from the commands so they can later be swapped out when running linters over projects is supported, and also better support filename mapping for running linters on other machines in future.
37 lines
1.1 KiB
Text
37 lines
1.1 KiB
Text
Before:
|
|
Save g:ale_stylelint_options
|
|
|
|
let g:ale_stylelint_options = ''
|
|
|
|
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,
|
|
\ 'cwd': '%s:h',
|
|
\ 'command': (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,
|
|
\ 'cwd': '%s:h',
|
|
\ 'command': (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',
|
|
\ }
|