不要怂,就是干,撸起袖子干!

Commit 18da2d19 by Jan Aagaard Meier

fix(test): Update unit test to match new .validate signature

1 parent d5607665
...@@ -48,9 +48,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() { ...@@ -48,9 +48,7 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
expect(instance.get('updated_time')).to.be.ok; expect(instance.get('updated_time')).to.be.ok;
expect(instance.get('updated_time')).to.be.an.instanceof(Date); expect(instance.get('updated_time')).to.be.an.instanceof(Date);
return instance.validate().then(function(err) { return instance.validate();
expect(err).to.be.equal(null);
});
}); });
it('should popuplate explicitely undefined UUID primary keys', function () { it('should popuplate explicitely undefined UUID primary keys', function () {
......
...@@ -199,9 +199,7 @@ describe(Support.getTestDialectTeaser('InstanceValidator'), function() { ...@@ -199,9 +199,7 @@ describe(Support.getTestDialectTeaser('InstanceValidator'), function() {
var failingUser = UserFail.build({ name: failingValue }); var failingUser = UserFail.build({ name: failingValue });
return failingUser.validate().then(function(_errors) { return expect(failingUser.validate()).to.be.rejected.then(function(_errors) {
expect(_errors).not.to.be.null;
expect(_errors).to.be.an.instanceOf(Error);
expect(_errors.get('name')[0].message).to.equal(message); expect(_errors.get('name')[0].message).to.equal(message);
}); });
}); });
...@@ -230,11 +228,7 @@ describe(Support.getTestDialectTeaser('InstanceValidator'), function() { ...@@ -230,11 +228,7 @@ describe(Support.getTestDialectTeaser('InstanceValidator'), function() {
} }
}); });
var successfulUser = UserSuccess.build({ name: succeedingValue }); var successfulUser = UserSuccess.build({ name: succeedingValue });
return successfulUser.validate().then(function(errors) { return expect(successfulUser.validate()).not.to.be.rejected;
expect(errors).to.be.null;
}).catch(function(err) {
expect(err).to.deep.equal({});
});
}); });
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!