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`.
24 lines
751 B
JavaScript
24 lines
751 B
JavaScript
describe('myHead directive', function () {
|
|
var $compile, $rootScope;
|
|
|
|
beforeEach(module('myApp.templates'));
|
|
beforeEach(module('myApp.directives'));
|
|
|
|
beforeEach(inject(function (_$compile_, _$rootScope_) {
|
|
$compile = _$compile_;
|
|
$rootScope = _$rootScope_;
|
|
}));
|
|
|
|
it('compiles a my-head attribute', function () {
|
|
var compiledElement = $compile('<div my-head></div>')($rootScope);
|
|
$rootScope.$digest(); // Fire watchers
|
|
expect(compiledElement.html()).toContain('tg_page_head');
|
|
});
|
|
|
|
it('compiles a my-head element', function () {
|
|
var compiledElement = $compile('<my-head></my-head>')($rootScope);
|
|
$rootScope.$digest(); // Fire watchers
|
|
expect(compiledElement.html()).toContain('tg_page_head');
|
|
});
|
|
});
|