summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/linter/test_typescript_deno_lsp.vader40
-rw-r--r--test/test-files/typescript/custom_import_map.json0
-rw-r--r--test/test-files/typescript/import_map.json0
-rw-r--r--test/test_deno_executable_detection.vader3
4 files changed, 40 insertions, 3 deletions
diff --git a/test/linter/test_typescript_deno_lsp.vader b/test/linter/test_typescript_deno_lsp.vader
index 88b2e036..944f6a0a 100644
--- a/test/linter/test_typescript_deno_lsp.vader
+++ b/test/linter/test_typescript_deno_lsp.vader
@@ -1,4 +1,5 @@
Before:
+ let g:ale_deno_importMap = 'import_map.json'
let g:ale_deno_unstable = 0
let g:ale_deno_executable = 'deno'
let g:ale_deno_lsp_project_root = ''
@@ -13,7 +14,8 @@ Execute(Should set deno lsp for TypeScript projects using stable Deno API):
AssertLSPOptions {
\ 'enable': v:true,
\ 'lint': v:true,
- \ 'unstable': v:false
+ \ 'unstable': v:false,
+ \ 'importMap': ''
\}
Execute(Should set deno lsp using unstable Deno API if enabled by user):
@@ -22,7 +24,41 @@ Execute(Should set deno lsp using unstable Deno API if enabled by user):
AssertLSPOptions {
\ 'enable': v:true,
\ 'lint': v:true,
- \ 'unstable': v:true
+ \ 'unstable': v:true,
+ \ 'importMap': ''
+ \}
+
+Execute(Should set the default importMap filepath):
+ call ale#test#SetFilename('../test-files/typescript/test.ts')
+
+ AssertLSPOptions {
+ \ 'enable': v:true,
+ \ 'lint': v:true,
+ \ 'unstable': v:false,
+ \ 'importMap': ale#path#Simplify(g:dir . '/../test-files/typescript/import_map.json')
+ \}
+
+Execute(Should set the importMap filepath from user defined importMap):
+ let g:ale_deno_importMap = 'custom_import_map.json'
+ call ale#test#SetFilename('../test-files/typescript/test.ts')
+
+ AssertLSPOptions {
+ \ 'enable': v:true,
+ \ 'lint': v:true,
+ \ 'unstable': v:false,
+ \ 'importMap': ale#path#Simplify(g:dir . '/../test-files/typescript/custom_import_map.json')
+ \}
+
+Execute(Should set the importMap filepath from user defined importMap with unstable API):
+ let g:ale_deno_importMap = 'custom_import_map.json'
+ let g:ale_deno_unstable = 1
+ call ale#test#SetFilename('../test-files/typescript/test.ts')
+
+ AssertLSPOptions {
+ \ 'enable': v:true,
+ \ 'lint': v:true,
+ \ 'unstable': v:true,
+ \ 'importMap': ale#path#Simplify(g:dir . '/../test-files/typescript/custom_import_map.json')
\}
Execute(Should find project root containing tsconfig.json):
diff --git a/test/test-files/typescript/custom_import_map.json b/test/test-files/typescript/custom_import_map.json
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/test-files/typescript/custom_import_map.json
diff --git a/test/test-files/typescript/import_map.json b/test/test-files/typescript/import_map.json
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/test-files/typescript/import_map.json
diff --git a/test/test_deno_executable_detection.vader b/test/test_deno_executable_detection.vader
index edd408b1..87690bfe 100644
--- a/test/test_deno_executable_detection.vader
+++ b/test/test_deno_executable_detection.vader
@@ -1,8 +1,9 @@
Before:
+ Save g:ale_deno_executable
runtime autoload/ale/handlers/deno.vim
After:
- unlet! g:ale_deno_executable
+ unlet! b:ale_deno_executable
call ale#linter#Reset()