diff options
| author | William Boman <william@redwill.se> | 2022-07-06 19:41:43 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2022-07-07 00:39:59 +0200 |
| commit | 5f634e0c37e723fc0c33e06b4fd5c2180178db40 (patch) | |
| tree | fa4f09363adefa8259e23e4d1ea036db628b1243 /tests/middleware_spec.lua | |
| parent | feat(health): use stderr for java version, also check for JAVA_HOME (#765) (diff) | |
| download | mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.gz mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.bz2 mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.lz mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.xz mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.tar.zst mason-5f634e0c37e723fc0c33e06b4fd5c2180178db40.zip | |
mason.nvim
Diffstat (limited to 'tests/middleware_spec.lua')
| -rw-r--r-- | tests/middleware_spec.lua | 71 |
1 files changed, 0 insertions, 71 deletions
diff --git a/tests/middleware_spec.lua b/tests/middleware_spec.lua deleted file mode 100644 index 35aa5fe0..00000000 --- a/tests/middleware_spec.lua +++ /dev/null @@ -1,71 +0,0 @@ -local util = require "lspconfig.util" -local servers = require "nvim-lsp-installer.servers" -local middleware = require "nvim-lsp-installer.middleware" - -describe("middleware", function() - local server - before_each(function() - -- 1. setup dummy server - local default_options = { - cmd = { "dummy-lsp" }, - cmd_env = { PATH = "/keep/my/path/out/your/f/mouth" }, - } - server = ServerGenerator { - default_options = default_options, - } - servers.register(server) - - -- 2. register hook - middleware.register_lspconfig_hook() - end) - - after_each(function() - -- reset hook - util.on_setup = nil - end) - - it( - "should apply config changes to installed servers", - async_test(function() - server:install() - assert.wait_for(function() - assert.is_true(server:is_installed()) - end) - local config = { - name = "dummy", - cmd = { "should", "be", "overwritten" }, - custom = "setting", - cmd_env = { SOME_DEFAULT_ENV = "important" }, - } - util.on_setup(config) - assert.same({ - cmd = { "dummy-lsp" }, - name = "dummy", - custom = "setting", - cmd_env = { - PATH = "/keep/my/path/out/your/f/mouth", - SOME_DEFAULT_ENV = "important", - }, - }, config) - end) - ) - - it( - "should not apply config changes to uninstalled servers", - async_test(function() - local config = { - name = "uninstalled_dummy", - cmd = { "should", "not", "be", "overwritten" }, - custom = "setting", - cmd_env = { SOME_DEFAULT_ENV = "important" }, - } - util.on_setup(config) - assert.same({ - name = "uninstalled_dummy", - cmd = { "should", "not", "be", "overwritten" }, - custom = "setting", - cmd_env = { SOME_DEFAULT_ENV = "important" }, - }, config) - end) - ) -end) |
