Skip to content

Commit

Permalink
update dependencies and fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Peischl committed Feb 19, 2018
1 parent 1ae6f7a commit 4d3ca6e
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 128 deletions.
15 changes: 8 additions & 7 deletions .angular-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"styles": [
"styles.scss"
],
"scripts": [
],
"scripts": [],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
Expand All @@ -38,13 +37,16 @@
},
"lint": [
{
"project": "src/tsconfig.app.json"
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json"
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json"
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
Expand All @@ -54,7 +56,6 @@
},
"defaults": {
"styleExt": "scss",
"component": {
}
"component": {}
}
}
141 changes: 70 additions & 71 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,77 +38,76 @@
},
"dependencies": {},
"devDependencies": {
"@angular/common": "5.2.5",
"@angular/compiler": "5.2.5",
"@angular/core": "5.2.5",
"@angular/forms": "5.2.5",
"@angular/http": "5.2.5",
"@angular/platform-browser": "5.2.5",
"@angular/platform-browser-dynamic": "5.2.5",
"@angular/router": "5.2.5",
"@ngx-translate/core": "9.1.1",
"@ngx-translate/http-loader": "2.0.1",
"core-js": "2.4.1",
"enhanced-resolve": "3.3.0",
"rxjs": "5.5.2",
"zone.js": "0.8.17",
"@angular/cli": "1.6.8",
"@angular/compiler-cli": "5.2.5",
"@angular/language-service": "5.2.5",
"@types/core-js": "0.9.36",
"@types/jasmine": "2.5.54",
"@types/jasminewd2": "2.0.2",
"@types/node": "7.0.7",
"autoprefixer": "8.0.0",
"circular-dependency-plugin": "4.4.0",
"codelyzer": "4.1.0",
"copy-webpack-plugin": "4.1.1",
"copyfiles": "1.2.0",
"cross-env": "5.0.5",
"css-loader": "0.28.9",
"cssnano": "3.10.0",
"electron": "1.8.2",
"electron-builder": "20.0.4",
"electron-reload": "1.2.2",
"exports-loader": "0.7.0",
"file-loader": "1.1.6",
"html-loader": "0.5.5",
"html-webpack-plugin": "2.30.1",
"istanbul-instrumenter-loader": "3.0.0",
"jasmine-core": "2.8.0",
"jasmine-spec-reporter": "4.2.1",
"json-loader": "0.5.7",
"karma": "1.7.1",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.3.0",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"karma-sourcemap-loader": "0.3.7",
"less-loader": "4.0.5",
"minimist": "1.2.0",
"mkdirp": "0.5.1",
"npm-run-all": "4.1.2",
"npx": "9.7.1",
"postcss-loader": "2.1.0",
"postcss-url": "7.3.0",
"postcss-custom-properties": "6.2.0",
"protractor": "5.3.0",
"raw-loader": "0.5.1",
"sass-loader": "6.0.6",
"script-loader": "0.7.2",
"source-map-loader": "0.2.3",
"style-loader": "0.20.1",
"stylus-loader": "3.0.1",
"ts-node": "4.1.0",
"tslint": "5.9.1",
"typescript": "2.6.2",
"uglifyjs-webpack-plugin": "1.1.8",
"url-loader": "0.6.2",
"webdriver-manager": "12.0.6",
"webpack": "3.11.0",
"webpack-concat-plugin": "2.4.2",
"webpack-dev-server": "2.11.1"
"@angular/cli": "~1.7.0",
"@angular/common": "^5.2.5",
"@angular/compiler": "^5.2.5",
"@angular/compiler-cli": "^5.2.5",
"@angular/core": "^5.2.5",
"@angular/forms": "^5.2.5",
"@angular/http": "^5.2.5",
"@angular/language-service": "^5.2.5",
"@angular/platform-browser": "^5.2.5",
"@angular/platform-browser-dynamic": "^5.2.5",
"@angular/router": "^5.2.5",
"@ngx-translate/core": "^9.1.1",
"@ngx-translate/http-loader": "^2.0.1",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "^2.0.3",
"@types/node": "^9.4.6",
"autoprefixer": "^8.0.0",
"circular-dependency-plugin": "^4.4.0",
"codelyzer": "^4.1.0",
"copy-webpack-plugin": "~4.4.1",
"copyfiles": "^1.2.0",
"core-js": "^2.4.1",
"cross-env": "^5.1.3",
"css-loader": "^0.28.9",
"cssnano": "^3.10.0",
"electron": "^1.8.2",
"electron-builder": "^20.0.5",
"electron-reload": "^1.2.2",
"enhanced-resolve": "^3.4.1",
"exports-loader": "^0.7.0",
"file-loader": "^1.1.6",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^2.30.1",
"istanbul-instrumenter-loader": "^3.0.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"json-loader": "^0.5.7",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "^1.0.1",
"karma-coverage-istanbul-reporter": "^1.4.1",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-sourcemap-loader": "^0.3.7",
"less-loader": "^4.0.5",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
"npm-run-all": "^4.1.2",
"npx": "^9.7.1",
"postcss-custom-properties": "^7.0.0",
"postcss-loader": "^2.1.0",
"postcss-url": "^7.3.0",
"protractor": "~5.3.0",
"raw-loader": "^0.5.1",
"rxjs": "^5.5.6",
"sass-loader": "^6.0.6",
"script-loader": "^0.7.2",
"source-map-loader": "^0.2.3",
"style-loader": "^0.20.2",
"stylus-loader": "^3.0.1",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.6.2",
"uglifyjs-webpack-plugin": "^1.2.0",
"url-loader": "^0.6.2",
"webdriver-manager": "^12.0.6",
"webpack": "~3.11.0",
"webpack-concat-plugin": "^2.4.2",
"webpack-dev-server": "^2.11.1",
"zone.js": "^0.8.20"
},
"license": "SEE LICENSE IN LICENSE.md"
}
6 changes: 5 additions & 1 deletion src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
import { ElectronService } from 'app/providers/electron.service';
import { TranslateModule } from '@ngx-translate/core';

