mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-03 18:14:01 +08:00
#4454 Clean up root test directory tests
Combine cases into smaller tests of tests and remove tests we no longer need. Linter tests have been moved to where they should be.
This commit is contained in:
17
test/linter/test_css_csslint.vader
Normal file
17
test/linter/test_css_csslint.vader
Normal file
@@ -0,0 +1,17 @@
|
||||
Before:
|
||||
call ale#assert#SetUpLinterTest('css', 'csslint')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(--config should be set when the .csslintrc file is found):
|
||||
call ale#test#SetFilename('../test-files/csslint/some-app/subdir/testfile.js')
|
||||
|
||||
AssertLinter 'csslint', 'csslint --format=compact '
|
||||
\ . '--config=' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/csslint/some-app/.csslintrc'))
|
||||
\ . ' %t'
|
||||
|
||||
Execute(--config should not be used when no .csslintrc file exists):
|
||||
call ale#test#SetFilename('../test-files/csslint/other-app/testfile.css')
|
||||
|
||||
AssertLinter 'csslint', 'csslint --format=compact %t'
|
||||
25
test/linter/test_hadolint.vader
Normal file
25
test/linter/test_hadolint.vader
Normal file
@@ -0,0 +1,25 @@
|
||||
Before:
|
||||
call ale#assert#SetUpLinterTest('dockerfile', 'hadolint')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(We should not use Docker by default):
|
||||
AssertLinter 'hadolint', 'hadolint --no-color -'
|
||||
|
||||
Execute(Options should be passed correctly when docker is disabled):
|
||||
let b:ale_dockerfile_hadolint_options = '--ignore DL3006'
|
||||
|
||||
AssertLinter 'hadolint', 'hadolint --ignore DL3006 --no-color -'
|
||||
|
||||
Execute(The command should be correct when using Docker):
|
||||
let b:ale_dockerfile_hadolint_use_docker = 'always'
|
||||
|
||||
AssertLinter 'docker', 'docker run --rm -i hadolint/hadolint hadolint --no-color -'
|
||||
|
||||
Execute(The command should be correct when using docker and supplying options):
|
||||
let b:ale_dockerfile_hadolint_use_docker = 'always'
|
||||
let b:ale_dockerfile_hadolint_options = '--ignore DL3006'
|
||||
|
||||
AssertLinter 'docker',
|
||||
\ 'docker run --rm -i hadolint/hadolint hadolint --ignore DL3006 --no-color -'
|
||||
31
test/linter/test_jsonlint.vader
Normal file
31
test/linter/test_jsonlint.vader
Normal file
@@ -0,0 +1,31 @@
|
||||
Before:
|
||||
call ale#assert#SetUpLinterTest('json', 'jsonlint')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(local executable should be detected correctly):
|
||||
call ale#test#SetFilename('../test-files/jsonlint/app/src/app.json')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/jsonlint/app/node_modules/.bin/jsonlint'),
|
||||
\ ale_linters#json#jsonlint#GetExecutable(bufnr(''))
|
||||
\
|
||||
Execute(use_global should override project executable):
|
||||
let g:ale_json_jsonlint_use_global = 1
|
||||
|
||||
call ale#test#SetFilename('../test-files/jsonlint/app/src/app.json')
|
||||
|
||||
AssertEqual
|
||||
\ 'jsonlint',
|
||||
\ ale_linters#json#jsonlint#GetExecutable(bufnr(''))
|
||||
\
|
||||
Execute(manually defined should override default executable):
|
||||
let g:ale_json_jsonlint_use_global = 1
|
||||
let g:ale_json_jsonlint_executable = 'custom_jsonlint'
|
||||
|
||||
call ale#test#SetFilename('../test-files/jsonlint/app/src/app.json')
|
||||
|
||||
AssertEqual
|
||||
\ 'custom_jsonlint',
|
||||
\ ale_linters#json#jsonlint#GetExecutable(bufnr(''))
|
||||
19
test/linter/test_puppet_languageserver.vader
Normal file
19
test/linter/test_puppet_languageserver.vader
Normal file
@@ -0,0 +1,19 @@
|
||||
Before:
|
||||
call ale#assert#SetUpLinterTest('puppet', 'languageserver')
|
||||
|
||||
After:
|
||||
call ale#assert#TearDownLinterTest()
|
||||
|
||||
Execute(old-style module should find its root correctly):
|
||||
call ale#test#SetFilename('../test-files/puppet/old-style-module/manifests/init.pp')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/puppet/old-style-module'),
|
||||
\ ale_linters#puppet#languageserver#GetProjectRoot(bufnr(''))
|
||||
\
|
||||
Execute(new-style module should find its root correctly):
|
||||
call ale#test#SetFilename('../test-files/puppet/new-style-module/lib/puppet/types/exampletype.rb')
|
||||
|
||||
AssertEqual
|
||||
\ ale#path#Simplify(g:dir . '/../test-files/puppet/new-style-module'),
|
||||
\ ale_linters#puppet#languageserver#GetProjectRoot(bufnr(''))
|
||||
Reference in New Issue
Block a user