summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMohammed Chelouti <70812484+motato1@users.noreply.github.com>2020-12-29 21:46:02 +0100
committerMohammed Chelouti <70812484+motato1@users.noreply.github.com>2021-01-22 19:06:53 +0100
commit9b362634f7210657d94870b017e969bdcdda8de0 (patch)
treebb08e4a17bf156f54babd40207c6ee1f8ec51b5e /test
parent4f2666265a09cceac2e4091dc871107e418f1f67 (diff)
downloadale-9b362634f7210657d94870b017e969bdcdda8de0.zip
feat: Add Deno lsp support
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/test_typescript_deno_lsp.vader61
-rw-r--r--test/typescript/test.ts0
-rw-r--r--test/typescript/tsconfig.json0
3 files changed, 61 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..b6e4db0e
--- /dev/null
+++ b/test/command_callback/test_typescript_deno_lsp.vader
@@ -0,0 +1,61 @@
+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',
+ \]
diff --git a/test/typescript/test.ts b/test/typescript/test.ts
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/typescript/test.ts
diff --git a/test/typescript/tsconfig.json b/test/typescript/tsconfig.json
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/typescript/tsconfig.json