Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: share/sharedb-mongo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.1.0
Choose a base ref
...
head repository: share/sharedb-mongo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Feb 28, 2023

  1. 💥 BREAKING: drop mongodb@2 support

    The `mongodb@2` driver is not compatible with MongoDB v6. In order to
    add support for the latest database, we drop support for this old
    version of the `mongodb` driver.
    alecgibson committed Feb 28, 2023
    Copy the full SHA
    023f2b2 View commit details
  2. ✅ Add async to devDependencies

    We incorrectly [removed `async`][1] from our dependencies, but we still
    import this library for our tests.
    
    This change puts it back in our `devDependencies`
    
    [1]: https://github.com/share/sharedb-mongo/pull/140/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L7
    alecgibson committed Feb 28, 2023
    Copy the full SHA
    eda5a69 View commit details
  3. Merge pull request #144 from share/async-test

    ✅ Add `async` to `devDependencies`
    alecgibson authored Feb 28, 2023
    Copy the full SHA
    5682d86 View commit details
  4. 2.1.1

    alecgibson committed Feb 28, 2023
    Copy the full SHA
    05c7bae View commit details
  5. Merge pull request #142 from share/drop-mongodb2

    💥 BREAKING: drop `mongodb@2` support
    alecgibson authored Feb 28, 2023
    Copy the full SHA
    a2ab6d4 View commit details
  6. Copy the full SHA
    f5575e9 View commit details
  7. Merge pull request #139 from share/mongodb6

    ⬆️ Add MongoDB server 6 to our test matrix
    alecgibson authored Feb 28, 2023
    Copy the full SHA
    75ab33c View commit details
  8. 3.0.0

    alecgibson committed Feb 28, 2023
    Copy the full SHA
    97e90c0 View commit details
  9. ✅ Fix npm test

    This is broken in a fresh install:
    
    ```
    npm install
    npm test
    ```
    
    This is because `npm` will fetch `mongodb@5` (the latest it can), but
    running `npm test` without the `_SHAREDB_MONGODB_DRIVER` variable set
    means that the map reduce test still runs, when `mongodb@5` doesn't
    support it.
    
    This change tweaks the test to check if the function is defined, instead
    of relying on the environment variable.
    alecgibson committed Feb 28, 2023
    Copy the full SHA
    adaf37f View commit details

Commits on Mar 1, 2023

  1. Merge pull request #145 from share/fix-map-reduce-test

    ✅ Fix `npm test`
    alecgibson authored Mar 1, 2023
    Copy the full SHA
    1bb27de View commit details
  2. 3.0.1

    alecgibson committed Mar 1, 2023
    Copy the full SHA
    39b7dda View commit details

Commits on Apr 21, 2023

  1. 💥 Drop Node.js 14 and add Node.js 20

    According to the Node.js [release schedule][1]:
    
     - v14 will be end-of-lifed on 30 April
     - v20 has been released
    
    This change drops v14 from our test matrix, and adds v20.
    
    [1]: https://nodejs.dev/en/about/releases/
    alecgibson committed Apr 21, 2023
    Copy the full SHA
    73d9a26 View commit details

Commits on Apr 25, 2023

  1. Merge pull request #148 from share/bump-node

    💥 Drop Node.js 14 and add Node.js 20
    alecgibson authored Apr 25, 2023
    Copy the full SHA
    83dd2d2 View commit details

Commits on May 16, 2023

  1. Add support for sharedb@4

    ericyhwang committed May 16, 2023
    Copy the full SHA
    3bf44aa View commit details
  2. Copy the full SHA
    9c91afc View commit details
  3. Merge pull request #149 from share/sharedb-4

    Add support for sharedb@4
    ericyhwang authored May 16, 2023
    Copy the full SHA
    e5a01cf View commit details
  4. 4.0.0

    ericyhwang committed May 16, 2023
    Copy the full SHA
    a9b38af View commit details

