1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2025-01-14 14:43:17 +08:00

update packages

This commit is contained in:
Braun Patrik 2016-03-19 10:55:46 +01:00
parent c186770a50
commit ffc8574b79
5 changed files with 24 additions and 29 deletions

View File

@ -8,26 +8,30 @@ import {
TestComponentBuilder TestComponentBuilder
} from 'angular2/testing'; } from 'angular2/testing';
import {Component, provide} from 'angular2/core'; import {provide} from 'angular2/core';
import {AuthenticationService} from "../../../frontend/app/model/authentication.service"; import {AuthenticationService} from "./authentication.service";
import {UserService} from "./user.service"; import {UserService} from "./user.service";
import {User} from "../../../common/entities/User";
import {Message} from "../../../common/entities/Message";
import "rxjs/Rx";
import {LoginCredential} from "../../../common/entities/LoginCredential";
class MockUserService {
public login(credential:LoginCredential){
return Promise.resolve(new Message<User>(null,new User()))
}
}
describe('LoginService', () => { describe('LoginService', () => {
beforeEachProviders(() => [ beforeEachProviders(() => [
provide(UserService, { provide(UserService, {useClass: MockUserService}),
useFactory: function() {
return {login() {}};
}
}),
AuthenticationService AuthenticationService
]); ]);
it('should call User service login', inject([ AuthenticationService,UserService ], (authService, userService) => { it('should call User service login', inject([ AuthenticationService,UserService ], (authService, userService) => {
spyOn(userService,"login"); spyOn(userService,"login").and.callThrough();
expect(userService.login).not.toHaveBeenCalled(); expect(userService.login).not.toHaveBeenCalled();
authService.login(); authService.login();
expect(userService.login).toHaveBeenCalled(); expect(userService.login).toHaveBeenCalled();

View File

@ -21,16 +21,16 @@
"url": "https://github.com/bpatrik/PiGallery2/issues" "url": "https://github.com/bpatrik/PiGallery2/issues"
}, },
"dependencies": { "dependencies": {
"angular2": "^2.0.0-beta.10", "angular2": "^2.0.0-beta.11",
"core-js": "^2.2.1",
"debug": "^2.2.0", "debug": "^2.2.0",
"es6-promise": "^3.1.2", "es6-promise": "^3.1.2",
"es6-shim": "^0.33.13", "es6-shim": "^0.35.0",
"es7-reflect-metadata": "^1.6.0", "es7-reflect-metadata": "^1.6.0",
"express": "^4.13.4", "express": "^4.13.4",
"express-session": "^1.13.0", "express-session": "^1.13.0",
"karma-jasmine": "^0.3.8",
"morgan": "^1.7.0", "morgan": "^1.7.0",
"protractor": "^3.2.0", "protractor": "^3.2.1",
"reflect-metadata": "0.1.2", "reflect-metadata": "0.1.2",
"rxjs": "^5.0.0-beta.2", "rxjs": "^5.0.0-beta.2",
"ts-loader": "^0.8.1", "ts-loader": "^0.8.1",
@ -41,7 +41,6 @@
"zone.js": "^0.6.4" "zone.js": "^0.6.4"
}, },
"devDependencies": { "devDependencies": {
"awesome-typescript-loader": "^0.16.0-rc.0",
"compression-webpack-plugin": "^0.3.0", "compression-webpack-plugin": "^0.3.0",
"copy-webpack-plugin": "^1.1.1", "copy-webpack-plugin": "^1.1.1",
"css-loader": "^0.23.1", "css-loader": "^0.23.1",
@ -65,7 +64,6 @@
"karma-sourcemap-loader": "^0.3.7", "karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "1.7.0", "karma-webpack": "1.7.0",
"ng2lint": "0.0.10", "ng2lint": "0.0.10",
"phantomjs-polyfill": "0.0.2",
"phantomjs-prebuilt": "^2.1.4", "phantomjs-prebuilt": "^2.1.4",
"protractor": "^3.1.1", "protractor": "^3.1.1",
"raw-loader": "0.5.1", "raw-loader": "0.5.1",
@ -78,7 +76,6 @@
"tslint": "^3.5.0", "tslint": "^3.5.0",
"tslint-loader": "^2.1.3", "tslint-loader": "^2.1.3",
"typedoc": "^0.3.12", "typedoc": "^0.3.12",
"typescript": "~1.8.7",
"url-loader": "^0.5.7", "url-loader": "^0.5.7",
"webpack": "^1.12.14" "webpack": "^1.12.14"
}, },

View File

@ -9,16 +9,12 @@
* all here! Crazy huh. So we need to do some setup * all here! Crazy huh. So we need to do some setup
*/ */
Error.stackTraceLimit = Infinity; Error.stackTraceLimit = Infinity;
require('phantomjs-polyfill'); require('core-js');
require('es6-promise');
require('es6-shim');
require('es7-reflect-metadata');
require('zone.js/dist/zone-microtask.js'); require('zone.js/dist/zone.js');
require('zone.js/dist/long-stack-trace-zone.js'); require('zone.js/dist/long-stack-trace-zone.js');
require('zone.js/dist/jasmine-patch.js'); require('zone.js/dist/jasmine-patch.js');
var testing = require('angular2/testing'); var testing = require('angular2/testing');
var browser = require('angular2/platform/testing/browser'); var browser = require('angular2/platform/testing/browser');

View File

@ -9,12 +9,10 @@
* all here! Crazy huh. So we need to do some setup * all here! Crazy huh. So we need to do some setup
*/ */
Error.stackTraceLimit = Infinity; Error.stackTraceLimit = Infinity;
require('phantomjs-polyfill'); // Prefer CoreJS over the polyfills above
require('es6-promise'); require('core-js');
require('es6-shim');
require('es7-reflect-metadata');
require('zone.js/dist/zone-microtask.js'); require('zone.js/dist/zone.js');
require('zone.js/dist/long-stack-trace-zone.js'); require('zone.js/dist/long-stack-trace-zone.js');
require('zone.js/dist/jasmine-patch.js'); require('zone.js/dist/jasmine-patch.js');

View File

@ -34,7 +34,7 @@ module.exports = {
loaders: [ loaders: [
{ {
test: /\.ts$/, test: /\.ts$/,
loader: 'awesome-typescript-loader', loader: 'ts-loader',
query: { query: {
"compilerOptions": { "compilerOptions": {
"removeComments": true "removeComments": true