Skip to content

Commit

Permalink
style: npm run prettier:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ytetsuro committed Aug 6, 2020
1 parent 9969506 commit 108c02e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
10 changes: 6 additions & 4 deletions test/functional/nested-validation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ describe('nested validation', () => {
model.mySubClass = 'invalidnested object' as any;

return validator.validate(model).then(errors => {
expect(errors[0].target).toEqual(model);
expect(errors[0].property).toEqual("mySubClass");
expect(errors[0].children.length).toEqual(0);
expect(errors[0].constraints).toEqual({[ValidationTypes.NESTED_VALIDATION]: "nested property mySubClass must be either object or array"});
expect(errors[0].target).toEqual(model);
expect(errors[0].property).toEqual('mySubClass');
expect(errors[0].children.length).toEqual(0);
expect(errors[0].constraints).toEqual({
[ValidationTypes.NESTED_VALIDATION]: 'nested property mySubClass must be either object or array',
});
});
});

Expand Down
13 changes: 8 additions & 5 deletions test/functional/promise-validation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe('promise validation', () => {
});
});

it("should validate when nested is not object", () => {
it('should validate when nested is not object', () => {
expect.assertions(4);

class MySubClass {
Expand All @@ -109,18 +109,21 @@ describe('promise validation', () => {
}

class MyClass {
@ValidatePromise() @ValidateNested()
@ValidatePromise()
@ValidateNested()
mySubClass: MySubClass;
}

const model = new MyClass();
model.mySubClass = "invalidnested object" as any;
model.mySubClass = 'invalidnested object' as any;

return validator.validate(model).then(errors => {
expect(errors[0].target).toEqual(model);
expect(errors[0].property).toEqual("mySubClass");
expect(errors[0].property).toEqual('mySubClass');
expect(errors[0].children.length).toEqual(0);
expect(errors[0].constraints).toEqual({[ValidationTypes.NESTED_VALIDATION]: "nested property mySubClass must be either object or array"});
expect(errors[0].constraints).toEqual({
[ValidationTypes.NESTED_VALIDATION]: 'nested property mySubClass must be either object or array',
});
});
});

Expand Down

0 comments on commit 108c02e

Please sign in to comment.