How to run Javascript tests? (JsTestDriver is not suited well)... Follow
Hi I'm trying to run a test in Javascript. The greeter example provided here http://blog.jetbrains.com/webide/2011/10/javascript-unit-testing-support/ runs correctly.
When I change something I'll obtain:
No tests found. Please check 'test:' section of the configuration file.
Empty test suite.
The file fuckingme.jstd contains:
load:
- ./src/User.js
test:
- ./test/UserTest.js
I have also tested it without ./
The file User.js contains:
function User(firstName, lastName, birthDate) {
this.firstName = firstName;
this.lastName = lastName;
this.birthDate = birthDate;
};
The file UserTest.js contains:
TestCase("UserTest", {
"this is a test you mother fucker of an ide": function() {
var user = new User("Mario", "Rossi", new Date());
assertNull(user.birthDate);
}
});
any idea on how can I run it?
Thanks bye
R
Please sign in to leave a comment.
I'll suggest to create a new project (e.g. a Foundation), then add some directory to that.
You'll not able to run any test.
R
Hello!
don't you see a warning shown for your TestCase in the editor: 'TestCase has no tests. Tests names should have test prefix'?
Also, the config should be:
load:
- src/User.js
test:
- test/UserTest.js
I'm attaching the modified greeter sample that works for me
Attachment(s):
greeter-sample.zip
Hi Elena, I have the same problem.
I think this is an issue. I have done these steps:
When I opened the greeter-example it runs correctly?!?
There are 3 files and I do not understand how the content of those files can produce a message that says "No tests found".
I have attached a screenshot to show content of files...
I'm trying Webstorm for Linux and I have an Ubuntu with Oracle JDK 1.6 (if can help).
Thanks bye
R
Attachment(s):
webstorm.png
Hello!
- Foundation has nothing to do with the problem
- as far as I can see from screenshot, you haven't changed the test name to include the 'test' prefix, as I suggested above. Please see the sample project attached to my previous post - it includes the working version of your UserTest
Best regards,
Lena
ahhh thank you... now I see it.
Thanks
Bye
R