]> git.madduck.net Git - etc/vim.git/blob - .vim/bundle/ale/test/linter/test_javascript_deno_lsp.vader

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Merge commit '76265755a1add77121c8f9dabb3e9bb70fe9a972' as '.vim/bundle/ale'
[etc/vim.git] / .vim / bundle / ale / test / linter / test_javascript_deno_lsp.vader
1 Before:
2   Save g:ale_deno_import_map
3   Save g:ale_deno_unstable
4   Save g:ale_deno_executable
5   Save g:ale_deno_lsp_project_root
6
7   let g:ale_deno_import_map = 'import_map.json'
8   let g:ale_deno_unstable = 0
9   let g:ale_deno_executable = 'deno'
10   let g:ale_deno_lsp_project_root = ''
11
12   runtime autoload/ale/handlers/deno.vim
13   call ale#assert#SetUpLinterTest('javascript', 'deno')
14
15 After:
16   call ale#assert#TearDownLinterTest()
17
18 Execute(Should set deno lsp for JavaScript projects using stable Deno API):
19   AssertLSPOptions {
20   \   'enable': v:true,
21   \   'lint': v:true,
22   \   'unstable': v:false,
23   \   'importMap': ''
24   \}
25
26 Execute(Should set deno lsp using unstable Deno API if enabled by user):
27   let g:ale_deno_unstable = 1
28
29   AssertLSPOptions {
30   \   'enable': v:true,
31   \   'lint': v:true,
32   \   'unstable': v:true,
33   \   'importMap': ''
34   \}
35
36 Execute(Should set the default importMap filepath):
37   call ale#test#SetFilename('../test-files/javascript_deno/main.js')
38
39   AssertLSPOptions {
40   \   'enable': v:true,
41   \   'lint': v:true,
42   \   'unstable': v:false,
43   \   'importMap': ale#path#Simplify(g:dir . '/../test-files/javascript_deno/import_map.json')
44   \}
45
46 Execute(Should set the importMap filepath from user defined importMap):
47   let g:ale_deno_import_map = 'custom_import_map.json'
48   call ale#test#SetFilename('../test-files/javascript_deno/main.js')
49
50   AssertLSPOptions {
51   \   'enable': v:true,
52   \   'lint': v:true,
53   \   'unstable': v:false,
54   \   'importMap': ale#path#Simplify(g:dir . '/../test-files/javascript_deno/custom_import_map.json')
55   \}
56
57 Execute(Should set the importMap filepath from user defined importMap with unstable API):
58   let g:ale_deno_import_map = 'custom_import_map.json'
59   let g:ale_deno_unstable = 1
60   call ale#test#SetFilename('../test-files/javascript_deno/main.js')
61
62   AssertLSPOptions {
63   \   'enable': v:true,
64   \   'lint': v:true,
65   \   'unstable': v:true,
66   \   'importMap': ale#path#Simplify(g:dir . '/../test-files/javascript_deno/custom_import_map.json')
67   \}
68
69 Execute(Should find project root containing tsconfig.json):
70   call ale#test#SetFilename('../test-files/javascript_deno/main.js')
71
72   AssertLSPLanguage 'javascript'
73   AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/javascript_deno')
74
75 Execute(Should use user-specified project root):
76   let g:ale_deno_lsp_project_root = '/'
77
78   call ale#test#SetFilename('../test-files/javascript_deno/main.js')
79
80   AssertLSPLanguage 'javascript'
81   AssertLSPProject '/'
82
83 Execute(Check Deno LSP command):
84   AssertLinter 'deno', ale#Escape('deno') . ' lsp'