describe('AppComponent', () => {
beforeEach(async(() => {
Expand All @@ -12,7 +13,10 @@ describe('AppComponent', () => {
providers : [
ElectronService
],
imports: [RouterTestingModule]
imports: [
RouterTestingModule,
TranslateModule.forRoot()
]
}).compileComponents();
}));

Expand Down
4 changes: 2 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'zone.js/dist/zone-mix';
import 'reflect-metadata';
import 'polyfills';
import '../polyfills';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
Expand All @@ -15,7 +15,7 @@ import { TranslateHttpLoader } from '@ngx-translate/http-loader';

import { ElectronService } from './providers/electron.service';

import { WebviewDirective } from 'app/directives/webview.directive';
import { WebviewDirective } from './directives/webview.directive';

import { AppComponent } from './app.component';
import { HomeComponent } from './components/home/home.component';
Expand Down
12 changes: 4 additions & 8 deletions src/app/components/home/home.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { HomeComponent } from './home.component';
import { TranslateModule } from '@ngx-translate/core';

describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ HomeComponent ]
declarations: [ HomeComponent ],
imports: [ TranslateModule.forRoot() ]
})
.compileComponents();
}));
Expand All @@ -23,16 +25,10 @@ describe('HomeComponent', () => {
expect(component).toBeTruthy();
});

it(`should have as title 'App works !'`, async(() => {
fixture = TestBed.createComponent(HomeComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('App works !');
}));

it('should render title in a h1 tag', async(() => {
fixture = TestBed.createComponent(HomeComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('App works !');
expect(compiled.querySelector('h1').textContent).toContain('PAGES.HOME.TITLE');
}));
});
36 changes: 24 additions & 12 deletions src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,37 +31,49 @@
// import 'core-js/es6/array';
// import 'core-js/es6/regexp';
// import 'core-js/es6/map';
// import 'core-js/es6/weak-map';
// import 'core-js/es6/set';

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js'; // Run `npm install --save classlist.js`.

/** IE10 and IE11 requires the following to support `@angular/animation`. */
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/** IE10 and IE11 requires the following for the Reflect API. */
// import 'core-js/es6/reflect';


/** Evergreen browsers require these. **/
import 'core-js/es6/reflect';
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
import 'core-js/es7/reflect';


/** ALL Firefox browsers require the following to support `@angular/animation`. **/
/**
* Required to support Web Animations `@angular/platform-browser/animations`.
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
**/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.

/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
*/

// (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
// (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
// (window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames

/*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*/
// (window as any).__Zone_enable_cross_context_check = true;

/***************************************************************************************************
* Zone JS is required by Angular itself.
* Zone JS is required by default for Angular itself.
*/
import 'zone.js/dist/zone-mix'; // Included with Angular CLI.
import 'zone.js/dist/zone-mix'; // Included with Angular CLI.



/***************************************************************************************************
* APPLICATION IMPORTS
*/

/**
* Date, currency, decimal and percent pipes.
* Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10
*/
// import 'intl'; // Run `npm install --save intl`.
14 changes: 1 addition & 13 deletions src/test.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'zone.js/dist/long-stack-trace-zone';
import 'zone.js/dist/proxy.js';
import 'zone.js/dist/sync-test';
import 'zone.js/dist/jasmine-patch';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
declare const __karma__: any;
declare const require: any;

// Prevent Karma from running prematurely.
__karma__.loaded = function () {};

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
Expand All @@ -28,5 +18,3 @@ getTestBed().initTestEnvironment(
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
// Finally, start Karma to run the tests.
__karma__.start();
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"node_modules/@types"
],
"lib": [
"es2016",
"es2017",
"dom"
]
},
Expand Down
Loading

0 comments on commit 4d3ca6e

Please sign in to comment.