Commits on Aug 29, 2023

  1. ⬆️ Add support for mongodb@6

    This change adds support for the latest major version bump of the
    `mongodb` driver: [v6][1].
    
    None of the breaks appear to affect us, so we just update our
    `dependencies` and test matrix.
    
    [1]: https://github.com/mongodb/node-mongodb-native/releases/tag/v6.0.0
    alecgibson committed Aug 29, 2023
    Copy the full SHA
    ec898a4 View commit details

Commits on Sep 6, 2023

  1. Merge pull request #151 from share/mongodb6

    ⬆️ Add support for `mongodb@6`
    alecgibson authored Sep 6, 2023
    Copy the full SHA
    b72c420 View commit details
  2. 4.1.0

    alecgibson committed Sep 6, 2023
    Copy the full SHA
    0ca1235 View commit details

Commits on Feb 13, 2024

  1. Add dev dependency on rich-text for tests

    sharedb-mongo includes and runs all tests from sharedb core, and one of the core tests requires rich-text to be installed.
    ericyhwang committed Feb 13, 2024
    Copy the full SHA
    8270f4a View commit details
  2. Copy the full SHA
    b54863a View commit details
  3. Copy the full SHA
    220dfbf View commit details
  4. Merge pull request #154 from share/fix-map-add-tests

    Fix $map query transform, add tests for $map and $explain
    ericyhwang authored Feb 13, 2024
    Copy the full SHA
    5e6fc4c View commit details
  5. Resolve memory leak when using cursor operations like $count in mongo…

    …db@4-6
    
    Starting in Mongo Node driver `mongodb@4`, up through the latest version `mongodb@6`, using `cursor.count()` results in a memory leak. `mongodb@3` doesn't leak in the same situation.
    
    The driver creates an implicit client session, but it doesn't automatically close the session when getting the results back from the server. Those unclosed sessions build up over time, causing a memory leak.
    
    sharedb-mongo exposes document counting via a user passing the `$count: true` property on query objects, and it currently uses `cursor.count()`.
    
    There are a couple ways sharedb-mongo could address the leak:
    - Switch to `Collection#countDocuments()`, which is the recommended replacement for the deprecated `FindCursor#count()`. This is better long-term, but it's more work since we have to map things like `$limit` from using chained cursor calls over to the equivalent property in CountOptions, where appropriate.
    - Explicitly close the cursor. Easy and safe, since the cursor is created inside sharedb-mongo and not exposed externally.
    
    To resolve the leak more quickly, this change opts for the latter, explicitly closing the cursor for the "cursor operations" `$count`, `$explain`, and `$map`.
    ericyhwang committed Feb 13, 2024
    Copy the full SHA
    06b5c78 View commit details
  6. Copy the full SHA
    3410c26 View commit details
  7. Merge pull request #152 from share/fix-mongo-count-leak

    Resolve memory leak when using cursor operations like $count in mongodb@4-6
    ericyhwang authored Feb 13, 2024
    Copy the full SHA
    2b3566d View commit details
  8. 4.1.1

    ericyhwang committed Feb 13, 2024
    Copy the full SHA
    98563df View commit details

Commits on Apr 15, 2024

  1. 👷‍♀️ Update MongoDB test matrix

    According to the MongoDB [release schedule][1]:
    
     - MongoDB 4.2 is EoL this month (April 2023)
     - MongoDB 7.0 was released in August
    
    [1]: https://www.mongodb.com/legal/support-policy/lifecycles
    alecgibson committed Apr 15, 2024
    Copy the full SHA
    e6df010 View commit details

Commits on Apr 16, 2024

  1. Merge pull request #155 from share/update-mongodb-matrix

    👷‍♀️ Update MongoDB test matrix
    alecgibson authored Apr 16, 2024
    Copy the full SHA
    0013d15 View commit details

