My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
IntelliJPlugin  
How to use the IntelliJ Plugin for JsTestDriver.
Updated Dec 30, 2011 by Sergey.S...@gmail.com

JsTestDriver IntelliJ plugin allows you to enjoy all the benefits of JsTestDriver right from the comfort of your IDE (WebStorm, PhpStorm, IntelliJ IDEA, RubyMine, PyCharm or AppCode).

It is the open-source project under the terms of Apache License 2.0.

Features

  • starting and stopping the server;
  • running and rerunning tests;
  • filtering and viewing test results, navigation from results to source code;
  • jumping from JavaScript exception stacktrace to source code;
  • support for JsTestDriver configuration file: syntax and error highlighting, basic completion, navigation to referenced files;
  • capturing messages sent to console.log();
  • support for Jasmine, QUnit and JsTestDriver built-in assertion frameworks:
    • quick-fixes for enabling global symbol reference resolving for each assertion framework (if you have QUnit or Jasmine tests in a project, you will be prompted to install the corresponding adapter);
    • contextual code generation actions (Alt+Insert) for creating new tests, setup and teardown methods for each assertion framework;
    • declarative HTML injection support for JsTestDriver built-in assertion framework.

Installation

Please visit Installation page.

Getting started

Please visit Getting Started page.

Releases & Changelog

You can check out the plugin page for more information about the releases.

Roadmap

You can find features that we are planning to implement in the future on the Roadmap page.

Issue tracker

If you've found a bug, a glitch or anything that doesn't work well, please file an issue in the WebStorm/PhpStorm project issue tracker (select "Plugin: JsTestDriver" subsystem when creating an issue).

Please don't file an issue in the http://code.google.com/p/js-test-driver/issues/list?q=label:IntelliJ. Those bugs are handled normally, but it's an old way.

For developers

If you are considering participation in the development of the plugin, or just going to build it yourself, please visit Development page.

Comment by ireney.b...@gmail.com, Nov 18, 2010

Hi guys, I have been using the Eclipse plugin, and just have been moving over to WebStorm? 2 EAP. I enjoyed the ability to run my tests on every file save ... is this possible in WebStorm?? The Eclipse run configuration allowed this with a simple checkbox tick ... any plans to support this in WebStorm? also?

Comment by project member aeagle22206, Nov 21, 2010

@Ireney: IntelliJ automatically saves your files, so you may as well use the keybinding for running the tests directly. Just replace ctrl-s (save) with shift-F10 (re-run) in your brain, and you'll get exactly the same behavior you're used to.

Comment by ken.eger...@gmail.com, Dec 13, 2010

Does this plugin work with IntelliJ 10? I can get the server running and it's green. I added src/main/js and src/test/js and put my javascript files in there. I then made a configuration file to point to:

load:

- src/main/js/.js - src/test/js/.js

I then made a configuration, pointed it to the configuration file (and I tried to either run inside the IDE or pointed to the server directly) but no tests run. It just does nothing at all.

Help?

Comment by alexea...@google.com, Jan 14, 2011

@Ken: make sure you've got the most recent version, which shouldn't have a Java dependency. It uses a more generic way to launch the test runner. It works for me in IDEA 10.

Comment by flah...@gmail.com, Jan 28, 2011

Can the IDEA plugin accept params/flags? I need to set the --basePath and --config flags.

Comment by monkeybo...@gmail.com, Feb 26, 2011

hi, noob question :o)

"Now just launch that config" - can you provide more detail - can you do this from the IDE or do you need to use the command line?

thanks

Comment by anton.ne...@gmail.com, Apr 4, 2011

It seems that plugin is broken in PHPStorm 2.0? There is an exception on the start of the project...

Comment by project member Sergey.S...@gmail.com, May 4, 2011

@Anton: Please update JsTestDriver?-plugin from plugin repository. Fixed version is already there.

Comment by plante...@gmail.com, Jul 28, 2011

So I tried checking out the source code to compile the IntelliJ-Plugin, but failed to find the newest version in SVN.

Where is version 1.3.5? :-)

Comment by project member Sergey.S...@gmail.com, Aug 1, 2011

Version 1.3.5 can be found at http://git.jetbrains.org/?p=idea/contrib.git;a=tree;f=JsTestDriver;h=57f655bfc53f67fa5259c211adffc01dd7e1d288;hb=HEAD .

$ git clone git://git.jetbrains.org/idea/contrib.git

Plugin source code is being moving to JetBrains? repo. We need to resolve a few problems to complete the moving.

If you want to sumbit a patch before moved is completed, you can create an issue at http://code.google.com/p/js-test-driver/issues/list and attach your patch to it.

After moving is done wiki page will be updated.

Comment by mistae...@gmail.com, Sep 18, 2011

May I ask what is the status of the repo transition?

