Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run angularJS tests in intellij idea 11.1.3?

I am new to AngularJS to JS in general. Now I want to use JSTestDriver and behavior driven development framework Jasmin . As I understood AngularJS works with Jasmine and test driver. I am working with Ideal Intellij 11.1.3. I added the plug in for JsTestdriver to It and run some test as described here http://code.google.com/p/js-test-driver/wiki/IntelliJPlugin. Now here is the problem. When I write some Jasmine tests like this one

describe("A suite", function() {
    it("contains spec with an expectation", function() {
        expect(true).toBe(true);
    });
});

, for the first time indea intellij asked me to download the jasmine adapter and I did, but when I run the test I got this message : unable to attach test reporter to test framework intellij. I searched google for solutions, some guy posted how to run the angular tutorials: here : https://groups.google.com/forum/?fromgroups=#!topic/angular/LdjNsZD69Uk.

he uses a configuration files that comes with Angular js. and Node.js should I install them too ? isn't there any way to automatically do this from ideal intellij ?

What files structure should I have ?

Any help, link or suggestion will be great.

I fixed my jsTestDriver.conf file and it's paths, but now I get this problem :

Testing started at 1:31 PM ...

Cannot read [
/tmp/.m2/repository/org/testng/testng/6.7/testng-6.7.jar!/testng-reports.js
    /home/clouway/.m2/repository/org/testng/testng/6.7/testng-6.7.jar!/testng-reports.js
] derived from .m2/repository/org/testng/testng/6.7/testng-6.7.jar!/testng-reports.js
Cannot read [
/tmp/.m2/repository/org/testng/testng/6.7/testng-6.7.jar!/jquery-1.7.1.min.js
    /home/clouway/.m2/repository/org/testng/testng/6.7/testng-6.7.jar!/jquery-1.7.1.min.js
] derived from .m2/repository/org/testng/testng/6.7/testng-6.7.jar!/jquery-1.7.1.min.js
    at com.google.jstestdriver.PathResolver.resolve(PathResolver.java:98)
    at com.google.jstestdriver.config.ParsedConfiguration.resolvePaths(ParsedConfiguration.java:99)
    at com.google.jstestdriver.config.Initializer.initialize(Initializer.java:86)
    at com.google.jstestdriver.embedded.JsTestDriverImpl.createRunnerInjector(JsTestDriverImpl.java:368)
    at com.google.jstestdriver.embedded.JsTestDriverImpl.runConfigurationWithFlags(JsTestDriverImpl.java:342)
    at com.google.jstestdriver.embedded.JsTestDriverImpl.runConfiguration(JsTestDriverImpl.java:233)
    at com.google.jstestdriver.idea.TestRunner.runTests(TestRunner.java:195)
    at com.google.jstestdriver.idea.TestRunner.executeTestCase(TestRunner.java:131)
    at com.google.jstestdriver.idea.TestRunner.unsafeExecuteConfig(TestRunner.java:122)
    at com.google.jstestdriver.idea.TestRunner.executeConfig(TestRunner.java:97)
    at com.google.jstestdriver.idea.TestRunner.executeAll(TestRunner.java:88)
    at com.google.jstestdriver.idea.TestRunner.main(TestRunner.java:330)

Empty test suite.

I Use maven as my build tool.

like image 880
Adelin Avatar asked Oct 07 '22 16:10

Adelin


1 Answers

I haven't used JSTestDriver in IntelliJ, so I can't address your question directly. However, AngularJS has moved from JSTestDriver to using Testacular (http://vojtajina.github.com/testacular/), so you might want to do the same. The link includes some setup help getting it running in WebStorm which should be the same.

Looks like he's renamed it "Karma" (http://karma-runner.github.com/)

like image 105
Chris Avatar answered Oct 10 '22 01:10

Chris