summaryrefslogtreecommitdiff
path: root/test/linter/test_angular.vader
blob: fe0749a18592f91f2d364de726d5f975e5875c36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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-files/angular/test.html')
  let g:paths = {
  \ 'ngserver': ale#test#GetFilename('../test-files/angular/node_modules/@angular/language-server/bin/ngserver'),
  \ 'service': ale#test#GetFilename('../test-files/angular/node_modules/@angular/language-service'),
  \ 'typescript': ale#test#GetFilename('../test-files/angular/node_modules/typescript'),
  \}

  AssertLSPLanguage 'html'
  AssertLSPProject ale#test#GetFilename('../test-files/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-files/angular/test.html')
  let g:paths = {
  \ 'service': ale#test#GetFilename('../test-files/angular/node_modules/@angular/language-service'),
  \ 'typescript': ale#test#GetFilename('../test-files/angular/node_modules/typescript'),
  \}

  AssertLSPLanguage 'html'
  AssertLSPProject ale#test#GetFilename('../test-files/angular')
  AssertLinter 'ngserver', ale#Escape('ngserver')
  \   . ' --ngProbeLocations ' . ale#Escape(g:paths.service)
  \   . ' --tsProbeLocations ' . ale#Escape(g:paths.typescript)
  \   . ' --stdio'