mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
fixing tests
This commit is contained in:
parent
d6ba7813a2
commit
4e16925517
@ -19,6 +19,7 @@ describe('Authentication middleware', () => {
|
|||||||
session: {
|
session: {
|
||||||
user: "A user"
|
user: "A user"
|
||||||
},
|
},
|
||||||
|
sessionOptions: {},
|
||||||
query: {},
|
query: {},
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
@ -33,6 +34,7 @@ describe('Authentication middleware', () => {
|
|||||||
it('should call next with error on not authenticated', (done) => {
|
it('should call next with error on not authenticated', (done) => {
|
||||||
let req: any = {
|
let req: any = {
|
||||||
session: {},
|
session: {},
|
||||||
|
sessionOptions: {},
|
||||||
query: {},
|
query: {},
|
||||||
params: {}
|
params: {}
|
||||||
};
|
};
|
||||||
@ -52,7 +54,8 @@ describe('Authentication middleware', () => {
|
|||||||
|
|
||||||
it('should call next with error on authenticated', (done) => {
|
it('should call next with error on authenticated', (done) => {
|
||||||
let req: any = {
|
let req: any = {
|
||||||
session: {}
|
session: {},
|
||||||
|
sessionOptions: {},
|
||||||
};
|
};
|
||||||
let res: any = {};
|
let res: any = {};
|
||||||
let next: any = (err) => {
|
let next: any = (err) => {
|
||||||
@ -68,7 +71,8 @@ describe('Authentication middleware', () => {
|
|||||||
let req: any = {
|
let req: any = {
|
||||||
session: {
|
session: {
|
||||||
user: "A user"
|
user: "A user"
|
||||||
}
|
},
|
||||||
|
sessionOptions: {},
|
||||||
};
|
};
|
||||||
let res: any = {};
|
let res: any = {};
|
||||||
let next: any = (err: ErrorDTO) => {
|
let next: any = (err: ErrorDTO) => {
|
||||||
@ -88,7 +92,8 @@ describe('Authentication middleware', () => {
|
|||||||
user: {
|
user: {
|
||||||
role: UserRoles.LimitedGuest
|
role: UserRoles.LimitedGuest
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
sessionOptions: {}
|
||||||
};
|
};
|
||||||
let next: any = (err) => {
|
let next: any = (err) => {
|
||||||
expect(err).to.be.undefined;
|
expect(err).to.be.undefined;
|
||||||
@ -104,7 +109,8 @@ describe('Authentication middleware', () => {
|
|||||||
user: {
|
user: {
|
||||||
role: UserRoles.LimitedGuest
|
role: UserRoles.LimitedGuest
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
sessionOptions: {}
|
||||||
};
|
};
|
||||||
let next: any = (err: ErrorDTO) => {
|
let next: any = (err: ErrorDTO) => {
|
||||||
expect(err).not.to.be.undefined;
|
expect(err).not.to.be.undefined;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user