Closed lvoliveira closed 3 years ago
Resolves #150
pretty cool :rocket:
i tested
currently the explorer menu is shown no matter which file im going to click
it would be cleaner if the menu where only shown if the files are actual test/spec files.
i researched and this should be possible:
@firsttris I was thinking about that too. I'll try to modify it.
My only concern is with the test file pattern that should be used.
I'll check if there is a way to make it configurable on the extension. What do you think?
configurable:
i think you could simlpy use jestrunner.codeLensSelector from config.
jestrunner.codeLensSelector | CodeLens will be shown on files matching this pattern (default */.{test,spec}.{js,jsx,ts,tsx})
maybe we should rename that config option to "testFilePattern" then...?
jestrunner.codeLensSelector | CodeLens will be shown on files matching this pattern (default */.{test,spec}.{js,jsx,ts,tsx})
I couldn't find a way to make it work with a regex coming from a config entry. The options will be shown on folders and on files matching this pattern. I think that will cover most use cases.
People can still open the file on the editor and use the menus from that context to run all tests on a file. Since they don't have any match filters they will be shown on any file
I think this is ready. @firsttris please let me know if there is anything else I need to do.
@lvoliveira good work, thx!
@lvoliveira
currently for me it does not show any explorer/context items.
do you know why that is?
did something broke by merging it?
can you check?
@firsttris Look like this commit removed the explorer menu options from the package.json file. I already created a new PR fixing it #184.
Add explorer context menus for running tests under a folder
Also works in files