Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mock sync function #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,15 @@ fakeModelInstance.prototype.toJSON = fakeModelInstance.prototype.toJson = functi
return this.get();
};

/**
* This has no effect on the Instance
*
* @instance
* @return {Promise<Instance>} will always resolve with the current instance
**/
fakeModelInstance.prototype.sync = function () {
return bluebird.resolve(this);
};


module.exports = fakeModelInstance;
11 changes: 11 additions & 0 deletions src/sequelize.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,4 +410,15 @@ Sequelize.prototype.authenticate = function() {
});
};

/**
* Always returns a resolved promise
*
* @return {Promise} will always resolve as a successful sync
*/
Sequelize.prototype.sync = function() {
return new bluebird(function (resolve) {
return resolve();
});
};

module.exports = Sequelize;