Search code examples
reactjsunit-testingwebstorm

WebStorm test shortcut


Does anyone know why the shortcut to go to the tests for a given class (cmd+shift+t) doesn't work in WebStorm as it does in IntelliJ Idea, or how one can enable it?


Solution

  • Cmd+Shift+T does work in WebStorm; navigation is based on test names (i.e. marking folder as test root won't help here), e.g. performing Navigate | Test inside a file named My.js will navigate you to MySpec.js file. Patterns are hardcoded to *Spec.js, *_spec.js, *-spec.js (+same patterns with "test" instead of "spec"). Note that if the file extensions differ (jsx > js), it won't work..

    We have a feature request for making patterns configurable, WEB-29053; please feel free to vote for it