summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorHoracio Sanson <hsanson@gmail.com>2021-01-23 11:04:52 +0900
committerGitHub <noreply@github.com>2021-01-23 11:04:52 +0900
commitc37473630189a597f20016d11ba3ba1ae0bd6923 (patch)
treed91b397ee7c6e2131818bb2f25757d61dbb79ca8 /test/command_callback
parent5200e6c73460232de7c8ea7659cea2429e02e2a0 (diff)
parentfe666a7a6c38a7026b1969e6be00eb5d380f8b13 (diff)
downloadale-c37473630189a597f20016d11ba3ba1ae0bd6923.zip
Merge pull request #3533 from motato1/master
Deno support for LSP and fixer
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_typescript_deno_lsp.vader60
1 files changed, 60 insertions, 0 deletions
diff --git a/test/command_callback/test_typescript_deno_lsp.vader b/test/command_callback/test_typescript_deno_lsp.vader
new file mode 100644
index 00000000..01cbc851
--- /dev/null
+++ b/test/command_callback/test_typescript_deno_lsp.vader
@@ -0,0 +1,60 @@
+Before:
+ let g:ale_deno_unstable = 0
+ let g:ale_deno_executable = 'deno'
+ let g:ale_deno_project_root = ''
+
+ runtime autoload/ale/handlers/deno.vim
+ call ale#assert#SetUpLinterTest('typescript', 'deno')
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+Execute(Should set deno lsp for TypeScript projects using stable Deno API):
+ AssertLSPLanguage 'typescript'
+ AssertLSPConfig {}
+ AssertLSPProject ale#path#Simplify(g:dir . '/../..')
+ AssertLSPOptions {
+ \ 'enable': v:true,
+ \ 'lint': v:true,
+ \ 'unstable': v:false
+ \}
+
+Execute(Should set deno lsp using unstable Deno API if enabled by user):
+ let g:ale_deno_unstable = 1
+ AssertLSPLanguage 'typescript'
+ AssertLSPConfig {}
+ AssertLSPProject ale#path#Simplify(g:dir . '/../..')
+ AssertLSPOptions {
+ \ 'enable': v:true,
+ \ 'lint': v:true,
+ \ 'unstable': v:true
+ \}
+
+Execute(Should find project root containing tsconfig.json):
+ call ale#test#SetFilename('../typescript/test.ts')
+ AssertLSPLanguage 'typescript'
+ AssertLSPConfig {}
+ AssertLSPProject ale#path#Simplify(g:dir . '/../typescript')
+ AssertLSPOptions {
+ \ 'enable': v:true,
+ \ 'lint': v:true,
+ \ 'unstable': v:false
+ \}
+
+Execute(Should use user-specified project root):
+ let g:ale_deno_lsp_project_root = '/'
+
+ call ale#test#SetFilename('../typescript/test.ts')
+ AssertLSPLanguage 'typescript'
+ AssertLSPConfig {}
+ AssertLSPProject '/'
+ AssertLSPOptions {
+ \ 'enable': v:true,
+ \ 'lint': v:true,
+ \ 'unstable': v:false
+ \}
+
+Execute(Check Deno LSP command):
+ AssertLinter 'deno', [
+ \ ale#Escape('deno') . ' lsp',
+ \]