summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorClément DOUIN <clement.douin@gmail.com>2017-09-10 13:58:42 +0200
committerw0rp <w0rp@users.noreply.github.com>2017-09-10 12:58:42 +0100
commit18a7d32c4cc77d0eaa9ff860f86a307d0baafa09 (patch)
tree2c32d2884282305ed41931e6b53d7f0ab56ea0df /test
parentc11d2ae375399ea935e3c2e36e812e8a727ffd99 (diff)
downloadale-18a7d32c4cc77d0eaa9ff860f86a307d0baafa09.zip
Elm local install support (#915)
* Add Elm support for npm local installation
Diffstat (limited to 'test')
-rw-r--r--test/elm-test-files/app/filetest.elm0
-rw-r--r--test/elm-test-files/app/node_modules/.bin/elm-make0
-rw-r--r--test/test_elm_executable_detection.vader36
3 files changed, 36 insertions, 0 deletions
diff --git a/test/elm-test-files/app/filetest.elm b/test/elm-test-files/app/filetest.elm
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/elm-test-files/app/filetest.elm
diff --git a/test/elm-test-files/app/node_modules/.bin/elm-make b/test/elm-test-files/app/node_modules/.bin/elm-make
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/elm-test-files/app/node_modules/.bin/elm-make
diff --git a/test/test_elm_executable_detection.vader b/test/test_elm_executable_detection.vader
new file mode 100644
index 00000000..7b758fc2
--- /dev/null
+++ b/test/test_elm_executable_detection.vader
@@ -0,0 +1,36 @@
+Before:
+ call ale#test#SetDirectory('/testplugin/test')
+ runtime ale_linters/elm/make.vim
+
+After:
+ unlet! g:ale_elm_make_use_global
+ unlet! g:ale_elm_make_executable
+
+ call ale#test#RestoreDirectory()
+
+Execute(should get valid executable with default params):
+ call ale#test#SetFilename('elm-test-files/app/testfile.elm')
+
+ AssertEqual
+ \ g:dir . '/elm-test-files/app/node_modules/.bin/elm-make',
+ \ ale_linters#elm#make#GetExecutable(bufnr(''))
+
+Execute(should get valid executable with 'use_global' params):
+ let g:ale_elm_make_use_global = 1
+
+ call ale#test#SetFilename('elm-test-files/app/testfile.elm')
+
+ AssertEqual
+ \ 'elm-make',
+ \ ale_linters#elm#make#GetExecutable(bufnr(''))
+
+Execute(should get valid executable with 'use_global' and 'executable' params):
+ let g:ale_elm_make_executable = 'other-elm-make'
+ let g:ale_elm_make_use_global = 1
+
+ call ale#test#SetFilename('elm-test-files/app/testfile.elm')
+
+ AssertEqual
+ \ 'other-elm-make',
+ \ ale_linters#elm#make#GetExecutable(bufnr(''))
+