This repository has been archived on 2024-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
ale/test/fixers/test_stylelint_fixer_callback.vader

38 lines
1.2 KiB
Text
Raw Normal View History

2017-07-31 00:51:08 +00:00
Before:
Save g:ale_stylelint_options
let g:ale_stylelint_options = ''
call ale#assert#SetUpFixerTest('css', 'stylelint')
2017-07-31 00:51:08 +00:00
After:
call ale#assert#TearDownFixerTest()
2017-07-31 00:51:08 +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')
AssertFixer
2017-07-31 00:51:08 +00:00
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#path#BufferCdString(bufnr(''))
\ . (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#BufferCdString(bufnr(''))
\ . (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',
\ }