fix: tests for datatypes

This commit is contained in:
jannyHou 2019-11-06 15:50:46 -05:00
parent 71df0be70b
commit 1617fc289e
1 changed files with 4 additions and 2 deletions

View File

@ -22,11 +22,13 @@ describe('MySQL specific datatypes', function() {
var dateForTransactions = [new Date(dateString1).toString(), new Date(dateString2).toString()]; var dateForTransactions = [new Date(dateString1).toString(), new Date(dateString2).toString()];
var data = [ var data = [
{ {
id: 1,
type: 'Student - Basic', type: 'Student - Basic',
amount: 1000, amount: 1000,
lastTransaction: dateString1, lastTransaction: dateString1,
}, },
{ {
id: 2,
type: 'Professional', type: 'Professional',
amount: 1999.99, amount: 1999.99,
lastTransaction: dateString2, lastTransaction: dateString2,
@ -51,7 +53,7 @@ describe('MySQL specific datatypes', function() {
dataType: 'DATE', dataType: 'DATE',
}, },
}, },
}); }, {forceId: false});
db.automigrate(done); db.automigrate(done);
}); });
after(function(done) { after(function(done) {
@ -86,7 +88,7 @@ describe('MySQL specific datatypes', function() {
}); });
it('find an instance', function(done) { it('find an instance', function(done) {
Account.find(function(err, result) { Account.find({order: 'amount'}, function(err, result) {
if (err) return done(err); if (err) return done(err);
assert(result); assert(result);
assert(_.isEqual(data.length, result.length)); assert(_.isEqual(data.length, result.length));