Commits on May 15, 2024

  1. 👷‍♀️ Update Node.js build matrix

    Drop Node.js v16 support, and add v22 support in-line with the Node.js
    [release schedule][1].
    
    [1]: https://github.com/nodejs/release#release-schedule
    alecgibson committed May 15, 2024
    Copy the full SHA
    95e5398 View commit details

Commits on May 17, 2024

  1. Copy the full SHA
    9d4e40e View commit details
  2. 4.1.2

    alecgibson committed May 17, 2024
    Copy the full SHA
    7e88b0a View commit details

Commits on May 20, 2024

  1. 🔧 Allow disabling the src/seq/v index

    - Fixes #94
    - Follows on from share/sharedb#657
    
    This change is to work alongside upstream work to remove ShareDB's
    usage of `getCommittedOpVersion()`.
    
    In `sharedb-mongo` this function requires an entire extra op index,
    just to handle a corner case where two `create` ops are submitted at the
    same time, which should happen relatively infrequently.
    
    This change allows consumers to opt out of individual indexes. For
    example, if we're not using `getCommittedOpVersion()`, consumers can
    opt out of the automatic `src`/`seq`/`v` index creation with:
    
    ```js
    new ShareDbMongo(
      mongoUrl,
      {
        disableIndexCreation: {
          src_seq_v: true,
        },
      },
    );
    ```
    
    Note that if this index already exists, consumers will need to manually
    remove it.
    
    Previous behaviour will still work, so setting:
    
    ```js
    new ShareDbMongo(
      mongoUrl,
      {
        disableIndexCreation: true,
      },
    );
    ```
    
    disables **all** index creation.
    alecgibson committed May 20, 2024
    Copy the full SHA
    763baa6 View commit details

Commits on May 28, 2024

  1. Merge pull request #157 from share/no-src-seq-index

    🔧 Allow disabling the `src`/`seq`/`v` index
    alecgibson authored May 28, 2024
    Copy the full SHA
    162b81c View commit details
  2. 4.2.0

    alecgibson committed May 28, 2024
    Copy the full SHA
    d48f2c7 View commit details

Commits on Jun 12, 2024

  1. Merge pull request #156 from share/nodejs-matrix

    👷‍♀️ Update Node.js build matrix
    alecgibson authored Jun 12, 2024
    Copy the full SHA
    6ce36de View commit details
  2. 5.0.0

    alecgibson committed Jun 12, 2024
    Copy the full SHA
    dc887c7 View commit details
  3. ✅ Fix a slightly flaky test

    Sometimes this test fails with:
    
    ```
      1) mongo db connection
           via url string with mongoPoll and pollDelay option
             delays queryPoll but not commit:
    
          Uncaught AssertionError: expected 1000 to be above 1000
          + expected - actual
    
          at /home/runner/work/sharedb-mongo/sharedb-mongo/test/test_mongo.js:541:48
          at /home/runner/work/sharedb-mongo/sharedb-mongo/index.js:133:2086
          at /home/runner/work/sharedb-mongo/sharedb-mongo/index.js:133:109
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    ```
    
    We don't care about the exact millisecond, so this change updates the
    assertion to `greaterThanOrEqual()`
    alecgibson committed Jun 12, 2024
    Copy the full SHA
    3470ec5 View commit details
  4. 👷‍♀️ Add Dependabot config

    Will check for updates to Github Actions.
    alecgibson committed Jun 12, 2024
    Copy the full SHA
    56143f4 View commit details
  5. Bump actions/setup-node from 3 to 4

    Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
    - [Release notes](https://github.com/actions/setup-node/releases)
    - [Commits](actions/setup-node@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/setup-node
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jun 12, 2024
    Copy the full SHA
    39deb83 View commit details
  6. Merge pull request #161 from share/dependabot/github_actions/actions/…

    …setup-node-4
    
    Bump actions/setup-node from 3 to 4
    alecgibson authored Jun 12, 2024
    Copy the full SHA
    61e3e27 View commit details
  7. Bump actions/checkout from 3 to 4

    Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jun 12, 2024
    Copy the full SHA
    6b92823 View commit details
  8. Merge pull request #160 from share/dependabot/github_actions/actions/…

    …checkout-4
    
    Bump actions/checkout from 3 to 4
    alecgibson authored Jun 12, 2024
    Copy the full SHA
    92aee77 View commit details

Commits on Jun 25, 2024

  1. Merge pull request #159 from share/poll-delay-fix

    ✅ Fix a slightly flaky test
    alecgibson authored Jun 25, 2024
    Copy the full SHA
    02fbf78 View commit details
Showing with 141 additions and 41 deletions.
  1. +6 −0 .github/dependabot.yml
  2. +6 −6 .github/workflows/test.yml
  3. +14 −23 index.js
  4. +10 −8 package.json
  5. +105 −4 test/test_mongo.js
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -20,23 +20,23 @@ jobs:
fail-fast: false
matrix:
node:
- 14
- 16
- 18
- 20
- 22
mongodb:
- 4.0
- 4.2
- 4.4
- 5.0
- 6.0
- 7.0
services:
mongodb:
image: mongo:${{ matrix.mongodb }}
ports:
- 27017:27017
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install
37 changes: 14 additions & 23 deletions index.js
Original file line number Diff line number Diff line change
@@ -126,16 +126,6 @@ ShareDbMongo.prototype.getDbs = function(callback) {
}, callback);
};

function isLegacyMongoClient(client) {
// mongodb 2.0 connect returns a DB object that also implements the
// functionality of client, such as `close()`. mongodb 3.0 connect returns a
// Client without the `collection()` method
return (
typeof client.collection === 'function' &&
typeof client.close === 'function'
);
}

ShareDbMongo.prototype._connect = function(mongo, options) {
// Create the mongo connection client connections if needed
//
@@ -148,17 +138,12 @@ ShareDbMongo.prototype._connect = function(mongo, options) {
return Promise.all(connections).then(function(clients) {
var mongoClient = clients[0];
var mongoPollClient = clients[1];
var result = {
mongo: mongoClient,
return {
mongo: mongoClient.db(),
mongoClient: mongoClient,
mongoPoll: mongoPollClient,
mongoPoll: mongoPollClient && mongoPollClient.db(),
mongoPollClient: mongoPollClient
};
if (!isLegacyMongoClient(mongoClient)) {
result.mongo = mongoClient.db();
if (mongoPollClient) result.mongoPoll = mongoPollClient.db();
}
return result;
});
};

@@ -399,7 +384,7 @@ ShareDbMongo.prototype.getOpCollection = function(collectionName, callback) {
var collection = mongo.collection(name);
// Given the potential problems with creating indexes on the fly, it might
// be preferrable to disable automatic creation
if (self.disableIndexCreation) {
if (self.disableIndexCreation === true) {
return callback(null, collection);
}
if (self.opIndexes[collectionName]) {
@@ -413,10 +398,13 @@ ShareDbMongo.prototype.getOpCollection = function(collectionName, callback) {
// collection this won't be a problem, but this is a dangerous mechanism.
// Perhaps we should only warn instead of creating the indexes, especially
// when there is a lot of data in the collection.
collection.createIndex({d: 1, v: 1}, {background: true})
.then(function() {
return collection.createIndex({src: 1, seq: 1, v: 1}, {background: true});
})

var disabledIndexes = self.disableIndexCreation || {};
var promises = [
collection.createIndex({d: 1, v: 1}, {background: true}),
!disabledIndexes.src_seq_v && collection.createIndex({src: 1, seq: 1, v: 1}, {background: true})
];
Promise.all(promises)
.then(function() {
self.opIndexes[collectionName] = true;
callback(null, collection);
@@ -1525,17 +1513,20 @@ var cursorOperationsMap = {
$count: function(cursor, value, cb) {
cursor.count()
.then(function(result) {
cursor.close();
cb(null, result);
}, cb);
},
$explain: function(cursor, verbosity, cb) {
cursor.explain(verbosity)
.then(function(result) {
cursor.close();
cb(null, result);
}, cb);
},
$map: function(cursor, fn, cb) {
cursor.map(fn)
.toArray()
.then(function(result) {
cb(null, result);
}, cb);
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
{
"name": "sharedb-mongo",
"version": "2.1.0",
"version": "5.0.0",
"description": "MongoDB database adapter for ShareDB",
"main": "index.js",
"dependencies": {
"mongodb": "^2.1.2 || ^3.1.13 || ^4.0.0 || ^5.0.0",
"sharedb": "^1.9.1 || ^2.0.0 || ^3.0.0"
"mongodb": "^3.1.13 || ^4.0.0 || ^5.0.0 || ^6.0.0",
"sharedb": "^1.9.1 || ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0"
},
"devDependencies": {
"async": "^3.2.4",
"chai": "^4.2.0",
"coveralls": "^3.0.7",
"eslint": "^5.16.0",
"eslint-config-google": "^0.13.0",
"mocha": "^6.2.2",
"mongodb2": "npm:mongodb@^2.1.2",
"mongodb3": "npm:mongodb@^3.0.0",
"mongodb4": "npm:mongodb@^4.0.0",
"mongodb5": "npm:mongodb@^5.0.0",
"mongodb6": "npm:mongodb@^6.0.0",
"nyc": "^14.1.1",
"ot-json1": "^1.0.1",
"sharedb-mingo-memory": "^1.1.1",
"sinon": "^6.1.5",
"rich-text": "^4.1.0",
"sharedb-mingo-memory": "^1.0.0 || ^2.0.0 || ^3.0.0",
"sinon": "^9.2.4",
"sinon-chai": "^3.7.0"
},
"scripts": {
"lint": "./node_modules/.bin/eslint --ignore-path .gitignore '**/*.js'",
"lint:fix": "npm run lint -- --fix",
"test": "mocha",
"test:mongodb2": "_SHAREDB_MONGODB_DRIVER=mongodb2 npm test",
"test:mongodb3": "_SHAREDB_MONGODB_DRIVER=mongodb3 npm test",
"test:mongodb4": "_SHAREDB_MONGODB_DRIVER=mongodb4 npm test",
"test:mongodb5": "_SHAREDB_MONGODB_DRIVER=mongodb5 npm test",
"test:all": "npm run test:mongodb2 && npm run test:mongodb3 && npm run test:mongodb4 && npm run test:mongodb5",
"test:mongodb6": "_SHAREDB_MONGODB_DRIVER=mongodb6 npm test",
"test:all": "npm run test:mongodb3 && npm run test:mongodb4 && npm run test:mongodb5 && npm run test:mongodb6",
"test-cover": "nyc --temp-dir=coverage -r text -r lcov npm run test:all"
},
"repository": "git://github.com/share/sharedb-mongo.git",
109 changes: 105 additions & 4 deletions test/test_mongo.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ var expect = require('chai').expect;
var ShareDbMongo = require('..');
var getQuery = require('sharedb-mingo-memory/get-query');
var async = require('async');
var randomUUID = require('crypto').randomUUID;

var mongoUrl = process.env.TEST_MONGO_URL || 'mongodb://localhost:27017/test';

@@ -100,6 +101,61 @@ describe('mongo db', function() {
});
});

it('$map maps docs with output in extra', function(done) {
var snapshots = [
{type: 'json0', id: 'test1', v: 1, data: {x: 1, y: 1}},
{type: 'json0', id: 'test2', v: 1, data: {x: 2, y: 2}},
{type: 'json0', id: 'test3', v: 1, data: {x: 3, y: 2}}
];
var query = {
y: 2,
$sort: {x: 1},
$map: function(doc) {
return doc.x;
}
};

var db = this.db;
async.each(snapshots, function(snapshot, cb) {
db.commit('testcollection', snapshot.id, {v: 0, create: {}}, snapshot, null, cb);
}, function(err) {
if (err) return done(err);
db.query('testcollection', query, null, null, function(err, results, extra) {
if (err) return done(err);

// Since $map can return non-docs, the output is delivered in extra.
expect(results).eql([]);
expect(extra).to.deep.equal([2, 3]);
done();
});
});
});

it('$explain delivers output in extra', function(done) {
var snapshots = [
{type: 'json0', id: 'test1', v: 1, data: {x: 1, y: 1}},
{type: 'json0', id: 'test2', v: 1, data: {x: 2, y: 2}},
{type: 'json0', id: 'test3', v: 1, data: {x: 3, y: 2}}
];
var query = {$explain: true, y: 2};

var db = this.db;
async.each(snapshots, function(snapshot, cb) {
db.commit('testcollection', snapshot.id, {v: 0, create: {}}, snapshot, null, cb);
}, function(err) {
if (err) return done(err);
db.query('testcollection', query, null, null, function(err, results, extra) {
if (err) return done(err);

expect(results).eql([]);
// Just check for the presence of an explain result. The specific structure
// could vary between Mongo versions.
expect(extra).to.be.an('object');
done();
});
});
});

it('$sort, $skip and $limit should order, skip and limit', function(done) {
var snapshots = [
{type: 'json0', v: 1, data: {x: 1}, id: 'test1', m: null},
@@ -334,9 +390,10 @@ describe('mongo db', function() {
});

it('$mapReduce queries should work when allowJavaScriptQuery == true', function(done) {
if (process.env._SHAREDB_MONGODB_DRIVER === 'mongodb5') {
// This function was removed in mongodb5:
// https://github.com/mongodb/node-mongodb-native/pull/3511
// This function was removed in mongodb5:
// https://github.com/mongodb/node-mongodb-native/pull/3511
var mapReduceSupported = typeof this.db.mongo.collection('test').mapReduce === 'function';
if (!mapReduceSupported) {
return done();
}
var snapshots = [
@@ -376,6 +433,50 @@ describe('mongo db', function() {
});
});

describe('options', function() {
var db;

afterEach(function(done) {
db.close(done);
});

it('disables index creation', function(done) {
var collection = randomUUID();
db = new ShareDbMongo(mongoUrl, {disableIndexCreation: true});
async.waterfall([
db.commit.bind(db, collection, 'foo', {v: 0, create: {}}, {}, null),
function(succeeded, next) {
db.getDbs(next);
},
function(mongo, mongoPoll, next) {
mongo.collection('o_' + collection).indexInformation().then(function(indexes) {
expect(indexes['d_1_v_1']).not.to.be.ok;
expect(indexes['src_1_seq_1_v_1']).not.to.be.ok;
next();
});
}
], done);
});

it('disables just the src,seq,v index', function(done) {
var collection = randomUUID();
db = new ShareDbMongo(mongoUrl, {disableIndexCreation: {src_seq_v: true}});
async.waterfall([
db.commit.bind(db, collection, 'foo', {v: 0, create: {}}, {}, null),
function(succeeded, next) {
db.getDbs(next);
},
function(mongo, mongoPoll, next) {
mongo.collection('o_' + collection).indexInformation().then(function(indexes) {
expect(indexes['d_1_v_1']).to.be.ok;
expect(indexes['src_1_seq_1_v_1']).not.to.be.ok;
next();
});
}
], done);
});
});

describe('mongo db connection', function() {
describe('via url string', function() {
beforeEach(function(done) {
@@ -437,7 +538,7 @@ describe('mongo db connection', function() {
db.queryPoll('testcollection', {}, null, function(err, results) {
if (err) return done(err);
expect(results.length).eql(1);
expect((new Date) - timeBeforeQuery).greaterThan(pollDelay);
expect((new Date) - timeBeforeQuery).greaterThanOrEqual(pollDelay);
done();
});
});