We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cca14a0 commit 94c5c18Copy full SHA for 94c5c18
test/datatype.test.js
@@ -52,6 +52,17 @@ describe('datatypes', function() {
52
done();
53
});
54
55
+ it('throws an error when property of type Date is set to an invalid value',
56
+ function() {
57
+ var myModel = db.define('myModel', {
58
+ date: { type: Date },
59
+ });
60
+
61
+ (function() {
62
+ myModel.create({ date: 'invalid' });
63
+ }).should.throw({ message: 'Invalid date: invalid' });
64
65
66
it('should keep types when get read data from db', function(done) {
67
var d = new Date, id;
68
0 commit comments