@@ -49,15 +49,15 @@ describe('ValidationPipe', () => {
4949 } ) ;
5050 describe ( 'when validation strips' , ( ) => {
5151 it ( 'should return a TestModel without extra properties' , async ( ) => {
52- target = new ValidationPipe ( { strip : true } ) ;
52+ target = new ValidationPipe ( { whitelist : true } ) ;
5353 const testObj = { prop1 : 'value1' , prop2 : 'value2' , prop3 : 'value3' } ;
5454 expect ( await target . transform ( testObj , metadata ) ) . to . be . instanceOf ( TestModel ) ;
5555 expect ( await target . transform ( testObj , metadata ) ) . to . not . have . property ( 'prop3' ) ;
5656 } ) ;
5757 } ) ;
5858 describe ( 'when validation rejects' , ( ) => {
5959 it ( 'should throw an error' , ( ) => {
60- target = new ValidationPipe ( { reject : true } ) ;
60+ target = new ValidationPipe ( { forbidNonWhitelisted : true } ) ;
6161 const testObj = { prop1 : 'value1' , prop2 : 'value2' , prop3 : 'value3' } ;
6262 expect ( target . transform ( testObj , metadata ) ) . to . be . rejected ;
6363 } ) ;
@@ -66,15 +66,15 @@ describe('ValidationPipe', () => {
6666 describe ( 'when validation does\'t transform' , ( ) => {
6767 describe ( 'when validation strips' , ( ) => {
6868 it ( 'should return a plain object without extra properties' , async ( ) => {
69- target = new ValidationPipe ( { transform : false , strip : true } ) ;
69+ target = new ValidationPipe ( { transform : false , whitelist : true } ) ;
7070 const testObj = { prop1 : 'value1' , prop2 : 'value2' , prop3 : 'value3' } ;
7171 expect ( await target . transform ( testObj , metadata ) ) . to . not . be . instanceOf ( TestModel ) ;
7272 expect ( await target . transform ( testObj , metadata ) ) . to . not . have . property ( 'prop3' ) ;
7373 } ) ;
7474 } ) ;
7575 describe ( 'when validation rejects' , ( ) => {
7676 it ( 'should throw an error' , ( ) => {
77- target = new ValidationPipe ( { transform : false , reject : true } ) ;
77+ target = new ValidationPipe ( { transform : false , forbidNonWhitelisted : true } ) ;
7878 const testObj = { prop1 : 'value1' , prop2 : 'value2' , prop3 : 'value3' } ;
7979 expect ( target . transform ( testObj , metadata ) ) . to . be . rejected ;
8080 } ) ;
0 commit comments