Feat: Add Basic Lua Test Suite (#115)

This MR adds a Lua test suite to the project, run via busted, and introduces tests for a number of the utility functions. Subsequent work will have to be done to test functions that use the `vim.api` scope and external packages to the plugin.
This commit is contained in:
Harrison (Harry) Cramer
2023-11-20 18:03:35 -05:00
committed by GitHub
parent 1abc33d149
commit 88b9196a2e
12 changed files with 401 additions and 180 deletions

View File

@@ -892,7 +892,7 @@ end
---@param note Note
---@return string
M.build_note_header = function(note)
return "@" .. note.author.username .. " " .. u.format_date(note.created_at)
return "@" .. note.author.username .. " " .. u.time_since(note.created_at)
end
M.build_note_body = function(note, resolve_info)
@@ -977,7 +977,7 @@ M.add_discussions_to_table = function(items)
end
-- Creates the first node in the discussion, and attaches children
local body = u.join_tables(root_text_nodes, discussion_children)
local body = u.spread(root_text_nodes, discussion_children)
local root_node = NuiTree.Node({
text = root_text,
is_note = true,