This Question is Answered

1 "correct" answer available (4 pts) 1 "helpful" answer available (2 pts)
5 Replies Last post: Dec 23, 2013 12:04 PM by Roberto Simoni  
Roberto Simoni Newbie 4 posts since
Dec 18, 2013
Currently Being Moderated

Dec 18, 2013 8:26 PM

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

Elena Pogorelova Apprentice 919 posts since
Oct 5, 2011
Currently Being Moderated
Dec 19, 2013 6:02 PM in response to: Roberto Simoni
Re: How to run Javascript tests? (JsTestDriver is not suited well)...

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

Attachments:
Elena Pogorelova Apprentice 919 posts since
Oct 5, 2011
Currently Being Moderated
Dec 20, 2013 1:47 PM in response to: Roberto Simoni
Re: How to run Javascript tests? (JsTestDriver is not suited well)...

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

More Like This

  • Retrieving data ...