Upgrade sinonjs (and related libs) (#9914)

* update sinon

* remove errors

* fix unit tests
This commit is contained in:
Matteo Pagliazzi
2018-01-31 10:56:32 +01:00
committed by GitHub
parent 47dbe4561f
commit a85282763f
12 changed files with 129 additions and 19 deletions

View File

@@ -24,7 +24,9 @@ describe('ensure access middlewares', () => {
ensureAdmin(req, res, next);
expect(next).to.be.calledWith(new NotAuthorized(i18n.t('noAdminAccess')));
const calledWith = next.getCall(0).args;
expect(calledWith[0].message).to.equal(i18n.t('noAdminAccess'));
expect(calledWith[0] instanceof NotAuthorized).to.equal(true);
});
it('passes when user is an admin', () => {
@@ -43,7 +45,9 @@ describe('ensure access middlewares', () => {
ensureSudo(req, res, next);
expect(next).to.be.calledWith(new NotAuthorized(apiMessages('noSudoAccess')));
const calledWith = next.getCall(0).args;
expect(calledWith[0].message).to.equal(apiMessages('noSudoAccess'));
expect(calledWith[0] instanceof NotAuthorized).to.equal(true);
});
it('passes when user is a sudo user', () => {