mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
update packages
This commit is contained in:
parent
c186770a50
commit
ffc8574b79
@ -8,26 +8,30 @@ import {
|
||||
TestComponentBuilder
|
||||
} from 'angular2/testing';
|
||||
|
||||
import {Component, provide} from 'angular2/core';
|
||||
import {AuthenticationService} from "../../../frontend/app/model/authentication.service";
|
||||
import {provide} from 'angular2/core';
|
||||
import {AuthenticationService} from "./authentication.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', () => {
|
||||
beforeEachProviders(() => [
|
||||
provide(UserService, {
|
||||
useFactory: function() {
|
||||
return {login() {}};
|
||||
}
|
||||
}),
|
||||
|
||||
provide(UserService, {useClass: MockUserService}),
|
||||
AuthenticationService
|
||||
]);
|
||||
|
||||
|
||||
it('should call User service login', inject([ AuthenticationService,UserService ], (authService, userService) => {
|
||||
spyOn(userService,"login");
|
||||
spyOn(userService,"login").and.callThrough();
|
||||
|
||||
expect(userService.login).not.toHaveBeenCalled();
|
||||
authService.login();
|
||||
expect(userService.login).toHaveBeenCalled();
|
||||
|
11
package.json
11
package.json
@ -21,16 +21,16 @@
|
||||
"url": "https://github.com/bpatrik/PiGallery2/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"angular2": "^2.0.0-beta.10",
|
||||
"angular2": "^2.0.0-beta.11",
|
||||
"core-js": "^2.2.1",
|
||||
"debug": "^2.2.0",
|
||||
"es6-promise": "^3.1.2",
|
||||
"es6-shim": "^0.33.13",
|
||||
"es6-shim": "^0.35.0",
|
||||
"es7-reflect-metadata": "^1.6.0",
|
||||
"express": "^4.13.4",
|
||||
"express-session": "^1.13.0",
|
||||
"karma-jasmine": "^0.3.8",
|
||||
"morgan": "^1.7.0",
|
||||
"protractor": "^3.2.0",
|
||||
"protractor": "^3.2.1",
|
||||
"reflect-metadata": "0.1.2",
|
||||
"rxjs": "^5.0.0-beta.2",
|
||||
"ts-loader": "^0.8.1",
|
||||
@ -41,7 +41,6 @@
|
||||
"zone.js": "^0.6.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"awesome-typescript-loader": "^0.16.0-rc.0",
|
||||
"compression-webpack-plugin": "^0.3.0",
|
||||
"copy-webpack-plugin": "^1.1.1",
|
||||
"css-loader": "^0.23.1",
|
||||
@ -65,7 +64,6 @@
|
||||
"karma-sourcemap-loader": "^0.3.7",
|
||||
"karma-webpack": "1.7.0",
|
||||
"ng2lint": "0.0.10",
|
||||
"phantomjs-polyfill": "0.0.2",
|
||||
"phantomjs-prebuilt": "^2.1.4",
|
||||
"protractor": "^3.1.1",
|
||||
"raw-loader": "0.5.1",
|
||||
@ -78,7 +76,6 @@
|
||||
"tslint": "^3.5.0",
|
||||
"tslint-loader": "^2.1.3",
|
||||
"typedoc": "^0.3.12",
|
||||
"typescript": "~1.8.7",
|
||||
"url-loader": "^0.5.7",
|
||||
"webpack": "^1.12.14"
|
||||
},
|
||||
|
@ -9,16 +9,12 @@
|
||||
* all here! Crazy huh. So we need to do some setup
|
||||
*/
|
||||
Error.stackTraceLimit = Infinity;
|
||||
require('phantomjs-polyfill');
|
||||
require('es6-promise');
|
||||
require('es6-shim');
|
||||
require('es7-reflect-metadata');
|
||||
require('core-js');
|
||||
|
||||
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/jasmine-patch.js');
|
||||
|
||||
|
||||
var testing = require('angular2/testing');
|
||||
var browser = require('angular2/platform/testing/browser');
|
||||
|
||||
|
@ -9,12 +9,10 @@
|
||||
* all here! Crazy huh. So we need to do some setup
|
||||
*/
|
||||
Error.stackTraceLimit = Infinity;
|
||||
require('phantomjs-polyfill');
|
||||
require('es6-promise');
|
||||
require('es6-shim');
|
||||
require('es7-reflect-metadata');
|
||||
// Prefer CoreJS over the polyfills above
|
||||
require('core-js');
|
||||
|
||||
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/jasmine-patch.js');
|
||||
|
||||
|
@ -34,7 +34,7 @@ module.exports = {
|
||||
loaders: [
|
||||
{
|
||||
test: /\.ts$/,
|
||||
loader: 'awesome-typescript-loader',
|
||||
loader: 'ts-loader',
|
||||
query: {
|
||||
"compilerOptions": {
|
||||
"removeComments": true
|
||||
|
Loading…
x
Reference in New Issue
Block a user