Debugging unit tests Larry Eitel Created July 03, 2013 14:26 Is there a way to debug/step through jasmine unit tests?
Hi Larry,
sure, it's supported via JSTestDriver integration. See http://www.jetbrains.com/webstorm/webhelp/enabling-javascript-unit-testing-support.html#d14643e782 and http://www.jetbrains.com/webstorm/webhelp/debugging-javascript-unit-tests.html for more information
Best regards,
Lena
I am making progress. Although I have the following in my jsTestDriver.conf:
load:
- test/vendor/jasmine/jasmine.js
- test/vendor/jasmine-jstd-adapter/*
- vendor/angular/angular.js
- src/**/*.js
I go to run a test and get.
"c:\program files (x86)\jetbrains\webstorm 6.0.1\jre\jre\bin\java" -cp "C:\Users\Larry\Google Drive\ProgramSettings\WebStorm6\config\plugins\JsTestDriver\lib\JsTestDriver-plugin-rt.jar;C:\Users\Larry\Google Drive\ProgramSettings\WebStorm6\config\plugins\JsTestDriver\lib\JsTestDriver-1.3.5-patched.jar;C:\Program Files (x86)\JetBrains\WebStorm 6.0.1\lib\guava-12.0.jar;C:\Program Files (x86)\JetBrains\WebStorm 6.0.1\lib\gson-2.2.1.jar" com.google.jstestdriver.idea.TestRunner --server_url=http://localhost:9876 --config_files=C:/Users/Larry/__prjs/ourfield/client/jsTestDriver.conf --tests=security --debug=true
Testing started at 2:24 PM ...
Uncaught TypeError: Cannot read property 'prototype' of undefined C:/Users/Larry/__prjs/ourfield/client/test/vendor/jasmine/jasmine.js:402
Uncaught TypeError: Cannot read property 'prototype' of undefined C:/Users/Larry/__prjs/ourfield/client/test/vendor/jasmine/jasmine.js:402
jasmine.util.inherit C:/Users/Larry/__prjs/ourfield/client/test/vendor/jasmine/jasmine.js:402
C:/Users/Larry/__prjs/ourfield/client/test/vendor/jasmine-jstd-adapter/JasmineAdapter.js:42
C:/Users/Larry/__prjs/ourfield/client/test/vendor/jasmine-jstd-adapter/JasmineAdapter.js:155
The jasmine files are there. But can't explain why the error.
By the way, I AM able to run tests using sample GreeterTest project.
Hi Larry,
some needed dependencies must be missing (angular-resource, angular-mocks)? Please find the sample AngularJS+Jasmine+JSTestDriver project attached - it works fine for me
Best regards,
Lena
Attachment(s):
angularJSTD.zip
Thank you Lena,
That was very helpful.
Larry