summaryrefslogtreecommitdiff
path: root/test/fixers
diff options
context:
space:
mode:
authorCarlos Ramos <carakan@gmail.com>2017-10-16 00:53:17 -0400
committerCarlos Ramos <carakan@gmail.com>2017-10-16 00:53:17 -0400
commit07ebfbeef0ac3eb895182675c87cd5324bd3bf3c (patch)
tree429d613326f6cc819578396569beaefddcacb921 /test/fixers
parenta790077136ac3830e959a8215419dfb09340cea4 (diff)
downloadale-07ebfbeef0ac3eb895182675c87cd5324bd3bf3c.zip
Add new fixer tslint for typescript, fixes #932
Diffstat (limited to 'test/fixers')
-rw-r--r--test/fixers/test_tslint_fixer_callback.vader41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/fixers/test_tslint_fixer_callback.vader b/test/fixers/test_tslint_fixer_callback.vader
new file mode 100644
index 00000000..73871137
--- /dev/null
+++ b/test/fixers/test_tslint_fixer_callback.vader
@@ -0,0 +1,41 @@
+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 = ''
+
+ call ale#test#SetDirectory('/testplugin/test/fixers')
+ silent cd ..
+ silent cd command_callback
+ let g:dir = getcwd()
+
+After:
+ Restore
+
+ call ale#test#RestoreDirectory()
+
+Execute(The tslint callback should return the correct default values):
+ call ale#test#SetFilename('../prettier-test-files/testfile.ts')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_typescript_tslint_executable)
+ \ . ' -c tslint.json'
+ \ . ' --fix %t',
+ \ },
+ \ ale#fixers#tslint#Fix(bufnr(''))
+
+Execute(The tslint callback should include custom tslint config option):
+ let g:ale_typescript_tslint_config_path = '.tslintrc'
+ call ale#test#SetFilename('../prettier-test-files/testfile.ts')
+
+ AssertEqual
+ \ {
+ \ 'read_temporary_file': 1,
+ \ 'command': ale#Escape(g:ale_typescript_tslint_executable)
+ \ . ' -c ' . ale#Escape(g:ale_typescript_tslint_config_path)
+ \ . ' --fix %t',
+ \ },
+ \ ale#fixers#tslint#Fix(bufnr(''))