diff --git a/package.json b/package.json index e0e08f3..89c8359 100644 --- a/package.json +++ b/package.json @@ -31,8 +31,8 @@ "nyc": "^14.1.1", "ot-json1": "^1.0.1", "rich-text": "^4.1.0", - "sharedb": "^3.0.0 || ^4.0.0", - "sinon": "^11.1.2" + "sharedb": "^6.0.0", + "sinon": "^22.0.0" }, "author": "Avital Oliver", "license": "MIT", diff --git a/test/test.js b/test/test.js index a93803c..4145de3 100644 --- a/test/test.js +++ b/test/test.js @@ -30,7 +30,9 @@ describe('db', function() { }); it('preserves doc metadata after deletion', function(done) { - var clock = sinon.useFakeTimers(1000000); + // Only fake Date — newer Sinon also fakes process.nextTick by default, + // which stalls ShareDB's async callbacks and times the test out. + var clock = sinon.useFakeTimers({now: 1000000, toFake: ['Date']}); function expectMeta(property, value) { var snapshot = db._getSnapshotSync('testcollection', 'test1', true); expect(snapshot).to.have.property('m');