summaryrefslogtreecommitdiff
path: root/test/test_eslint_executable_detection.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-07-09 22:43:25 +0100
committerw0rp <devw0rp@gmail.com>2017-07-09 22:43:31 +0100
commit6a84605c578ea844a02e429edb38ff2986bc308b (patch)
treea76cd146691fe7c11ae9576162091ab617ed2ba8 /test/test_eslint_executable_detection.vader
parentb50a7318fbf8836b820df9d10e0fc6ffba6bcd1e (diff)
downloadale-6a84605c578ea844a02e429edb38ff2986bc308b.zip
Make every test set filenames and switch directories in the same way, and fix some missing escaping for the rubocop linter
Diffstat (limited to 'test/test_eslint_executable_detection.vader')
-rw-r--r--test/test_eslint_executable_detection.vader29
1 files changed, 8 insertions, 21 deletions
diff --git a/test/test_eslint_executable_detection.vader b/test/test_eslint_executable_detection.vader
index 4f787367..30ae38d5 100644
--- a/test/test_eslint_executable_detection.vader
+++ b/test/test_eslint_executable_detection.vader
@@ -1,8 +1,7 @@
Before:
let g:ale_javascript_eslint_executable = 'eslint_d'
- silent! cd /testplugin/test
- let g:dir = getcwd()
+ call ale#test#SetDirectory('/testplugin/test')
runtime ale_linters/javascript/eslint.vim
@@ -11,62 +10,50 @@ After:
let g:ale_javascript_eslint_executable = 'eslint'
let g:ale_javascript_eslint_use_global = 0
- silent execute 'cd ' . g:dir
- unlet! g:dir
-
+ call ale#test#RestoreDirectory()
call ale#linter#Reset()
Execute(create-react-app directories should be detected correctly):
- silent noautocmd new eslint-test-files/react-app/subdir/testfile.js
+ call ale#test#SetFilename('eslint-test-files/react-app/subdir/testfile.js')
AssertEqual
\ g:dir . '/eslint-test-files/react-app/node_modules/eslint/bin/eslint.js',
\ ale#handlers#eslint#GetExecutable(bufnr(''))
- :q
-
Execute(use-global should override create-react-app detection):
let g:ale_javascript_eslint_use_global = 1
- silent noautocmd new eslint-test-files/react-app/subdir/testfile.js
+ call ale#test#SetFilename('eslint-test-files/react-app/subdir/testfile.js')
AssertEqual
\ 'eslint_d',
\ ale#handlers#eslint#GetExecutable(bufnr(''))
- :q
-
Execute(other app directories should be detected correctly):
- silent noautocmd new eslint-test-files/other-app/subdir/testfile.js
+ call ale#test#SetFilename('eslint-test-files/other-app/subdir/testfile.js')
AssertEqual
\ g:dir . '/eslint-test-files/node_modules/.bin/eslint',
\ ale#handlers#eslint#GetExecutable(bufnr(''))
- :q
-
Execute(use-global should override other app directories):
let g:ale_javascript_eslint_use_global = 1
- silent noautocmd new eslint-test-files/other-app/subdir/testfile.js
+ call ale#test#SetFilename('eslint-test-files/other-app/subdir/testfile.js')
AssertEqual
\ 'eslint_d',
\ ale#handlers#eslint#GetExecutable(bufnr(''))
- :q
-
Execute(eslint_d should be detected correctly):
- silent noautocmd new eslint-test-files/app-with-eslint-d/testfile.js
+ call ale#test#SetFilename('eslint-test-files/app-with-eslint-d/testfile.js')
AssertEqual
\ g:dir . '/eslint-test-files/app-with-eslint-d/node_modules/.bin/eslint_d',
\ ale#handlers#eslint#GetExecutable(bufnr(''))
- :q
-
Execute(eslint.js executables should be run with node on Windows):
- silent noautocmd new eslint-test-files/react-app/subdir/testfile.js
+ call ale#test#SetFilename('eslint-test-files/react-app/subdir/testfile.js')
let g:ale_has_override['win32'] = 1
" We have to execute the file with node.