2017-07-31 00:51:08 +00:00
|
|
|
Before:
|
2020-08-28 16:46:43 +00:00
|
|
|
Save g:ale_stylelint_options
|
|
|
|
|
|
|
|
let g:ale_stylelint_options = ''
|
|
|
|
|
2019-10-28 13:23:02 +00:00
|
|
|
call ale#assert#SetUpFixerTest('css', 'stylelint')
|
2017-07-31 00:51:08 +00:00
|
|
|
|
|
|
|
After:
|
2019-10-28 13:23:02 +00:00
|
|
|
call ale#assert#TearDownFixerTest()
|
2017-07-31 00:51:08 +00:00
|
|
|
|
2019-10-28 13:23:02 +00:00
|
|
|
Execute(The stylelint callback should return the correct default values):
|
2017-07-31 00:51:08 +00:00
|
|
|
call ale#test#SetFilename('../eslint-test-files/react-app/subdir/testfile.css')
|
|
|
|
|
2019-10-28 13:23:02 +00:00
|
|
|
AssertFixer
|
2017-07-31 00:51:08 +00:00
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
2020-08-28 16:46:43 +00:00
|
|
|
\ 'command': ale#path#BufferCdString(bufnr(''))
|
2019-10-28 13:23:02 +00:00
|
|
|
\ . (has('win32') ? 'node.exe ' : '')
|
2017-12-19 18:23:09 +00:00
|
|
|
\ . ale#Escape(ale#path#Simplify(g:dir . '/../eslint-test-files/react-app/node_modules/stylelint/bin/stylelint.js'))
|
2019-10-28 13:23:02 +00:00
|
|
|
\ . ' %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,
|
2020-08-28 16:46:43 +00:00
|
|
|
\ 'command': ale#path#BufferCdString(bufnr(''))
|
2019-10-28 13:23:02 +00:00
|
|
|
\ . (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',
|
|
|
|
\ }
|