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

Commit b05abdd4 by Sushant

chores: sinon 5

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