Skip to content

Commit

Permalink
chore: use insertOne() instead of insert() in tests re: #6880
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Aug 20, 2018
1 parent 7ecce58 commit 44acd50
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
16 changes: 16 additions & 0 deletions lib/collection.js
Expand Up @@ -198,6 +198,22 @@ Collection.prototype.insert = function() {
throw new Error('Collection#insert unimplemented by driver');
};

/**
* Abstract method that drivers must implement.
*/

Collection.prototype.insertOne = function() {
throw new Error('Collection#insertOne unimplemented by driver');
};

/**
* Abstract method that drivers must implement.
*/

Collection.prototype.insertMany = function() {
throw new Error('Collection#insertMany unimplemented by driver');
};

/**
* Abstract method that drivers must implement.
*/
Expand Down
6 changes: 3 additions & 3 deletions test/collection.test.js
Expand Up @@ -23,7 +23,7 @@ describe('collections:', function() {
done();
}

collection.insert({}, {}, function() {
collection.insertOne({}, {}, function() {
assert.ok(connected);
inserted = true;
db.close();
Expand Down Expand Up @@ -72,9 +72,9 @@ describe('collections:', function() {
thrown = false;

try {
collection.insert();
collection.insertOne();
} catch (e) {
assert.ok(/unimplemented/.test(e.message));
assert.ok(/unimplemented/.test(e.message), e.message);
thrown = true;
}

Expand Down

0 comments on commit 44acd50

Please sign in to comment.