1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
This commit is contained in:
Patrik Braun 2017-07-26 19:43:06 +02:00
parent e998b5fedb
commit 01621470c0
2 changed files with 4 additions and 3 deletions

View File

@ -9,7 +9,7 @@
"bin": "./backend/index.js",
"scripts": {
"install": "tsc && ng build -prod",
"build-release": "gulp",
"build-release": "gulp build-release",
"pretest": "tsc",
"test": "ng test --single-run && mocha --recursive test/backend/unit",
"start": "node ./backend/index",

View File

@ -5,6 +5,7 @@ import {UserDTO, UserRoles} from "../../../../../common/entities/UserDTO";
import {ObjectManagerRepository} from "../../../../../backend/model/ObjectManagerRepository";
import {UserManager} from "../../../../../backend/model/memory/UserManager";
import {Config} from "../../../../../common/config/private/Config";
import {IUserManager} from "../../../../../backend/model/interfaces/IUserManager";
describe('Authentication middleware', () => {
@ -219,9 +220,9 @@ describe('Authentication middleware', () => {
expect(req.session.user).to.be.eql("test user");
done();
};
ObjectManagerRepository.getInstance().UserManager = <UserManager>{
ObjectManagerRepository.getInstance().UserManager = <IUserManager>{
findOne: (filter) => {
return Promise.resolve("test user");
return Promise.resolve(<any>"test user");
}
};
AuthenticationMWs.login(req, null, next);