feat(busted): option to filter tests to run by pattern [wip]#378
Draft
joeveiga wants to merge 2 commits intonvim-lua:masterfrom
Draft
feat(busted): option to filter tests to run by pattern [wip]#378joeveiga wants to merge 2 commits intonvim-lua:masterfrom
joeveiga wants to merge 2 commits intonvim-lua:masterfrom
Conversation
Conni2461
reviewed
Jun 12, 2022
lua/plenary/busted.lua
Outdated
|
|
||
| mod.run = function(file) | ||
| mod.run = function(file, opts) | ||
| _PlenaryBustedOpts = vim.tbl_deep_extend("force", {}, opts or {}) |
Collaborator
There was a problem hiding this comment.
doing a global is technically fine because busted is already run in another process. But can't we do
-- top of the file
local busted_opts
--- ......
mod.run = function(file, opts)
busted_opts = vim.F.if_nil(opts, {})
-- ...
end
Contributor
Author
There was a problem hiding this comment.
Done, thanks! Although I did a vim.F.if_nil(opts, {}, opts) (3rd arg) 👍
Collaborator
|
Overall Looks good. Thanks :) |
Contributor
Author
Thanks @Conni2461! plenary.nvim/lua/plenary/test_harness.lua Line 33 in 9f033d1 It seems we're doing some hacking there to parse the second argument as a lua table manually? But adding a second field to the table causes an error. I'm guessing it doesn't like the comma in {minimal_init = 'tests/minimal_init.lua', filter = 'test'}?
EDIT: found this #284 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a step towards being able to run individual tests. See #343.
I'm just starting with lua and vim plugin development as well so, be gentle 😆.
Todo
TODOs in the code).