6f8676dd74
* Add karma, Jasmine, deps and karma.conf.js. Fixes #1291 * Improved service worker code * npm start script executes gulp watch task. * Written a gulp task to compile templates AOT. Get rid of loading deps in unit tests and a preprocessor. * PhantomJS package is deprecated. Use phantomjs-prebuilt instead. * Adjust `npm run test`.
51 lines
1.4 KiB
JavaScript
51 lines
1.4 KiB
JavaScript
describe('AppWelcomeController', function () {
|
|
var $controller, $rootScope, $scope, $location, MtApiManager, ErrorService,
|
|
ChangelogNotifyService, LayoutSwitchService;
|
|
|
|
beforeEach(module('myApp.controllers'));
|
|
|
|
beforeEach(function () {
|
|
ChangelogNotifyService = {
|
|
checkUpdate: function () {}
|
|
};
|
|
|
|
LayoutSwitchService = {
|
|
start: function () {}
|
|
};
|
|
|
|
MtpApiManager = {
|
|
getUserID: function () {
|
|
return {
|
|
then: function () {}
|
|
};
|
|
}
|
|
};
|
|
|
|
module(function ($provide) {
|
|
$provide.value('MtpApiManager', MtpApiManager);
|
|
});
|
|
|
|
inject(function (_$controller_, _$rootScope_, _$location_) {
|
|
$controller = _$controller_;
|
|
$rootScope = _$rootScope_;
|
|
$location = _$location_;
|
|
|
|
$scope = $rootScope.$new();
|
|
$controller('AppWelcomeController', {
|
|
$scope: $scope,
|
|
$location: $location,
|
|
MtpApiManager: MtpApiManager,
|
|
ErrorService: ErrorService,
|
|
ChangelogNotifyService: ChangelogNotifyService,
|
|
LayoutSwitchService: LayoutSwitchService
|
|
});
|
|
});
|
|
});
|
|
|
|
// https://stackoverflow.com/a/36460924
|
|
it('executes a dummy spec', function (done) {
|
|
expect(true).toBe(true);
|
|
done();
|
|
});
|
|
});
|