summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ale_linters/elm/make.vim6
-rw-r--r--test/command_callback/test_elm_make_command_callback.vader9
-rw-r--r--test/elm-test-files/newapp-notests/elm.json0
-rw-r--r--test/elm-test-files/newapp-notests/node_modules/.bin/elm0
-rw-r--r--test/elm-test-files/newapp-notests/tests/TestMain.elm0
5 files changed, 14 insertions, 1 deletions
diff --git a/ale_linters/elm/make.vim b/ale_linters/elm/make.vim
index 37b8d07c..76622028 100644
--- a/ale_linters/elm/make.vim
+++ b/ale_linters/elm/make.vim
@@ -209,7 +209,11 @@ function! ale_linters#elm#make#GetExecutable(buffer) abort
let l:is_v19 = ale_linters#elm#make#IsVersionGte19(a:buffer)
if l:is_test && l:is_v19
- return ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm-test'])
+ return ale#node#FindExecutable(
+\ a:buffer,
+\ 'elm_make',
+\ ['node_modules/.bin/elm-test', 'node_modules/.bin/elm']
+\ )
else
return ale#node#FindExecutable(a:buffer, 'elm_make', ['node_modules/.bin/elm'])
endif
diff --git a/test/command_callback/test_elm_make_command_callback.vader b/test/command_callback/test_elm_make_command_callback.vader
index 6400e187..02b2d76c 100644
--- a/test/command_callback/test_elm_make_command_callback.vader
+++ b/test/command_callback/test_elm_make_command_callback.vader
@@ -24,6 +24,15 @@ Execute(should get elm-test executable for test code with elm >= 0.19):
\ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/../elm-test-files/newapp')) . ' && '
\ . ale#Escape(g:executable) . ' make --report=json --output=/dev/null %t'
+Execute(should fallback to elm executable with elm >= 0.19):
+ call ale#test#SetFilename('../elm-test-files/newapp-notests/tests/TestMain.elm')
+
+ let g:executable = ale#path#Simplify(g:dir . '/../elm-test-files/newapp-notests/node_modules/.bin/elm')
+
+ AssertLinter g:executable,
+ \ 'cd ' . ale#Escape(ale#path#Simplify(g:dir . '/../elm-test-files/newapp-notests')) . ' && '
+ \ . ale#Escape(g:executable) . ' make --report=json --output=/dev/null %t'
+
Execute(should get plain elm executable for test code with elm < 0.19):
call ale#test#SetFilename('../elm-test-files/oldapp/tests/TestSuite.elm')
diff --git a/test/elm-test-files/newapp-notests/elm.json b/test/elm-test-files/newapp-notests/elm.json
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/elm-test-files/newapp-notests/elm.json
diff --git a/test/elm-test-files/newapp-notests/node_modules/.bin/elm b/test/elm-test-files/newapp-notests/node_modules/.bin/elm
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/elm-test-files/newapp-notests/node_modules/.bin/elm
diff --git a/test/elm-test-files/newapp-notests/tests/TestMain.elm b/test/elm-test-files/newapp-notests/tests/TestMain.elm
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/elm-test-files/newapp-notests/tests/TestMain.elm