Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mikicho committed Oct 29, 2020
1 parent dbcc366 commit c7b6eba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/common/test/pipes/validation.pipe.spec.ts
Expand Up @@ -403,7 +403,7 @@ describe('ValidationPipe', () => {
public prop1: string;

@IsBoolean()
public prop2: string;
public prop2: boolean;

@IsOptional()
@IsString()
Expand All @@ -418,9 +418,9 @@ describe('ValidationPipe', () => {
};

target = new ValidationPipe({ expectedType: TestModel });
const testObj = { prop1: 'value1', prop2: 1 };
const testObj = { prop1: 'value1', prop2: 'value2' };

await expect(target.transform(testObj, m)).rejectedWith(BadRequestException);
expect(await target.transform(testObj, m)).to.equal(testObj);
});

it('should validate against the expected type if presented and metatype is primitive type', async () => {
Expand All @@ -431,9 +431,9 @@ describe('ValidationPipe', () => {
};

target = new ValidationPipe({ expectedType: TestModel });
const testObj = { prop1: 'value1', prop2: 1 };
const testObj = { prop1: 'value1', prop2: 'value2' };

await expect(target.transform(testObj, m)).rejectedWith(BadRequestException);
expect(await target.transform(testObj, m)).to.equal(testObj);
});
});
});

0 comments on commit c7b6eba

Please sign in to comment.