summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-07-15 18:24:53 +0100
committerw0rp <devw0rp@gmail.com>2018-07-15 18:28:28 +0100
commita42999a639b2916b769a85f37d037be314d9d61b (patch)
tree5ebfb4d357dc673efa93fd32a66b489c4510de40 /test/fixers
parent5155a35a80fe3b20659eb0f28cc6cc720532dd3f (diff)
downloadale-a42999a639b2916b769a85f37d037be314d9d61b.zip
Massively reduce the amount of code needed for linter tests
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_tslint_fixer_callback.vader18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/fixers/test_tslint_fixer_callback.vader b/test/fixers/test_tslint_fixer_callback.vader
index 5bfafe24..aa9c0322 100644
--- a/test/fixers/test_tslint_fixer_callback.vader
+++ b/test/fixers/test_tslint_fixer_callback.vader
@@ -2,13 +2,16 @@ Before:
Save g:ale_typescript_tslint_executable
Save g:ale_typescript_tslint_config_path
- let g:ale_typescript_tslint_executable = 'xxxinvalid'
- let g:ale_typescript_tslint_config_path = 'tslint.json'
+ unlet! g:ale_typescript_tslint_executable
+ unlet! g:ale_typescript_tslint_config_path
+ unlet! b:ale_typescript_tslint_executable
+ unlet! b:ale_typescript_tslint_config_path
+
+ call ale#handlers#tslint#InitVariables()
- call ale#test#SetDirectory('/testplugin/test/fixers')
+ call ale#test#SetDirectory('/testplugin/test/command_callback')
silent cd ..
silent cd command_callback
- let g:dir = getcwd()
After:
Restore
@@ -16,12 +19,13 @@ After:
call ale#test#RestoreDirectory()
Execute(The tslint callback should return the correct default values):
+ let g:ale_typescript_tslint_config_path = 'tslint.json'
call ale#test#SetFilename('../prettier-test-files/testfile.ts')
AssertEqual
\ {
\ 'read_temporary_file': 1,
- \ 'command': ale#Escape(g:ale_typescript_tslint_executable)
+ \ 'command': ale#Escape('tslint')
\ . ' -c ' . ale#Escape('tslint.json')
\ . ' --fix %t',
\ },
@@ -34,8 +38,8 @@ Execute(The tslint callback should include custom tslint config option):
AssertEqual
\ {
\ 'read_temporary_file': 1,
- \ 'command': ale#Escape(g:ale_typescript_tslint_executable)
- \ . ' -c ' . ale#Escape(g:ale_typescript_tslint_config_path)
+ \ 'command': ale#Escape('tslint')
+ \ . ' -c ' . ale#Escape('.tslintrc')
\ . ' --fix %t',
\ },
\ ale#fixers#tslint#Fix(bufnr(''))