From e5e8d7a8056a8c80456751385e73a4b184bcd436 Mon Sep 17 00:00:00 2001 From: Pavel Savchenko Date: Thu, 27 Jun 2024 15:04:26 +0100 Subject: [PATCH] fix(neotest): support adapter key on adapter for playwright (#3824) ## What is this PR for? Similar to https://github.com/LazyVim/LazyVim/issues/847 , only this adapter adds a setup function into the 'adapter' key in the plugin table ([source](https://github.com/thenbe/neotest-playwright/blob/f61463f5c74d53fc5975b7e086b7c6e9356d9215/lua/neotest-playwright/init.lua#L31-L33)). It is somewhat annoying that neotest does not provide a recommended way for adapters to define their configuration function (at least not explicitly)... Perhaps we should work around it temporarily, but reach out to either neotest or neotest-playwright authors? ## Does this PR fix an existing issue? I didn't see anyone complaining about playwright adapter in issues or discussions :/ ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --- lua/lazyvim/plugins/extras/test/core.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/lazyvim/plugins/extras/test/core.lua b/lua/lazyvim/plugins/extras/test/core.lua index cab47ee9..5579ee89 100644 --- a/lua/lazyvim/plugins/extras/test/core.lua +++ b/lua/lazyvim/plugins/extras/test/core.lua @@ -86,6 +86,9 @@ return { local meta = getmetatable(adapter) if adapter.setup then adapter.setup(config) + elseif adapter.adapter then + adapter.adapter(config) + adapter = adapter.adapter elseif meta and meta.__call then adapter(config) else