Skip to content

Commit

Permalink
fix(test): adding missing dep for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
s1n7ax committed Dec 2, 2023
1 parent 8667bd3 commit 2f278c8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
3 changes: 0 additions & 3 deletions tests/before-test.lua

This file was deleted.

4 changes: 1 addition & 3 deletions tests/java-dap/java_dap_spec.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
local plugin = require('java-dap')

describe('setup', function()
it('java-dap', function()
assert('plugin module should be avaiable', plugin)
assert('setup module should be avaiable', require('java-dap.api.setup'))
end)
end)
13 changes: 13 additions & 0 deletions tests/prepare-config.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'

---@diagnostic disable: assign-type-mismatch
---@param path string
---@return string|nil
local function local_plug(path)
return vim.fn.isdirectory(path) == 1 and path or nil
end

if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
'git',
Expand All @@ -20,6 +27,12 @@ require('lazy').setup({
'nvim-lua/plenary.nvim',
lazy = false,
},
{
'nvim-java/nvim-java-core',
---@diagnostic disable-next-line: assign-type-mismatch
dir = local_plug('~/Workspace/nvim-java-core'),
lazy = false,
},
}, {
root = temp_path,
lockfile = temp_path .. '/lazy-lock.json',
Expand Down
14 changes: 14 additions & 0 deletions tests/test-config.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---@diagnostic disable: assign-type-mismatch
---@param dev_path string
---@param plug_path string
---@return string|nil
local function local_plug(dev_path, plug_path)
return (vim.fn.isdirectory(dev_path) == 1) and dev_path or plug_path
end

local plug_path = './.test_plugins'

vim.opt.rtp:append(plug_path .. '/plenary.nvim')
vim.opt.rtp:append(
local_plug('~/Workspace/nvim-java-core', plug_path .. '/nvim-java-core')
)

0 comments on commit 2f278c8

Please sign in to comment.