summaryrefslogtreecommitdiff
path: root/test/linter/test_biome.vader
diff options
context:
space:
mode:
authorBraden Kelley <redbmk@gmail.com>2024-06-23 22:32:24 -0700
committerGitHub <noreply@github.com>2024-06-24 06:32:24 +0100
commit5606606b32299832d92050f4e0f5af646d08f47c (patch)
treea3ad8f0a3c75e46c27fafeffa507d90ea619f64c /test/linter/test_biome.vader
parentf2aef2f510f1c4c0efea019e7c2dc36799133689 (diff)
downloadale-5606606b32299832d92050f4e0f5af646d08f47c.zip
fix(biome): send correct language to lsp proxy (#4773)
Since Biome understands `typescriptreact` and `javascriptreact` as languages, we can send the `filetype` to the LSP, rather than only sending `typescript` for both `ts` and `tsx` files, or `javascript` for `js` and `jsx` files. fixes: #4752
Diffstat (limited to 'test/linter/test_biome.vader')
-rw-r--r--test/linter/test_biome.vader35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/linter/test_biome.vader b/test/linter/test_biome.vader
new file mode 100644
index 00000000..c2cd9407
--- /dev/null
+++ b/test/linter/test_biome.vader
@@ -0,0 +1,35 @@
+Before:
+ Save g:ale_biome_options
+
+ let g:ale_biome_options = ''
+
+ call ale#assert#SetUpLinterTest('typescript', 'biome')
+ call ale#test#SetFilename('test.ts')
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+Execute(The default biome command should be correct):
+ AssertLinter 'biome', ale#Escape('biome') . ' lsp-proxy'
+
+Execute(The biome command should accept options):
+ let g:ale_biome_options = '--foobar'
+
+ AssertLinter 'biome', ale#Escape('biome') . ' lsp-proxy --foobar'
+
+Execute(Uses the filetype as the language):
+ call ale#test#SetFilename('test.ts')
+ set filetype=typescript
+ AssertLSPLanguage 'typescript'
+
+ call ale#test#SetFilename('test.tsx')
+ set filetype=typescriptreact
+ AssertLSPLanguage 'typescriptreact'
+
+ call ale#test#SetFilename('test.js')
+ set filetype=javascript
+ AssertLSPLanguage 'javascript'
+
+ call ale#test#SetFilename('test.jsx')
+ set filetype=javascriptreact
+ AssertLSPLanguage 'javascriptreact'