File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @nestia/e2e" ,
3
- "version" : " 0.3.6 " ,
3
+ "version" : " 0.3.7 " ,
4
4
"description" : " E2E test utilify functions" ,
5
5
"main" : " lib/index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change @@ -103,16 +103,16 @@ export namespace TestValidator {
103
103
104
104
export const httpError =
105
105
( title : string ) =>
106
- ( status : number ) =>
106
+ ( ... statuses : number [ ] ) =>
107
107
< T > ( task : ( ) => T ) : T extends Promise < any > ? Promise < void > : void => {
108
108
const message = ( actual ?: number ) =>
109
109
typeof actual === "number"
110
- ? `Bug on ${ title } : status code must be ${ status } , but ${ actual } .`
111
- : `Bug on ${ title } : status code must be ${ status } , but succeeded.` ;
110
+ ? `Bug on ${ title } : status code must be ${ statuses . join ( " or " ) } , but ${ actual } .`
111
+ : `Bug on ${ title } : status code must be ${ statuses . join ( " or " ) } , but succeeded.` ;
112
112
const predicate = ( exp : any ) : Error | null =>
113
113
typeof exp === "object" &&
114
114
exp . constructor . name === "HttpError" &&
115
- exp . status === status
115
+ statuses . some ( val => val === exp . status )
116
116
? null
117
117
: new Error (
118
118
message (
You can’t perform that action at this time.
0 commit comments