Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: return more data from getSuggestedQuery to support tooling (#608)
* feat: expose suggestion data to support tooling I've added more data to the returned object, to support the development of tooling. Before this change, the returned value would be something like `{ queryName: 'Role' }`, and only by calling the `toString` method, the caller would get more information (the full formatted expression). With this change, the caller gets more useful data, to build tooling around. Example result: ``` { queryName: 'Role', queryMethod: 'getByRole', queryArgs: ['button', { name: /submit/i }], variant: 'get' } ``` The variant now defaults to `get`, to fix a bug that was causing suggestions like `undefinedByRole(…)` to be generated. * feat: update query style to match docs * chore: add some tests for getSuggestedQuery
- Loading branch information
Showing
2 changed files
with
90 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters