summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2021-03-14 21:10:05 +0000
committerw0rp <devw0rp@gmail.com>2021-03-14 21:10:20 +0000
commitb45ee8ec6c760089c68fb28a5436ec8275ca5381 (patch)
treeb37f356b016f3c09ac7a706ed22fa0d852b32969 /test/command_callback
parent80a48d01be663205b92902ca3fa137706e3e88c6 (diff)
downloadale-b45ee8ec6c760089c68fb28a5436ec8275ca5381.zip
Close #2102 - Add support for the Angular language server
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_angular_command_callback.vader44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/command_callback/test_angular_command_callback.vader b/test/command_callback/test_angular_command_callback.vader
new file mode 100644
index 00000000..c5de3d87
--- /dev/null
+++ b/test/command_callback/test_angular_command_callback.vader
@@ -0,0 +1,44 @@
+Before:
+ call ale#assert#SetUpLinterTest('html', 'angular')
+ let g:paths = {}
+
+After:
+ call ale#assert#TearDownLinterTest()
+ unlet g:paths
+
+Execute(The Angular LSP connection shouldn't be created outside of Angular projects):
+ AssertLSPLanguage 'html'
+ AssertLSPConfig {}
+ AssertLSPProject ''
+ AssertLinterNotExecuted
+
+Execute(The default command for Angular should be correct):
+ call ale#test#SetFilename('../test-projects/angular/test.html')
+ let g:paths = {
+ \ 'ngserver': ale#test#GetFilename('../test-projects/angular/node_modules/@angular/language-server/bin/ngserver'),
+ \ 'service': ale#test#GetFilename('../test-projects/angular/node_modules/@angular/language-service'),
+ \ 'typescript': ale#test#GetFilename('../test-projects/angular/node_modules/typescript'),
+ \}
+
+ AssertLSPLanguage 'html'
+ AssertLSPProject ale#test#GetFilename('../test-projects/angular')
+ AssertLinter g:paths.ngserver, ale#Escape(g:paths.ngserver)
+ \ . ' --ngProbeLocations ' . ale#Escape(g:paths.service)
+ \ . ' --tsProbeLocations ' . ale#Escape(g:paths.typescript)
+ \ . ' --stdio'
+
+Execute(It should be possible to use the global ngserver):
+ let b:ale_html_angular_use_global = 1
+
+ call ale#test#SetFilename('../test-projects/angular/test.html')
+ let g:paths = {
+ \ 'service': ale#test#GetFilename('../test-projects/angular/node_modules/@angular/language-service'),
+ \ 'typescript': ale#test#GetFilename('../test-projects/angular/node_modules/typescript'),
+ \}
+
+ AssertLSPLanguage 'html'
+ AssertLSPProject ale#test#GetFilename('../test-projects/angular')
+ AssertLinter 'ngserver', ale#Escape('ngserver')
+ \ . ' --ngProbeLocations ' . ale#Escape(g:paths.service)
+ \ . ' --tsProbeLocations ' . ale#Escape(g:paths.typescript)
+ \ . ' --stdio'