Skip to content

Commit

Permalink
test: remove hardcoded dir
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarriga committed Jul 2, 2022
1 parent ddd3e10 commit 3956aad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion lua/neotest/consumers/summary/component.lua
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ function SummaryComponent:render(canvas, tree, expanded, focused, indent)
if position.type ~= "dir" then
canvas:add_mapping("jumpto", function()
local buf = vim.fn.bufadd(position.path)
vim.fn.bufload(buf)
-- Fails on swap conflict
pcall(vim.fn.bufload, buf)
vim.api.nvim_buf_set_option(buf, "buflisted", true)
if position.type == "file" then
lib.ui.open_buf(buf)
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/client/init_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ describe("neotest client", function()
client:run_tree(tree)

assert.same({
["/home/ronan/Dev/repos/neotest/test_file_1::test_a"] = true,
["/home/ronan/Dev/repos/neotest/test_file_1::test_b"] = true,
["/home/ronan/Dev/repos/neotest/test_file_2::test_a"] = true,
["/home/ronan/Dev/repos/neotest/test_file_2::test_b"] = true,
[dir .. "/test_file_1::test_a"] = true,
[dir .. "/test_file_1::test_b"] = true,
[dir .. "/test_file_2::test_a"] = true,
[dir .. "/test_file_2::test_b"] = true,
}, positons_run)
end)

Expand All @@ -234,8 +234,8 @@ describe("neotest client", function()
client:run_tree(tree)

assert.same({
["/home/ronan/Dev/repos/neotest/test_file_1::test_a"] = true,
["/home/ronan/Dev/repos/neotest/test_file_1::test_b"] = true,
[dir .. "/test_file_1::test_a"] = true,
[dir .. "/test_file_1::test_b"] = true,
}, positons_run)
end)
end)
Expand Down

0 comments on commit 3956aad

Please sign in to comment.