Quantcast
Channel: Chutzpah - A JavaScript Test Runner
Viewing all articles
Browse latest Browse all 1864

Reopened Unassigned: Using Chutzpah to run Typescript qUnit tests - VS2012 [177]

$
0
0
Hi there,

I've recently tried to implement Chutzpah and qUnit to test some typescript code and have come up with an issue where I can run Chutzpah no problems to test a simple ok("yey" === "yey", "oh no!") assertion in qUnit, but as soon as I try to dip into my TypeScript code I get:

```
'undefined' is not a constructor (evaluating 'new DMC.TreeBurst.Node({
id: 1,
parentId: null,
title: ""
})')
```

The DMC.TreeBurst.Node is a TypeScript class and my test is a simple demo:
```

///<reference path="../typings/qunit/qunit.d.ts" />
///<reference path="references.ts">
///<reference path="references.js">

module DMC.TreeBurst {

QUnit.module("TreeBurst.Node.ts tests");

test("Load-a-single-node-creates-correctly", () => {

var node = [new DMC.TreeBurst.Node({
id: 1,
parentId: null,
title: ""
})];

ok(node, "Node not create correctly with valid constructor parameters");

});
}
```

I believe it may be some kind of namespacing/referencing issue as when I take the test out of my DMC.TreeBurst module it tells me it's unable to resolve DMC (the root namespace for my typescript application).

Are there any tricks and tips on using Chutzpah with TypeScript and qUnit? I'd very much appreciate any suggestions or ideas.

Kind Regards,

Doug

P.S. Also posted the same question on SO:

http://stackoverflow.com/questions/19986705/using-chutzpah-to-run-typescript-qunit-tests

Viewing all articles
Browse latest Browse all 1864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>