2018-12-06 18:23:31 +00:00
|
|
|
Before:
|
|
|
|
call ale#assert#SetUpLinterTest('scss', 'sasslint')
|
|
|
|
call ale#test#SetFilename('test.scss')
|
|
|
|
unlet! b:executable
|
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
|
|
|
|
Execute(should default to source, bin/sass-lint.js):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/sasslint/with-source/test.scss')
|
2018-12-06 18:23:31 +00:00
|
|
|
|
|
|
|
let b:executable = ale#path#Simplify(
|
|
|
|
\ g:dir
|
2021-03-20 22:11:22 +00:00
|
|
|
\ . '/../test-files/sasslint/with-source/node_modules/sass-lint/bin/sass-lint.js'
|
2018-12-06 18:23:31 +00:00
|
|
|
\)
|
|
|
|
|
|
|
|
AssertLinter b:executable,
|
|
|
|
\ (has('win32') ? 'node.exe ' : '')
|
|
|
|
\ . ale#Escape(b:executable)
|
|
|
|
\ . ' -v -q -f compact %t'
|
|
|
|
|
|
|
|
Execute(should fallback to bin, .bin/sass-lint):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/sasslint/with-bin/test.scss')
|
2018-12-06 18:23:31 +00:00
|
|
|
|
|
|
|
let b:executable = ale#path#Simplify(
|
|
|
|
\ g:dir
|
2021-03-20 22:11:22 +00:00
|
|
|
\ . '/../test-files/sasslint/with-bin/node_modules/.bin/sass-lint'
|
2018-12-06 18:23:31 +00:00
|
|
|
\)
|
|
|
|
|
|
|
|
AssertLinter b:executable, ale#Escape(b:executable) . ' -v -q -f compact %t'
|
|
|
|
|
|
|
|
Execute(should fallback to global bin):
|
|
|
|
AssertLinter 'sass-lint', ale#Escape('sass-lint') . ' -v -q -f compact %t'
|
|
|
|
|
|
|
|
Execute(The global executable should be configurable):
|
|
|
|
let b:ale_scss_sasslint_executable = 'foo'
|
|
|
|
|
|
|
|
AssertLinter 'foo', ale#Escape('foo') . ' -v -q -f compact %t'
|
|
|
|
|
|
|
|
Execute(The options should be configurable):
|
|
|
|
let b:ale_scss_sasslint_options = '--bar'
|
|
|
|
|
|
|
|
AssertLinter 'sass-lint', ale#Escape('sass-lint') . ' --bar -v -q -f compact %t'
|