Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Commented Issue: Test cases grouped by class (MochaJS) [1547]

$
0
0
I'm trying to define a test class in TypeScript, similar to how you would do it for C#, and get the Test Explorer to show my tests grouped by class.

For instance, a test class similar to the one below:

```
import assert = require('assert');

export class TestClass {
public before() {

}

public Test1() {
assert.ok(true, "This shouldn't fail");
}

public Test2() {
assert.fail(false, "This should fail");
}
}

export var testClass = new TestClass();
```

In the Test Explorer, I was expecting to see something similar to the following, when grouping by class:

- TestClass
- Test1
- Test2

Right now, it shows each test case in its own test class:

- Test1
- Test 1
- Test2
- Test2

Do you know what would take to group tests by test class?
Thanks.

As a note:
I had to make small changes to the ...\IDE\Extensions\Microsoft\Node.js Tools for Visual Studio\1.0\TestFrameworks\Mocha\mocha.js to get the [exports](http://mochajs.org/#interfaces) way of writing tests to work with the VS plugin (attached).
Comments: I have written a new mocha.js to allow my purpose (integrate with mocha and writing tests using typescript classes directly). I have submitted a pull request to incorporate that to the VS tools. https://nodejstools.codeplex.com/SourceControl/network/forks/andrees/nodejstoolsforvs/contribution/7712

Viewing all articles
Browse latest Browse all 4630

Trending Articles