jest-community / vscode-jest

The optimal flow for Jest based testing in VS Code
MIT License
2.85k stars 295 forks source link

Add an option to not launch vscode-jest when it detects a wallaby.js file in the repo root #235

Open orta opened 6 years ago

orta commented 6 years ago

Environment

All

Steps to Reproduce

When I open a project I'm using wallaby with, I'd like vscode-jest to stop at launch before annotations are added everywhere.

Expected Behavior

I change my settings.json to allow vscode-jest to stop loading up the core extension

Actual Behavior

It loads, I have a workaround, but it's a hack.

seanpoulter commented 6 years ago

We might be able to detect the other extensions that are installed using this API. How do you feel about using the setting to decide what to do when Wallaby is also installed? Does Wallaby start without the config file?

Since you're helping so much with all the reviews, I'll try and churn this out this week for you. 🌠 🚀

orta commented 6 years ago

Wallaby will only start with that with that config file, yes - but there will be people using the trail mode etc so it's not a safe assumption that someone with the extension installed will actively be using it IMO

Clever idea though, I love it. A dumb option is probably simplest.

seanpoulter commented 6 years ago

That's a good point that folks may have the extension in trial mode.

A dumb option is probably simplest.

One jest.preferWallabyjs setting coming right up, defaulting to false (?).

orta commented 6 years ago

Yep

seanpoulter commented 6 years ago

How do you feel about bypassing our extension entirely if jest.preferWallabyJs is set? Is there any functionality you'd still want access to? Figured it's worth asking before you see it in a PR. :wink:
I'm thinking we can disable the extension in two spots:

orta commented 6 years ago

I wouldn't worry about handling it all at runtime, unless you're using this as a reason to improve the jest stop and jest start commands. If you are, ace. If not, it's probably only going to be used by me and a few other tooling nerds that want to use both, in which case it's not worth the faff.

seanpoulter commented 6 years ago

Have you had any issues with the start/stop commands? I'm happy to look into it.

I was thinking that handling changes while the extension is running is a great use case to investigate dangling/parentless Node processes left around when I've been debugging. Oh, and of course go out of the way to make your life easier.

orta commented 6 years ago

Not in the sense of "issues", but doing the stop command doesn't remove code lenses/decorations for example. I took a stab at this once, https://github.com/jest-community/vscode-jest/tree/turn_off_stuff but never finished it up

seanpoulter commented 6 years ago

Well, I guess we better clear that up. 👍

seanpoulter commented 6 years ago

@orta, do you think "Jest: Stop Runner" should close the snapshot preview as well?

Edit: I'm going to assume yes.

orta commented 6 years ago

Yes 👍 - hah