From 74b9348540e89e8918eddd4e8da276c80cee3bb7 Mon Sep 17 00:00:00 2001 From: Fredrik Averpil Date: Thu, 11 Jul 2024 19:24:03 +0200 Subject: [PATCH] fix(option): testify -> testify_enabled --- lua/neotest-golang/ast.lua | 4 ++-- lua/neotest-golang/init.lua | 2 +- lua/neotest-golang/options.lua | 2 +- tests/go/testify/lookup_spec.lua | 2 +- tests/go/testify/positions_spec.lua | 2 +- tests/unit/options_spec.lua | 12 ++++++------ 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lua/neotest-golang/ast.lua b/lua/neotest-golang/ast.lua index 3fb6595..43b8382 100644 --- a/lua/neotest-golang/ast.lua +++ b/lua/neotest-golang/ast.lua @@ -127,7 +127,7 @@ function M.detect_tests(file_path) local opts = { nested_tests = true } local query = M.test_function .. M.table_tests - if options.get().testify == true then + if options.get().testify_enabled == true then -- detect receiver types (as namespaces) and test methods. query = query .. testify.query.namespace_query @@ -137,7 +137,7 @@ function M.detect_tests(file_path) ---@type neotest.Tree local tree = lib.treesitter.parse_positions(file_path, query, opts) - if options.get().testify == true then + if options.get().testify_enabled == true then tree = testify.tree_modification.modify_neotest_tree(tree) end diff --git a/lua/neotest-golang/init.lua b/lua/neotest-golang/init.lua index a0aaa76..912616f 100644 --- a/lua/neotest-golang/init.lua +++ b/lua/neotest-golang/init.lua @@ -18,7 +18,7 @@ local M = {} M.Adapter = { name = "neotest-golang", init = function() - if options.get().testify == true then + if options.get().testify_enabled == true then testify.lookup.generate() end end, diff --git a/lua/neotest-golang/options.lua b/lua/neotest-golang/options.lua index b983052..d8ce358 100644 --- a/lua/neotest-golang/options.lua +++ b/lua/neotest-golang/options.lua @@ -8,9 +8,9 @@ local opts = { go_test_args = { "-v", "-race", "-count=1" }, dap_go_enabled = false, dap_go_opts = {}, + testify_enabled = false, warn_test_name_dupes = true, warn_test_not_executed = true, - testify = false, -- experimental, for now undocumented, options runner = "go", -- or "gotestsum" diff --git a/tests/go/testify/lookup_spec.lua b/tests/go/testify/lookup_spec.lua index 82cee93..28839a0 100644 --- a/tests/go/testify/lookup_spec.lua +++ b/tests/go/testify/lookup_spec.lua @@ -6,7 +6,7 @@ local testify = require("neotest-golang.features.testify") describe("Lookup", function() it("Generates tree replacement instructions", function() -- Arrange - options.set({ testify = true }) -- enable testify + options.set({ testify_enabled = true }) -- enable testify local folderpath = vim.loop.cwd() .. "/tests/go" local expected_lookup = { [folderpath .. "/positions_test.go"] = { diff --git a/tests/go/testify/positions_spec.lua b/tests/go/testify/positions_spec.lua index 2a2853c..2b051d6 100644 --- a/tests/go/testify/positions_spec.lua +++ b/tests/go/testify/positions_spec.lua @@ -72,7 +72,7 @@ describe("With testify_enabled=true", function() -- Arrange local test_filepath = vim.loop.cwd() .. "/tests/go/testify/positions_test.go" - options.set({ testify = true }) -- enable testify + options.set({ testify_enabled = true }) -- enable testify testify.lookup.generate() -- generate lookup local expected = { diff --git a/tests/unit/options_spec.lua b/tests/unit/options_spec.lua index f009a7b..8a6f424 100644 --- a/tests/unit/options_spec.lua +++ b/tests/unit/options_spec.lua @@ -3,16 +3,16 @@ local options = require("neotest-golang.options") describe("Options are set up", function() it("With defaults", function() local expected_options = { - dap_go_enabled = false, - dap_go_opts = {}, go_test_args = { "-v", "-race", "-count=1", }, + dap_go_enabled = false, + dap_go_opts = {}, + testify_enabled = false, warn_test_name_dupes = true, warn_test_not_executed = true, - testify = false, -- experimental runner = "go", @@ -25,17 +25,17 @@ describe("Options are set up", function() it("With non-defaults", function() local expected_options = { - dap_go_enabled = false, - dap_go_opts = {}, go_test_args = { "-v", "-race", "-count=1", "-parallel=1", -- non-default }, + dap_go_enabled = false, + dap_go_opts = {}, + testify_enabled = false, warn_test_name_dupes = true, warn_test_not_executed = true, - testify = false, -- experimental runner = "go",