I can't get the source from the jetbrains repo to build against IDEA 10.5.2. It seems that the HEAD is built against an IDEA OpenAPI version > 10.5.2? Is that observation correct?

What revision is the latest plugin release (1.3.5)?

Thank you!

Comment by project member Sergey.S...@gmail.com, Sep 20, 2011

Hi!

Repo transition is not finished yet.

The latest plugin release version is 1.3.5. I've updated plugin's source code in JetBrains? git repository, so now plugin can be built against IDEA 10.5.2.

Now I am working on the next JsTestDriver? plugin release. After that I'll focus on the repo transition. If you want to contribute, you can email me a patch or just describe your needs.

Any help is appreciated!

Comment by mistae...@gmail.com, Sep 22, 2011

Thank you, Sergey!

The code from the jetbrains repo now compiles nicely against 10.5.2!

I also have a version of the plugin compiling against the trunk of the jstestdriver core. Unfortunately, since the jstd 1.3.2 release, there have been some breaking API changes.

I wonder if there are any future plans/strategies to keep the core library and the plugin in sync. I will drop you an email!

Comment by gsha...@gmail.com, Sep 29, 2011

Would it be possible to configure how the auto-generated jstd files are generated for running Jasmine cases?

Our use case: We recently started adding Jasmine tests for a new feature we're building. The feature we're building has all the production JS files in a subdirectory of the project (e.g. project/production-js/tested-js/feature1. For future features, we're planning to put the production JS files in a similar subdirectory (e.g. project/production-js/tested-js/feature2). All of the jasmine tests are in project/js-tests/spec/feature1. We're planning something similar with future features (e.g. project/js-tests/spec/feature2)

The existing project has a ton of JS files all over the place, including project/production-js/. Unfortunately, there are no real tests for those JS files. In addition, some of the existing JS has DOM manipulation in it, which we don't want to test in js-test-driver.

We can run all the tests in project/js-tests/spec/feature1 by configuring the jsTestDriver.conf appropriately and setting up an IntelliJ run configuration. Unfortunately, this takes close to 20 seconds for 500 or so tests. It would be nice to be able to run individual tests in IntelliJ instead. However, whenever we try to run individual tests cases, the auto-generated jstd file has all of the JS files in the project, even those we don't want to test. It also includes JS files that are embedded in library jar files, which js-test-driver can't read and blows up.

A potential solution would be to provide a configuration option in the plugin for where the production JS files would come from (i.e. everything under project/production-js/tested-js/). The run configuration would created the generated jstd with only those files, in addition to the file that contains the JS test that we're trying to run.

If any of the above doesn't make sense or if I can help out, please let me know.

Thanks, George Shakhnazaryan

Comment by project member Sergey.S...@gmail.com, Sep 29, 2011

Hi George,

Thank you for the detailed report! Yes, there is a real need to configure a set of files/directories for a given file. Generally it's an issue for WebStorm?, because it will let us improve reference resolving. I'll try to investigate it. Anyway I have plans to improve jstd config automatic generation in a slightly another way.

-- Sergey Simonchik

Comment by liquidri...@gmail.com, Oct 13, 2011

Is it possible to debug the test cases within phpStorm using this plugin? I'm sorry I haven't found any way to do this if there is.

Comment by project member Sergey.S...@gmail.com, Oct 13, 2011

No, it's impossible to debug. This feature is planned.

Comment by mcmahon...@us.saic.com, Oct 14, 2011

Okay...so How DO I use JsTestDriver? with IntelliJ when I have never used JsTestDriver?. All this page has it how to install it, not use it.

Comment by mcmahon...@us.saic.com, Oct 14, 2011

It's been 3 hours, I'm looking at the Getting Started page which has little relevance to using the IntelliJ plugin. Through IntelliJ I have the serving running with Firefox captured.

But the Getting Started page states that the conf file will list the files to test and the files that will perform the tests. Yet the plugin has no conf file in the directory. I searched the hard drive that it is not there.

So how do I use this friggin plugin to test these files? You are not providing any kind of guidance just "You can install it".

How does the plugin know what files to test if the plugin doesn't have the conf file?

Comment by alexea...@google.com, Oct 17, 2011

mcmahon: Sorry this wasn't more clear. I'll update this page to indicate that you should still follow the GettingStarted instructions (http://code.google.com/p/js-test-driver/wiki/GettingStarted) to create the conf file.

Comment by stephen....@gmail.com, Feb 11, 2012

Jetbrains / IDEA users -- at the time of this writing, JetBrains? doesn't support debugging JSTestDriver tests within IDE. If you want to debug, you still would use chrome / firebug. I've created a youtrack request for adding feature in IDE debugging. Would appreciate your votes!

http://youtrack.jetbrains.net/issue/IDEA-81226

Thanks


Sign in to add a comment
Powered by Google Project Hosting