mardi 27 janvier 2015

Unit testing typescript classes with jest ("Cannot read property '__extends' of null")

I am trying to test class "a" (which inherits from class "b") with jest. The typescript compiler prepends the file compiled javascript of "a" with



var __extends = this.__extends || function (d, b) { ... };


unfortunately this is null, when running the unit test, so I am getting



Cannot read property '__extends' of null


I am using jest-cli@0.2.1 to run the tests and typescript@1.4.1 to compile my typescript files.


Does someone know how to get around that issue?


Aucun commentaire:

Enregistrer un commentaire