Closed stevenhansel closed 1 year ago
Yep you're right. Treesitter can't extract the data that Neotest needs in order to run your tests:
I used the online Treesitter playground to write the queries that currently work with the adapter.
I think your use case is too unique to be included in the adapter but i'd be open to a PR which allows users to pass in custom Treesitter queries for the adapter to process as part of the NeotestAdapter.discover_positions
method.
In my rspec, I use a lot of
include_examples
to check the structure of the JSON response against a schema.In my spec file, I usually include a line like this:
include_examples 'http_response', :ok, 'users/collection
My current RSpec setup is that I create a shared example like here below:
And then in the second expect, I create a rspec matcher to automatically search the schema in a specific folder where I store all the schemas as a json file, and then I use validate that schema with the response.body
I see that this probably will be related to the
discover_positions
method from NeotestI personally haven't dig too much on how it finds and executes the test, but I really need this feature because in every spec file I have an
include_examples
. I'll try to see also if I can help, thanks!