generator-confit
Version:
Yeoman generator for creating the development process, tools and a sample project for current-generation web applications
50 lines (35 loc) • 954 B
JavaScript
;
import app from '../app';
import demoModule from '../demoModule';
describe('Basic unit test', function () {
var adder = function (x, y) {
return x + y;
};
it('should add two numbers together', function () {
expect(adder(2, 3)).toEqual(5);
});
});
describe('Test imported module', function () {
var demoService;
beforeEach(function() {
angular.mock.module(demoModule);
angular.mock.inject(function(_demoService_) {
demoService = _demoService_;
});
});
it('should have a demoService with a demo method', function () {
expect(typeof demoService.demo).toEqual('function');
});
});
describe('Changing pages', function () {
var $location;
beforeEach(function() {
angular.mock.module(demoModule);
angular.mock.inject(function(_$location_) {
$location = _$location_;
});
});
it('should go to the default page', function () {
$location.path('/');
});
});