Im currently involved in a project that has used typescript to build its single page anuglar app. Unfortunately they have done no unit testing. Being new to using typescript i am having problems getting any testing going. An example test is below. followed by the typescript file
When i run the test it fails to find the controller !
(function() {
'use strict';
describe('CarController', function() {
// Load the controllers module
beforeEach(module('CarDealerApp'));
var scope,
CarController ;
beforeEach(inject(function($controller) {
scope = {};
CarController = $controller('CarController', {
$scope: scope
});
}));
it('should set the car name', function() {
expect(scope.carMake).toEqual('Ford');
});
});
})();
module CarDealerApp.Cars.Controllers {
"use strict";
export interface ICarScope extends angular.Scope {
carName : string;
}
export class CarController {
carName:string = "Ford";
// $inject annotation
public static $inject = [
'$scope'
]
constructor(private $scope: ICarScope){
$scope.vm = this;
}
}
}