refactor: cleanup legacy sinon sandboxing (#7066)

Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
This commit is contained in:
Caleb Cartwright
2021-09-26 15:34:51 -05:00
committed by GitHub
parent 926e62f927
commit 5e96598fcb
3 changed files with 8 additions and 23 deletions

View File

@@ -124,15 +124,11 @@ describe('BaseService', function () {
})
describe('Logging', function () {
let sandbox
beforeEach(function () {
sandbox = sinon.createSandbox()
sinon.stub(trace, 'logTrace')
})
afterEach(function () {
sandbox.restore()
})
beforeEach(function () {
sandbox.stub(trace, 'logTrace')
sinon.restore()
})
it('Invokes the logger as expected', async function () {
await DummyService.invoke(
@@ -426,15 +422,11 @@ describe('BaseService', function () {
})
describe('request', function () {
let sandbox
beforeEach(function () {
sandbox = sinon.createSandbox()
sinon.stub(trace, 'logTrace')
})
afterEach(function () {
sandbox.restore()
})
beforeEach(function () {
sandbox.stub(trace, 'logTrace')
sinon.restore()
})
it('logs appropriate information', async function () {

View File

@@ -99,14 +99,11 @@ describe('Cache header functions', function () {
})
describe('setHeadersForCacheLength', function () {
let sandbox
beforeEach(function () {
sandbox = sinon.createSandbox()
sandbox.useFakeTimers()
sinon.useFakeTimers()
})
afterEach(function () {
sandbox.restore()
sandbox = undefined
sinon.restore()
})
it('should set the correct Date header', function () {

View File

@@ -10,15 +10,11 @@ describe('validate', function () {
requiredString: Joi.string().required(),
}).required()
let sandbox
beforeEach(function () {
sandbox = sinon.createSandbox()
sinon.stub(trace, 'logTrace')
})
afterEach(function () {
sandbox.restore()
})
beforeEach(function () {
sandbox.stub(trace, 'logTrace')
sinon.restore()
})
const ErrorClass = InvalidParameter