fix/ Fix npm run lint

This commit is contained in:
Maxime GRIS
2017-06-08 12:55:53 +02:00
parent 7e71add264
commit db7972aca4
7 changed files with 103 additions and 76 deletions

View File

@@ -9,7 +9,7 @@ import { ElectronService } from './providers/electron.service';
export class AppComponent {
constructor(public electronService: ElectronService) {
if(electronService.isElectron()) {
if (electronService.isElectron()) {
console.log('Mode electron');
// Check if electron is correctly injected (see externals in webpack.config.js)
console.log('c', electronService.ipcRenderer);

View File

@@ -24,13 +24,13 @@ describe('HomeComponent', () => {
});
it(`should have as title 'App works !'`, async(() => {
const fixture = TestBed.createComponent(HomeComponent);
fixture = TestBed.createComponent(HomeComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('App works !');
}));
it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(HomeComponent);
fixture = TestBed.createComponent(HomeComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('App works !');

View File

@@ -12,7 +12,7 @@ export class ElectronService {
childProcess: typeof childProcess;
constructor() {
//Conditional imports
// Conditional imports
if (this.isElectron()) {
this.ipcRenderer = window.require('electron').ipcRenderer;
this.childProcess = window.require('child_process');

View File

@@ -13,8 +13,8 @@ import {
} from '@angular/platform-browser-dynamic/testing';
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
declare var __karma__: any;
declare var require: any;
declare const __karma__: any;
declare const require: any;
// Prevent Karma from running prematurely.
__karma__.loaded = function () {};