firsttris / vscode-jest-runner

Simple way to run or debug one or more tests from context menu, codelens or command plalette
https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner
MIT License
265 stars 124 forks source link

Adding test reference by filename pattern #265

Closed gustavo80br closed 2 years ago

gustavo80br commented 2 years ago

Dear all. This is because my Jest installation, using typescript, can't call the test by the full path of the .ts file. My need as to have only the name of the test, so that Jest could find it by the pattern in the dist folder. So, I did this change by adding a new configuration parameter to enable/disable this behavior.

firsttris commented 2 years ago

hey @gustavo80br

thanks for your contribution. Im curios why you want to do this?

My understandig is the following:

With the correct config Jest CLI has the capability to preprocess your es6 or typescript code on the fly.

Means there is generally no need to transpile your code to the dist folder and execute test on it.

gustavo80br commented 2 years ago

Hi @firsttris!

In our case, it's a very large repo where I cannot change typescript or jest configuration so easily, otherwise I would need to change the entire way we call the tests on pipelines, yarn, gulp, etc. I did this change and installed the extension as a file, and I'm using it without any problem, it's working just fine.

I would like to extend the usage to my peers and would be much easier if I can say to them to just download the extension on vscode, than to have to share a file for installation. I'm talking about a large group of more than 100 people.

What you think?

gustavo80br commented 2 years ago

Could we re-open this PR? Maybe the setting name is not the most perfect one. I kindly ask you to reconsider, sorry I was busy and could not answer on time. This week I took to solve testing problems in the project and came back to review this proposal.

gustavo80br commented 2 years ago

Never mind, found a way to use a configuration file just for the Jest Runner and It works. Thanks

firsttris commented 2 years ago

hey @gustavo80br happy that you found a solution.

one main advantage the came with jest is that you dont have to compile your typescript files to run the test, that improved development xp alot.

development is always about feedback loop, the faster the feedback loop the better.

let me know if need further assistance.

best regards tristan