Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neotest-go adapter being used for typescript files when repo has both typescript and go #70

Open
trevorwhitney opened this issue Jan 25, 2024 · 1 comment

Comments

@trevorwhitney
Copy link

I have a few repos that have both typescript and go in them. I've noticed that when trying to run tests for the typescript code, the neotest-go adapter is being used.

Here's my config:

	require("neotest").setup({
		quickfix = {
			enabled = true,
		},
		log_level = vim.log.levels.DEBUG,
		adapters = {
			require("neotest-vim-test")({
				ignore_file_types = { "go" },
			}),

			require("neotest-go")({
				experimental = {
					test_table = true,
				},
			}),
		},
	})

When I remove neotest-go, I'm able to run both typescript and go tests just fine using the neotest-vim-test adapter. However, I miss out on the table test functionality which is the whole thing that brought me to neotest in the first place. When I add neotest-go, running the same test yields the following debug message:

DEBUG | 2024-01-25T15:37:23Z-0700 | .../pack/packer/start/neotest/lua/neotest/adapters/init.lua:19 | Adapters: { {
    adapter = {
      _generate_position_id = <function 1>,
      build_spec = <function 2>,
      discover_positions = <function 3>,
      is_test_file = <function 4>,
      name = "neotest-go",
      prepare_results = <function 5>,
      results = <function 6>,
      root = <function 7>,
      <metatable> = {
        __call = <function 8>
      }
    },
    root = "/home/twhitney/workspace/some-typescript-repo"
  } }

The file I'm trying to run here is github.test.ts so there's no _test.go in the filename at all, but I'm assuming that since I have a go.mod at the root of this repo (as well as a package.json). the neotest-go adapter is trying to take over. Any way to work around this?

@trevorwhitney
Copy link
Author

Upon further investigation, not sure if this bug belongs here or if this is a neotest bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant