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

Make it possible for cmd+S to trigger a test run #16

Open
IgorMinar opened this issue Aug 24, 2013 · 5 comments
Open

Make it possible for cmd+S to trigger a test run #16

IgorMinar opened this issue Aug 24, 2013 · 5 comments

Comments

@IgorMinar
Copy link

right now it doesn't seem to be possible to have a single shortcut to both save files and trigger a test run.

even if I reconfigure the keyboard mappings so that cmd+S triggers test rerun in addition to saving all files it doesn't work.

@segrey
Copy link
Contributor

segrey commented Aug 24, 2013

"Rerun tests" action saves all files and trigger a test run. Shift+Alt+R is a default shortcut for this action.
You can reconfigure the keyboard mappings for this action (Settings | Keymap, search for "Rerun Tests").
This functionality is available in WebStorm 130.1630.
What is your WebStorm build number?

@IgorMinar
Copy link
Author

by build is 130.1630

So you are saying that I should just map Rerun tests to cmd+s and remove that binding from Save all? Then since rerun also saves I'll get saving + test rerun?

If that's the case then there is one flaw - I don't want to rerun tests when I'm editing files that have nothing to do with my tests. I want to run tests only if files defined in my karma.conf change.

My ideal workflow is this one:

  • I define all files I care about with regards to testing in karma conf
  • if I make modifications to any of these files and save them tests rerun automatically
  • ideally this should apply to changes coming from switching branches in git, etc

This is exactly how my current workflow works with webstorm without the plugin (just by using custom node.js configuration and karma configured in --auto-watch=true mode)

@segrey
Copy link
Contributor

segrey commented Aug 24, 2013

Yes, I see. The only thing about custom node.js configuration: it triggers test runs on frame deactivation (i.e. when switching from IDE to some other app), because IDE saves all changed files.

@IgorMinar
Copy link
Author

that's ok, since that's actually how it behaves now without the plugin. I don't mind running the tests unnecessarily (they are very fast to run). But I want to avoid having to trigger the test run manually because most of the time I really just want to rerun the tests if any of my src or test files change.

@c089
Copy link

c089 commented Oct 22, 2014

👍 I'm still running my karma tests in a terminal because of this. Rerun tests doesn't seem to save when using the vi emulation, and even with that turned off it seems to have a race condition too: for me, it only picks up unsaved changes on the second rerun.

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

No branches or pull requests

3 participants