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](f61463f5c7/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.
This commit is contained in:
Pavel Savchenko 2024-06-27 15:04:26 +01:00 committed by GitHub
parent 5b44e1040e
commit e5e8d7a805
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -86,6 +86,9 @@ return {
local meta = getmetatable(adapter) local meta = getmetatable(adapter)
if adapter.setup then if adapter.setup then
adapter.setup(config) adapter.setup(config)
elseif adapter.adapter then
adapter.adapter(config)
adapter = adapter.adapter
elseif meta and meta.__call then elseif meta and meta.__call then
adapter(config) adapter(config)
else else