feat(test): add testing infrastructure: karma, jasmine and chrome (#982)

This commit is contained in:
Deilan 2017-04-17 16:05:45 +03:00 committed by Lex Zhukov
parent b95abbd48d
commit 4420048bfe
9 changed files with 1389 additions and 56 deletions

View file

@ -0,0 +1,42 @@
import { NO_ERRORS_SCHEMA } from '@angular/core';
import {
inject,
async,
TestBed,
ComponentFixture
} from '@angular/core/testing';
// Load the implementations that should be tested
import { App } from './app.component';
import { GlobalState } from './global.state';
import { BaImageLoaderService, BaThemeSpinner } from './theme/services';
import { BaThemeConfigProvider } from './theme/theme.configProvider';
import { BaThemeConfig } from './theme/theme.config';
describe(`App`, () => {
let comp: App;
let fixture: ComponentFixture<App>;
// async beforeEach
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ App ],
schemas: [NO_ERRORS_SCHEMA],
providers: [GlobalState, BaImageLoaderService, BaThemeSpinner, BaThemeConfigProvider, BaThemeConfig]
})
.compileComponents(); // compile template and css
}));
// synchronous beforeEach
beforeEach(() => {
fixture = TestBed.createComponent(App);
comp = fixture.componentInstance;
fixture.detectChanges(); // trigger initial data binding
});
it(`should be readly initialized`, () => {
expect(fixture).toBeDefined();
expect(comp).toBeDefined();
});
});

View file

@ -1,3 +1,3 @@
$roboto-font-path: "~roboto-fontface/fonts/";
$roboto-font-path: "~roboto-fontface/fonts";
@import "~roboto-fontface/css/roboto/sass/roboto-fontface";