From 3f4af326f5afce53e1e5067c73b0f5a77819874a Mon Sep 17 00:00:00 2001 From: biniam Date: Wed, 5 Dec 2018 12:16:32 -0500 Subject: [PATCH] chore: update mocha to 5.x --- package.json | 4 ++-- test/datetime.test.js | 15 +++------------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 2d2a680..fe376e8 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "scripts": { "pretest": "node pretest.js", "lint": "eslint .", - "test": "mocha --timeout 10000 test/*.test.js node_modules/juggler-v3/test.js node_modules/juggler-v4/test.js", + "test": "mocha --timeout 10000 test/*.test.js node_modules/juggler-v3/test.js node_modules/juggler-v4/test.js --exit", "posttest": "npm run lint" }, "dependencies": { @@ -27,7 +27,7 @@ "juggler-v3": "file:./deps/juggler-v3", "juggler-v4": "file:./deps/juggler-v4", "loopback-datasource-juggler": "^3.0.0 || ^4.0.0", - "mocha": "^2.1.0", + "mocha": "^5.2.0", "rc": "^1.0.0", "should": "^8.0.2", "sinon": "^1.15.4" diff --git a/test/datetime.test.js b/test/datetime.test.js index 9b5239e..c16a1d3 100644 --- a/test/datetime.test.js +++ b/test/datetime.test.js @@ -46,7 +46,7 @@ describe('MySQL datetime handling', function() { }); }); - it('should allow use of DateStrings', function(done) { + it('should allow use of DateStrings', function() { var d = new DateString('1971-06-22'); return Person.create({ name: 'Mr. Pink', @@ -58,9 +58,6 @@ describe('MySQL datetime handling', function() { }).then(function(inst) { inst.should.not.eql(null); inst.dob.toString().should.eql(d.toString()); - return done(); - }).catch(function(err) { - return done(err); }); }); @@ -72,7 +69,7 @@ describe('MySQL datetime handling', function() { testDateTime(d, '+12:00', '1971-06-22 12:00:00'); function testDateTime(date, tz, expected) { - it(tz, function(done) { + it(tz, function() { setConnectionTimezones(tz); db.settings.legacyUtcDateProcessing = false; db.settings.timezone = tz; @@ -86,15 +83,12 @@ describe('MySQL datetime handling', function() { }).then(function(inst) { inst.should.not.eql(null); inst.createdAt.toString().should.eql(expected); - return done(); - }).catch(function(err) { - return done(err); }); }); } }); - it('should allow use of fractional seconds', function(done) { + it('should allow use of fractional seconds', function() { var d = new Date('1971-06-22T12:34:56.789Z'); return Person.create({ name: 'Mr. Pink', @@ -106,9 +100,6 @@ describe('MySQL datetime handling', function() { inst.should.not.eql(null); var lastLogon = new Date(inst.lastLogon); lastLogon.toJSON().should.eql(d.toJSON()); - return done(); - }).catch(function(err) { - return done(err); }); }); });