Skip to content

Commit

Permalink
test: test passed
Browse files Browse the repository at this point in the history
  • Loading branch information
lianghx-319 committed Jun 28, 2021
1 parent 7829978 commit 5b03c18
Show file tree
Hide file tree
Showing 5 changed files with 9,750 additions and 14 deletions.
20 changes: 20 additions & 0 deletions __tests__/number.spec.js
Expand Up @@ -86,4 +86,24 @@ describe('number', () => {
done();
});
});

it('return transformed value in promise.then', done => {
const value = {
v: '1',
};
new Schema({
v: {
type: 'number',
transform: () => 2,
},
})
.validate(value, errors => {
expect(value.v).toBe('1');
expect(errors).toBeFalsy();
})
.then(source => {
expect(source.v).toBe(2);
done();
});
});
});
4 changes: 2 additions & 2 deletions __tests__/validator.spec.js
Expand Up @@ -434,8 +434,8 @@ describe('validator', () => {
v: 2,
v2: 1,
})
.then(e => {
expect(e).toBeUndefined();
.then(source => {
expect(source).toMatchObject({ v: 2, v2: 1 });
done();
});
});
Expand Down

0 comments on commit 5b03c18

Please sign in to comment.