Question

I need a way to test my TypeScript files that integrates with Visual Studio's Test Explorer. For that I found an extension that does it, Chutzpah [codeplex].

The problem is that the current version of the extension does not work with TypeScript Generics.

Unfortunately that doesn't work with Generics. I hope they release an update.

class Foo<T>

When I use generics it crashes at

foo.ts (3,23): Expected '{'

If I remove Generics and change everything to any it works without any errors.

So, since it is open source, I was wondering how can I change it so it will run with a more update version of TypeScript.

How can I do that?

Était-ce utile?

La solution

Can't you just run the tests against the compiled JavaScript - then it wouldn't need to know anything about generics as they are erased by the TypeScript compiler.

You can still write all your tests in TypeScript, but at runtime use the plain JavaScript.

Update: new version of Chutzpah just got released with support for TypeScript 0.9!

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top