angular-nevera-generator
Version:
Yeoman AngularJS scaffold a webapp with Angular 1 written in ES6 (Babel), TypeScript through Webpack or SystemJS including tools Gulp 4, ESLint, Browsersync and Karma
20 lines (17 loc) • 747 B
text/typescript
import * as angular from 'angular';
import 'angular-mocks';
import {header} from './header';
describe('header component', () => {
beforeEach(() => {
angular
.module('fountainHeader', ['<%- templateUrl %>'])
.component('fountainHeader', header);
<%- modules !== 'systemjs' ? 'angular.mock.' : '' %>module('fountainHeader');
});
it('should render \'Fountain Generator\'', <%- modules !== 'systemjs' ? 'angular.mock.' : '' %>inject(($rootScope: ng.IRootScopeService, $compile: ng.ICompileService) => {
const element = $compile('<fountain-header></fountain-header>')($rootScope);
$rootScope.$digest();
const header = element.find('a');
expect(header.html().trim()).toEqual('Fountain Generator');
}));
});