Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Autorun test on save #83

Open
deavid opened this issue May 16, 2020 · 2 comments
Open

Add Autorun test on save #83

deavid opened this issue May 16, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@deavid
Copy link

deavid commented May 16, 2020

It is unclear if autorun is supported or not by this extension, it's not mentioned but it appears in some parts of the sources. I never used autorun before in VSCode, so I may be mistaken on how it works. My guess is that the tests marked as autorun should run on file save. I don't expect much autodetection magic to know which tests to run depending on the file saved, so it would be okay if all tests marked were run on save.

My current layout looks like this:

src/
├── linked4
│   ├── mod.rs
│   └── test.rs
├── linked5
│   ├── mod.rs
│   └── test.rs
└── main.rs

So the tests are in a separate file from the module. I've tried to save the test file or the mod file. Nothing happens. I can't find any option in any extension to enable this. My guess the support should be provided in this extension but I might be wrong.

For the time being I added Alt-S as a keybinding to run all the tests, so I can do Ctrl-S ; Alt-S; to trigger a save, then test.

@calebcartwright
Copy link
Member

hi @deavid, this is not an implemented feature. You can view the list of currently supported features for this extension here.

We'd certainly consider adding this feature one day (I believe the Mocha Test Explorer extension has it), but for now it's a low priority feature relative to other items on the backlog, especially since there are alternative ways to achieve the result in the interim.

Thanks for the request!

@calebcartwright calebcartwright added the enhancement New feature or request label May 19, 2020
@calebcartwright calebcartwright changed the title Autorun test does not work Add Autorun test on save May 19, 2020
@russdam
Copy link

russdam commented Dec 10, 2021

Hi,
Hope this helps someone,
I got it to run on save with this extension: https://marketplace.visualstudio.com/items?itemName=pucelle.run-on-save

Config:

    "runOnSave.commands": [
        {
            "match": ".*\\.rs$",
            "command": "test-explorer.run-all",
            "runIn": "vscode"
        }
    ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants