不要怂,就是干,撸起袖子干!

Commit b05abdd4 by Sushant

chores: sinon 5

1 parent a1f30d27
......@@ -64,7 +64,7 @@
"pg-types": "^1.x",
"rimraf": "^2.x",
"semantic-release": "^15.x",
"sinon": "^4.x",
"sinon": "^5.0.10",
"sinon-chai": "^3.1.0",
"sqlite3": "^4.x",
"tedious": "^2.x",
......
......@@ -1338,7 +1338,7 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), () => {
}).return (user);
}).then(user => {
expect(spy).to.have.been.calledTwice;
spy.reset();
spy.resetHistory();
return Promise.join(
user,
user.getProjects({
......@@ -1377,14 +1377,14 @@ describe(Support.getTestDialectTeaser('BelongsToMany'), () => {
return user.addProject(project, { logging: spy }).return (user);
}).then(user => {
expect(spy.calledTwice).to.be.ok; // Once for SELECT, once for INSERT
spy.reset();
spy.resetHistory();
return user.getProjects({
logging: spy
});
}).then(projects => {
const project = projects[0];
expect(spy.calledOnce).to.be.ok;
spy.reset();
spy.resetHistory();
expect(project).to.be.ok;
return self.user.removeProject(project, {
......
......@@ -1147,7 +1147,7 @@ describe(Support.getTestDialectTeaser('Sequelize'), () => {
it('through Sequelize.sync()', function() {
const self = this;
self.spy.reset();
self.spy.resetHistory();
return this.sequelize.sync({ force: true, logging: false }).then(() => {
expect(self.spy.notCalled).to.be.true;
});
......@@ -1155,7 +1155,7 @@ describe(Support.getTestDialectTeaser('Sequelize'), () => {
it('through DAOFactory.sync()', function() {
const self = this;
self.spy.reset();
self.spy.resetHistory();
return this.User.sync({ force: true, logging: false }).then(() => {
expect(self.spy.notCalled).to.be.true;
});
......
......@@ -63,7 +63,7 @@ describe(Support.getTestDialectTeaser('hasMany'), () => {
]));
return user.setTasks([task1, task2]).bind(this).then(function() {
this.update.reset();
this.update.resetHistory();
return user.setTasks(null);
}).then(function() {
expect(this.findAll).to.have.been.calledTwice;
......
......@@ -278,8 +278,8 @@ describe(Support.getTestDialectTeaser('Hooks'), () => {
expect(hook1).to.have.been.calledOnce;
expect(hook2).to.have.been.calledOnce;
hook1.reset();
hook2.reset();
hook1.resetHistory();
hook2.resetHistory();
this.Model.removeHook('beforeCreate', 'myHook');
this.Model.removeHook('beforeCreate', 'myHook2');
......@@ -308,10 +308,10 @@ describe(Support.getTestDialectTeaser('Hooks'), () => {
expect(hook3).to.have.been.calledOnce;
expect(hook4).to.have.been.calledOnce;
hook1.reset();
hook2.reset();
hook3.reset();
hook4.reset();
hook1.resetHistory();
hook2.resetHistory();
hook3.resetHistory();
hook4.resetHistory();
this.Model.removeHook('beforeCreate', 'myHook');
......
......@@ -23,7 +23,7 @@ describe(Support.getTestDialectTeaser('Model'), () => {
});
afterEach(function() {
this.stub.reset();
this.stub.resetHistory();
});
after(function() {
......
......@@ -26,7 +26,7 @@ describe(Support.getTestDialectTeaser('Model'), () => {
beforeEach(function() {
this.deloptions = {where: {secretValue: '1'}};
this.cloneOptions = _.clone(this.deloptions);
this.stubDelete.reset();
this.stubDelete.resetHistory();
});
afterEach(function() {
......
......@@ -52,8 +52,8 @@ describe(Support.getTestDialectTeaser('Model'), () => {
});
beforeEach(() => {
this.stub.reset();
this.warnOnInvalidOptionsStub.reset();
this.stub.resetHistory();
this.warnOnInvalidOptionsStub.resetHistory();
});
after(() => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!