Help With JavaScript Unit Testing - Sample Does Not Work

I believe that I followed these instructions correctly http://blog.jetbrains.com/webide/2011/10/javascript-unit-testing-support/, but the result I get is:

"c:\program files (x86)\java\jre6\bin\java" -cp
C:\Users\keithdavis\.WebIde50\config\plugins\JsTestDriver\lib\JsTestDriver-plugin-rt.jar;C:\Users\keithdavis\.WebIde50\config\plugins\JsTestDriver\lib\JsTestDriver-1.3.4.b.jar
com.google.jstestdriver.idea.TestRunner --server_url=http://localhost:9876 --config_files=C:/inetpub/jstest/greeter.jstd
Testing started at 10:38 AM ...
Empty test suite.

Process finished with exit code 0

What could I be doing wrong?

6 comments
Comment actions Permalink

Hey Keith,

Unfortunately I can't reproduce it.
Can I ask you to attach here your project, IDE version and JsTestDriver plugin version?

One more thing I'd like to ask you about.
Please run tests in IDE once again to get above-mentioned wrong console output:


<command>
Testing started at 10:38 AM ...
Empty test suite.

Process finished with exit code 0


After that execute <command> in terminal and paste here its stdout and stderr.
Thanks!

0
Comment actions Permalink

PHPStorm 121.322

Plugin version: 121.215, JsTestDriver-1.3.4.b

Project attached.

Here is the command:

"c:\program files (x86)\java\jre6\bin\java" -cp C:\Users\keithdavis\.WebIde50\config\plugins\JsTestDriver\lib\JsTestDriver-plugin-rt.jar;C:\Users\keithdavis\.WebIde50\config\plugins\JsTestDriver\lib\JsTestDriver-1.3.4.b.jar com.google.jstestdriver.idea.TestRunner --server_url=http://localhost:9876 --config_files=C:/inetpub/jstest/greeter.jstd --debug=true

(FYI, on Windows 7 x64)

Result from running on command line: nothing. It appears to never finish (control never returns to command line)



Attachment(s):
jstest.zip
0
Comment actions Permalink

The last command has "--debug=true" at its end, so it was debugging,
What browser did you capture for debugging? It can wait for connection in case of Chrome. But it should work properly in case of Firefox.

The first command don't have "--debug=true", so it was running.
According to the console output from the first your post, tests were not run successfully: "Empty test suite." message was reported.
Please paste here output of running <command>.

0
Comment actions Permalink

Yes, I know it was debugging, but that doesn't affect the test results in PHPStorm. With or without --debug=true, I get Empty Test Suite.

However, without the --debug=true on the command line, I do get a result. So, using this:

"c:\program files (x86)\java\jre6\bin\java" -cp C:\Users\keithdavis\.WebIde50\config\plugins\JsTestDriver\lib\JsTestDriver-plugin-rt.jar;C:\Users\keithdavis\.WebIde50\config\plugins\JsTestDriver\lib\JsTestDriver-1.3.4.b.jar com.google.jstestdriver.idea.TestRunner --server_url=http://localhost:9876 --config_files=C:/inetpub/jstest/greeter.jstd

I get:

C:\Windows\System32>"c:\program files (x86)\java\jre6\bin\java" -cp C:\Users\keithdavis\.WebIde50\config\plugins\JsTestDriver\lib\JsTestDriver-plugin-rt.jar;C:\Users\keithdavis\.WebIde50\config\plugins\JsTestDriver\lib\JsTestDriver-1.3.4.b.jar com.google.jstestdriver.idea.TestRunner --server_url=http://localhost:9876 --config_files=C:/inetpub/jstest/greeter.jstd

##teamcity[testSuiteStarted nodeId='1' parentNodeId='0' locationHint='config://C
:\inetpub\jstest\greeter.jstd' name='greeter.jstd']
##teamcity[testSuiteStarted nodeId='2' parentNodeId='1' name='Chrome 22.0.1229.9
4 Windows' nodeType='browser' nodeArgs='C:\\inetpub\\jstest,Chrome 22.0.1229.94
Windows']
##teamcity[testSuiteStarted nodeId='3' parentNodeId='2' locationHint='testCase:/
/C\:\\inetpub\\jstest\\test\\GreeterTest.js:GreeterTest' name='GreeterTest']
##teamcity[testStarted nodeId='4' parentNodeId='3' locationHint='test://C\:\\ine
tpub\\jstest\\test\\GreeterTest.js:GreeterTest:test greet' name='test greet']
##teamcity[testStarted nodeId='5' parentNodeId='3' locationHint='test://C\:\\ine
tpub\\jstest\\test\\GreeterTest.js:GreeterTest:test greet null' name='test greet
null']
##teamcity[testFinished nodeId='4' duration='0']
##teamcity[testFailed nodeId='5' message='AssertError: expected null but was "He
llo null!"' details='    at Object.TestCase.test greet null (http://localhost:98
76/test/test/GreeterTest.js:8:9)|r|n|r|n' duration='1']
##teamcity[testSuiteFinished nodeId='3']
##teamcity[testSuiteFinished nodeId='2']
##teamcity[testSuiteFinished nodeId='1']


So, it does appear to be working on the command line, but not in PHPStorm.

File as a bug?

0
Comment actions Permalink

Yes, please file an issue.

0
Comment actions Permalink

I just updated to 5.0.3 and updated the JSTestDriver Plugin for http://youtrack.jetbrains.com/printIssue?issue=25-479722 and now it works:

"c:\program files (x86)\java\jre6\bin\java" -cp C:\Users\keithdavis\.WebIde50\config\plugins\JsTestDriver\lib\JsTestDriver-plugin-rt.jar;C:\Users\keithdavis\.WebIde50\config\plugins\JsTestDriver\lib\JsTestDriver-1.3.5-patched.jar com.google.jstestdriver.idea.TestRunner --server_url=http://localhost:9876 --config_files=C:/inetpub/jstest/greeter.jstd
Testing started at 11:44 AM ...
AssertError: expected null but was "Hello null!"
    at Object.TestCase.test greet null (http://localhost:9876/test/test/GreeterTest.js:8:9)

Process finished with exit code 0

0

Please sign in to leave a comment.