I don't quite understand how magento2 implements tests in javascript.

From this doc: http://devdocs.magento.com/guides/v2.1/extension-dev-guide/test/test_js-unit.html it looks like it is possible to run javascript tests only though phpstorm?

If yes, is it possible to use some hacks to simulate the tests using just a text editor and command line? (I just don't understand why you need a specific IDE to develop with magento2)

1 Answer 1


FTA: "After you run the PHP interpreter once to run unit tests, you can run the JavaScript unit tests from the PhpStorm IDE."

It is saying you have to run it once OUTSIDE of PhpStorm, then you can run it inside of PhpStorm. So the tests are not tied to a specific IDE. I would suggest reading the whole document through to understand how to run the tests. (Specifically: http://devdocs.magento.com/guides/v2.1/extension-dev-guide/test/test_js-unit.html#run-js-unit-tests where it talks about running the tests from the command line)

  • the command line is using JsTestDriver which is found in jetbrains IDEs... Sep 1, 2016 at 9:18
  • No, it says: "If found, the script uses the custom jsTestDriver.php configuration file. Otherwise, the script uses the default jsTestDriver.php.dist configuration file." jsTestDriver.php.dist is included in dev/tests/js/JsTestDriver/jsTestDriver.php.dist Sep 1, 2016 at 15:08
  • jsTestDriver is a Google Code product, not JetBrains: code.google.com/archive/p/js-test-driver JetBrains has just included support for it in PhpStorm and its other IDEs. Sep 1, 2016 at 15:14
  • 1
    Here is a blog post that provides a walkthrough of using jsTestDriver and has no mention of PhpStorm: danieldyba.com/blog/2013/05/08/… Sep 1, 2016 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.