How to run Javascript tests? (JsTestDriver is not suited well)...

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

5 comments

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

0

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
0

Hi Elena, I have the same problem.
I think this is an issue. I have done these steps:

  1. create a project for Foundation
  2. created an index.html
  3. create a UserTest.js
  4. write a stupid test
  5. create a User.js
  6. write a code that pass the test
  7. found on web how to run a test
  8. create the file with .jstd extension
  9. run the test without success


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
0

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

0

ahhh thank you... now I see it.
Thanks
Bye
  R

0

Please sign in to leave a comment.